CederGroupHub / smol

Statistical Mechanics on Lattices
https://cedergrouphub.github.io/smol/
Other
62 stars 14 forks source link

Complaints on the naming of "enthalpy" in moca #295

Open qchempku2017 opened 1 year ago

qchempku2017 commented 1 year ago
File Name Module Path Authors
ensemble.py smol.moca Luis

Code Review

The name "enthalpy" has confused many smol users, including @zhongpc and @YunyeongChoi . This name is designated to the quantity H that appears in the exponential part of ensemble distribution function as P=exp(-beta* H), where H can be E-mu N in the semigrand-canonical ensemble, but is actually not the thermodynamic enthalpy at all. It might be better to change its name to "legendre_transformed_energy" or something cleaner, etc.

lbluque commented 1 year ago

The use of the word "enthalpy" is precisely to capture both cases you mention. In all generality, what you said is correct, think of enthalpy as $H$ in $P = exp(-\beta* H)$. Or equivalently call it whatever changes the energy of the system excluding heat, as in $H$ that gives heat capacity $C = \frac{d H}{d T}$.

This use of the word "enthalpy" as a "generalized enthalpy" is documented in the code. Unfortunately, changing it to something more verbose does not add much and will require many backward incompatible changes in the sampler, kernel, samplecontainer, etc...

My suggestion is to simply make the use clear in the documentation and appropriate example notebooks. A PR with any edits accordingly is welcome.