Everything we've done so far has in fact been for systems at effectively zero temperature. And even at zero temperature, we haven't taken into account the zero-point motion of the atoms and have treated them as purely classical objects residing at fixed positions.
In actuality, there will be an effect from the zero-point motion of the atoms, and as temperature increases the atoms will vibrate with larger amplitude and this can lead to changes in many properties of a material with temperature. You will learn how the thermodynamic properties of a material can be computed from first principles and be able to predict properties such as the total energy, heat capacity, Helmholtz free energy and Entropy.
Our approach will be to use the type of density functional theory (DFT) and density functional perturbation theory (DFPT) calculations you've already seen, and spend more time analysing the output to produce materials properties. To get the finite temperature properties, we need to get a list of the phonon modes available to the system. The more phonon modes we include in this list, the more accurate the calculation will be, but this comes at the cost of increased computational time. Once the phonon mode list has been obtained, we sum the individual contribution of each phonon mode to get the thermodynamical quantity of interest. This will be done using python.
The total energy due to phonons can be written as
where the factor
Notice how the energy requires summing over every single mode
We've already done most of the work needed to also calculate phonons on a fine-grid in our previous lab (Lab06/Diamond). This can be done following the q2r.x
calculation by choosing some different input options for matdyn.x
. Take a look at the input file 05_CD_matdyn-fine.in
. The contents are as follows:
&input
asr='simple'
flfrc='CD444.fc'
flfrq='CD-fine.freq'
nk1=20,nk2=20,nk3=20
nosym=.true.
dos=.true.
/
This is quite similar to the band plot, but now we're setting nosym
to true, choosing a dense q-point grid on which to recalculate our frequencies. Run matdyn.x
now with this input file. Please do not forget to copy all the things you did in your previous lab on the same material (Copy the files from (Lab06/Diamond)
directory into Lab07/CarbonDiamond. It'll take a bit longer than the band calculation as it is explicitly computing without invoking the symmetry. After it finishes, it will generate the following file: CD-fine.freq
. Take a look at the contents of this file. It is organized as such
freq1
freq2
freq3
We will utilize this file to compute several thermodynamic properties using python in the next step.
To calculate the total energy due to phonons using python, we will create a simple script that reads in the temperature and a file with the list of frequencies and prints out the energy.
import sys
frequencies = sys.argv[1]
temperature = sys.argv[2]
energy = 0
for frequency in frequencies:
if abs(frequency) < 1e-5:
continue
x = frequency/temperature
bose = 1.0/(exp(x) - 1)
energy += x*(0.5 + bose)
print(energy)
Note that this program ignores very small frequencies due to the possibility of dividing by zero.
Some key quantities are (For reference, see Wikipedia and and the reference therein):
Total energy due to phonons within harmonic approximation can be written as,
Specific heat at constant volume can be obtained from the total energy calculations:
To compute the Helmholtz free energy, we need the partition function,
Entropy,
Note that the temperature dependence in all these quantities are determined by the Bose-Einstein distribution.
We have implemented these codes using python. For example, you will
find a folder Thermodynamics
containing a file thermo.py
that has all these quantities you need. It reads
the phonon bands calculations at a fine-grid and can compute several
thermodynamic properties. For the implementation of total energy due to
harmonic phonon, look up the function, get_E_T inside the thermo.py
file:
def get_E_T(self):
"""
Computes total energy at a Temperature
@output
E_T, in units of meV
NOTE: E_T/nkp is returned
"""
E_T = 0.0
# For every band n
for n in range(self.omega_nq.shape[0]):
# For every band q
for q in range(self.omega_nq.shape[1]):
omega = self.omega_nq[n][q]
E_T = E_T + \
(omega*\
(0.5 + self.befactor(omega)))
return E_T/self.omega_nq.shape[1]
You can compute the total energy at a given temperature by running
the compute.py
: python compute.py
Try understanding how the calculations are performed and how are
they implemented. Note that, all the calculations internaly
converts temperature to meV (i.e.
- Run the calculations at a temperature 20 K.
- Compute the temperature dependence of
$E, C_{V}, H, S$ for several temperatures, ranging from 10 K to 1000 K in steps of 20 K. What happens to specific heat at low-temperature? You will see a lot more details on your homework. Hint: Write a for loop to do this. - Plot these data using matplotlib.
- Try increasing the grid-size from
$20\times20\times20$ to a larger number and try reducing as well. What happens?
NOTE: An important contribution in the total energy,
entropy, etc. are missing in the above calculations: the
contribution without the phonons. For example, the total energy of
a material at a given temperature is, $$ E(T)= E_{ph}(T) + E_{DFT}$$,
where