pub fn gtau_single_pole<S: StatisticsType>(
tau: f64,
omega: f64,
beta: f64,
) -> Result<f64, Error>Expand description
Generic single-pole Green’s function at imaginary time τ
Computes G(τ) for either fermionic or bosonic statistics based on the type parameter S.
Both use G(τ) = -exp(-ω×τ) / (1 ± exp(-β×ω)) (+ for fermions, - for bosons),
the imaginary-time counterpart of giwn_single_pole’s G(iν) = 1/(iν - ω).
§Type Parameters
S- Statistics type (Fermionic or Bosonic)
§Arguments
tau- Imaginary time τ ∈ [-β, β]; τ < 0 is mapped to [0, β] by (anti-)periodicity (seefermionic_single_poleandbosonic_single_pole)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::traits::{Bosonic, Fermionic};
use sparse_ir::{bosonic_single_pole, fermionic_single_pole, gtau_single_pole};
let g_f = gtau_single_pole::<Fermionic>(0.5, 5.0, 1.0).unwrap();
assert_eq!(g_f, fermionic_single_pole(0.5, 5.0, 1.0).unwrap());
let g_b = gtau_single_pole::<Bosonic>(0.5, 5.0, 1.0).unwrap();
assert_eq!(g_b, bosonic_single_pole(0.5, 5.0, 1.0).unwrap());