How to check frequencies and fits

(and making pressure estimations from frequency values)

In this tutorial the different possibilities offered by the code to deal with the frequencies and their variations with the volume, will be shown.

First, load the code by running the following cell (the file quick_start is found in the master folder, so that data files and input.txt are automatically loaded):

In [10]:
%run bm3_thermal_2.py


File quick_start.txt found in the master folder
Input files in 'pyrope' folder

Input file

STATIC
pyrope_static.dat
VOLUME
volume.dat
FREQ
pyrope_freq_2.dat
EXP
experimental.txt
FITVOL
SPLINE
725. 773. 16  3 2.
FU
4 20
SET
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 19 21
EXCLUDE
88
TEMP
300 325 350 375 400 450
CP
0. 2 -2. -1 -0.5
ALPHA
0. 2 -2  -1 -0.5
END

-------- End of input file -------


Static BM3 EoS

Bulk Modulus: 173.95 (0.06) GPa
Kp:             4.30 (0.03)
V0:           756.1932 (0.00) A^3


As specified in input.txt a spline fit of the frequencies is required. This can can be checked with the fit_status command:

In [11]:
fit_status()
Fit of frequencies is active
Spline fit: degree  3, smooth: 2.0
Volume range: 725.00 - 773.00, points=16

To have more a complete information about the current setting, use the info.show command

In [12]:
info.show()
Current settings and results

Static data            ** min, max volumes: 725.7483, 772.6196; points: 8
Frequency volume range ** min, max volumes: 725.7483, 772.6196; points: 22
Selected freq. sets    ** min, max volumes: 725.7483, 772.6196; points: 20
Frequency sets:           [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 19, 21]

Fit of frequencies     ** type: spline, degree: 3, smooth: 2.0
                          min, max volumes: 725.0000, 773.0000; points 16

** Static EoS (BM3) **
K0: 173.95 GPa, Kp: 4.30, V0: 756.1932 A^3

Excluded modes: [88]

Kieffer model off

To start, try to deactive any fitting procedure of the frequencies (that is, override the requested spline fitting) and run the optimization of a BM3 EoS at 300K:

In [13]:
fit_off()
eos_temp(300,prt=False)
 ** BM3 fit **

EoS at the temperature of 300.00 K

Bulk Modulus: 160.64   (1.05) GPa
Kp:             4.60   (0.25)
V0:           767.5930 (0.051) A^3

Fix status: False
Fitting is off

Now, request the spline fit (degree=3, smooth=1) and run again the eos_temp command to see the impact of the fitting of the computed EoS parameters:

In [14]:
set_spline(3, 1)
eos_temp(300,prt=False)
 ** BM3 fit **

EoS at the temperature of 300.00 K

Bulk Modulus: 160.57   (0.34) GPa
Kp:             4.61   (0.08)
V0:           767.5993 (0.015) A^3

Fix status: False
Fit of frequencies is active
Spline fit: degree  3, smooth: 1.0
Volume range: 725.00 - 773.00, points=16

No significant variations are indeed observed with respect to the fit_off case

Have a look at the frequency plots, to detect any anomalous behaviour and the efficacy of fitting, by using the command check_spline_total.

To plot only a specific set of modes, the check_spline_list function can be used; such function is employed here to look at partularly noisy modes in our example:

In [15]:
check_spline_list([38, 76, 88])

The spline function appears to be rather wavy. For this reason, such modes can be excluded from the computation of the free energy, and the optimization of the EoS is done without their contribution. Fore the mode n. 88, this was already requested in the input.txt by the keyword EXCLUDE. The command print(exclude) shows the list of excluded modes:

In [16]:
print(exclude)
Excluded modes:[88]

To add modes n. 38 and 76, also, just use the method exclude.add

In [17]:
exclude.add([38, 76])
print(exclude)
Excluded modes:[88, 38, 76]

To reintroduce such modes in the computation, you can remove the EXCLUDE keyword in input.txt (and reload the file with reload_input), or issue the command exclude.restore().

For now, we just keep those modes in the excluded list and change the spline parameters: set_spline(2,20): now the degree of the spline is 2 and the smooth parameter is 20. To see the effect of the EoS, we fix Kp to 4.61 (the value previously optimized):

In [18]:
set_spline(3, 20)
set_fix(4.61)
eos_temp(300,prt=False)
check_spline(38)
check_spline(76)
check_spline(88)
 ** BM3 fit **

EoS at the temperature of 300.00 K

Bulk Modulus: 160.61   (0.02) GPa
Kp:             4.61   (0.00)
V0:           767.5076 (0.002) A^3

Fix status: True
Kp fixed at 4.61
Fit of frequencies is active
Spline fit: degree  3, smooth: 20.0
Volume range: 725.00 - 773.00, points=16

By the way, the EoS was not significantly affected by this change of the smooth parameter. No significant changes are observe even if Kp is optimized.

In [19]:
reset_fix()
eos_temp(300,prt=False)
 ** BM3 fit **

EoS at the temperature of 300.00 K

Bulk Modulus: 160.66   (0.08) GPa
Kp:             4.60   (0.02)
V0:           767.5058 (0.003) A^3

Fix status: False
Fit of frequencies is active
Spline fit: degree  3, smooth: 20.0
Volume range: 725.00 - 773.00, points=16

The command freq_spline_p(mode,temp,pr) can be used to estimate the frequency of a specific mode at given temperature (temp) and pressure (pr). We use it to estimate the frequency of the mode number 88, at 300 K and 0 GPa, both with the original spline setting (3, 20) and with a lower degree spline fitting (degree=2, smooth=20)

In [20]:
fit_status()
set_fix(4.60)
freq_spline_p(88,300,0)
set_spline(2,20)
freq_spline_p(88,300,0)
Fit of frequencies is active
Spline fit: degree  3, smooth: 20.0
Volume range: 725.00 - 773.00, points=16
Frequency: 917.44
Pressure: 0.00 GPa, temperature 300.00 K, volume 767.5061 A^3
Frequency: 917.50
Pressure: 0.00 GPa, temperature 300.00 K, volume 767.5072 A^3

Note the slight difference in the volume at 300K and 0 GPa with the two different spline settings (indeed, volume at P/T is estimated by a BM3 fit that uses the spline fitting).

Wanting to estimate the pressure (at a given temperature) by knowing the frequency of a mode, the command pressure_freq(mode, freq, temp) can be used. Suppose the frequency of the mode 88 is 919.50 cm^-1: at 300 K it provides an estimation of the pressure at 0.47 GPa:

In [21]:
pressure_freq(88,919.5,300)
Pressure:   0.47 GPa
Mode: 88, frequency: 919.50 cm^-1, temperature: 300.00 K

Exactly the same type of calculations can be made by using a polynomial fit, as shown in the following cell:

  • polynomial fit of degree 3
  • eos_temp optimization (Kp free) at 300K to check the impact of the frequency fit on EoS
  • kp fixed to 4.60
  • check_poly(88) to see the $\nu_{88}(V)$ fit
  • pressure estimation at 300K if $\nu_{88}=919.5 cm^{-1}$
In [22]:
set_poly(3)
reset_fix()
set_volume_range(725,773)
eos_temp(300,prt=False)
set_fix(4.60)
check_poly(88)
pressure_freq(88,919.5,300)
Volume range 725.5483 - 772.8196 defined for 'POLY' fit

 ** BM3 fit **

EoS at the temperature of 300.00 K

Bulk Modulus: 160.66   (0.08) GPa
Kp:             4.60   (0.02)
V0:           767.5058 (0.003) A^3

Fix status: False
Fit of frequencies is active
Polynomial fit: degree  3
Volume range: 725.00 - 773.00, points=16
Pressure:   0.42 GPa
Mode: 88, frequency: 919.50 cm^-1, temperature: 300.00 K