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.float32 or torch.float64).

  • system_extras_map (dict[SystemExtras, str] | None) – Map of {ts_key: ase_key} controlling which atoms.info entries 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 which atoms.arrays entries are read into _atom_extras. None (default) means no extras are read.

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