atoms_to_state

torch_sim.io.atoms_to_state(atoms, device, dtype)[source]

Convert an ASE Atoms object or list of Atoms objects to a SimState.

Parameters:
  • atoms (Atoms | list[Atoms]) – Single ASE Atoms object or list of Atoms objects

  • device (device) – Device to create tensors on

  • dtype (dtype) – Data type for tensors (typically torch.float32 or torch.float64)

Returns:

TorchSim SimState object.

Return type:

SimState

Raises:
  • ImportError – If ASE is not installed

  • ValueError – If systems have inconsistent periodic boundary conditions

Notes

  • Input positions and cell should be in Å

  • Input masses should be in amu

  • All systems must have consistent periodic boundary conditions