atoms_to_state¶
- torch_sim.io.atoms_to_state(atoms, device=None, dtype=None, *, system_extras_map=None, atom_extras_map=None)[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 | None) – Device to create tensors on.
dtype (dtype | None) – Data type for tensors (typically
torch.float32ortorch.float64).system_extras_map (dict[SystemExtras, str] | None) – Map of
{ts_key: ase_key}controlling whichatoms.infoentries are read into_system_extras.None(default) means no extras are read.atom_extras_map (dict[AtomExtras, str] | None) – Map of
{ts_key: ase_key}controlling whichatoms.arraysentries are read into_atom_extras.None(default) means no extras are read.
- Returns:
TorchSim SimState object.
- Return type:
- 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