pub fn fermionic_single_pole(
tau: f64,
omega: f64,
beta: f64,
) -> Result<f64, Error>Expand description
Compute fermionic single-pole Green’s function at imaginary time τ
Evaluates G(τ) = -exp(-ω×τ) / (1 + exp(-β×ω)) for a single pole at frequency ω.
Supports negative τ with anti-periodic boundary conditions:
- G(τ + β) = -G(τ) (fermionic anti-periodicity)
- Valid for τ ∈ [-β, β]; τ is normalized with
normalize_tau
§Arguments
tau- Imaginary time τ ∈ [-β, β]omega- Pole position (real frequency)beta- Inverse temperature
§Returns
Real-valued Green’s function G(τ)
§Errors
Error::InvalidParameterifbetais not positive and finite, oromegais not finiteError::OutOfDomainiftauis outside [-β, β] or NaN
§Example
use sparse_ir::fermionic_single_pole;
let beta = 1.0;
let omega = 5.0;
let tau = 0.5 * beta;
let g = fermionic_single_pole(tau, omega, beta).unwrap();
let expected = -(-omega * tau).exp() / (1.0 + (-beta * omega).exp());
assert!((g - expected).abs() < 1e-15);
// Anti-periodicity: G(τ - β) = -G(τ)
assert!((fermionic_single_pole(tau - beta, omega, beta).unwrap() + g).abs() < 1e-15);