NESSi  v1.0.2
The NonEquilibrium Systems Simulation Library

◆ bose() [1/2]

template<typename T >
T cntr::bose ( beta,
omega 
)

Evaluates the Bose distribution function.

Purpose

Evaluates the Bose distribution function \( n_\mathrm{B}(\omega)\) at given inverse temperature \(\beta\). The calculation is numerically stable for any \(\omega\ne 0 \).

Parameters
beta

[T] inverse temperature \(\beta\)

omega

[T] energy

Definition at line 131 of file cntr_equilibrium_impl.hpp.

Referenced by bose().

131  {
132  T arg = omega * beta;
133  if (arg < 0)
134  return (-1.0 - bose<T>(beta, -omega));
135  if (fabs(arg) > EXPMAX) {
136  return 0.0;
137  } else if (arg < 1e-10) {
138  return 1.0 / arg;
139  } else {
140  return 1.0 / (exp(arg) - 1.0);
141  }
142 }
+ Here is the caller graph for this function: