Installation
PhonTS installation requires some software to be present on your system. PhonTS is written in Fortran90, hence Fortran90 compiler is required. It is most rigorously tested with Intel compiler, hence it is a recommended one. Currently only parallel version of the code is available, with the parallelization via the MPI set of libraries. Any version should work, but it was tested on OpenMPI and MPICH. Further, PhonTS relies on LAPACK set of libraries for the linear algebra operations. Any version of it should work, while supplied makefile links to Intel version (mkl libraries, version 10.0.011). Once all the needed pieces are available proceed with the PhonTS installation as follows:
If version for debugging needs to be created, type:
and PhonTS executable with many optional debugging features (timing, debugging information, run-time checks and no optimization) will be created
If you attempted to compile with other F90/MPI/LAPACK combination and compilation failed, please contact authors for support.
Getting started
PhonTS is driven by the single input file, called phonons_input.dat. This input file is keyword driven, freestyle type of file: it is does not matter what is the order of the keywords. Any line that starts from a "#" considered to be a comment line and is ignored, as well as empty lines. Most of the parameters have default values specified (for details see here), but a few are necessary for specification of the system under consideration. Directory "examples" in the PhonTS directory contains a few sample problems, one of the simplest one being "Argon". phonons_input.dat found there contains absolute minimum amount of keywords, thus we consider this example here. Here is how it looks like:
Keyword "cell" determines geometry of the cell. Note that currently only the orthorhombic cells are supported, thus for the fcc crystal, one has to specify a conventional cubic cell (defined in this example by 1. 1. 1.). Keyword "species" determines a list of atomic species in the system, 1 being the number of different species. In this example, there is only one type of atoms, Ar, with mass 40 a.u. and charge of zero electrons. Keyword "lattice" determine the lattice constant at which simulations will be performed. "exp-6" is one of the available pair-wise potentials, so this keywords determines interactions between the atoms. "natoms" defines number of atoms in the cell, and "fractional" means that fractional coordinates of the atoms will be supplied. "end" specifies the end of the file.
Executing PhonTS in this directory should generate the following screen output:
PhonTS first reports how many processors it is running on and prints the greeting message. It then proceeds to construct a simulation supercell from the cell that is supplied in the input file that satisfy the minimum image requirement with respect to longest real-space cutoff in the system and reports its dimensions. The next block of data is a printout of the input parameters, including some that are set by default. For example, thermal conductivity is set to be computed by the iterative technique, but only a single iteration is performed by default, thus producing relaxation time approximation result. Particularly important is the k-mesh used for the calculations, which is set to default of 9x9x9, but typically is a part of the input file. Further, the energy of the ideal system is computed for the verification purposes, and various other quantities, such as speed of sound and Debye temperature, and parallelization parameters are reported. Memory estimator attempts to report the memory footprint of the code, since all the arrays are allocated withing the code, and memory is the main bottleneck for the scalability. This routiune accesses system information about PhonTS process (this is one of the places that unlickely to trasfer easily to other compilers) and reads how much memory it takes. Estimates of the memory leftovers are often misleading, however, and should not be taken seriously. Finally, once PhonTS reposts "Done with preparations..." All the preliminary things are done, and PhonTS enters the main loop that cycles through all possible 3-phonons processes and adds up their contribution to thermal conductivity. This is typically the most time consuming part of the calculations. Finally, thermal conductivity tensor is reported, together with the differences between current iteration and the previous one (in the case of the iterative solution). In the simulations directory, there is also a number of other files created. Among the important ones are "pdos.dat" that contains phonon density of states and "tc_dos.dat" that contains spectral thermal conductivty.
Recommended procedure
Based on our expirience performing thermal conductivity calculations and comparing with the results of the molecular dynamics simulations (which employs different set of approximations, thus comparison have to be done carefully) we recommend the following setup for the calculations.
This setup will reqiuire separate calculations for the thermal conductivity at each temperature, which might be too time consuming. An obvious shortcut is to use a single volume (for exampl T=0 volume) for all temperatures of interest, however, in our expirience this will slightly overestimate thermal conductivity, especially at high temperatures.
Structural optimization
PhonTS can perform a structural optimization of the supplied structure. Optimizsation performe via very simple steepest decent algorithm, namely, the atoms are moved in the direction of the forces with some step which can be controlled by the user. There is also a variation of the algorithm, which allow for a change of the minimization step on the fly, which may improve the performane of this step. Either constant volume, or simulatlations under hydrostatic pressure can be performed, which is controlled by the "cell_control" keyword. User also have control over the precision of the optimization procedure.
First Principles Calculations
Key advantage of the BTE approach over molecular dynamics is the possibility of the first principles simulations of the thermal conductivity. In particular Density Functional Therory (DFT) caluclations strike the balance between the accuracy and computational resources required. As a result they are extremely popular in the community, with the number of the well-tested codes available to perform such simulations (VASP, QuantumEspresso, ABINIT to name just a few). PhonTS relies on these codes (interfaces to VASP and QuantumEspresso only are currently implemented, but authors will be happy to work work with you to produce an interface to Your favorite code) to perform first principles calculations. The quantities that are needed from the first principles calculations are the second and third derivatives of the total energy with respect to atomic positions. Those can be obtained in two different ways. Firstly, analytical calculations in principle is possible via the Density Functional Perturbation Theory (DFPT). Since all the codes mentioned above are the plain-wave codes, calclulations essentially proceeds in the recipical space, and one obtains Fourier transformed force constants on requested grid of k-points. Second derivatives are the function of a single k-point, while third one is a function of the pair of k-points. However, currently third derivatives calculations for all pairs of k-points is not included in any of the standard codes to the best of our knowledge. Moreover, if one is interested in using any of the formalism beyond standard DFT (such DFT+U, or hybrid functionals), then second derivatives are not implemented for this case either. One therefore has to resort to the second method of calculating derivatives, namely via the numerical differentiation. In this approach one starts with the supercell, and "manually" displace atoms from the equilibrium positions and compute derivative by numberically differentiating the forces, which are typically computed analytically. Currently, PhonTS is coupled to QuantumEspresso to obtain either second or first derivatives, and to VASP to obtain the first derivatives in real space, and then internally computes the rest via the fitnite differences. The key issue in this calculations is accuracy: numerical differentiation performed twice significantly reduces the accuracy of the third derivatives. It is thus recommended to set convergence parameters (especially for the self-consistency and internal Fourier grids) as tight as one can afford. In the example below, we consider calculations performed with VASP via the supercell approach.
In light of the discussion above, first principles calculations of thermal conductivity with PhonTS is performed in 3 stages:
All the intermediate steps, such as file copying can be performed by the shell scripts, and example included with distribution provides scripts used by the authors. Users can either adopt those, or make up their own, more suited for their needs.
Below we discuss these steps in turn on the example of the thermal conductivity of solid argon (at the pressure of 50 GPa) from the recent paper. Note, that scripts used here need the directory structure in PhonTS/example/AbInitio folder. AbInitio_reference contains all the data after the calculations for comparison. We start in PhonTS/example/AbInitio/PhonTS folder.
Description of the output files