pub fn bosonic_single_pole(
tau: f64,
omega: f64,
beta: f64,
) -> Result<f64, Error>Expand description
Compute bosonic single-pole Green’s function at imaginary time τ
Evaluates G(τ) = -exp(-ω×τ) / (1 - exp(-β×ω)) for a single pole at frequency ω.
This is the imaginary-time counterpart of giwn_single_pole:
G(iνn) = ∫₀^β dτ exp(iνn×τ) G(τ) = 1/(iνn - ω). G(τ) is negative for ω > 0
and positive for ω < 0, the same sign convention as fermionic_single_pole
and the bosonic τ functions of DiscreteLehmannRepresentation.
Supports negative τ with periodic boundary conditions:
- G(τ + β) = G(τ) (bosonic periodicity)
- Valid for τ ∈ [-β, β]; τ is normalized with
normalize_tau
ω = 0 is a genuine pole of the Bose factor, so the result is infinite there:
-inf for omega = +0.0 (the ω → 0⁺ limit) and +inf for omega = -0.0.
DiscreteLehmannRepresentation evaluates a zero pole through its finite,
regularized limit instead.
§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::bosonic_single_pole;
let beta = 1.0;
let omega = 5.0;
let tau = 0.5 * beta;
let g = bosonic_single_pole(tau, omega, beta).unwrap();
let expected = -(-omega * tau).exp() / (1.0 - (-beta * omega).exp());
assert!((g - expected).abs() <= 1e-14 * expected.abs());
assert!(g < 0.0);
// Periodicity: G(τ - β) = G(τ)
assert!((bosonic_single_pole(tau - beta, omega, beta).unwrap() - g).abs() < 1e-15);