Loading...
Searching...
No Matches
gaussian.hpp
Go to the documentation of this file.
1#pragma once
2
3/**
4 * GaussianSmearing — Gaussian broadening for metallic occupation functions.
5 *
6 * Implements f(x) = erfc(x)/2 smearing and its entropy contribution,
7 * where x = (ε - ε_F) / σ.
8 */
9
10#include <cmath>
11
13
14namespace q3 {
15
16/// Gaussian smearing.
18 public:
20
21 [[nodiscard]] Real occupation(Real x) const override {
22 return 0.5 * std::erfc(x);
23 }
24
25 [[nodiscard]] Real entropy_weight(Real x) const override {
26 const Real sqrtpi_inv = 1.0 / std::sqrt(constants::pi);
27 return -0.5 * sqrtpi_inv * std::exp(-x * x);
28 }
29
30 [[nodiscard]] std::string name() const override {
31 return "gaussian";
32 }
33};
34
35} // namespace q3
Gaussian smearing.
Definition gaussian.hpp:17
Real occupation(Real x) const override
Compute the occupation f(x) where x = (E - E_F) / σ.
Definition gaussian.hpp:21
Real entropy_weight(Real x) const override
Compute the entropy contribution δ(x) weight.
Definition gaussian.hpp:25
std::string name() const override
Definition gaussian.hpp:30
GaussianSmearing(Real smearing_width=0.0)
Definition gaussian.hpp:19
Abstract interface for electronic smearing schemes.
Definition init.hpp:19
Real smearing_width() const
Smearing width σ (degauss) in Ry.
Definition init.hpp:33
constexpr Real pi
Definition constants.hpp:24
double Real