\(\newcommand{\AA}{\text{Å}}\)

CRYSTALClear.base package

Developer

CRYSTALClear.base.basisset

class BS_GTF(info)

Bases: object

A Gaussian type function object.

Parameters:

info (str) – GTF radial coefficients in CRYSTAL format

property data

Print basis set information in CRYSTAL format

class BS_Shell(ITYB, LAT, NG, CHE, SCAL, info)

Bases: object

The Shell object to set a general basis set.

Parameters:

info (list[str]) – String in Crystal format

Other arguments are consistent with CRYSTAL manual.

property data

Print basis set information in CRYSTAL format

class BS_Atom(z, info)

Bases: object

The atom object to set a basis set.

Note

The type of basis set should be consistent for all the shells. Otherwise unexpected errors might happen.

Free effective core pseudopotential (ECP) definition not supported.

Parameters:
  • z (int) – Convential atomic number Z.

  • info (list(str)) – String in Crystal BS format

conventional_atomic_number(zconv)

Set convential atomic number.

Parameters:

zconv (int) – Z(real atomic number) + n*100. N is an integer.

property data

Print basis set information in CRYSTAL format

class BasisSetBASE

Bases: object

The basisset object in CRYSTAL format. When called, one can pass the following arguments:

Parameters:
  • name (str | None) – When specified, download the corresponding basis set from Basis Set Exchange(BSE)

  • element (list[str] | list[int]) – Elements to download. Either as a list of atomic numbers or labels.

Note

For basis sets from BSE, reference and roles are omitted.

classmethod from_bse(name, element, zconv=None)

Download basis set definitions from BSE.

Parameters:
  • name (str) – Basis set’s name.

  • element (list[str] | list[int]) – List of elements.

classmethod from_string(bs_str, fmt='crystal')

Define basis set from a string.

Parameters:
  • bs_str (str)

  • fmt (str) – Format string. Consistent with BSE python API.

classmethod from_file(file, fmt='crystal')

Define a basis set from a file.

property data

Print basis set information in CRYSTAL format

to_file(file='BASISSET.DAT', fmt='crystal')

Print formatted data into a text file.

Parameters:
  • file (str)

  • fmt (str) – Output format

CRYSTALClear.base.crysd12

Classes and methods of keywords used in ‘crystal’ input file (d12).

class Crystal_inputBASE

Bases: BlockBASE

The base class of Crystal_input class

property geom
set_geom(obj=None)

Geom subblock

Parameters:

obj (Geom | str) – A block object of ‘GEOM’ submodule. Or a string in CRYSTAL d12 format.

property basisset
set_basisset(obj=None)

Basis set subblock

Parameters:

obj (BasisSet | str) – A block object of basis set submodule. Or a string in CRYSTAL d12 format

property scf
set_scf(obj=None)

SCF subblock

Parameters:

obj (SCF | str) – A block object of SCF submodule. Or a string in CRYSTAL d12 format

from_file(file)

Generate a CrystalInputBASE obj from a d12 file. A ‘complete’ d12 file with geometry, basis set and SCF blocks is suggested.

to_file(file)

Write data to a file

class Geom

Bases: BlockBASE

Geometry block object

property data

Settings in all the attributes are summarized here. Covers the data property in BlockBASE, to address the ambiguity of ‘MOLECULE’ keywords.

title(title='Generated by CRYSTALClear')
crystal(IGR=None, latt=[], atom=[], IFLAG=0, IFHR=0, IFSO=0, origin=[])

Define ‘CRYSTAL’ structure

Parameters:
  • sg (int) – Space group number. Parameter IGR in the manual

  • latt (list) – Minimal set of crystallographic cell parameters

  • atom (list) – Natom * 4 list of conventional atomic number and 3D fractional coordinates.

  • IFLAG (int) – See the manual

  • IFHR (int) – See the manual

  • IFSO (int) – See the manual

  • origin (list) – IFSO > 1 See the manual

slab(IGR=None, latt=[], atom=[])

Define ‘SLAB’ structure

polymer(IGR=None, latt=[], atom=[])

Define ‘POLYMER’ structure

helix(N1=None, N2=0, latt=[], atom=[])

Define ‘HELIX’ structure

Parameters:
  • N1 (int) – See the manual

  • N2 (int) – See the manual

molecule(IGR=None, atom=[])

Define ‘MOLECULE’ structure

external(key='EXTERNAL')

Define ‘EXTERNAL’ structure

dlvinput(key='DLVINPUT')

Define ‘DLVINPUT’ structure

supercel(mx=None)

Supercell by ‘SUPERCEL’ keyword

Parameters:

mx (array | list | str) – ndimen * ndimen matrix, [] or ‘’

supercon(mx=None)

Supercell by ‘SUPERCON’ keyword

scelconf(mx=None)

Supercell by ‘SCELCONF’ keyword

scelphono(mx=None)

Supercell by ‘SCELPHONO’ keyword

atombsse(IAT=None, NSTAR=None, RMAX=None)
atomdisp(NDISP=None, atom=[])

ATOMDISP keyword

Parameters:
  • NDISP (int) – See manual

  • atom (list) – NDISP*4 list. Including LB, DX, DY, DZ

atominse(NINS=None, atom=[])

ATOMINSE keyword

Parameters:
  • NINS (int) – See manual

  • atom (list) – NINS*4 list. Including NA, X, Y, Z

atomorde(key='ATOMORDE')
atomremo(NL=None, atom=[])

ATOMREMO keyword

Parameters:
  • NL (int) – See manual

  • atom (list) – NL*1 list. Including LB

moleiso(NMOL=None, atom=[])

Note

Corresponds to the option MOLECULE to isolate molecules from lattice. Only the method’s name is changed to avoid ambiguity with the one to set 0D geometry.

Parameters:
  • NMOL (int)

  • atom (list[list[int]]) – NMOL*4 list. See CRYSTAL manual.

extprt(key='EXTPRT')
cifprt(key='CIFPRT')
cifprtsym(key='CIFPRTSYM')
coorprt(key='COORPRT')
testgeom(key='TESTGEOM')
property optgeom

Subblock object OPTGEOM

set_optgeom(obj=None)

Optgeom subblock

Parameters:

obj (Optgeom | str) – A block object of ‘OPTGEOM’ submodule. Or a string in CRYSTAL d12 format

property freqcalc

Subblock object FREQCALC

set_freqcalc(obj=None)

Freqcalc subblock

Parameters:

obj (Freqcalc | str) – A block object of ‘FREQCALC’ submodule. Or a string in CRYSTAL d12 format

class Optgeom

Bases: BlockBASE

OPTGEOM block object

fulloptg(key='FULLOPTG')
cellonly(key='CELLONLY')
intredun(key='INTREDUN')
itatocel(key='ITATOCEL')
cvolopt(key='CVOLOPT')
hessiden(key='HESSIDEN')
hessmod1(key='HESSMOD1')
hessmod2(key='HESSMOD2')
hessnum(key='HESSNUM')
toldeg(TG=None)
toldex(TX=None)
toldee(IG=None)
maxcycle(MAX=None)
fragment(NL=None, LB=[])
Parameters:
  • NL (int | str) – Number of atoms. See manual. Or ‘’

  • LB (list[int]) – Label of atoms. See manual

restart(key='RESTART')
finalrun(ICODE=None)
extpress(pres=None)
allowtrustr(key='ALLOWTRUSTR')
notrustr(key='NOTRUSTR')
maxtradius(TRMAX=None)
trustradius(TRADIUS=None)
onelog(key='ONELOG')
noxyz(key='NOXYZ')
nosymmops(key='NOSYMMOPS')
printforces(key='PRINTFORCES')
printhess(key='PRINTHESS')
printopt(key='PRINTOPT')
print(key='PRINT')
class Freqcalc

Bases: BlockBASE

FREQCALC block object

nooptgeom(key='NOOPTGEOM')
property optgeom
preoptgeom(obj=None)
Parameters:

obj (Optgeom) – An Optgeom block object

dispersion(key='DISPERSION')
bands(ISS=None, NSUB=None, NLINE=None, points=[])
modes(key='MODES')
nomodes(key='NOMODES')
numderiv(N=None)
pressure(NP=None, P1=None, P2=None)
restart(key='RESTART')
stepsize(STEP=None)
temperat(NT=None, T1=None, T2=None)
class BasisSet

Bases: BlockBASE

Basis Set block object

basisset(NAME=None)
from_bse(name, element, filename=None, append=False)

Download basis set definitions from Basis Set Exchange.

Parameters:
  • name (str) – Basis set’s name.

  • element (list[str] | list[int] | list[list[str | int, int]]) – List of elements, specified by either atomic number or label. When a nelement*2 list is used, the second entry is recognized as conventional atomic numbers.

  • filename (None | str) – If not None, print basis set definitions to a text file

  • append (bool) – Whether to cover old entries. If the old entry contains ‘BASISSET’, it will be removed anyway.

from_string(string, fmt='crystal', filename=None, append=False)

Basis set from a string

Parameters:
  • string (str) – A line of string. Use ‘n’ to break lines. The ending line ‘99 0’ is needed but not ‘END’.

  • fmt (str) – Format of basis set string. if not ‘crystal’, this method calls Basis Set Exchange API to convert it.

  • filename (None | str) – See from_bse

  • append (bool) – See from_bse

from_file(file, fmt='crystal', filename=None, append=False)

Basis set from a file

Parameters:
  • file (file) – A formatted text file with basis set definitions. The ending line ‘99 0’ is needed but not ‘END’.

  • fmt (str) –

    Format of basis set string. if not ‘crystal’, this method calls Basis Set Exchange API to convert it.

  • filename (None | str) – See from_bse

  • append (bool) – See from_bse

from_obj(bs_obj, filename=None, append=False)

Define basis set from a BasisSetBASE object.

Parameters:
  • bs_obj (BasisSetBASE) – A CRYSTALClear.base.basisset.BasisSetBASE object.

  • filename (None | str) – See from_bse

  • append (bool) – See from_bse

ghosts(NA=None, LA=[])
class SCF

Bases: BlockBASE

SCF block object

property dft

Subblock object DFT

set_dft(obj=None)

DFT subblock

Parameters:

obj (DFT | str) – A block object of ‘DFT’ submodule. Or a string in CRYSTAL d12 format

property dftd3

Subblock object DFTD3

set_dftd3(obj=None)

DFTD3 subblock

Parameters:

obj (DFTD3 | str) – A block object of ‘DFTD3’ submodule. Or a string in CRYSTAL d12 format

property gcp

Subblock object GCP

set_gcp(obj=None)

GCP subblock

Parameters:

obj (GCP | str) – A block object of ‘GCP’ submodule. Or a string in CRYSTAL d12 format.

property fixgeom
property fixbase
fixindex(key1=None, obj1=None, obj2=None)
Parameters:
  • key1 (str) – ‘GEOM’, ‘BASE’ or ‘GEBA’. Fixindex block keywords

  • obj1 (Geom | BasisSet) – Geometry or basis set object.

  • obj2 (BasisSet) – key1 = GEBA only. Basis set object.

biposize(ISIZE=None)
exchsize(ISIZE=None)
toldee(ITOL=None)
guessp(key='GUESSP')
atomspin(NA=None, LA=[])
tolinteg(ITOL1=None, ITOL2=None, ITOL3=None, ITOL4=None, ITOL5=None)
nobipola(key='NOBIPOLA')
nobipcou(key='NOBIPCOU')
nobipexc(key='NOBIPEXC')
ldremo(value)
maxcycle(MAX=None)
fmixing(IPMIX=None)
shrink(IS=None, ISP=None, IS1=None, IS2=None, IS3=None)
gcpauto(key='GCPAUTO')
smear(WIDTH=None)
ppan(key='PPAN')
gradcal(key='GRADCAL')
exchange(key='EXCHANGE')
postscf(key='POSTSCF')
diis(key='DIIS')
nodiis(key='NODIIS')
diisallk(key='DIISALLK')
histdiis(NCYC=None)
prtdiis(key='PRTDIIS')
cmplxfac(WEIGHT=None)
repldata(key='REPLDATA')
stdiag(key='STDIAG')
class DFT

Bases: BlockBASE

DFT block object

spin(key='SPIN')
exchange(ex=None)
correlat(cor=None)
xcfunc(xc=None)
lgrid(key='LGRID')
oldgrid(key='OLDGRID')
xlgrid(key='XLGRID')
xxlgrid(key='XXLGRID')
xxxlgrid(key='XXXLGRID')
radial(NR=None, RL=[], IL=[])
angular(NI=None, AL=[], LEV=[])
class DFTD3

Bases: BlockBASE

DFTD3 block object

version(NAT=None)
func(CHAR=None)
abc(key='ABC')
s6(s6=None)
s8(s8=None)
a1(a1=None)
a2(a1=None)
rs6(rs6=None)
rs8(rs8=None)
radius(radius=None)
cnradius(cnradius=None)
abcradius(abcradius=None)
printc6(key='PRINTC6')
class GCP

Bases: BlockBASE

GCP block object

method(method=None)
sigma(sigma=None)
alpha(alpha=None)
beta(beta=None)
eta(eta=None)
radius(radius=None)
printemiss(key='PRINTEMISS')

CRYSTALClear.base.crysout

Classes and methods to phrase ‘crystal’ output file.

class GeomBASE

Bases: object

A container of basic methods for SCF geometry.

classmethod read_geom(data, countline)

Read lattice from ‘A B C ALPHA BETA GAMMA’ block, periodic boundary condition and atom positions from ‘ATOMS IN THE ASYMMETRIC UNIT’ block. It terminates at the first empty line after that block.

Parameters:
  • data (list[str]) – output file read by readlines()

  • countline (int) – The starting line number

Returns:
  • countline (int) – Line number of output file.

  • struc (Pymatgen Structure | Molecule)

classmethod read_conv_z(data, countline)

Read conventional atom numbers.

Parameters:
  • data (list[str]) – output file read by readlines()

  • countline (int) – The starting line number

Returns:
  • countline (int) – Line number of output file.

  • conv_z (array) – Int array of conventional atom numbers

class SCFBASE

Bases: object

A container of basic methods for SCF loop.

classmethod read_convergence(data, countline)

Read SCF convergence.

Returns:
  • countline (int)

  • ncyc (int) – Number of cycles

  • endflag (str) – ‘terminated’, ‘converged’, ‘too many cycles’ and ‘unknown’

  • e (array) – nCYC*1 array of SCF energy. Unit: eV

  • de (array) – nCYC*1 array of SCF energy difference. Unit: eV

classmethod read_fermi_energy(data, countline, history=False)

Read Fermi energy.

Parameters:

history (bool) – Whether to read e fermi of all steps

Returns:
  • countline (int)

  • spin (bool) – Whether the system is spin-polarised.

  • efermi (float | array) – Fermi energy. Unit: eV

classmethod read_band_gap(data, countline, history=False)

Read band gap.

Parameters:

history (bool) – Whether to read band gap of all steps

Returns:
  • countline (int)

  • spin (bool) – Whether the system is spin-polarised.

  • gap (float | array) – Band gap. Unit: eV

class OptBASE

Bases: object

A container of basic methods for Opt loop.

classmethod read_optblock(data, countline)

Read optimisation blocks.

Returns:
  • countline (int) – Line number of output file.

  • ncyc (int) – Number of cycles

  • endflag (str) – ‘terminated’, ‘converged’, ‘failed’ and ‘unknown’

  • e (array) – nCYC*1 array of total energy. Unit: eV

  • de (array) – nCYC*1 array of total energy difference. Unit: eV

  • struc (list[Structure]) – nCYC*1 list of pymatgen structures

  • maxg (array) – nCYC*1 array of max energy gradient convergence. Unit: Hartree / Bohr

  • rmsg (array) – nCYC*1 array of RMS energy gradient convergence. Unit: Hartree / Bohr

  • maxd (array) – nCYC*1 array of max displacement convergence. Unit: Bohr

  • rmsd (array) – nCYC*1 array of RMS displacement convergence. Unit: Bohr

class PhononBASE

Bases: object

A container of basic methods for phonon information.

classmethod readmode_basic(data, countline)

Read basic frequency information.

Returns:
  • countline (int) – Line number of output file.

  • frequency (array[float]) – nmode * 1

  • intens (array[float]) – nmode * 1

  • IR (array[bool]) – nmode * 1

  • Raman (array[bool]) – nmode * 1

classmethod readmode_eigenvector(data, countline)

Get mode eigenvectors.

Returns:
  • countline (int) – Line number of output file.

  • eigvt (array[float]) – nmode*natom*3 array.

classmethod classical_amplitude(struc, freq)

Get classical amplitude of phonon modes

\[x = \sqrt{\]

rac{hbar}{muomega}}

Args:

struc (Structure): Pymatgen structure freq (float | array): Frequency. Unit: THz

Returns:
classic_a (array): nfreq*3natom*3natom array, or 3natom*3natom

if freq is float. The diagonal matrix of classical amplitude.

classmethod normalize_eigenvector(eigvt, amplitude=1.0)

Normalize the mode of eigenvectors.

Parameters:
  • eigvt (array[complex]) – nmode*natom*3 array.

  • amplitude (float) – Amplitude of normalization

Returns:

eigvt (array[complex]) – Normalized eigenvector.

classmethod clean_q_overlap(crysout, threshold)

Remove the repeated q points at both ends of line segment when dispersion is read. The weight of q points will be updated here.

Parameters:
  • crysout (Crystal_output) – CRYSTALClear.crystal_io.Crystal_output object

  • threshold (float) – The q point overlap threshold.

classmethod clean_imaginary(crysout, threshold)

Substitute imaginary modes and corresponding eigenvectors with numpy NaN format and print warning message.

Parameters:
  • crysout (Crystal_output) – CRYSTALClear.crystal_io.Crystal_output object

  • threshold (float) – The threshold to identify a phonon mode as negative.

CRYSTALClear.base.inputbase

Base object of all the input (d12/d3) blocks.

class BlockBASE

Bases: object

The base class of ‘block’ objects

property data

Settings in all the attributes are summarized here.

static assign_keyword(key, shape, value=None)

Transform value into string formats.

Parameters:
  • key (str) – CRYSTAL keyword

  • shape (list[int]) – 1D list. Shape of input text. Length: Number of lines; Element: Number of values

  • value (list | str) – List, a 1D list of arguments; None or a list begins with None, return to keyword only; '' or a list begins with '', Clean everything

Returns:

text (str) – CRYSTAL input

static set_matrix(mx)

Set matrix-like data to get assign_keyword inputs. Used for supercell expansion matrix and strain tensor.

Parameters:

mx (list | str) – ndimen*ndimen list, None, or ''

Returns:
  • shape (list) – ndimen*1 1D list. All elements are ndimen.

  • value (list) – ndimen*2*1 1D list. Flattened matrix.

static set_list(*args)

Set list-like data to get assign_keyword inputs. Used for lists with known dimensions. Such as atom coordinate list.

Parameters:

*args'', Clean data; None, Return keyword only; int, list, int for length of the list, list for list data

Returns:
  • shape (list) – 1 + length 1D list or []

  • args (list) – Flattened list, [] or ‘’

clean_conflict(newattr, conflict)

Addressing the conflictions between attributes, usually between blocks or block and keywords. For conflictions between keywords, they are set to direct the same attribute.

Parameters:
  • newattr (str) – The attribute explicitly specified.

  • conflict (list[str]) – The list of conflicting attributes including the called one. ‘Real’ attributes (begins with ‘_’) are needed.

clean_block()

Clean all the keyword-related attributes (accessible attributes).

Note

This method directly deletes all the attributes. Alternatively, by setting an attribute with ‘’, the attribute is kept but its old values are erased.

update_block()

Update the _block_data attribute: Summarizing all the settings to _block_data attribute for inspection and print

analyze_text(text)

Analyze the input text and return to corresponding attributes

CRYSTALClear.base.plotbase

Base functions for plotting 2D and 3D figures

plot_cry_bands(bands, k_labels, energy_range, title, not_scaled, mode, linestl, linewidth, color, fermi, k_range, labels, figsize, scheme, sharex, sharey, fermiwidth, fermialpha)

The base function to plot electron phonon density of states.

Parameters:
  • bands (Union[List, object]) – List of band objects or a single band object.

  • k_labels (Union[List[str], None]) – List of strings specifying the labels for high symmetry points along the path.

  • energy_range (Union[List[Union[int, float]], None]) – List of two integers or floats specifying the energy range (min, max).

  • title (Union[str, None]) – Title of the plot.

  • not_scaled (bool) – Flag indicating whether to scale the band structure for comparison.

  • mode (str) – Mode of the plot (‘single’, ‘multi’, ‘compare’).

  • linestl (Union[str, List[str]]) – Line style or list of line styles for the bands.

  • linewidth (Union[int, List[int]]) – Line width or list of line widths for the bands.

  • color (Union[str, List[str]]) – Color or list of colors for the bands.

  • fermi (str) – Color of the Fermi level.

  • fermiwidth (float) – Thickness of the Fermi level

  • fermialpha (float) – Opacity of the Fermi level

  • k_range (Union[List[str], None]) – List of two strings specifying the range of k points to plot.

  • labels (Union[List[str], None]) – List of labels for the bands in multi-mode.

  • figsize (Union[Tuple[int, int], None]) – Figure size.

  • scheme (Union[List[int], Tuple[int, int], None]) – Subplot scheme in compare-mode (number of rows, number of columns).

  • sharex (Union[bool, str]) – Flag or ‘row’ or ‘col’ specifying sharing of x-axis.

  • sharey (Union[bool, str]) – Flag or ‘row’ or ‘col’ specifying sharing of y-axis.

  • fermialpha – Opacity of the fermi level 0-1

  • fermiwidth – Width of the fermi level

Raises:

ValueError – If an invalid mode flag is specified or if there are errors in the input parameters.

Returns:

None

plot_single_cry_bands(bands, linestl, linewidth, color, figsize, sharex, sharey)
plot_multi_cry_bands(bands, not_scaled, linestl, linewidth, color, labels, figsize, sharex, sharey)
plot_compare_cry_bands(bands, energy_range, not_scaled, linestl, linewidth, color, fermi, figsize, scheme, sharex, sharey, fermiwidth, fermialpha)
plot_cry_doss(doss, color, fermi, overlap, labels, figsize, linestl, linewidth, title, beta, energy_range, dos_range, prj)

The base function to plot electron / phonon density of states.

Parameters:
  • doss (object) – The density of states object.

  • color (str or list) – The color(s) of the plot(s).

  • fermi (str) – The color of the Fermi level line.

  • overlap (bool) – True if the projections should overlap, False otherwise.

  • labels (str or list) – The label(s) for the plot(s).

  • figsize (tuple) – The figure size (width, height) in inches.

  • linestl (str or list) – The line style(s) for the plot(s).

  • linewidth (float) – The width of the line(s) in points.

  • title (str) – The title of the plot.

  • beta (str) – The beta value (‘up’ or ‘down’).

  • energy_range (tuple) – The energy range (xmin, xmax) for the x-axis.

  • dos_range (tuple) – The density of states range (ymin, ymax) for the y-axis.

  • prj (None or list) – The projection(s) to plot.

Returns:

None

plot_cry_es(bands, doss, k_labels, color_bd, color_doss, fermi, energy_range, linestl_bd, linestl_doss, linewidth, prj, figsize, labels, dos_range, title, dos_beta, legend)

The base function to plot electron / phonon band structure + DOS

Parameters:
  • bands (object) – Object containing band structure data

  • doss (object) – Object containing density of states data

  • k_labels (list or None) – List of labels for high symmetry points along the path

  • color_bd (str) – Color for the band structure plot

  • color_doss (str or list or tuple) – Color(s) for the density of states plot

  • fermi (str) – Color for the Fermi level lines

  • energy_range (list or None) – Range of energy values for the y-axis

  • linestl_bd (str) – Linestyle for the band structure plot

  • linestl_doss (str or list or tuple or None) – Linestyle(s) for the density of states plot

  • linewidth (float) – Width of the lines

  • prj (list or None) – List of projection indices for plotting specific projections

  • figsize (tuple) – Figure size (width, height)

  • labels (str or list or tuple or None) – Labels for the density of states plot

  • dos_range (list or None) – Range of the density of states plot

  • title (str or None) – Title of the figure

  • dos_beta (str) – Beta state for the density of states plot (‘up’ or ‘down’)

  • legend (bool) – Enables or disables the legend

Returns:

fig (object) – Figure object containing the plotted data

CRYSTALClear.base.propout

Classes and methods to phrase output files by ‘properties’ calculations.

class OutBASE(filename)

Bases: object

Base object for Properties output file. Auxiliary information is substracted. Other data is read from formatted files respectively.

Parameters:

filename (str) – Properties output file name.

classmethod get_geometry(filename)

Get geometry from properties output calculation. A 3D geometry is generated since no dimensionality information is provided.

Parameters:

filename (str) – Properties output file name.

Returns:

struc (Structure) – Pymatgen structure

classmethod get_lattice(filename)

Get lattice matrix from properties output calculation. A 3D lattice is generated since no dimensionality information is provided.

Parameters:

filename (str) – Properties output file name.

Returns:

matrix (array) – 3*3 lattice matrix

classmethod get_reciprocal_lattice(filename)

Get reciprocal lattice matrix from properties output calculation. A 3D lattice is generated since no dimensionality information is provided.

Parameters:

filename (str) – Properties output file name.

Returns:

matrix (array) – 3*3 reciprocal lattice matrix

classmethod get_3dkcoord(filename)

BANDS calculation only. Get 3D coordinates of k points and shrinking factors from output file.

Parameters:

filename (str) – Properties output file name.

Returns:
  • tick_pos3d (array) – ntick*3 array of fractional coordinates of high symmetry k points

  • k_pos3d (array) – nkpoint*3 fractional coordinates of k points

class DOSBASE(n_energy, n_proj, spin, efermi, doss, unit)

Bases: object

Base object for doensity of states.

Parameters:
  • n_energy (int) – Number of energy points

  • n_proj (int) – Number of projections

  • spin (int) – 1 or 2, restricted or open shell calculations

  • efermi (float) – Fermi energy. Unit: eV / THz

  • doss (array[float]) – n_energy*(n_proj+1)*spin array of data. The first entry of 2nd dimension is energy / frequency axis. Unit: eV / THz. Other entries are data in states / eV or states / THz.

classmethod DOSS_parser(data)

Parse DOSS.DAT / PHONDOS file for electron / phonon DOS. Unit: eV / THz. E Fermi is aligned to 0.

Parameters:

data (list[str]) – A list of string (DOSS.DAT).

classmethod f25_parser(data)

Parse fort.25 file for electron / phonon DOS. Unit: eV / THz. E Fermi is aligned to 0.

Parameters:

data (list[str]) – A list of string (fort.25).

class BandsBASE(spin, n_tick, tick_position, tick_label, efermi, n_bands, bands, n_kpoints, k_point_plot, unit)

Bases: object

Base object for electron / phonon band structure.

Parameters:
  • spin (int) – 1 or 2. Closed or open shell calculation

  • n_tick (int) – Number of high symmetric k points

  • tick_position (array) – n_tick*1, 1D coordinates of k points along the path

  • tick_label (list[str]) – Label of k points

  • efermi (str) – Fermi energy

  • n_bands (int) – Number of bands

  • bands (array) – n_bands*n_kpoints*spin array of band data. Unit: eV / THz

  • n_kpoints (int) – Number of k points along the path

  • k_point_plot (float) – 1D k coordinates along the path

Uninitialized attributes * self.geometry: Pymatgen structure * self.reciprocal_latt: array, matrix of reciprocal lattice * self.tick_pos3d: array, 3D fractional coordinates of tick labels in reciprocal space * self.k_point_pos3d: array, 3D fractional coordinates of k points in reciprocal space

classmethod BAND_parser(data)

Parse BAND.DAT / PHONBANDS.DAT file for electron / phonon band structure. Unit: eV / THz. E Fermi is aligned to 0.

Parameters:

data (list[str]) – A list of string (BAND.DAT).

classmethod f25_parser(data)

Parse fort.25 file for electron / phonon band structure. Unit: eV / THz. E Fermi is aligned to 0.

Note

If Fermi energy is 0, the file is read as phonon band file.

Parameters:

data (list[str]) – A list of string (fort.25).