kliff.dataset.extxyz¶
- kliff.dataset.extxyz.read_extxyz(filename)[source]¶
Read atomic configuration stored in extended xyz file_format.
- Parameters:
filename (
Path) – filename to the extended xyz file- Returns:
3x3 array, supercell lattice vectors species: species of atoms coords: Nx3 array, coordinates of atoms PBC: periodic boundary conditions energy: potential energy of the configuration; None if not provided in file forces: Nx3 array, forces on atoms; None if not provided in file stress: 1D array of size 6, stress on the cell in Voigt notation; None if not
provided in file
- Return type:
cell
- kliff.dataset.extxyz.write_extxyz(filename, cell, species, coords, PBC, energy=None, forces=None, stress=None, bool_as_str=False)[source]¶
Write configuration info to a file in extended xyz file_format.
- Parameters:
filename (
Path) – filename to the extended xyz filecell (
ndarray) – 3x3 array, supercell lattice vectorsspecies (
List[str]) – species of atomscoords (
ndarray) – Nx3 array, coordinates of atomsPBC (
List[bool]) – periodic boundary conditionsenergy (
Optional[float]) – potential energy of the configuration; If None, not write to fileforces (
Optional[ndarray]) – Nx3 array, forces on atoms; If None, not write to filestress (
Optional[List[float]]) – 1D array of size 6, stress on the cell in Voigt notation; If None, not write to filebool_as_str (
bool) – If True, write PBC as “T” or “F”; otherwise, write PBC as 1 or 0.