Skip to content

Commit 7f7493a

Browse files
authored
Merge pull request #257 from phoebe-team/relaxonsTutorial
Coupled Relaxons tutorial
2 parents 07aa270 + 72e1455 commit 7f7493a

File tree

62 files changed

+1375
-716
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1375
-716
lines changed

doc/sphinx/source/faq.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,23 @@ Frequently asked questions
66

77
**Why does my iterative or variational BTE solution not converge, or my relaxons solution have negative eigenvalues?**
88

9-
If the iterative solver, or especially the variational solver, does not converge, this could be a sign that your scattering matrix is poorly conditioned. You can check this by running the relaxons solver and noting if there are negative eigenvalues (which indicate the matrix is not positive semi-definite as it should be). This could indicate a number of problems:
9+
If the iterative solver, or especially the variational solver, does not converge, this could be a sign that your scattering matrix is poorly conditioned. You can check this by running the relaxons solver and noting if there are negative eigenvalues (which indicate the matrix is not positive semi-definite as it should be).
10+
11+
This could indicate a number of problems:
1012

1113
* For electron and phonon calcultions, you may have chosen a smearing value which violates the conservation of energy too strongly
1214
* For an el-ph calculation, your Wannierization may not be very good, producing noisy el-ph matrix elements, energies, etc. For phonon only calculations, you might have poor force constants.
1315
* Symmetrizing the scattering matrix might help - but if you have many negative eigenvalues, likely this is just going to partially cover up a potentially serious problem.
1416

17+
For more discussion on this topic, see the :ref:`negativeEigenvalues` section of the relaxons tutorial.
1518

1619
**Can I use the rotationally invariant ASR?**
1720

1821
* One can take advantage of an improved ASR using the matdyn tool of QE. We recommend this for 2D materials. Here, one should use the ASR=‘all’ tag in matdyn. This should output the force constants using rotational invariance + vanishing stress conditions. Then, when Phoebe is run, use sumRuleFC2 = "no", as applying a further ASR will just add additional noise.
1922
https://www.quantum-espresso.org/Doc/INPUT_MATDYN.html#idm17
2023

2124

22-
** I have encountered the error `Error in routine phoebe (1): atom mapping failed`` when running the `phoebe-quantum-espresso` version of `ph.x`.
25+
**I have encountered the error `Error in routine phoebe (1): atom mapping failed`` when running the `phoebe-quantum-espresso` version of `ph.x`.**
2326

2427
This is a somewhat rare issue that emerges either because of a general issue with the crystal structure or because of a difference in how symmetries are used in the pw.x and ph.x calculations (often, it seems to appear when fractional translations are found in the sym ops list).
2528
Typically this can be resolved by a standardized representation of your crystal structure -- generated for example by running `AFLOW <http://www.aflowlib.org/aflow-online/>`_ on your structure, using the button for "structure conversion" and "standard primitive" (or any other equivalent utility.)

doc/sphinx/source/inputFiles.rst

Lines changed: 134 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ Phonon BTE Solver
153153

154154
* :ref:`checkNegativeRelaxons`
155155

156-
* :ref:`enforcePositiveSemiDefinite`
156+
* :ref:`enforceDetailedBalance`
157157

158158
.. raw:: html
159159

@@ -256,7 +256,7 @@ Electron BTE Solver
256256

257257
* :ref:`checkNegativeRelaxons`
258258

259-
* :ref:`enforcePositiveSemiDefinite`
259+
* :ref:`enforceDetailedBalance`
260260

261261
.. raw:: html
262262

@@ -332,6 +332,112 @@ EPA Transport
332332
temperatures = [300.]
333333
dopings = [1.0e21]
334334

335+
-------------------------------------
336+
337+
Coupled Electron-Phonon BTE Solver
338+
-----------------------------------
339+
340+
**Functionality:** Build and solve the coupled Boltzmann Transport Equation (BTE). Use and outputs are described in :ref:`tutorialCBTE`.
341+
342+
.. raw:: html
343+
344+
<h3>Input variables</h3>
345+
346+
347+
:ref:`appName` = "coupledTransport"
348+
349+
* :ref:`phFC2FileName`
350+
351+
* :ref:`phFC3FileName`
352+
353+
* :ref:`phonopyDispFileName`
354+
355+
* :ref:`phonopyBORNFileName`
356+
357+
* :ref:`sumRuleFC2`
358+
359+
* :ref:`electronH0Name`
360+
361+
* :ref:`wsVecFileName`
362+
363+
* :ref:`elphFileName`
364+
365+
* :ref:`kMesh`
366+
367+
* :ref:`qMesh`
368+
369+
* :ref:`temperatures`
370+
371+
* :ref:`dopings`
372+
373+
* :ref:`chemicalPotentials`
374+
375+
* :ref:`smearingMethod`
376+
377+
* :ref:`smearingWidth`
378+
379+
* :ref:`phSmearingWidth`
380+
381+
* :ref:`elSmearingWidth`
382+
383+
* :ref:`dimensionality`
384+
385+
* :ref:`thickness`
386+
387+
* :ref:`windowType`
388+
389+
* :ref:`windowEnergyLimit`
390+
391+
* :ref:`windowPopulationLimit`
392+
393+
* :ref:`solverBTE`
394+
395+
* :ref:`scatteringMatrixInMemory`
396+
397+
* :ref:`symmetrizeMatrix`
398+
399+
* :ref:`fermiLevel`
400+
401+
* :ref:`numOccupiedStates`
402+
403+
* :ref:`numRelaxonsEigenvalues`
404+
405+
* :ref:`checkNegativeRelaxons`
406+
407+
* :ref:`enforceDetailedBalance`
408+
409+
.. raw:: html
410+
411+
<h3>Sample input file</h3>
412+
413+
::
414+
415+
appName = "coupledTransport"
416+
417+
sumRuleFC2 = "crystal"
418+
phFC2FileName = "silicon.fc"
419+
electronH0Name = "si_tb.dat"
420+
elphFileName = "silicon.phoebe.elph.hdf5"
421+
phFC3FileName = "FORCE_CONSTANTS_3RD"
422+
423+
kMesh = [25, 25, 25]
424+
qMesh = [5, 5, 5]
425+
temperatures = [200.]
426+
dopings = [1.e21]
427+
428+
smearingMethod = "gaussian"
429+
elSmearingWidth = 0.005 eV
430+
phSmearingWidth = 0.002 eV
431+
windowType = "population"
432+
windowPopulationLimit = 1e-3
433+
numOccupiedStates = 4
434+
435+
useSymmetries = false
436+
enforceDetailedBalance = true
437+
symmetrizeMatrix = true
438+
scatteringMatrixInMemory = true
439+
solverBTE = ["relaxons"]
440+
335441
-----------------------------------
336442

337443
Phonon Lifetimes on a Path
@@ -953,6 +1059,29 @@ smearingWidth
9531059
* **Required:** yes (when :ref:`smearingMethod` = "gaussian")
9541060

9551061

1062+
.. _elSmearingWidth:
1063+
1064+
elSmearingWidth
1065+
^^^^^^^^^^^^^
1066+
1067+
* **Description:** This parameter allows different smearing values to be used if :ref:`smearingMethod` = "gaussian" and one is using both el and ph scattering types, as in the coupled BTE, where this parameter represents the full-width half-maximum of the Gaussian used to approximate the Dirac-delta conserving energy. Example: elSmearingWidth = 0.5 eV
1068+
1069+
* **Format:** *double+units*
1070+
1071+
* **Required:** no
1072+
1073+
1074+
.. _phSmearingWidth:
1075+
1076+
phSmearingWidth
1077+
^^^^^^^^^^^^^
1078+
1079+
* **Description:** This parameter allows different smearing values to be used if :ref:`smearingMethod` = "gaussian" and one is using both el and ph scattering types, as in the coupled BTE, where this parameter represents the full-width half-maximum of the Gaussian used to approximate the Dirac-delta conserving energy. Example: phSmearingWidth = 0.5 eV
1080+
1081+
* **Format:** *double+units*
1082+
1083+
* **Required:** no
1084+
9561085
.. _solverBTE:
9571086

9581087
solverBTE
@@ -1024,12 +1153,12 @@ checkNegativeRelaxons
10241153

10251154
* **Default:** `true`
10261155

1027-
.. _enforcePositiveSemiDefinite:
1156+
.. _enforceDetailedBalance:
10281157

1029-
enforcePositiveSemiDefinite
1158+
enforceDetailedBalance
10301159
^^^^^^^^^^^^^^^^^^^^^^^^^^^
10311160

1032-
* **Description:** When `enforcePositiveSemiDefinite` is true, we apply a diagonal perturbation to the scattering matrix to make it positive definite. Note that that this is a bit of a band-aid -- you should check that your matrix is not too far from correct before applying this (that it has just a few small negative eigenvalues at most!).
1161+
* **Description:** When `enforceDetailedBalance` is set to true, we recompute the diagonal elements of the scattering matrix by summing up the rows of the matrix (enforcing detailed balance). This is especially relevant to the relaxons solution to the BTE, in order to avoid issues with negative eigenvalues arising from numerical noise.
10331162

10341163
* **Format:** *bool*
10351164

doc/sphinx/source/theory/coupledBTE.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ Coupled BTE
1111
| *Coupled electron-phonon hydrodynamics and viscous thermoelectric equations.*
1212
| `arXiv:2503.07560 <https://arxiv.org/abs/2503.07560>`_
1313
14-
| Here, we outline the high-level perspective of the theory behind this development, but encourage you to study the manuscript before using it. This represents a major development in preparation of the second release of Phoebe.
14+
| Here, we outline the high-level perspective of the theory behind this development, but encourage you to study the manuscript before using it.
1515
1616
Introduction
1717
-------------------------------
1818
When we consider the response of electron or phonon populations to a small electric field or thermal gradient, we typically can focus on calculating the out-of-equilibrium population of only the electron or phonon states, assuming the other particles remain at their equilibrium distribution.
1919
However, in some cases, the scattering between electrons and phonon means that if the el or ph population goes out-of-equilibrium, it can cause a shift in the other's distribution as well.
2020
Essentially, this is the **electron-phonon drag effect**, the phenomenon in which out-of-equilibrium electrons induce out-of-equilibrium phonons via electron-phonon scattering, and vice-versa.
2121

22-
In order to predict the phonon drag effect on transport, we have to construct the coupled electron-phonon Boltzmann Transport Equation (epBTE). In Phoebe, we implement the epBTE using a full scattering matrix approach, so that the coupled scattering matrix consists of
22+
In order to predict the phonon drag effect on transport, we have to construct the coupled electron-phonon Boltzmann Transport Equation (CBTE). In Phoebe, we implement the epBTE using a full scattering matrix approach, so that the coupled scattering matrix consists of
2323
the standard electron and phonon scattering matrixes, along with off diagonal drag terms, which couple the independent electron and phonon subspaces. Written out,
2424

2525
.. math::

doc/sphinx/source/theory/electronBTE.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ The linearized electronic BTE for a system exposed to an applied electric field
2121
2222
where the first term describes the diffusion due to an externally applied electric field :math:`\boldsymbol{E}`, the second the diffusion due to a temperature gradient, and the third term is the linearized scattering operator.
2323

24-
The electron scattering matrix :math:`\Omega_{\lambda,\lambda'}` can be computed as,
24+
Electron scattering rates
25+
-----------------------------
26+
27+
The electron scattering matrix :math:`\Omega_{\lambda,\lambda'}` can be computed using electron-phonon scattering as,
2528

2629
.. math::
2730
\Omega_{\boldsymbol{k}b,\boldsymbol{k}'b'} =&
@@ -59,7 +62,10 @@ This scattering matrix requires us to know the phonon and electron energies, as
5962

6063
The Kronecker delta function on momentum is enforces exactly, while the Dirac delta for conservation of energy is instead approximated with methods as described in the section :ref:`delta_fns`.
6164

62-
Since the scattering matrix :math:`\Omega_{\lambda,\lambda'}` is not inherently symmetric, we perform the transformation,
65+
Symmetrization of the scattering matrix
66+
----------------------------------------
67+
68+
Since the scattering matrix :math:`\Omega_{\lambda,\lambda'}` is not inherently symmetric (which we will need if we want to have a real symmetric matrix, as in the realxons solution), we perform the transformation,
6369

6470
.. math::
6571
\tilde{\Omega}_{\lambda \lambda'}

doc/sphinx/source/theory/wannier.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ What we need to interpolate instead is:
7272
First, recall the relation between the wavefunctions in Wannier and Bloch representations,
7373

7474
.. math::
75-
\big|m\boldsymbol{R}_e\big> = \sum_{b\boldsymbol{k}} e^{-i\boldsymbol{k}\cdot\boldsymbol{R}_e} U_{mb,\boldsymbol{k}} \big|b\boldsymbol{k}\big>
75+
\big|m\boldsymbol{R}_e\big> = \frac{1}{N_k} \sum_{b\boldsymbol{k}} e^{-i\boldsymbol{k}\cdot\boldsymbol{R}_e} U_{mb,\boldsymbol{k}} \big|b\boldsymbol{k}\big>
7676
7777
7878
.. math::
79-
\big|b\boldsymbol{k}\big> = \frac{1}{N_e} \sum_{m\boldsymbol{R}_e} e^{i\boldsymbol{k}\cdot\boldsymbol{R}_e} U_{bm,\boldsymbol{k}}^\dagger \big|m\boldsymbol{R}_e\big>
79+
\big|b\boldsymbol{k}\big> = \sum_{m\boldsymbol{R}_e} e^{i\boldsymbol{k}\cdot\boldsymbol{R}_e} U_{bm,\boldsymbol{k}}^\dagger \big|m\boldsymbol{R}_e\big>
8080
8181
where :math:`N_e` is the number of supercells.
8282

@@ -93,8 +93,6 @@ To transform the potential from the reciprocal to the real space representation,
9393
\frac{1}{N_q}
9494
\sum_{\boldsymbol{q}\nu} e^{-i\boldsymbol{q}\cdot\boldsymbol{R}_p} [u_{\boldsymbol{q}\kappa}^{\nu}]^{-1} \partial_{\boldsymbol{q}\nu} V(\boldsymbol{r})
9595
96-
97-
9896
So, we first transform to Wannier space by:
9997

10098
.. math::

doc/sphinx/source/tutorials/bands.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Basic Band Structure and DoS
44
==============================
55

6-
Synopsis
6+
Overview
77
--------
88

99
In addition to transport and lifetime calculations, Phoebe can also perform basic band structure and density of states calculations. These can be useful when debugging a calculation or checking the quality of a Wannier or Fourier interpolation. The quality of interpolation is often dependent on the number of k or q points used in DFT, so sometimes it can be helpful to run this calculation to ensure that your DFT calculation used a dense enough mesh.
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
.. _tutorialCBTE:
2+
3+
Coupled BTE Tutorial
4+
=========================
5+
6+
Overview
7+
--------
8+
9+
In order to predict thermoelectric transport properties including the phonon drag effect, we have to construct the coupled electron-phonon Boltzmann Transport Equation (epBTE). We do this using a full scattering matrix approach, so that the coupled scattering matrix consists of the standard electron and phonon scattering matrices, along with off diagonal drag terms, which couple the previously independent electron and phonon subspaces. Then, we solve the CBTE using the relaxons solution.
10+
11+
Before proceeding to the CBTE tutorial, we strongly recommend you first read the :ref:`theoryCBTE` section of the theory documentation, and should also review the :ref:`relaxons` to see how the standard electron and phonon relaxons calculations are used.
12+
13+
.. note::
14+
We note that this is an extreme computational effort -- both in memory and compute requirements, as many scattering rates are required.
15+
16+
.. important::
17+
At this time, we consider it a beta feature -- if you encounter difficulty, please post this on the `discussions page <https://github.com/phoebe-team/phoebe/discussions>`_ of the Phoebe GitHub repository.
18+
19+
Step 0: Preparing the input files
20+
----------------------------------
21+
22+
As in the case of the :ref:`phononElectronTransport`, you will need electron and phonon input files from both the :ref:`elWanTransport` and :ref:`phononTransport` calculations (making sure to use the same crystal structure in both el and ph file generation).
23+
These files can be taken directly from the output of the el and ph transport tutorials, which generate files for silicon, as in the example `here <https://github.com/phoebe-team/phoebe/tree/develop/example/Silicon-coupled>`_:
24+
25+
+---------------------------+-----------------------------+
26+
|**For electrons:** | **For phonons:** |
27+
+===========================+=============================+
28+
| From Quantum ESPRESSO: | From phono3py: |
29+
| - ``*.phoebe.elph.hdf5`` | - ``fc2.hdf5`` |
30+
| - ``*.fc`` | - ``fc3.hdf5`` |
31+
| - ``*_tb.dat`` | - ``phono3py_disp.yaml`` |
32+
| | Or from shengBTE: |
33+
| | - ``*.fc`` |
34+
| | - ``FORCE_CONSTANTS_3RD`` |
35+
+---------------------------+-----------------------------+
36+
37+
With these in hand, we can proceed to perform a coupled BTE calculation. For this tutorial, we will perform a calculation of doped silicon, so ``* = si`` or ``silicon``.
38+
39+
Step 1: Running the Coupled BTE calculation
40+
-------------------------------------------
41+
42+
This calculation will construct a scattering matrix using electron-phonon, phonon-phonon, phonon-isotope, phonon-electron, and drag term scattering rates.
43+
We can set up a coupled BTE calculation using the following example input file, as currently exists in ``phoebe/examples/Silicon-coupled/coupledTransport.in``::
44+
45+
appName = "coupledTransport"
46+
47+
sumRuleFC2 = "crystal"
48+
phFC2FileName = "silicon.fc"
49+
electronH0Name = "si_tb.dat"
50+
elphFileName = "silicon.phoebe.elph.hdf5"
51+
phFC3FileName = "FORCE_CONSTANTS_3RD"
52+
53+
kMesh = [25, 25, 25]
54+
qMesh = [5, 5, 5]
55+
temperatures = [200.]
56+
dopings = [1.e21]
57+
58+
smearingMethod = "gaussian"
59+
elSmearingWidth = 0.005 eV
60+
phSmearingWidth = 0.002 eV
61+
windowType = "population"
62+
windowPopulationLimit = 1e-3
63+
numOccupiedStates = 4
64+
65+
useSymmetries = false
66+
enforceDetailedBalance = true
67+
symmetrizeMatrix = true
68+
scatteringMatrixInMemory = true
69+
solverBTE = ["relaxons"]
70+
71+
| Most parameters used here are applicable to all relaxon calculations and are described in the relaxons tutorial.
72+
| **Here we address a few points specific to the coupled BTE calculation:**
73+
74+
- The population window limit and k/q-grids here are *very* coarse. One should increase them and the grids used in the calculation until it is converged.
75+
- We have chosen a ``qMesh`` which is commensurate with our ``kMesh``. This is required in the coupled BTE calculation so that the same electron and phonon states are used in the electron-phonon, phonon-electron, and drag contributions to the scattering matrix.
76+
- As with all relaxons calculations, we here choose Gaussian smearing. However now, we have ``elSmearingWidth`` and ``phSmearingWidth`` listed separately. This is required because electron and phonon energy scales are dramatically different, resulting in different requirements for mesh samplings and as a result differences in smearing values. ``phSmearingWidth`` will apply to phonon-phonon and phonon-isotope scattering, and the ``elSmearingWidth`` applies to electron-phonon, phonon-electron, and drag terms.
77+
- Because the coupled BTE calculation is very sensitive to interpolation error with respect to the quality of the electron-phonon matrix elements, it's very likely that we will need to apply ``enforceDetailedBalance = true`` to enforce that the diagonal of the scattering matrix can be reconstructed from the off-diagonal scattering rates (detailed balance).
78+
- Note, as with earlier electron and phonon only relaxons solutions, here the use of symmetries is still a research problem, so we have to have ``useSymmetries = false``.
79+
80+
.. note::
81+
A very important part of this calculation is that it's extremely easy to come up with negative eigenvalues.
82+
Please check carefully the appendix section of the relevant paper by Coulter et al. for discussion about the positive semi-definite nature of the coupled scattering matrix.
83+
84+
This should be run just as in the other tutorial::
85+
86+
export OMP_NUM_THREADS=4
87+
mpirun -np 4 /path/to/phoebe/build/phoebe -in coupledTransport.in > coupledTransport.out
88+
89+
We note that this one can take a bit of time, so we recommend using a cluster or workstation for the demonstration.
90+
The parallelism of this calculation follows the same principles as that of the standard relaxons solution as discussed in :ref:`relaxonsParallelism`.
91+
92+
Output and Post-Processing
93+
--------------------------
94+
95+
As in the standard relaxons solution to the BTE, we have outputs containing bulk transport coefficients, including:
96+
97+
* ``relaxons_coupled_viscosity.json``
98+
* ``relaxons_coupled_transport_coefficients.json``
99+
* ``relaxons_coupled_relaxation_times.json``
100+
101+
These files contain the viscosity, electrical and thermal conductivity, and relaxation times calculated from the coupled relaxons solution in ``json`` format.
102+
103+
As before, we will also have the files ``relaxons_el_eigenvectors.hdf5`` or ``relaxons_ph_eigenvectors.hdf5``, which contain the el and ph contributions to each coupled relaxon eigenvector of the scattering matrix.
104+
These again can be plotted on the Wigner-Seitz cell using the script provided in ``phoebe/plotScripts/relaxons_eigenvectors.py``.
105+
106+
Finally, the contents of ``relaxons_coupled_real_space_coefficients.json`` can be used to parameterize the Viscous Thermoelectric Equations as in Coulter, Rajkov, and Simoncelli (2025). `arXiv:2503.07560 <https://arxiv.org/abs/2503.07560>`_

0 commit comments

Comments
 (0)