\(\newcommand{\AA}{\text{Å}}\)
CRYSTALpytools.io package
Submodules
CRYSTALpytools.io.xcrysden module
Classes and methods to parse files used by XCrySDen.
- class XSF(struc, forces=[], grid_base=[], grid_data=[])
Bases:
object
A collection of methods to parse and write XCrySDen XSF files.
Note
At most 1 grid data is saved with this class.
- Parameters:
struc (CStructure) – Extended Pymatgen Structure object.
forces (array) – nForce*4 array of forces (or any vector associated with atoms). The first element is the index of atom (from 0) and the last 3 are Cartesian components along x, y and z directions. Unit: Hartree/\(\AA\).
grid_base (array) – 3(4)*3 array of Cartesian coordinates of points O, A, B(, C) to define a 2D(3D) grid. Vectors OA, OB (and OC) are used. Unit: \(\AA\).
grid_data (arary) – (nZ*)nY*nX array of 2D(3D) data grid.
- classmethod read(filename, grid_index=1)
Generate a XSF class from XSF file. Only the grid specified by
grid_index
(starting from 1) is saved.- Parameters:
filename (str) – Iutput name.
grid_index (int) – The index of grid to be saved.
- Returns:
cls (XSF)
- write(filename, geomonly=False, grid_name='UNKNOWN')
Write data into a new XSF file.
- Parameters:
filename (str) – Output name.
geomoly (bool) – Only writes geometry into XSF file.
grid_name (str) – Name of the grid, valid only if
self.grid_ndim
is not 0.
- class BXSF(rlattice, bands, efermi=0.0, band_index=[])
Bases:
object
The collection of methods to parse and write XCrySDen BXSF files (Fermi surface).
Note
3D systems only.
- Parameters:
relattice (array|CStructure) – Reciprocal lattice matrix or structure object.
bands (array) – nBand*nX*nY*nZ*nSpin array. Unit: eV. Aligned to \(E_{F}=0\).
efermi (float) – Fermi energy. Unit: eV.
band_index (list|str|int) – Indices of bands. Starting from 1. For spin- polarized cases, one can specify ‘4a’ for the \(\alpha\) state of band 4. If only band number is given for spin polarized bands, both spin states are saved. Use ‘vb’ and ‘cb’ for the highest valance or the lowest conduction band.
[]
for all bands.
- write(filename, grid_name='UNKNOWN')
Write Fermi surface data into a new XSF file. Band labels:
[0:-2]: Band index strating from 1;
-2: Useless, 0;
-1: Spin. Alpha / No spin, 1; Beta, 2
- Parameters:
filename (str) – Output name.
grid_name (str) – Name of the grid.