Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions torch_sim/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,11 @@ def wrap_positions(self) -> torch.Tensor:
"""Atomic positions wrapped according to periodic boundary conditions if pbc=True,
otherwise returns unwrapped positions with shape (n_atoms, 3).
"""
# TODO: implement a wrapping method
return self.positions
if not self.pbc:
return self.positions
return ts.transforms.pbc_wrap_batched(
self.positions, self.cell, self.system_idx, self.pbc
)

@property
def device(self) -> torch.device:
Expand Down