complete_cell

torch_sim.neighbors.utils.complete_cell(cell, pbc)[source]

Fill zero-length lattice vectors on non-periodic axes, like ASE’s complete_cell.

Slabs, wires and molecules built by ASE (e.g. graphene(), nanotube(), molecule()) leave the vectors of their non-periodic axes at zero. These are replaced by unit vectors orthogonal to the others, keeping the cell right-handed. Image shifts along non-periodic axes are always zero, so the filled vectors never enter interatomic displacements.

Parameters:
  • cell (Tensor) – Row-vector cells [n_systems, 3, 3]

  • pbc (Tensor) – Periodic boundary conditions [n_systems, 3]

Returns:

Cells [n_systems, 3, 3] with every non-periodic zero vector filled in.

Return type:

Tensor