structures_to_state¶
- torch_sim.io.structures_to_state(structure, device=None, dtype=None, *, system_extras_map=None, atom_extras_map=None)[source]¶
Create a SimState from pymatgen Structure(s).
- Parameters:
structure (
Structure | list[Structure]) – Single Structure or list of Structure objectsdevice (
torch.device) – Device to create tensors ondtype (
torch.dtype) – Data type for tensors (typically torch.float32 or torch.float64)system_extras_map (dict[SystemExtras, str] | None) – Map of
{ts_key: pymatgen_key}controlling whichpymatgen.propertiesentries are read into_system_extras.None(default) means no extras are read.atom_extras_map (dict[AtomExtras, str] | None) – Map of
{ts_key: pymatgen_key}controlling whichpymatgen.site_propertiesentries are read into_atom_extras.None(default) means no extras are read.
- Returns:
TorchSim SimState object.
- Return type:
- Raises:
ImportError – If Pymatgen is not installed
Notes
Input positions and cell should be in Å
Cell matrix follows ASE convention: [[ax,ay,az],[bx,by,bz],[cx,cy,cz]]
Assumes periodic boundary conditions from Structure