Skip to content

File formats ​

The format registry (xtalforge_io::registry) reads and writes nine formats.

FormatExtensionsReadWriteNotes
CIF.cif, .mcifyesyesblocks, loops, symmetry operations, sites, occupancy, Uiso/Uij, disorder, charge, explicit bonds
POSCAR/CONTCAR.poscar, .vasp, .contcaryesyespositive scale or negative target volume, species/counts, selective dynamics
XYZ.xyz, .extxyzyesyesplain and extended (Lattice=, Properties=); plain becomes a padded P1 box
pymatgen JSON.jsonyesyeslattice matrix plus species/abc sites, partial occupancy
CSSR.cssryesyeswhole cell, fractional or Cartesian input
DFTB+ GEN.genyesyesC cluster, S Cartesian and F fractional supercells
LAMMPS data.data, .lmpyesyesatom_style full, triclinic box, masses, charges and bonds
SHELX.res, .insyesyesCELL, LATT, SYMM, SFAC, FVAR, atom records and PART
PDB.pdbnoyesHETATM/CONECT for Blender and external viewers

Use read_structure(text, hint) and write_structure(structure, format) for dispatch by name, extension or content sniffing; the same registry lists the capabilities of every format and the data a conversion drops. Project archives (.xtalproj) are a separate ZIP container, not a registry format.

bash
xtalforge convert structure.cif --format poscar --out structure.vasp
xtalforge --json info structure.xyz

CIF symmetry priority is the operation loop, then the Hall symbol, then the H-M symbol/number resolved through the symmetry catalogue. Only an unknown symbol records a symmetry_warning and expands with the identity. Unknown or malformed input returns a typed error; it never panics.