Skip to content

Commit 73ac176

Browse files
committed
Added the entropy calculation
1 parent 8f3e009 commit 73ac176

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

Modules/Ensemble.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,6 +1639,39 @@ def get_free_energy(self, return_error = False):
16391639
return free_energy, error
16401640
return free_energy
16411641

1642+
def get_entropy(self, return_error = False):
1643+
r"""
1644+
GET THE ENTROPY
1645+
===============
1646+
1647+
Get the total anharmonic entropy.
1648+
1649+
The equation implemented is the analytical derivative of the free energy,
1650+
and assumes that the SSCHA free energy is minimized.
1651+
1652+
.. math::
1653+
1654+
S = - \frac{dF}{dT}
1655+
1656+
S = S_{harm} - \left<V - {\mathcal V}\right>\sum_\mu \frac{1}{1 + 2n_\mu} \frac{dn_\mu}{dT}
1657+
1658+
1659+
where :math:`S_{harm}` is the 'harmonic' entropy computed from the dynamucal matrix,
1660+
plus a correction accounting for the ensemble anharmonicity.
1661+
1662+
1663+
Parameters
1664+
----------
1665+
return_error : bool
1666+
If true, returns also the error
1667+
1668+
Results
1669+
-------
1670+
entropy, error : float
1671+
Returns the entropy and [optionally] the stochastic error.
1672+
"""
1673+
raise NotImplementedError("Error, to be implemented")
1674+
16421675

16431676
def get_free_energy_interpolating(self, target_supercell, support_dyn_coarse = None, support_dyn_fine = None, error_on_imaginary_frequency = True, return_error = False):
16441677
"""

0 commit comments

Comments
 (0)