This tutorials cover how to compute the drift and Hall mobility of c-BN using the Boltzmann transport equation (BTE) within the EPW code and including anharmonic effects computed with sTDEP. The theory for the BTE can be found in the review [Ponce2020].
We will show how to compute the harmonic phonon dispersion of c-BN using density functional perturbation theory (DFPT) with Quantum ESPRESSO, the anharmonic temperature dependent phonon dispersion using stochastic TDEP and to convert the effective harmonic interatomic force constants (IFC) into real-space Quantum ESPRESSO XML format. We will then use these to compute transport properties with the EPW code.
For the description of inputs and more information please follow the link:
The TDEP to Quantum ESPRESSO interface is described in [Yin2025].
The standard EPW workflow is described here. What we are doing in this tutorial is to replace the harmonic phonons with the TDEP phonons, so the difference between a "normal" EPW calculation and what we are doing here is only in the preparation of the interatomic force constants.
In this example we are going to calculate the drift and Hall hole carrier mobility of c-BN. The drift mobility is obtained with:
where the out of equilibrium occupations are obtained by solving the BTE:
The scattering rate is defined as:
A common approximation to Eq. ~\eqref{eq:eqBTE} is called the self-energy relaxation time approximation (SERTA) and consists in neglecting the second term in the right-hand of the equation which gives:
The the low-field phonon-limited carrier mobility in the presence of a small finite magnetic field B is given by:
again solving the BTE with finite (small) magnetic field:
The Hall factor and Hall mobility are then obtained as:
where
For this tutorial, you will need to compile Quantum ESPRESSO v7.4 and we will assume that the following executables are in your path: pw.x, ph.x, q2r.x, matdyn.x, epw.x.
First, go to the folder example_cBN
Then download the standard boron and nitrogen PBE pseudopotential from PseudoDojo in upf format and renamed them B-PBE.upf and N-PBE.upf
and place them in the example_cBN folder.
- Perform a self-consistent calculation
cd 1_qe
mpirun -np 4 pw.x -in scf.in | tee scf.outNote that in practice the k-point grid needs to be fairly large in order to get converged dielectric function and Born effective charges during the following phonon calculation.
- Compute the phonon using DFPT on a coarse 4x4x4 q-point grid
mpirun -np 4 ph.x -in ph.in | tee ph.outNote that the input variable epsil=.true. computes the macroscopic dielectric constant in non-metallic systems. If you add .xml after the name of the dynamical matrix file, it will produce the data in XML format (preferred). The variable fildvscf is required as it generates the perturbed potential. It is also important that tr2_ph is very small as it control the threshold for the self-consistent first-order perturbed wavefunction.
Task: locate in ph.out the IBZ q-point grid, dielectric function and Born effective charge tensor. Note that denser k-point grids are required to obtain converged quantities.
- Run the python post-processing script to create the save folder, used later by EPW (the script is located in
QE/EPW/bin/pp.pybut copied here for convience).
python3 pp.pyThe script will ask you to enter the prefix used for the calculation. In this case enter bn. The script will create a new folder called save that contains the dvscf potential files, pattern files, and dynamical matrices on the IBZ.
- Do a Fourier transform from the dynamical matrices into real space to produce
bn444.fc.xmlthen interpolate on a high-symmetry lines to get the phonons
q2r.x < q2r.in | tee q2r.out- Interpolate the real space IFC in Bloch space along high-symmetry lines
matdyn.x < matdyn.in | tee matdyn.out- Use gnuplot (or any other tools) to show the resulting phonon dispersion
gnuplot gnuplot.inYou should obtain a dispersion similar to:
Fig. 1: Harmonic phonon dispersion of c-BN using Quantum ESPRESSO and DFPTThe anharmonic calculations here is an abbreviated version of the sampling tutorial, for production calculations it is highly recommended that you go through the previous tutorials in detail.
-
Create the primitive and supercell inputs. For this you need to create the
infile.ucposcarfrom the Quantum ESPRESSO calculation made in the step above. We provide the file for you in this tutorial.Note: the lattice parameter in
infile.ucposcarmust be expressed in Angstrom.Then execute:
cd ../2_tdep generate_structure -na 10The first command generates a supercell in TDEP format, and
where
output_format 6is a producing the crystal structure new Quantum ESPRESSO output format (you need TDEP v25.04 or higher) and it should generate a file calledoutfile.supercell_qe. -
Collect the dielectric tensor and Born effective charges from the QE output
ph.outThe quantities need to be provided to TDEP in the fileinfile.lotosplitting, according to the format specified here. -
Choose a temperature you want to study, we choose 600 K
mkdir sampling.600K cp outfile.ssposcar infile.ssposcar cp infile.ssposcar sampling.600K/ cp infile.ucposcar sampling.600K/ cp infile.lotosplitting sampling.600K/ cd sampling.600K -
Generate 1 configuration at 600 K. Since it is quantum, the temperature will not match perfectly.
tdep/bin/canonical_configuration --quantum --maximum_frequency 20 --temperature 600 -n 1 --output_format 6 mkdir -p iter.000/samples/sample.00001/ cd iter.000/samples/sample.00001/For an explanation of the command line options see the documentation for canonical configuration
-
Then you should copy your
scf.ininput and merge it with theqe_conf0001file produced in the previous step. Importantly the calculation of forces should be enabled in the input. We provide the filescf.infor reference.mpirun -np 4 pw.x -in scf.in | tee scf.out -
Extract forces from QE output
In principle you can parse the QE output yourself, what you need to extract are positions, forces, and energies from
scf.out, and store them in the format specified here.However, it is simpler to use:
pip install https://github.com/flokno/tools.tdep/archive/refs/tags/v0.0.5.zip
You can then run the extraction script:
cd ../../ tdep_parse_output samples/*/scf.out --format espresso-out cp ../infile.ucposcar . cp ../infile.ssposcar . cp ../infile.lotosplitting .
-
Create the file with the q-point path
infile.qpoints_dispersionthat we also provide for reference.You can then extract the force constant
tdep/bin/extract_forceconstants --polar -rc2 4 --output_epw | tee extract_forceconstants.log cp outfile.forceconstant infile.forceconstant tdep/bin/phonon_dispersion_relations -rpwhich should give you the TDEP phonon dispersion after a single iteration with a single configuration:
Fig. 2: Anharmonic phonon dispersion of c-BN using TDEP at 600 KIn practice you then need to re-use the IFC to generate new iterations with more configurations until convergence, which was covered in the tutorial on sampling.
The main difference from a usual calculation is that we add the option
--output_epwtoextract_forceconstants. This produces a replicate of the realspace IFCs inxmlformat for Quantum ESPRESSO, calledoutfile.qe_fc.xml. -
Compute the TDEP phonon dispersion along high-symmetry lines using
matdyn.xmatdyn.x < matdyn.in | tee matdyn.out gnuplot gnuplot.in
which should give you
Fig. 3: Anharmonic phonon dispersion of c-BN using TDEP at 600 K using matdyn.xwhich you can verify is the same as Fig. 2, validating the conversion.
Once you have computed the effective harmonic potential for a given temperature, you can use it within EPW.
For this, you can follow the EPW tutorial on mobility, accessible HERE.
The only thing to do in order to read external IFC, is to add the lifc = .true. in all your EPW input files.
Note: the IFC file must be in the same directory as the one you are running your EPW calculations on and must be named ifc.q2r.xml. Therefore rename it with
cp outfile.qe_fc.xml ifc.q2r.xml

