phonopy_to_state

torch_sim.io.phonopy_to_state(phonopy_atoms, device, dtype)[source]

Create state tensors from a PhonopyAtoms object or list of PhonopyAtoms objects.

Parameters:
  • phonopy_atoms (PhonopyAtoms | list[PhonopyAtoms]) – Single PhonopyAtoms object or list of PhonopyAtoms 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 Phonopy is not installed

Notes

  • Input positions and cell should be in Å

  • Input masses should be in amu

  • PhonopyAtoms does not have pbc attribute for Supercells, assumes True

  • Cell matrix follows ASE convention: [[ax,ay,az],[bx,by,bz],[cx,cy,cz]]