mag4.io_poscar

VASP POSCAR I/O — read into CrystalData and write supercell geometry.

Layer: VASP-specific (POSCAR format; also the geometry source for the WIEN2k path).

Functions

read_poscar(poscar, species_index)

Parse a VASP POSCAR / CONTCAR file.

write_poscar(crystal, name)

Write a single POSCAR for the supercell geometry.

mag4.io_poscar.read_poscar(poscar, species_index)[source]

Parse a VASP POSCAR / CONTCAR file.

Parameters:
  • poscar (str) – Path to the POSCAR.

  • species_index (int) – 1-based index of the magnetic species in the POSCAR header.

Return type:

CrystalData

mag4.io_poscar.write_poscar(crystal, name)[source]

Write a single POSCAR for the supercell geometry. Returns the file path.

Return type:

str

Parameters: