- What is the
Common_Tangentprogram ? - Why is
Common_Tangentuseful ? - Files needed for running
Common_Tangent - How to run
Common_Tangent - Test
- How to cite
- Contributing
-
Common_Tangentis a program for computational chemistry and physics. -
Extracts all the frequencies within all the k points in the supercell for a given volume.
-
Calculates the Helmholtz free energy.
- This program is useful becasue it outputs the pressure-temperature phase diagram for the thermodynamic phase stability of both solid phases:
- The underlying criteria for producing this phase boundary is
by evaluating common tangent between two Hemholtz free energy curves
and
Please have a look at the pdf in this repository, where you can dind a detailed explanation.
In the code, Eqn (6) and Eqn (7) in the pdf are solved in python, as
E1 and E2 respectively:
def BM(x, a, b, c, d):
return a + b*x + c*x**2 + d*x**3
def devBM(x, b, c, d):
return b + 2*c*x + 3*d*x**2
from scipy.optimize import fsolve
def equations(p):
x1, x2 = p
E1 = devBM(x1, popt_C_I[1], popt_C_I[2], popt_C_I[3]) - devBM(x2, popt_14[1], popt_14[2], popt_14[3])
E2 = ((BM(x1, popt_C_I[0], popt_C_I[1], popt_C_I[2], popt_C_I[3]) - BM(x2, popt_14[0], popt_14[1], popt_14[2], popt_14[3])) / (x1 - x2)) - devBM(x1, popt_C_I[1], popt_C_I[2], popt_C_I[3])
return (E1, E2)
x1, x2 = fsolve(equations, (50, 60))
print 'x1 = ', x1
print 'x2 = ', x2and the following solution is found for the case of zero Kelvin:
x1 = 61.445411835
x2 = 59.9942936344Now, the slope of the common tangent can be obtained going to Eqn 1:
slope_common_tangent = devBM(x1, popt_C_I[1], popt_C_I[2], popt_C_I[3])
print 'slope_common_tangent = ', slope_common_tangent
slope_common_tangent_GPa = abs(slope_common_tangent * 4.3597482E+3)
print ' slope_common_tangent_GPa = ', slope_common_tangent_GPaWhich yields:
slope_common_tangent = -0.000438955769096
slope_common_tangent_GPa = 1.91373662419
We know that the common tangent passes through the x1 point, and we know its slope. Thus, we can use Eq. (8) in the pdf:
y - y1 = m * (x -x1) # Eqn. 8 in the pdf
to sort out the common tangent equation (where m is the slope).
Since:
y1 = f(x1)
m = f'(x1) = slope_common_tangent
then the common tangent equation is:
def comm_tangent(x, x1, slope_common_tangent):
return BM(x1, popt_C_I[0], popt_C_I[1], popt_C_I[2], popt_C_I[3]) - slope_common_tangent * x1 + slope_common_tangent * xx = var('x')
print comm_tangent(x, x1, slope_common_tangent)Common tangent equation: -0.000438955769095521 x - 941.227540709767
-
Say you want to compute the pressure-temperature phase diagram of two solid phases I and II.
common_tangentrequires the frequency calculation outputs at each volume, for each of the two phases. These frequencies calculations can be either in the Gamma point or at finite k points. -
The name of all these frequency outputs have to end as
*.out
- Get the code:
git clone https://github.com/DavidCdeB/common_tangent - Create the
Files_Outputsfolder inside theCommon_Tangentfolder that has just been cloned:cd ./Common_Tangent && mkdir Files_Outputs - Create the folders that will contain the constant-volume frequency outputs for each phase:
mkdir Calcite_I && mkdir Calcite II - Copy all the frequencies outputs for each volume, for each phase, to the folders
Calcite_IandCalcite_II. For example,Calcite_Ifolder will contain the frequency output for eachj-th volume for the Calcite I phase. - Remember that name of all these frequency outputs have to end as
*.out - The file system at this point looks like the following:
-
Run
./boundary_1_node.sh -
commonTangentF_allTemperatures.mandcommonTangent.mcontain the same algorithm in Mathematica.
Under the TEST folder, you will find all the programs
needed, together with a Files_Outputs folder with the frequency outputs of two phases: calcite I and calcite II.
If you run the program, you will obtain the main.pdf with all the plots needed.
Please cite the following reference when using this code:
D. Carrasco-Busturia, "The temperature - pressure phase diagram of the calcite I - calcite II phase transition: A first-principles investigation", Journal of Physics and Chemistry of Solids, vol. 154, p. 110 045, 2021. DOI: https://doi.org/10.1016/j.jpcs.2021.110045.
Here the bibtex:
@article{CARRASCOBUSTURIA2021110045,
title = {The temperature - pressure phase diagram of the calcite {I} - calcite {II} phase transition: A first-principles investigation},
journal = {Journal of Physics and Chemistry of Solids},
volume = {154},
pages = {110045},
year = {2021},
issn = {0022-3697},
doi = {https://doi.org/10.1016/j.jpcs.2021.110045},
url = {https://www.sciencedirect.com/science/article/pii/S0022369721001116},
author = {David Carrasco-Busturia}
}
Common_Tangent is free software released under the Gnu Public Licence version 3.
All contributions to improve this code are more than welcome.
-
Have a look at GitHub's "How to contribute".
-
If you are familiar with
git: fork this repository and submit a pull request. -
If you are not familiar with
git:- If something should be improved, open an issue here on GitHub
- If you think a new feature would be interesting, open an issue
- If you need a particular feature for your project contact me directly.
