/elphbolt

A solver for the coupled and decoupled electron and phonon Boltzmann transport equations.

Primary LanguageFortranGNU General Public License v3.0GPL-3.0

./logo/logo.png

elphbolt

elphbolt (short for electron-phonon Boltzmann transport) is a modern Fortran (2018 standard) code for solving the coupled electron and phonon Boltzmann transport equations (BTEs). You can read about the methodology and implementation here: https://arxiv.org/abs/2109.08547.

elphbolt is a “free as in freedom” code distributed under the GNU General Public License (GPL) version 3. You can read more about the philosophy of software freedom here: https://www.gnu.org/philosophy/free-sw.en.html.

Using ab initio electron-phonon and phonon-phonon interactions and a fully wave vector and electron band/phonon branch resolved formulation of the BTEs, elphbolt can calculate the

  • phonon and electronic thermal conductivities;
  • electronic conductivity;
  • phonon and electronic contributions to the thermopower; and
  • effect of the mutual electron-phonon drag on the transport coefficients listed above.

Stylistically, it is designed to be simple, small, fast, and extensible. Object oriented programming concepts are combined with the procedural style, which allows fast development, while resulting in a rather compact source (~ 6700 lines of code). The symmetries of the crystal are fully exploited and the transport active Fermi window is used to allow the sampling of extremely fine wave vector meshes needed for an accurate solution of the BTEs. Parallelism is achieved through modern Fortran’s intrinsic coarrays feature that is fully supported by recent versions of both the gcc and intel compilers.

elphbolt currently works with the Quantum Espresso (https://www.quantum-espresso.org/) suite and its core module EPW (https://epw-code.org/) for the phonon quantities and the Wannier space information, respectively.

elphbolt is for all of the transport physics community. Feel free to fork and contribute. Create a pull request to incorporate your changes to this project. Tailor it to your own liking/needs and please pay it forward in the spirit of free software and open science. Let me know of bugs, suggestions for improvement, feature requests, criticism, and praises. You may use the Discussions section of this repository for this purpose. There is also a discord server for informal discussions about theory, set up, usage, extensions, maintenance, possible collaborations, etc. You might find me hanging out there from time to time. I’d love to have a coffee with you and talk physics there in the office-hour voice channel.

Documentation

The source is heavily commented and auto-documented with FORD (https://github.com/cmacmackin/ford). For call graphs and detailed documentation, read documentation/index.html with your browser.

Installation on HPC systems with gcc

1. Get spglib

elphbolt uses the spglib (https://spglib.github.io/spglib/) library for crystal symmetry analysis. Currently, versions 1.6.0 and 1.14.1 have been tried and tested. A lot of HPCs provide this library as a module, so check before building from source.

2. Get OpenCoarrays

OpenCoarrays (http://www.opencoarrays.org) is an implementation of the coarrays functionalities. Some HPC systems include it (for example, MareNostrum4 (BSC) and LaPalma (IAC)). In that case, load it. If not, you can build it from source. Below are a couple of concrete examples:

I was able to build version 2.0.0 on the LaPalma system of IAC by first loading gcc, openmpi, and cmake, then going into the OpenCoarrays-2.0.0 directory and saying ./install.sh. The executables caf and cafrun were then installed in /OpenCoarrays-2.0.0/prerequisites/installations/bin/. I added the above directory to my $PATH in my bashrc.

On the Sirius cluster of Boston College, I was able to build version 2.9.2 by first loading gnu_gcc/9.2.0, openmpi/4.0.5gcc9.2.0, and cmake/3.18.4, then going into the OpenCoarrays-2.9.2 directory and saying ./install.sh --with-fortran /usr/public/gnu_gcc/9.2.0/bin/gfortran --with-cxx /usr/public/gnu_gcc/9.2.0/bin/g++ --with-c /usr/public/gnu_gcc/9.2.0/bin/gcc --with-mpi /usr/public/openmpi/4.0.5gcc.9.2.0/ --with-cmake /usr/public/cmake/3.18.4/bin/cmake. The executables caf and cafrun were then installed in /OpenCoarrays-2.9.2/prerequisites/installations/opencoarrays/2.9.2/bin/. I added the above directory to my $PATH in my bashrc.

Above, you can change the build path with the additional argument --install-prefix <path to build directory> to install.sh.

3. Create your <title>.make file

In the Makefiles directory you will find a few <title>.make files. Adapt them to your own architecture. Then, in the Makefile include your personal <title>.make file at the top, commenting out any exiting one. Copy your Makefile and <title>.make files to the src/ directory.

Once you have done the above, go into src/ and simply say make. This should build the executable elphbolt.x one directory above.

Tests

A full example for cubic silicon is provided. More examples will be added over time.

Workflow

This is a transport code. And it comes after doing some DFT, DFPT, and Wannier calculations. Users of the popular ShengBTE (https://bitbucket.org/sousaw/shengbte/src/master/) code will find that just one extra step (an EPW calculation) on top of the ShengBTE workflow is needed to obtain all the input files necessary for a coupled BTEs calculation with elphbolt. You can, however, calculate just a decoupled phonon or electron BTE, if you so choose. For these, only a subset of the input files will be needed. For example, if you want to calculate just a decoupled electron BTE, then you do not need to provide the third order force constants. Similarly, if you are interested in just a phonon BTE without the phonon-electron interactions, then the Wannier parameters are not required.

Following is the full set of input files:

Input file

The input file - input.nml - contains the information about the crystal and the various parameters of the calculation. A full description of all the input parameters is given in the next section. Also take a look at the input.nml file for the cubic silicon example.

Second order interatomic force constants

This comes out of the usual ph.x and q2r.x calculation from Quantum Espresso. This file is needed to calculate phonon quantities and must be named espresso.ifc2.

Third order interatomic force constants

This file, which must be named FORCE_CONSTANTS_3RD, is needed to calculate the 3-ph scattering rates. This is a required file if you seek a solution of the decoupled phonon BTE or the coupled electron-phonon BTEs.

This must be provided for a solution to the phonon BTE or the coupled electron-phonon BTEs. See documentation for the code thirdorder.py (https://bitbucket.org/sousaw/thirdorder/src/master) for how to generate this file.

Wannier space information

These are required if you want to solve a decoupled electron BTE, include phonon-electron interaction in the decoupled phonon BTE, or solve the coupled electron-phonon BTEs.

These include the files rcells_k, rcells_q, rcells_g, wsdeg_k, wsdeg_q, and wsdeg_g which must be printed out of an EPW calculation. We will also need the files epmatwp1 and epwdata.fmt, both of which are outputted by EPW after the Bloch -> Wannier calculation step. The first contains the Wannier space electron-phonon matrix elements and the second contains the Wannier space dynamical matrix and Hamiltonian. A couple of modified source files can be found in EPW/src/ directory which are needed to correctly print these quantities out during EPW’s Bloch -> Wannier calculation step. The user must recompile their EPW code following the replacement with these modified source codes. At this time EPW v5.1.0 (shipped with Quantum Espresso v6.4.1) must be used for this purpose.

High symmetry electron and phonon wave vector path and initial electron wave vector

These are required if you want to plot the electronic bands, phonon dispersions, and the electron-phonon matrix elements along high symmetry paths in the Brillouin zone.

You need to provide a wave vector path file named highsympath.txt (to be used as both the electron and phonon wave vectors) and an initial electron wave vector file named initialk.txt if you want the electron bands, phonon dispersions, and electron-phonon matrix elements calculated along the path. The first line of highsympath.txt must be an integer equaling the number of wave vectors in the path. This should be followed by the same number of rows of wave vectors expressed in crystal coordinates (fractions of the reciprocal lattice vectors). The initialk.txt file must simply contain one wave vector in crystal coordinates.

Description of input.nml

There are 5 Namelists in the input.nml file: allocations, crystal_info, electrons, numerics, and wannier. Users of the ShengBTE code will find the format of this file familiar. Below the keys for each Namelist are described.

allocations

keyTypeDefaultDescription
numelementsInteger0Number of types of basis atoms.
numatomsInteger0Number of basis atoms.

crystal_info

keyTypeDefaultDescription
nameString“Crystal”Name of material.
elementsString array of size numelements‘X’Elements in the basis.
atomtypesInteger array of size numatoms0Integer tagging unique elements in the basis.
massesReal array of size numelements-1.0Masses of the basis atoms in amu. If masses are not provided, set autoisotopes to .True..
autoisotopesLogical.True.Use isotopic mix for masses?
lattvecs3 x 3 real array0.0Lattice vectors in Cartesian coordinates in units of nm. If twod is .True., the crystal must be positioned on the x-y plane and the third lattice vector must be of the form (0 0 layer thickness).
basis3 x numatoms real array0.0Atomic basis vectors in crystal coordinates (i.e. fraction of lattvecs).
polarLogical.False.Is the system polar?
born3 x 3 x numatoms rank-3 real tensor0.0Born effective charge tensor (from phonon calculation).
epsilon3 x 3 rank-2 real tensor0.0High-frequency dielectric tensor (from phonon calculation).
read_epsiloninfReal.False.Read high-frequency dielectric constant from input?
epsiloninfReal0.0High-frequency scalar dielectric constant. If read_epsiloninf is .True. (.False.), this is read from the input (set equal to the trace-average of epsilon). Currently this quantity is not used in any calculation.
epsilon0Real0.0Static scalar dielectric constant. Used for screening electron-charged impurity interaction, if included. Look up elchimp under the Namelist numerics. For the default value of epsilon0, the electron-charged interaction blows up.
TReal-1.0_dpCrystal temperature in K.
twodLogical.False.Is the system (quasi)-2-dimensional? See description of lattvecs also.
subs_massesReal array of size numelements0.0Masses of substitution atoms in amu. This is needed if phsubs is .True. See table of keys for Namelist numerics.
subs_concReal array of size numelements0.0Concentration of the substitutional atoms in cm-3 (or cm-2 if twod is .True.). This is needed if phsubs is .True. See table of keys for Namelist numerics.
bound_lengthReal1e12 mmCharacteristic sample length for boundary scattering. This is needed if phbound or elbound is .True. See table of keys for Namelist numerics.

electrons

keyTypeDefaultDescription
spindegInteger2Spin degeneracy of the bands.
enrefReal-999999.99999Electron referenc energy in eV. This is the center of the transport active window. Also see description for fsthick. See table of keys for Namelist ‘numerics’.
chempotReal-999999.99999Chemical potential in eV.
metallicLogical.False.Is the system metallic?
numbandsInteger0Total number of electronic Wannier bands.
indlowbandInteger0Lowest transport band index.
indhighbandInteger0Highest transport band index.
indlowconductionInteger0Lowest conduction band index. For metallic .False., this or indhighvalence must be provided.
indhighvalenceInteger0Highest valence band index. For metallic .False., this or indlowconduction must be provided.
dopingtypeCharacter‘x’Type of doping (‘n’ or ‘p’). This is needed for runlevel 0 only. See table of keys for Namelist ‘numerics’.
numconcInteger100Number of carrier concentration points. This is needed for runlevel 0 only. See table of keys for Namelist ‘numerics’.
conclistReal array of size numconc0.0List carrier concentrations in cm-3 (or cm-2 if twod is .True.). This is needed for runlevel 0 only. See table of keys for Namelist ‘numerics’.
numTInteger100Number of temperature points. This is needed for runlevel 0 only. See table of keys for Namelist ‘numerics’.
TlistReal array of size numT100List of temperatures in K. This is needed for runlevel 0 only. See table of keys for Namelist ‘numerics’.
ZnReal0.0Ionization number of donor impurities. This is needed only when elchimp is .True. and metallic is .False. See table of keys for Namelist ‘numerics’.
ZpReal0.0Ionization number of acceptor impurities. This is needed only when elchimp is .True. and metallic is .False. See table of keys for Namelist ‘numerics’.

numerics

keyTypeDefaultDescription
qmeshInteger array of size 31 1 1Phonon wave vector mesh (q).
mesh_refInteger1Electron wave vector mesh (k) refinement factor with respect to the phonon mesh.
fsthickReal0.0Fermi surface thickness in eV.
datadumpdirString”./”Runtime data dump directory.
read_gq2Logical.False.Read electron-phonon (irreducible wedge q) vertices from disk?
read_gk2Logical.False.Read electron-phonon (irreducible wedge k) vertices from disk?
read_VLogical.False.Read phonon-phonon (irreducible wedge q) vertices from disk?
read_WLogical.False.Read phonon-phonon (irreducible wedge q) transition probabilities from disk?
tetrahedraLogical.False.Use the analytic tetrahedron method instead of the triangular method for 3d delta function evaluation?
pheLogical.False.Include phonon-electron interaction in phonon BTE?
phisoLogical.False.Include phonon-isotope interaction in phonon BTE?
phsubsLogical.False.Include phonon-substitution interaction in phonon BTE? If .True., look up subs_masses and subs_conc under the Namelist crystal_info.
phboundLogical.False.Include phonon-boundary interaction in phonon BTE? If .True., look up bound_length under the Namelist crystal_info.
onlyphbteLogical.False.Calculate phonon BTE without electron drag?
elchimpLogical.False.Include electron-charged impurity scattering in electron BTE? If .True., look up epsilon0 under Namelist crystal_info and Zn and Zp under Namelist electrons.
elboundLogical.False.Include electron-boundary interaction in electron BTE? If .True., look up bound_length under the Namelist crystal_info.
onlyebteLogical.False.Calculate electron BTE without phonon drag?
dragLogical.True.Include electron and phonon drag term in the phonon and electron BTE, respectively.
maxiterIntger50Maximum number of iteration steps for the BTE(s).
conv_thresReal1e-4Relative convergence threshold for the BTE(s).
runlevelInteger1Control for the type of calculation. 0: Calculate table of chemical potentials for a given doping type, temperature range, and carrier concentrations. Look up dopingtype, numconc, conclist, numT, and Tlist under Namelist electrons. 1: Transport calculation(s). 2: Post-processing results to calculate the spectral transport coefficients.
plot_along_pathLogical.False.Plot Wannier interpolated quantities along high symmetry wave vectors?
ph_en_minReal0.0Lower bound of equidistant phonon energy mesh in eV. Only needed for runlevel 2.
ph_en_maxReal1.0Upper bound of equidistant phonon energy mesh in eV. Only needed for runlevel 2.
ph_en_numInteger100Number of equidistant phonon energy mesh points. Only needed for runlevel 2.
el_en_minReal-10.0Lower bound of equidistant electron energy mesh in eV. Only needed for runlevel 2.
el_en_maxReal10.0Upper bound of equidistant electron energy mesh in eV. Only needed for runlevel 2.
el_en_numInteger100Number of equidistant electron energy mesh points. Only needed for runlevel 2.

wannier

keyTypeDefaultDescription
coarse_qmeshInteger array of size 30 0 0Coarse phonon wave vector mesh employed in the Wannier calculation. This must match the q-mesh in the Quantum Espresso second order force constants file.

Description of output files

The code produces a large amount of data. Here, we provide a description of the various types output files.

Below I(F)BZ = irreducible (full) Brillouin zone; RTA = relaxation time approximation; ch. imp. = charged impurities; bound = boundary; subs = substitution; numbands = number of electron bands; and numbranches = number of phonon branches.

Zero temperature data

File nameDirectoryUnitsDescription
gk2.istate*datadumpdir/g2/eV2Squared e-ph (1-phonon) vertices for every IBZ electron state. Binary.
gq2.istate*datadumpdir/g2/eV2Squared e-ph (1-phonon) vertices for every IBZ electron state. Binary.
Vm2.istate*datadumpdir/V2/eV2Å-6amu-3Squared ph-ph (3-phonon) vertices for every IBZ phonon state. Binary.
el(ph).dos./eV-1Band resolved electronic (phononic) density of states. numbands (numbranches) columns of reals.
el(ph).ens_ibz./eVIBZ electronic (phononic) band energies. numbands (numbranches) columns of reals.
el.inwindow_states_ibz./noneIBZ electronic states (wave vector index, band index) within the transport active window. 2 columns of integers.
el(ph).vels_ibz./Kms-1IBZ electronic (phononic) band (branch) velocities. In each row, there are 3 (Cartesian direction) sets of numbands (numbranches) numbers.
el(ph).wavevecs_ibz[fbz]./crystalIBZ [FBZ] electronic (phononic) wave vectors. For the electrons, these are only within the transport window.
el.W_rta_elbound./THzIBZ RTA el-bound scattering rates. numbands columns of reals.
ph.W_rta_phiso(bound)[subs]./THzIBZ RTA ph-iso (bound) [subs] scattering rates. numbranches columns of reals.
el.ens_kpath./eVElectron energies along the given k-path.
ph.ens_qpath./eVPhonon energies along the given q-path.
gk_qpath./eVAbsolute value of the e-ph matrix elements (averaged over the degenerate bands and branches) for the given k-vector and q-path.

Finite temperature data

File nameDirectoryUnitsDescription
Xchimp.istate*datadumpdir/mu*/X/THzTransition probability for e-ch. imp. processes for every IBZ electron state. Binary.
Xminus[plus].istate*datadumpdir/mu*/X/THzTransition probability for e-ph (1-phonon) minus [plus] processes for every IBZ electron state. Binary.
Y.istate*datadumpdir/mu*/Y/THzTransition probability for ph-e (1-phonon) processes for every IBZ phonon state. Binary.
Wm[p].istate*datadumpdir/T*/W/THzTransition probability for ph-ph (3-phonon) minus [plus] processes for every IBZ phonon state. Binary.
el.W_rta_eph[chimp]./T*/THzIBZ RTA el-ph [ch. imp.] scattering rates. numbands columns of reals. Identically zero for bands outside the transport window.
ph.W_rta_3ph[phe]./T*/THzIBZ RTA ph-ph [e] scattering rates. numbranches columns of reals.
drag[nodrag]_el_sigma_*./T*/Ω-1m-1Band resolved (_<integer>) and total (_tot) charge conductivity tensor at every iteration step.
drag[nodrag]_el_alphabyT_*./T*/Am-1K-1Band resolved (_<integer>) and total (_tot) electronic Peltier(-ish) coefficient tensor at every iteration step.
drag[nodrag]_el_kappa0_*./T*/Wm-1K-1Band resolved (_<integer>) and total (_tot) electronic thermal conductivity (zero E-field) tensor at every iteration step.
drag[nodrag]_el_sigmaS_*./T*/Am-1K-1Band resolved (_<integer>) and total (_tot) electronic thermopower times conductivity tensor at every iteration step.
drag_ph_alphabyT_*./T*/Am-1K-1Branch resolved (_<integer>) and total (_tot) phonon Peltier(-ish) coefficient tensor at every iteration step.
drag[nodrag]_ph_kappa_*./T*/Wm-1K-1Branch resolved (_<integer>) and total (_tot) phonon thermal conductivity tensor at every iteration step.
RTA{nodrag}(partdcpl)[drag]_I0_*./T*/nmeVK-1Band resolved (_<integer>) and total (_tot) electronic response function to ∇ T-field in the RTA {dragless} (partially decoupled) [drag] theory.
RTA{nodrag}(partdcpl)[drag]_J0_*./T*/nmCBand resolved (_<integer>) and total (_tot) electronic response function to E-field in the RTA {dragless} (partially decoupled) [drag] theory.
RTA{nodrag}[drag]_F0_*./T*/nmeVK-1Branch resolved (_<integer>) and total (_tot) phononic response function to ∇ T-field in the RTA {dragless} [fully coupled] theory.
drag_G0_*./T*/nmCBranch resolved (_<integer>) and total (_tot) phononic response function to E-field in fully coupled theory.

Postprocessing (runlevel 2)

File nameDirectoryUnitsDescription
RTA{nodrag}(partdcpl)[drag]_{([iterated_el])}_sigma_spectral_*./T*/Ω-1m-1eV-1Band resolved (_<integer>) and total (_tot) spectral charge conductivity tensor in the RTA {([iterated])} {dragless} (partially decoupled) [drag] theory.
RTA{nodrag}(partdcpl)[drag]_{([iterated_el])}_alphabyT_spectral_*./T*/Am-1K-1eV-1Band resolved (_<integer>) and total (_tot) spectral electronic Peltier(-ish) coefficient tensor in the RTA {([iterated])} {dragless} (partially decoupled) [drag] theory.
RTA{nodrag}(partdcpl)[drag]_{([iterated_el])}_kappa0_spectral_*./T*/Wm-1K-1eV-1Band resolved (_<integer>) and total (_tot) spectral electronic thermal conductivity (zero E-field) tensor in the RTA {([iterated])} {dragless} (partially decoupled) [drag] theory.
RTA{nodrag}(partdcpl)[drag]_{([iterated_el])}_sigmaS_spectral_*./T*/Am-1K-1eV-1Band resolved (_<integer>) and total (_tot) spectral electronic thermopower times conductivity tensor in the RTA {([iterated])} {dragless} (partially decoupled) [drag] theory.
drag_iterated_ph_alphabyT_spectral_*./T*/Am-1K-1eV-1Branch resolved (_<integer>) and total (_tot) spectral phonon Peltier(-ish) coefficient tensor in the iterated drag theory.
RTA{nodrag}[drag]_{[iterated_ph]}_kappa_spectral_*./T*/Wm-1K-1eV-1Branch resolved (_<integer>) and total (_tot) spectral phonon thermal conductivity tensor in the RTA {[iterated]} {dragless} [drag] theory.
el[ph].en_grid./eVUniform electron [phonon] energy mesh for spectral coefficient calculation.