|
Quantum 3xplorer (Q3)
An AI-native quantum simulation engine
|
Fermi-Dirac (physical finite-T) smearing. More...
#include <fermi_dirac.hpp>
Inheritance diagram for q3::FermiDiracSmearing:Public Member Functions | |
| FermiDiracSmearing (Real smearing_width=0.0) | |
| Real | entropy_weight (Real x) const override |
| std::string | name () const override |
| Real | occupation (Real x) const override |
| Compute the occupation f(x) where x = (E - E_F) / σ. | |
Public Member Functions inherited from q3::SmearingScheme | |
| SmearingScheme (Real smearing_width=0.0) | |
| virtual | ~SmearingScheme ()=default |
| Real | smearing_width () const |
| Smearing width σ (degauss) in Ry. | |
| bool | uses_smearing () const |
| Whether this scheme uses actual smearing (width > 0). | |
Additional Inherited Members | |
Protected Attributes inherited from q3::SmearingScheme | |
| Real | smearing_width_ |
Fermi-Dirac (physical finite-T) smearing.
Definition at line 19 of file fermi_dirac.hpp.
|
inlineexplicit |
Definition at line 21 of file fermi_dirac.hpp.
Returns f ln f + (1-f) ln(1-f), which is minus the electronic entropy S = -[f ln f + (1-f) ln(1-f)] >= 0. The negative sign is deliberate and load-bearing: Σ w_k σ entropy_weight(x) is then directly the -T*S total-energy term, matching the sign convention of the other schemes. Do not "correct" this to return a positive entropy – the sign is consumed by the caller.
Load-bearing, not defensive: f reaches exactly 0.0 and exactly 1.0 in the saturated tails, where f*log(f) would be 0*(-inf) = NaN. The floor is what keeps the tails at 0 instead. Removing it makes entropy_weight NaN at every saturated point.
Implements q3::SmearingScheme.
Definition at line 49 of file fermi_dirac.hpp.
References occupation().
|
inlineoverridevirtual |
Implements q3::SmearingScheme.
Definition at line 65 of file fermi_dirac.hpp.
Compute the occupation f(x) where x = (E - E_F) / σ.
No saturation branch, and none is needed: IEEE-754 arithmetic already makes this expression total and exact at both limits. Large positive x overflows exp() to +inf (clause 7.4, default non-trapping), and 1/(inf + 1) is exactly 0.0; large negative x underflows exp() to +0 (clause 7.5), and 1/(0 + 1) is exactly 1.0. Both are the values a threshold would have returned, so a threshold would only decide where to stop computing an answer the format hands back for free.
Do not add one back. Any bound below ~709 makes the function discontinuous at the bound in entropy_weight(), which reaches f through this method – see EntropyWeightIsContinuousAcrossX36.
Implements q3::SmearingScheme.
Definition at line 23 of file fermi_dirac.hpp.
Referenced by entropy_weight().