pymatgen.electronic_structure.boltztrap2 module

BoltzTraT2 is a python software interpolating band structures and computing materials properties from dft band structure using Boltzmann semi-classical transport theory. This module provides a pymatgen interface to BoltzTraT2. Some of the code is written following the examples provided in BoltzTraP2

BoltzTraT2 has been developed by Georg Madsen, Jesús Carrete, Matthieu J. Verstraete.

https://gitlab.com/sousaw/BoltzTraP2 https://www.sciencedirect.com/science/article/pii/S0010465518301632

References are:

Georg K.H.Madsen, Jesús Carrete, Matthieu J.Verstraete BoltzTraP2, a program for interpolating band structures and calculating semi-classical transport coefficients Computer Physics Communications 231, 140-145, 2018

Madsen, G. K. H., and Singh, D. J. (2006). BoltzTraP. A code for calculating band-structure dependent quantities. Computer Physics Communications, 175, 67-71

TODO: - spin polarized bands - read first derivative of the eigenvalues from vasprun.xml (mommat) - handle magnetic moments (magmom)

class BandstructureLoader(bs_obj, structure=None, nelect=None, spin=None)[source]

Bases: object

Loader for Bandsstrcture object

Parameters
  • bs_obj

  • structure

  • nelect

  • spin

bandana(emin=-inf, emax=inf)[source]

Cut out bands outside the range (emin,emax)

get_lattvec()[source]
Returns

The lattice vectors.

get_volume()[source]
Returns

Volume

set_upper_lower_bands(e_lower, e_upper)[source]

Set fake upper/lower bands, useful to set the same energy range in the spin up/down bands when calculating the DOS

class BztInterpolator(data, lpfac=10, energy_range=1.5, curvature=True)[source]

Bases: object

Interpolate the dft band structures

Parameters
  • data – A loader

  • lpfac – the number of interpolation points in the real space. By default 10 gives 10 time more points in the real space than the number of kpoints given in reciprocal space.

  • energy_range – usually the interpolation is not needed on the entire energy range but on a specific range around the fermi level. This energy in eV fix the range around the fermi level (E_fermi-energy_range,E_fermi+energy_range) of bands that will be interpolated and taken into account to calculate the transport properties.

  • curvature – boolean value to enable/disable the calculation of second derivative related trasport properties (Hall coefficient).

Example

data = VasprunLoader().from_file(‘vasprun.xml’) bztInterp = BztInterpolator(data)

get_band_structure()[source]

Return a BandStructureSymmLine object interpolating bands along a High symmetry path calculated from the structure using HighSymmKpath function

get_dos(partial_dos=False, npts_mu=10000, T=None)[source]

Return a Dos object interpolating bands

Parameters
  • partial_dos – if True, projections will be interpolated as well and partial doses will be return. Projections must be available in the loader.

  • npts_mu – number of energy points of the Dos

  • T – parameter used to smooth the Dos

get_partial_doses(tdos, npts_mu, T)[source]

Return a CompleteDos object interpolating the projections

tdos: total dos previously calculated npts_mu: number of energy points of the Dos T: parameter used to smooth the Dos

class BztPlotter(bzt_transP=None, bzt_interp=None)[source]

Bases: object

Plotter to plot transport properties, interpolated bands along some high symmetry k-path, and fermisurface

Example

bztPlotter = BztPlotter(bztTransp,bztInterp)

Parameters
  • bzt_transP

  • bzt_interp

plot_bands()[source]

Plot a band structure on symmetry line using BSPlotter()

plot_dos(T=None, npoints=10000)[source]

Plot the total Dos using DosPlotter()

plot_props(prop_y, prop_x, prop_z='temp', output='avg_eigs', dop_type='n', doping=None, temps=None, xlim=(-2, 2), ax=None)[source]

Function to plot the transport properties.

Parameters
  • prop_y – property to plot among (“Conductivity”,”Seebeck”,”Kappa”,”Carrier_conc”, “Hall_carrier_conc_trace”). Abbreviations are possible, like “S” for “Seebeck”

  • prop_x – independent variable in the x-axis among (‘mu’,’doping’,’temp’)

  • prop_z – third variable to plot multiple curves (‘doping’,’temp’)

  • output – ‘avg_eigs’ to plot the average of the eigenvalues of the properties tensors; ‘eigs’ to plot the three eigenvalues of the properties tensors.

  • dop_type – ‘n’ or ‘p’ to specify the doping type in plots that use doping levels as prop_x or prop_z

  • doping – list of doping level to plot, useful to reduce the number of curves when prop_z=’doping’

  • temps – list of temperatures to plot, useful to reduce the number of curves when prop_z=’temp’

  • xlim – chemical potential range, useful when prop_x=’mu’

  • ax – figure.axes where to plot. If None, a new figure is produced.

Example: bztPlotter.plot_props(‘S’,’mu’,’temp’,temps=[600,900,1200]).show() more example are provided in the notebook “How to use Boltztra2 interface.ipynb”.

class BztTransportProperties(BztInterpolator, temp_r=array([ 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300]), doping=array([1.e+16, 1.e+17, 1.e+18, 1.e+19, 1.e+20, 1.e+21, 1.e+22]), npts_mu=4000, CRTA=1e-14, margin=None)[source]

Bases: object

Compute Seebeck, Conductivity, Electrical part of thermal conductivity and Hall coefficient, conductivity effective mass, Power Factor tensors w.r.t. the chemical potential and temperatures, from dft band structure via interpolation.

Parameters
  • BztInterpolator – a BztInterpolator previously generated

  • temp_r – numpy array of temperatures at which to calculate trasport properties

  • doping – doping levels at which to calculate trasport properties

  • npts_mu – number of energy points at which to calculate trasport properties

  • CRTA – constant value of the relaxation time

Upon creation, it contains properties tensors w.r.t. the chemical potential of size (len(temp_r),npts_mu,3,3):

Conductivity_mu (S/m), Seebeck_mu (microV/K), Kappa_mu (W/(m*K)), Power_Factor_mu (milliW/K); cond_Effective_mass_mu (m_e) calculated as Ref.

Also:

Carrier_conc_mu: carrier concentration of size (len(temp_r),npts_mu) Hall_carrier_conc_trace_mu: trace of Hall carrier concentration of size

(len(temp_r),npts_mu)

mu_r_eV: array of energies in eV and with E_fermi at 0.0

where all the properties are calculated.

Example

bztTransp = BztTransportProperties(bztInterp,temp_r = np.arange(100,1400,100))

compute_properties_doping(doping, temp_r=None)[source]

Calculate all the properties w.r.t. the doping levels in input.

Parameters

doping – numpy array specifing the doping levels

When executed, it add the following variable at the BztTransportProperties object:

Conductivity_doping, Seebeck_doping, Kappa_doping, Power_Factor_doping, cond_Effective_mass_doping are dictionaries with ‘n’ and ‘p’ keys and arrays of dim (len(temp_r),len(doping),3,3) as values

doping_carriers: number of carriers for each doping level mu_doping_eV: the chemical potential corrispondent to each doping level

find_mu_doping(epsilon, dos, N0, T, dosweight=2.0)[source]

Find the mu.

Parameters
  • epsilon

  • dos

  • N0

  • T

  • dosweight

Returns

props_as_dict()[source]
Returns

Get the properties as a dict.

save(fname='Transport_Properties.json')[source]

Writes the properties to a json file.

Parameters

fname – Filename

class VasprunLoader(vrun_obj=None)[source]

Bases: object

Loader for Vasprun object

Parameters

vrun_obj – Vasprun object.

bandana(emin=-inf, emax=inf)[source]

Cut out bands outside the range (emin,emax)

from_file(vasprun_file)[source]

Get a vasprun.xml file and return a VasprunLoader

get_lattvec()[source]
Returns

Lattice vectors

get_volume()[source]
Returns

Volume of cell

merge_up_down_doses(dos_up, dos_dn)[source]

Merge the up and down DOSs. :param dos_up: Up DOS. :param dos_dn: Down DOS :return: CompleteDos.