Skip to content
Merged
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
3 changes: 2 additions & 1 deletion torch_sim/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def state_to_atoms(state: "ts.SimState") -> list["Atoms"]:
cell = state.cell.detach().cpu().numpy() # Shape: (n_systems, 3, 3)
atomic_numbers = state.atomic_numbers.detach().cpu().numpy()
system_indices = state.system_idx.detach().cpu().numpy()
pbc = state.pbc.detach().cpu().numpy()

atoms_list = []
for sys_idx in np.unique(system_indices):
Expand All @@ -65,7 +66,7 @@ def state_to_atoms(state: "ts.SimState") -> list["Atoms"]:
symbols = [chemical_symbols[z] for z in system_numbers]

atoms = Atoms(
symbols=symbols, positions=system_positions, cell=system_cell, pbc=state.pbc
symbols=symbols, positions=system_positions, cell=system_cell, pbc=pbc
)
atoms_list.append(atoms)

Expand Down
Loading