state_to_structures

torch_sim.io.state_to_structures(state, *, system_extras_map=None, atom_extras_map=None)[source]

Convert a SimState to a list of Pymatgen Structure objects.

Parameters:
  • state (SimState) – Batched state containing positions, cell, and atomic numbers

  • system_extras_map (dict[SystemExtras, str] | None) – Map of {ts_key: pymatgen_key} controlling which _system_extras entries are written to structure.properties. None (default) means no extras are written.

  • atom_extras_map (dict[AtomExtras, str] | None) – Map of {ts_key: pymatgen_key} controlling which _atom_extras entries are written to structure.site_properties. None (default) means no extras are written.

Returns:

Pymatgen Structure objects, one per system

Return type:

list[Structure]

Raises:

ImportError – If Pymatgen is not installed

Notes

  • Output positions and cell will be in Å

  • Assumes periodic boundary conditions