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

Expected time of flight from hitting times of a continuous-time random walk on a ToFGraph, without sampling (graph random walk, Chen, van der Hoorn, Baumeier, arXiv:2405.15836). More...

#include <graphrandomwalk.h>

Collaboration diagram for votca::xtp::GraphRandomWalk:

Classes

struct  Settings
struct  Result
struct  Transient

Public Types

enum class  Solver {
  Auto , Cholesky , LU , CG ,
  BiCGSTAB
}
enum class  Observable { First , Transit }

Public Member Functions

 GraphRandomWalk (const ToFGraph &graph)
void setSettings (const Settings &settings)
Result SingleCarrier (Solver solver=Solver::Auto) const
Result TwoCarriers (Observable observable, Solver solver=Solver::Auto) const

Static Public Member Functions

static Solver SolverFromString (const std::string &name)
static Observable ObservableFromString (const std::string &name)

Private Member Functions

Transient FindTransient () const

Private Attributes

const ToFGraph & graph_
Settings settings_

Detailed Description

Expected time of flight from hitting times of a continuous-time random walk on a ToFGraph, without sampling (graph random walk, Chen, van der Hoorn, Baumeier, arXiv:2405.15836).

One carrier: the mean hitting times tau of the sink sites solve Q tau = 1, Q = diag(D) - W on the transient sites (all sites except sinks from which a sink can be reached), with D_i the escape rate of site i (hops into sinks included) and W_ij the rate of the hop i -> j. Sinks are not unknowns. The second moment follows from Q m2 = 2 tau, the expected time spent on each site for injection distribution w from the adjoint Q^T g = w.

Two carriers with site exclusion: the unknowns are pairs of occupied transient sites i < j, numbered j(j-1)/2 + i. Hops into an occupied site are not allowed (they enter neither D nor W). Two observables:

  • First: time until the first carrier reaches a sink (the paper's definition), Q_PP tau = 1.
  • Transit: carriers are removed when they reach a sink, tau is the mean transit time per carrier, (1/2) E[int N(t) dt]. The pair block is the same Q_PP; reaching a sink moves to the one-carrier state of the remaining carrier: Q_PP tau_P = 1 + W_PS tau_S with Q tau_S = 1/2.

If the rates obey detailed balance (ToFGraph::isReversible), Q and Q_PP are similar to symmetric positive definite matrices S = P Q P^-1 with P = diag(exp(-U/2kT)) (for pairs the product of the two sites), solved by sparse Cholesky (LDL^T) or, above Settings::direct_limit unknowns, Jacobi preconditioned conjugate gradients; otherwise sparse LU or BiCGSTAB with incomplete LU. Every solution is refined against Q itself.

The iterative tolerance has to be tight: with energetic disorder the hitting times are dominated by slow (trap) modes that a relative residual of 1e-10 can leave unresolved (7 % error in tau for a 40^3 lattice with sigma = 0.19 eV), hence the default of 1e-14. Direct factorization of graphs from 3D morphologies costs O(n^2) (O(n^2.5) in the pair space), which is why the iterative solvers take over above a few thousand unknowns.

Injection is uniform over the connected source sites (one carrier) or over pairs of them (two carriers). Times are in s.

Definition at line 81 of file graphrandomwalk.h.

Member Enumeration Documentation

◆ Observable

Enumerator
First 
Transit 

Definition at line 84 of file graphrandomwalk.h.

◆ Solver

Enumerator
Auto 
Cholesky 
LU 
CG 
BiCGSTAB 

Definition at line 83 of file graphrandomwalk.h.

Constructor & Destructor Documentation

◆ GraphRandomWalk()

votca::xtp::GraphRandomWalk::GraphRandomWalk ( const ToFGraph & graph)
inlineexplicit

Definition at line 131 of file graphrandomwalk.h.

Member Function Documentation

◆ FindTransient()

GraphRandomWalk::Transient votca::xtp::GraphRandomWalk::FindTransient ( ) const
private

Definition at line 393 of file graphrandomwalk.cc.

◆ ObservableFromString()

GraphRandomWalk::Observable votca::xtp::GraphRandomWalk::ObservableFromString ( const std::string & name)
static

Definition at line 382 of file graphrandomwalk.cc.

◆ setSettings()

void votca::xtp::GraphRandomWalk::setSettings ( const Settings & settings)
inline

Definition at line 139 of file graphrandomwalk.h.

◆ SingleCarrier()

GraphRandomWalk::Result votca::xtp::GraphRandomWalk::SingleCarrier ( Solver solver = Solver::Auto) const

Definition at line 442 of file graphrandomwalk.cc.

◆ SolverFromString()

GraphRandomWalk::Solver votca::xtp::GraphRandomWalk::SolverFromString ( const std::string & name)
static

Definition at line 365 of file graphrandomwalk.cc.

◆ TwoCarriers()

GraphRandomWalk::Result votca::xtp::GraphRandomWalk::TwoCarriers ( Observable observable,
Solver solver = Solver::Auto ) const

Definition at line 506 of file graphrandomwalk.cc.

Member Data Documentation

◆ graph_

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

Definition at line 156 of file graphrandomwalk.h.

◆ settings_

Settings votca::xtp::GraphRandomWalk::settings_
private

Definition at line 157 of file graphrandomwalk.h.


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