votca 2026-dev
Loading...
Searching...
No Matches
votca::xtp::IntegratedRateInversion Class Referencefinal

TEMPLATE, NOT IMPLEMENTED: waiting times for periodic rates by inverting the integrated escape rate (BEP R. Paiders, nhKMC, Algorithms 3 and 4; Prados, Brey, Sanchez-Rey 1997). More...

#include <kmcwaitingtime.h>

Inheritance diagram for votca::xtp::IntegratedRateInversion:
Collaboration diagram for votca::xtp::IntegratedRateInversion:

Classes

struct  Settings

Public Member Functions

 IntegratedRateInversion (const Settings &settings)
std::string Name () const override
void Prepare (const TimeDependentRates &rates) override
double NextTime (Index site, double t, KMCRandom &random) const override
Index ChooseHop (Index site, double t, KMCRandom &random) const override
Public Member Functions inherited from votca::xtp::WaitingTimeStrategy
virtual ~WaitingTimeStrategy ()=default

Private Attributes

Settings settings_
const TimeDependentRates * rates_ = nullptr

Detailed Description

TEMPLATE, NOT IMPLEMENTED: waiting times for periodic rates by inverting the integrated escape rate (BEP R. Paiders, nhKMC, Algorithms 3 and 4; Prados, Brey, Sanchez-Rey 1997).

For a carrier on site i at time t0 the waiting time dt solves -ln u = int_{t0}^{t0+dt} lambda_i(s) ds, u ~ U(0,1], lambda_i(t) = TimeDependentRates::EscapeRate(i, t) > 0 with period T. With Lambda_i(t) = int_0^t lambda_i, I_T = Lambda_i(T) and t0 = l T + t0*: m = floor((g + Lambda_i(t0*)) / I_T) ... (BEP eqs. 11-18) so only Lambda_i on [0, T) (or [0, 2T)) and I_T are needed, precomputed per site in Prepare() (quadrature + monotone PCHIP interpolant), and the remainder is a bounded, monotone root search.

ChooseHop(i, t): edge e with probability w_e(t) / lambda_i(t) at the event time t (never -1, apart from rounding).

Notes for the implementation:

  • Prepare(): rates.Period() must be > 0, else throw. Store per site what the inversion needs (e.g. the PCHIP coefficients of Lambda_i on [0, T] and I_T); memory is per site, not per edge.
  • Tolerances relative to T and I_T that double precision can reach (about 1e-14 relative, not 1e-20). The phase rem(t0, T) loses about log10(t0/T) digits for t0 >> T; document the accuracy or keep the time split into periods and phase.
  • Validation (see test_kmcwaitingtime.cc, disabled test cases):
    • static rates (Period() any > 0): identical statistics to ExponentialWaitingTime and the GRW hitting times;
    • uniformly scaled rates w_e(t) = s(t) w_e: hitting times are the static ones mapped through the inverse of int s (exact reference);
    • any periodic rates: same statistics as ThinningWaitingTime;
    • f -> infinity: the GRW with period-averaged rates; f -> 0: the average over the phase of the static result.

Definition at line 149 of file kmcwaitingtime.h.

Constructor & Destructor Documentation

◆ IntegratedRateInversion()

votca::xtp::IntegratedRateInversion::IntegratedRateInversion ( const Settings & settings)
inlineexplicit

Definition at line 156 of file kmcwaitingtime.h.

Member Function Documentation

◆ ChooseHop()

Index votca::xtp::IntegratedRateInversion::ChooseHop ( Index site,
double t,
KMCRandom & random ) const
overridevirtual

Implements votca::xtp::WaitingTimeStrategy.

Definition at line 161 of file kmcwaitingtime.cc.

◆ Name()

std::string votca::xtp::IntegratedRateInversion::Name ( ) const
inlineoverridevirtual

Implements votca::xtp::WaitingTimeStrategy.

Definition at line 158 of file kmcwaitingtime.h.

◆ NextTime()

double votca::xtp::IntegratedRateInversion::NextTime ( Index site,
double t,
KMCRandom & random ) const
overridevirtual

Implements votca::xtp::WaitingTimeStrategy.

Definition at line 155 of file kmcwaitingtime.cc.

◆ Prepare()

void votca::xtp::IntegratedRateInversion::Prepare ( const TimeDependentRates & rates)
overridevirtual

Implements votca::xtp::WaitingTimeStrategy.

Definition at line 137 of file kmcwaitingtime.cc.

Member Data Documentation

◆ rates_

const TimeDependentRates* votca::xtp::IntegratedRateInversion::rates_ = nullptr
private

Definition at line 165 of file kmcwaitingtime.h.

◆ settings_

Settings votca::xtp::IntegratedRateInversion::settings_
private

Definition at line 164 of file kmcwaitingtime.h.


The documentation for this class was generated from the following files: