pyextal.potentialMap.export

Volumetric files for VESTA and similar viewers: VASP CHGCAR and Gaussian cube.

Attributes

Functions

write_chgcar(path, volume, lattice[, atoms, origin_shift])

Writes a 3D map as a VASP CHGCAR (values times the cell volume).

read_chgcar(path)

Reads a CHGCAR written by write_chgcar (or VASP).

write_cube(path, volume[, structure, comment])

Writes a 3D map as a Gaussian cube file (lengths in Bohr).

read_cube(path)

Reads a cube file written by write_cube.

Module Contents

pyextal.potentialMap.export.BOHR = 0.529177210903
pyextal.potentialMap.export.write_chgcar(path, volume, lattice, atoms=None, origin_shift=None)

Writes a 3D map as a VASP CHGCAR (values times the cell volume).

Parameters:
  • path (path-like) – Output file.

  • volume (np.ndarray) – (Nx, Ny, Nz) map on the fractional grid.

  • lattice (np.ndarray) – (3, 3) Cartesian lattice vectors (rows), Angstrom.

  • atoms (list, optional) – [(symbol, [x, y, z]), ...] fractional, e.g. Structure.atoms. Without atoms a dummy H at the origin is written so viewers still draw the cell.

  • origin_shift (array-like, optional) – Fractional shift applied to the atoms and, rounded to whole grid steps, to the map.

pyextal.potentialMap.export.read_chgcar(path)

Reads a CHGCAR written by write_chgcar (or VASP).

Returns:

(volume, lattice, atoms), the map divided back by the cell volume.

Return type:

tuple

pyextal.potentialMap.export.write_cube(path, volume, structure=None, comment='Generated by pyextal')

Writes a 3D map as a Gaussian cube file (lengths in Bohr).

Parameters:
  • path (path-like) – Output file.

  • volume (np.ndarray) – (Nx, Ny, Nz) map on the fractional grid.

  • structure (Structure, optional) – Cell and atoms; defaults to structure_from_bloch().

  • comment (str) – Second header line.

pyextal.potentialMap.export.read_cube(path)

Reads a cube file written by write_cube.

Returns:

(volume, lattice, numbers, cart), lattice and atom positions in Angstrom.

Return type:

tuple