pbc_wrap_general¶
- torch_sim.transforms.pbc_wrap_general(positions, lattice_vectors)[source]¶
- Apply periodic boundary conditions using lattice
vector transformation method.
This implementation follows the general matrix-based approach for periodic boundary conditions in arbitrary triclinic cells: 1. Transform positions to fractional coordinates using B = A^(-1) 2. Wrap fractional coordinates to [0,1) using f - floor(f) 3. Transform back to real space using A
- Parameters:
- Returns:
- Tensor of wrapped positions in real space with
same shape as input positions.
- Return type: