votca 2026-dev
Loading...
Searching...
No Matches
votca::xtp::LifetimeSimulation Class Reference

Kinetic Monte Carlo of carriers (excitons) that hop and decay with a site-dependent rate, at constant number: every decayed carrier is replaced at once by a new one on a random free injection site (calculator kmclifetime). More...

#include <lifetimesimulation.h>

Collaboration diagram for votca::xtp::LifetimeSimulation:

Classes

struct  Settings
struct  Record
struct  DecaySums
 sums over the decays of one run More...
struct  EnergySample
struct  Result
struct  ExactResult
struct  RunData

Public Member Functions

 LifetimeSimulation (const ToFGraph &graph, std::vector< double > decay_rates, const Settings &settings)
 LifetimeSimulation (const ToFGraph &graph, std::vector< double > decay_rates, const Settings &settings, const TimeDependentRates &rates, WaitingTimeStrategy &strategy)
Result Simulate () const

Static Public Member Functions

static ExactResult Exact (const ToFGraph &graph, const std::vector< double > &decay_rates, Index direct_limit=20000, double tolerance=1e-12)

Private Member Functions

void Check () const
void Setup (WaitingTimeStrategy &strategy, const TimeDependentRates &rates)
RunData SingleRun (Index run, Index decays, std::vector< EnergySample > *energy) const

Private Attributes

const ToFGraph & graph_
std::vector< double > decay_rates_
Settings settings_
std::unique_ptr< TimeDependentRates > own_rates_
std::unique_ptr< WaitingTimeStrategy > own_strategy_
std::unique_ptr< KMCEngine > engine_

Detailed Description

Kinetic Monte Carlo of carriers (excitons) that hop and decay with a site-dependent rate, at constant number: every decayed carrier is replaced at once by a new one on a random free injection site (calculator kmclifetime).

Each run starts with the carriers on distinct random injection sites and stops after its share of the requested decays. Per decay: lifetime (decay - injection time), displacement (unwrapped), hops and decay site. Statistics are over all decays; their standard errors assume independent decays (exact for one carrier). Also the occupation probability of every site (summed over carriers) and the fraction of decays per site. Runs are done in parallel and reduced in run order.

Exact(): for one carrier the same averages without sampling, from linear systems with A = K + diag(W) - W (K: decay rates, W: hop rates): A tau = 1 (lifetime), A m = b with b_i = sum_j w_ij R_ij (mean displacement), A s = sum_j w_ij (R_ij^2 + 2 R_ij m_j) (mean squared displacement, per component), and A^T g = p0 for the expected time per site (occupation) and the decay probabilities k_j g_j, all averaged over a uniform start on the injection sites.

Definition at line 63 of file lifetimesimulation.h.

Constructor & Destructor Documentation

◆ LifetimeSimulation() [1/2]

votca::xtp::LifetimeSimulation::LifetimeSimulation ( const ToFGraph & graph,
std::vector< double > decay_rates,
const Settings & settings )

graph: a bulk graph (ToFGraph::BulkOptions) for the usual setup; decay rates per site (1/s), positive for every site that takes part

Definition at line 150 of file lifetimesimulation.cc.

◆ LifetimeSimulation() [2/2]

votca::xtp::LifetimeSimulation::LifetimeSimulation ( const ToFGraph & graph,
std::vector< double > decay_rates,
const Settings & settings,
const TimeDependentRates & rates,
WaitingTimeStrategy & strategy )

Definition at line 161 of file lifetimesimulation.cc.

Member Function Documentation

◆ Check()

void votca::xtp::LifetimeSimulation::Check ( ) const
private

Definition at line 185 of file lifetimesimulation.cc.

◆ Exact()

LifetimeSimulation::ExactResult votca::xtp::LifetimeSimulation::Exact ( const ToFGraph & graph,
const std::vector< double > & decay_rates,
Index direct_limit = 20000,
double tolerance = 1e-12 )
static

one carrier, static rates of the graph; direct sparse LU up to direct_limit sites, BiCGSTAB with ILUT above

Definition at line 305 of file lifetimesimulation.cc.

◆ Setup()

void votca::xtp::LifetimeSimulation::Setup ( WaitingTimeStrategy & strategy,
const TimeDependentRates & rates )
private

Definition at line 174 of file lifetimesimulation.cc.

◆ Simulate()

LifetimeSimulation::Result votca::xtp::LifetimeSimulation::Simulate ( ) const

Definition at line 234 of file lifetimesimulation.cc.

◆ SingleRun()

LifetimeSimulation::RunData votca::xtp::LifetimeSimulation::SingleRun ( Index run,
Index decays,
std::vector< EnergySample > * energy ) const
private

Definition at line 214 of file lifetimesimulation.cc.

Member Data Documentation

◆ decay_rates_

std::vector<double> votca::xtp::LifetimeSimulation::decay_rates_
private

Definition at line 161 of file lifetimesimulation.h.

◆ engine_

std::unique_ptr<KMCEngine> votca::xtp::LifetimeSimulation::engine_
private

Definition at line 165 of file lifetimesimulation.h.

◆ graph_

const ToFGraph& votca::xtp::LifetimeSimulation::graph_
private

Definition at line 160 of file lifetimesimulation.h.

◆ own_rates_

std::unique_ptr<TimeDependentRates> votca::xtp::LifetimeSimulation::own_rates_
private

Definition at line 163 of file lifetimesimulation.h.

◆ own_strategy_

std::unique_ptr<WaitingTimeStrategy> votca::xtp::LifetimeSimulation::own_strategy_
private

Definition at line 164 of file lifetimesimulation.h.

◆ settings_

Settings votca::xtp::LifetimeSimulation::settings_
private

Definition at line 162 of file lifetimesimulation.h.


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