structures_to_state

torch_sim.io.structures_to_state(structure, device, dtype)[source]

Create a SimState from pymatgen Structure(s).

Parameters:
  • structure (Structure | list[Structure]) – Single Structure or list of Structure 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 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