API usage

You can call a function in this library as follows:

import libtetrabz

Total energy, charge density, occupations

\[\begin{align} \sum_{n} \int_{\rm BZ} \frac{d^3 k}{V_{\rm BZ}} \theta(\varepsilon_{\rm F} - \varepsilon_{n k}) X_{n k} \end{align}\]
wght = libtetrabz.occ(bvec, eig)

Parameters

bvec = numpy.array([[b0x, b0y, b0z], [b1x, b1y, b1z], [b2x, b2y, b2z]])

Reciprocal lattice vectors (arbitrary unit). Because they are used to choose the direction of tetrahedra, only their ratio is used.

eig = numpy.empty([ng0, ng1, ng2, nb], dtype=numpy.float_)

The energy eigenvalue \(\varepsilon_{n k}\) in arbitrary unit. Where ng0, ng1, ng2 are the number of grid for each direction of the reciprocal lattice vectors and nb is the number of bands.

Return

wght = numpy.empty([ng0, ng1, ng2, nb], dtype=numpy.float_)

The integration weights.

Fermi energy and occupations

\[\begin{align} \sum_{n} \int_{\rm BZ} \frac{d^3 k}{V_{\rm BZ}} \theta(\varepsilon_{\rm F} - \varepsilon_{n k}) X_{n k} \end{align}\]
ef, wght, iteration = libtetrabz.fermieng(bvec, eig, nelec)

Parameters

bvec = numpy.array([[b0x, b0y, b0z], [b1x, b1y, b1z], [b2x, b2y, b2z]])

Reciprocal lattice vectors (arbitrary unit). Because they are used to choose the direction of tetrahedra, only their ratio is used.

eig = numpy.empty([ng0, ng1, ng2, nb], dtype=numpy.float_)

The energy eigenvalue \(\varepsilon_{n k}\) in arbitrary unit. Where ng0, ng1, ng2 are the number of grid for each direction of the reciprocal lattice vectors and nb is the number of bands.

nelec = # float

The number of electrons.

Return

ef = # float

The Fermi energy. Unit is the same as eig.

wght = numpy.empty([ng0, ng1, ng2, nb], dtype=numpy.float_)

The integration weights.

Partial density of states

\[\begin{align} \sum_{n} \int_{\rm BZ} \frac{d^3 k}{V_{\rm BZ}} \delta(\omega - \varepsilon_{n k}) X_{n k}(\omega) \end{align}\]
wght = libtetrabz.dos(bvec, eig, e0)

Parameters

bvec = numpy.array([[b0x, b0y, b0z], [b1x, b1y, b1z], [b2x, b2y, b2z]])

Reciprocal lattice vectors (arbitrary unit). Because they are used to choose the direction of tetrahedra, only their ratio is used.

eig = numpy.empty([ng0, ng1, ng2, nb], dtype=numpy.float_)

The energy eigenvalue \(\varepsilon_{n k}\) in arbitrary unit. Where ng0, ng1, ng2 are the number of grid for each direction of the reciprocal lattice vectors and nb is the number of bands.

e0 = numpy.empty(ne, dtype=numpy.float_)

The energy point \(\omega\) in the same unit of eig. Where ne is the number of energy points.

Return

wght = numpy.empty([ng0, ng1, ng2, nb, ne], dtype=numpy.float_)

The integration weights.

Integrated density of states

\[\begin{align} \sum_{n} \int_{\rm BZ} \frac{d^3 k}{V_{\rm BZ}} \theta(\omega - \varepsilon_{n k}) X_{n k}(\omega) \end{align}\]
wght = libtetrabz.intdos(bvec, eig, e0)

Parameters

bvec = numpy.array([[b0x, b0y, b0z], [b1x, b1y, b1z], [b2x, b2y, b2z]])

Reciprocal lattice vectors (arbitrary unit). Because they are used to choose the direction of tetrahedra, only their ratio is used.

eig = numpy.empty([ng0, ng1, ng2, nb], dtype=numpy.float_)

The energy eigenvalue \(\varepsilon_{n k}\) in arbitrary unit. Where ng0, ng1, ng2 are the number of grid for each direction of the reciprocal lattice vectors and nb is the number of bands.

e0 = numpy.empty(ne, dtype=numpy.float_)

The energy point \(\omega\) in the same unit of eig. Where ne is the number of energy points.

Return

wght = numpy.empty([ng0, ng1, ng2, nb, ne], dtype=numpy.float_)

The integration weights.

Nesting function and Fr&oumlhlich parameter

\[\begin{align} \sum_{n n'} \int_{\rm BZ} \frac{d^3 k}{V_{\rm BZ}} \delta(\varepsilon_{\rm F} - \varepsilon_{n k}) \delta(\varepsilon_{\rm F} - \varepsilon'_{n' k}) X_{n n' k} \end{align}\]
wght = libtetrabz.dbldelta(bvec, eig1, eig2)

Parameters

bvec = numpy.array([[b0x, b0y, b0z], [b1x, b1y, b1z], [b2x, b2y, b2z]])

Reciprocal lattice vectors (arbitrary unit). Because they are used to choose the direction of tetrahedra, only their ratio is used.

eig1 = numpy.empty([ng0, ng1, ng2, nb], dtype=numpy.float_)

The energy eigenvalue \(\varepsilon_{n k}\) in arbitrary unit. Where ng0, ng1, ng2 are the number of grid for each direction of the reciprocal lattice vectors and nb is the number of bands.

eig2 = numpy.empty([ng0, ng1, ng2, nb], dtype=numpy.float_)

Another energy eigenvalue \(\varepsilon'_{n k}\) in the same unit of eig1. Typically it is assumed to be \(\varepsilon_{n k+q}\).

Return

wght = numpy.empty([ng0, ng1, ng2, nb, nb], dtype=numpy.float_)

The integration weights.

A part of DFPT calculation

\[\begin{align} \sum_{n n'} \int_{\rm BZ} \frac{d^3 k}{V_{\rm BZ}} \theta(\varepsilon_{\rm F} - \varepsilon_{n k}) \theta(\varepsilon_{n k} - \varepsilon'_{n' k}) X_{n n' k} \end{align}\]
wght = libtetrabz.dblstep(bvec, eig1, eig2)

Parameters

bvec = numpy.array([[b0x, b0y, b0z], [b1x, b1y, b1z], [b2x, b2y, b2z]])

Reciprocal lattice vectors (arbitrary unit). Because they are used to choose the direction of tetrahedra, only their ratio is used.

eig1 = numpy.empty([ng0, ng1, ng2, nb], dtype=numpy.float_)

The energy eigenvalue \(\varepsilon_{n k}\) in arbitrary unit. Where ng0, ng1, ng2 are the number of grid for each direction of the reciprocal lattice vectors and nb is the number of bands.

eig2 = numpy.empty([ng0, ng1, ng2, nb], dtype=numpy.float_)

Another energy eigenvalue \(\varepsilon'_{n k}\) in the same unit of eig1. Typically it is assumed to be \(\varepsilon_{n k+q}\).

Return

wght = numpy.empty([ng0, ng1, ng2, nb, nb], dtype=numpy.float_)

The integration weights.

Static polarization function

\[\begin{align} \sum_{n n'} \int_{\rm BZ} \frac{d^3 k}{V_{\rm BZ}} \frac{\theta(\varepsilon_{\rm F} - \varepsilon_{n k}) \theta(\varepsilon'_{n' k} - \varepsilon_{\rm F})} {\varepsilon'_{n' k} - \varepsilon_{n k}} X_{n n' k} \end{align}\]
wght = libtetrabz.polstat(bvec, eig1, eig2)

Parameters

bvec = numpy.array([[b0x, b0y, b0z], [b1x, b1y, b1z], [b2x, b2y, b2z]])

Reciprocal lattice vectors (arbitrary unit). Because they are used to choose the direction of tetrahedra, only their ratio is used.

eig1 = numpy.empty([ng0, ng1, ng2, nb], dtype=numpy.float_)

The energy eigenvalue \(\varepsilon_{n k}\) in arbitrary unit. Where ng0, ng1, ng2 are the number of grid for each direction of the reciprocal lattice vectors and nb is the number of bands.

eig2 = numpy.empty([ng0, ng1, ng2, nb], dtype=numpy.float_)

Another energy eigenvalue \(\varepsilon'_{n k}\) in the same unit of eig1. Typically it is assumed to be \(\varepsilon_{n k+q}\).

Return

wght = numpy.empty([ng0, ng1, ng2, nb, nb], dtype=numpy.float_)

The integration weights.

Phonon linewidth

\[\begin{align} \sum_{n n'} \int_{\rm BZ} \frac{d^3 k}{V_{\rm BZ}} \theta(\varepsilon_{\rm F} - \varepsilon_{n k}) \theta(\varepsilon'_{n' k} - \varepsilon_{\rm F}) \delta(\varepsilon'_{n' k} - \varepsilon_{n k} - \omega) X_{n n' k}(\omega) \end{align}\]
wght = libtetrabz.fermigr(bvec, eig1, eig2, e0)

Parameters

bvec = numpy.array([[b0x, b0y, b0z], [b1x, b1y, b1z], [b2x, b2y, b2z]])

Reciprocal lattice vectors (arbitrary unit). Because they are used to choose the direction of tetrahedra, only their ratio is used.

eig1 = numpy.empty([ng0, ng1, ng2, nb], dtype=numpy.float_)

The energy eigenvalue \(\varepsilon_{n k}\) in arbitrary unit. Where ng0, ng1, ng2 are the number of grid for each direction of the reciprocal lattice vectors and nb is the number of bands.

eig2 = numpy.empty([ng0, ng1, ng2, nb], dtype=numpy.float_)

Another energy eigenvalue \(\varepsilon'_{n k}\) in the same unit of eig1. Typically it is assumed to be \(\varepsilon_{n k+q}\).

e0 = numpy.empty(ne, dtype=numpy.float_)

The energy point \(\omega\) in the same unit of eig. Where ne is the number of energy points.

Return

wght = numpy.empty([ng0, ng1, ng2, nb, nb, ne], dtype=numpy.float_)

The integration weights.

Polarization function (complex frequency)

\[\begin{align} \sum_{n n'} \int_{\rm BZ} \frac{d^3 k}{V_{\rm BZ}} \frac{\theta(\varepsilon_{\rm F} - \varepsilon_{n k}) \theta(\varepsilon'_{n' k} - \varepsilon_{\rm F})} {\varepsilon'_{n' k} - \varepsilon_{n k} + i \omega} X_{n n' k}(\omega) \end{align}\]
wght = libtetrabz.polcmplex(bvec, eig1, eig2, e0)

Parameters

bvec = numpy.array([[b0x, b0y, b0z], [b1x, b1y, b1z], [b2x, b2y, b2z]])

Reciprocal lattice vectors (arbitrary unit). Because they are used to choose the direction of tetrahedra, only their ratio is used.

eig1 = numpy.empty([ng0, ng1, ng2, nb], dtype=numpy.float_)

The energy eigenvalue \(\varepsilon_{n k}\) in arbitrary unit. Where ng0, ng1, ng2 are the number of grid for each direction of the reciprocal lattice vectors and nb is the number of bands.

eig2 = numpy.empty([ng0, ng1, ng2, nb], dtype=numpy.float_)

Another energy eigenvalue \(\varepsilon'_{n k}\) in the same unit of eig1. Typically it is assumed to be \(\varepsilon_{n k+q}\).

e0 = numpy.empty(ne, dtype=numpy.complex_)

The energy point \(\omega\) in the same unit of eig. Where ne is the number of energy points.

Return

wght = numpy.empty([ng0, ng1, ng2, nb, nb, ne], dtype=numpy.complex)

The integration weights.