The thermo_pw code is hosted at To download it you need the git package installed. Then you can give the command:

git clone

and you should get a directory called thermo_pw that contains the source code.
To compile the code you need a Fortran compiler, for instance the gcc package and gfortran (or gcc-fortran in some distributions), and the same libraries required by the Quantum ESPRESSO (QE) package. The git version of thermo_pw is compatible only with the version of QE written in the main thermo_pw page. After getting QE, move the directory thermo_pw in the main QE directory, cd to the directory thermo_pw and give the command make join_qe. Then cd to the main QE directory and compile thermo_pw with the command:

make thermo_pw

To run thermo_pw it is useful to have the gnuplot package installed, and to plot the Brillouin zone you need the asymptote package. Both are available as precompiled packages in many distributions. For further information, please refer to the user's guide available in the thermo_pw/Doc directory. Please report any problem to dalcorso .at.

Sometimes the git version of thermo_pw is not working properly and in any case its use is not recommended. In order to run thermo_pw for more serious work it is better to download thermo_pw.0.7.9 compatible with QE 6.1 and follow the instructions given above to compile and run. Note however that these versions of thermo_pw are still very experimental and given as they are. In order to make them work properly you have to apply the list of errata given below. The git version is corrected, but sometimes it contains new developments that make it quite unstable. Previous versions of thermo_pw are compatible with a few older versions of QE (see the user guide), but no version is compatible with QE older than 5.1.1.

Patches to thermo_pw.0.7.0:
With pools, all bands are red in the band plot. At line 550 of src/sym_band_sub.f90 substitute nks with nkstot and recompile.
Some problems with Intel compiler can be solved as described in the patch 68ec9d7
When emin_input and emax_input are given in the thermo_control namelist, some bands could be missing. The problem can be solved as described in the patch c39f6f0

Patches to thermo_pw.0.6.0:
There is a problem with anharmonic properties calculated recovering the run with after_disp=.TRUE. introduced in this version. Take the file thermo_pw/src/q2r_sub.f90, substitute the one of thermo_pw.0.6.0 and recompile.
Moreover, at lines 11307 and 11336 of lib/point_group.f90, change 1D-8 with 1D-5.
Modules/clocks.f90 : line 41 set maxclock=200 otherwise thermo_pw might run out of clocks.

Patches to thermo_pw.0.5.0:
Modules/clocks.f90 : line 41 set maxclock=200 otherwise thermo_pw might run out of clocks.

Patches to thermo_pw.0.4.0:
A problem with max_geometries: this is a bug. Add the instruction ph_geometries=0 at the line 431 of the file src/thermo_pw.f90 and recompile.
Compilation problem of tools/test_colors.f90: remove the RETURN command at the end of the file.
Error from find_aux_ind_two_groups in a phonon plot. Please check commit 122688. and make the same changes to src/matdyn_sub.f90.

Patches to thermo_pw.0.3.0:
With some compilers the code crashes at the beginning. Please change line 571 of src/thermo_readin.f90 from CALL clean_ngeo() to CALL clean_ngeo(ngeo,ibrav).
Anharmonic properties can be calculated only with the dynamical matrix in .xml format. Old format is not working. (See commit 110778).
The code is not recovering correctly and gives an error check_stop_init not initialized. (Please apply commit 110838).

Patches to thermo_pw.0.2.0:
Problem in anharmonic properties: use thermo_pw.0.3.0 or higher, or make the same changes as in commit 19508.
Modules/clocks.f90 : line 91 set maxclock=200 otherwise thermo_pw might run out of clocks.
Bug fix: In anharmonic calculations some vertical lines in phonon dispersion plots are double. Change as in commit 19386.

Patches to thermo_pw.0.1.0:
src/Makefile : line 83 change THERMO_PW with thermo_pw
outdir: must end with a /, the other case is not dealt with correctly.


0) How can I learn to use thermo_pw?

Please learn the basic use of Quantum ESPRESSO first. Then you can read the thermo_pw user's guide and run the examples. These FAQ assume that you have a basic understanding of thermo_pw and contain miscellaneous information not available in the user's guide.

1) Can I study the thermal expansion of anisotropic solids using thermo_pw?

For some crystal systems the answer is yes, but not all systems are supported or tested. Read carefully the user's guide and use version 0.3.0 or higher. Also use dynamical matrices in .xml format or the calculation of thermal expansion with Gruneisen parameters will not work with all versions previous to 0.5.0.

2) Can I introduce a finite pressure?

You can calculate the equilibrium structure at a given pressure. For other physical properties some experiments started with version 0.4.0 but in general this part of the code is still quite experimental.

3) Can I calculate the temperature dependence of the band gap or in general of the band structure using thermo_pw?

You can calculate the band structure at the crystal geometry that corresponds to a given temperature. In this way you evalute the effect of thermal expansion on the band structure or on the gap. However an important temperature dependence of the band gaps and of the band structure comes from the electron-phonon interactions that are not included in thermo_pw. For this purpose you should use another package.

4) Can I calculate the equilibrium geometry of a solid at a given temperature using thermo_pw?

Yes, but the calculation is as heavy as computing the anharmonic properties and it will take a lot of time and resources. You need to learn how to use thermo_pw before starting such a complex calculation.

5) Which is the difference between examples and inputs?

Examples illustrate the features of thermo_pw and are fast, but are not converged. inputs are more realistic examples.

6) Sometimes the examples of thermo_pw run correctly, sometimes they crash. Which is the problem?

The most probable reason is that you have not removed the results directory produced by a previous run of the example script.

7) make thermo_pw is not working. Compilation stops with some missing routines error.

Most probably you have not matched the versions of QE and of thermo_pw.

8) I have compiled thermo_pw but as I run it, it stops immediately. I am using thermo_pw.0.3.0.

Most probably you have not applied the patch described above. Update to a newer version.

9) I cannot run the examples. I have problems using images. What should I do?

If you want to run the examples without images edit the file environment_variables in the main QE directory. Search the two variables PARA_IMAGE_PREFIX and PARA_IMAGE_POSTFIX and set -ni 1.

10) I have not a parallel computer. I do not know what mpi is. Can I run thermo_pw?

Only thermo_pw.0.5.0 has a serial version. All previous versions must be compiled together with mpi.

11) An atomic relaxation converges with pw.x but not with thermo_pw.x (version 0.4.0).

This is a bug of version 0.4.0. Please apply the same changes as in the commit 197343 or update to 0.5.0.

12) The plot of the phonon dispersions is very strange with several disjoint parts. Moreover the modes are not classified using symmetry. Why?

The mode symmetry analysis requires dynamical matrices in .xml format. Please put the .xml extension in fildyn. Symmetry matrices are needed also to recognize symmetry equivalent point on the Brillouin zone.

13) The plot of the Gruneisen parameters has strange crossings in some points. Why?

In some cases the plot of the Gruneisen parameters needs more accuracy on the symmetry analysis than the phonon plot. Accidentally degenerate frequencies might have very different Gruneisen parameters. Change the parameter 5.D-2 at line 148 of PHonon/PH/find_mode_sym.f90 to 1.D-2 or less and recompile thermo_pw.

14) Thermo_pw does not compile and stops with an error saying that html.sty is missing or latex2html is missing.

This is not a problem of thermo_pw. In order to compile the documentation thermo_pw needs a quite complete latex package. You can find html.sty on the web and copy it inside thermo_pw/Doc directory and you can install latex2html. Even if you do not solve this problem, thermo_pw.x will be available in the bin directory of QE. Only the documentation will be missing. You can also remove the error editing thermo_pw/Makefile and removing the string doc at line 7.