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

Hopping graph for time-of-flight (ToF) transport. More...

#include <tofgraph.h>

Collaboration diagram for votca::xtp::ToFGraph:

Classes

struct  Options
struct  Site
struct  Edge
class  EdgeRange
 [begin, end) of the out-edges of one site More...

Public Types

enum class  Role { Bulk , Source , Sink }

Public Member Functions

 ToFGraph (const Topology &top, const Options &opt, QMStateType carrier, double temperature, const Eigen::Vector3d &field)
 temperature as kT in Hartree, field in Hartree/bohr (as Rate_Engine)
Index NumberOfSites () const
const std::vector< Site > & Sites () const
const Site & getSite (Index i) const
EdgeRange OutEdges (Index i) const
Index NumberOfEdges () const
Index EdgeOffset (Index i) const
const Edge & getEdge (Index e) const
double EscapeRate (Index i) const
 sum of the rates of all out-edges
const std::vector< Index > & SourceSites () const
 source sites from which a sink can be reached
const std::vector< Index > & DisconnectedSources () const
 source sites from which no sink can be reached (excluded above)
const std::vector< Index > & SinkSites () const
Index NumberOfCutPairs () const
Index NumberOfIgnoredSites () const
 sites of ignored segment types
bool isBulk () const
const Eigen::Vector3d & Normal () const
 unit normal of the cut face, pointing from source to sink side
double Thickness () const
 thickness of the box along the normal
double Length () const
bool isReversible () const
double DetailedBalanceDeviation () const
 largest |ln(w_ij/w_ji) - (U_i - U_j)/kT| over all pairs
QMStateType CarrierType () const
double Temperature () const
const Eigen::Vector3d & Field () const
std::string Summary () const
 human readable summary

Static Public Member Functions

static Options BulkOptions (const std::string &injection_pattern, const std::string &ignore_types)
static Options OptionsFromProperty (const tools::Property &tof)
 Options from the "tof" subpackage (subpackages/tof.xml), lengths in nm.

Private Member Functions

void SetupSites (const Topology &top)
void SetupEdges (const Topology &top)
void FindReachability ()
void SetupBulkSources ()

Private Attributes

Options opt_
QMStateType carrier_
double temperature_
Eigen::Vector3d field_
std::vector< Site > sites_
std::vector< Edge > edges_
std::vector< Index > offsets_
std::vector< double > escape_rates_
std::vector< Index > sources_
std::vector< Index > disconnected_sources_
std::vector< Index > sinks_
Index cut_pairs_ = 0
Index ignored_sites_ = 0
Index sites_without_sink_ = 0
Eigen::Vector3d normal_ = Eigen::Vector3d::Zero()
double thickness_ = 0.0
double length_ = 0.0
bool reversible_ = false
double db_deviation_ = 0.0

Detailed Description

Hopping graph for time-of-flight (ToF) transport.

Built from a periodic morphology (segments, box, neighbour list with couplings). The periodicity is cut across one box vector (the transport axis): pairs that connect two segments through a periodic image along that vector are dropped, the other two directions stay periodic. Source and sink sites are selected by slabs at the two faces normal to the transport axis and/or by segment type patterns. Rates are Marcus rates from Rate_Engine at the given temperature and field.

The graph is the common input of the ToF kinetic Monte Carlo and of the graph random walk (hitting time) calculations, so both see exactly the same sites, edges and rates.

With Options::bulk nothing is cut, the periodicity is kept in all three directions and there are no sinks: the graph of the bulk KMC (kmcmultiple). The ToF methods (GraphRandomWalk, ToFSimulation) refuse such a graph; a ToF graph stays periodic in the two directions normal to the transport axis. The source sites are then the injection sites (source_pattern, all sites if empty); normal, thickness, length and the coordinate x are zero. In this mode a field makes U = E - q F.r multivalued (it changes by q F.(box vector) around the torus), so the rates satisfy detailed balance only without a field component along a box vector, and the potential is only informative.

Segments whose type matches one of Options::ignore_types take no part in transport: they keep their index but have no edges and are neither source nor sink.

Coordinates along the transport axis are measured along the unit normal of the cut face, from the face at fractional coordinate 0 (source side) to the one at 1 (sink side). All quantities are in atomic units, rates in 1/s.

Definition at line 77 of file tofgraph.h.

Member Enumeration Documentation

◆ Role

enum class votca::xtp::ToFGraph::Role
strong
Enumerator
Bulk 
Source 
Sink 

Definition at line 106 of file tofgraph.h.

Constructor & Destructor Documentation

◆ ToFGraph()

votca::xtp::ToFGraph::ToFGraph ( const Topology & top,
const Options & opt,
QMStateType carrier,
double temperature,
const Eigen::Vector3d & field )

temperature as kT in Hartree, field in Hartree/bohr (as Rate_Engine)

Definition at line 96 of file tofgraph.cc.

Member Function Documentation

◆ BulkOptions()

ToFGraph::Options votca::xtp::ToFGraph::BulkOptions ( const std::string & injection_pattern,
const std::string & ignore_types )
static

bulk options: no cut, no sinks, injection on segments matching injection_pattern (empty or "*": all), ignore_types as for Options; the list is separated by commas or white space

Definition at line 61 of file tofgraph.cc.

◆ CarrierType()

QMStateType votca::xtp::ToFGraph::CarrierType ( ) const
inline

Definition at line 195 of file tofgraph.h.

◆ DetailedBalanceDeviation()

double votca::xtp::ToFGraph::DetailedBalanceDeviation ( ) const
inline

largest |ln(w_ij/w_ji) - (U_i - U_j)/kT| over all pairs

Definition at line 193 of file tofgraph.h.

◆ DisconnectedSources()

const std::vector< Index > & votca::xtp::ToFGraph::DisconnectedSources ( ) const
inline

source sites from which no sink can be reached (excluded above)

Definition at line 168 of file tofgraph.h.

◆ EdgeOffset()

Index votca::xtp::ToFGraph::EdgeOffset ( Index i) const
inline

global index of the first out-edge of site i (edges are stored per site, OutEdges(i) covers [EdgeOffset(i), EdgeOffset(i+1)))

Definition at line 160 of file tofgraph.h.

◆ EscapeRate()

double votca::xtp::ToFGraph::EscapeRate ( Index i) const
inline

sum of the rates of all out-edges

Definition at line 163 of file tofgraph.h.

◆ Field()

const Eigen::Vector3d & votca::xtp::ToFGraph::Field ( ) const
inline

Definition at line 197 of file tofgraph.h.

◆ FindReachability()

void votca::xtp::ToFGraph::FindReachability ( )
private

Definition at line 287 of file tofgraph.cc.

◆ getEdge()

const Edge & votca::xtp::ToFGraph::getEdge ( Index e) const
inline

Definition at line 161 of file tofgraph.h.

◆ getSite()

const Site & votca::xtp::ToFGraph::getSite ( Index i) const
inline

Definition at line 151 of file tofgraph.h.

◆ isBulk()

bool votca::xtp::ToFGraph::isBulk ( ) const
inline

Definition at line 176 of file tofgraph.h.

◆ isReversible()

bool votca::xtp::ToFGraph::isReversible ( ) const
inline

true if the rates satisfy detailed balance with the potential U, pi_i w_ij = pi_j w_ji with pi_i ~ exp(-U_i/kT); requires equal reorganization energies for both directions of each pair and a field along the normal (a field component along a periodic direction is not a potential)

Definition at line 191 of file tofgraph.h.

◆ Length()

double votca::xtp::ToFGraph::Length ( ) const
inline

transport length: distance along the normal from the mean position of the (connected) source sites to the closest sink site

Definition at line 184 of file tofgraph.h.

◆ Normal()

const Eigen::Vector3d & votca::xtp::ToFGraph::Normal ( ) const
inline

unit normal of the cut face, pointing from source to sink side

Definition at line 179 of file tofgraph.h.

◆ NumberOfCutPairs()

Index votca::xtp::ToFGraph::NumberOfCutPairs ( ) const
inline

Definition at line 173 of file tofgraph.h.

◆ NumberOfEdges()

Index votca::xtp::ToFGraph::NumberOfEdges ( ) const
inline

Definition at line 157 of file tofgraph.h.

◆ NumberOfIgnoredSites()

Index votca::xtp::ToFGraph::NumberOfIgnoredSites ( ) const
inline

sites of ignored segment types

Definition at line 175 of file tofgraph.h.

◆ NumberOfSites()

Index votca::xtp::ToFGraph::NumberOfSites ( ) const
inline

Definition at line 149 of file tofgraph.h.

◆ OptionsFromProperty()

ToFGraph::Options votca::xtp::ToFGraph::OptionsFromProperty ( const tools::Property & tof)
static

Options from the "tof" subpackage (subpackages/tof.xml), lengths in nm.

Definition at line 73 of file tofgraph.cc.

◆ OutEdges()

EdgeRange votca::xtp::ToFGraph::OutEdges ( Index i) const
inline

Definition at line 153 of file tofgraph.h.

◆ SetupBulkSources()

void votca::xtp::ToFGraph::SetupBulkSources ( )
private

Definition at line 346 of file tofgraph.cc.

◆ SetupEdges()

void votca::xtp::ToFGraph::SetupEdges ( const Topology & top)
private

Definition at line 216 of file tofgraph.cc.

◆ SetupSites()

void votca::xtp::ToFGraph::SetupSites ( const Topology & top)
private

Definition at line 134 of file tofgraph.cc.

◆ SinkSites()

const std::vector< Index > & votca::xtp::ToFGraph::SinkSites ( ) const
inline

Definition at line 171 of file tofgraph.h.

◆ Sites()

const std::vector< Site > & votca::xtp::ToFGraph::Sites ( ) const
inline

Definition at line 150 of file tofgraph.h.

◆ SourceSites()

const std::vector< Index > & votca::xtp::ToFGraph::SourceSites ( ) const
inline

source sites from which a sink can be reached

Definition at line 166 of file tofgraph.h.

◆ Summary()

std::string votca::xtp::ToFGraph::Summary ( ) const

human readable summary

Definition at line 360 of file tofgraph.cc.

◆ Temperature()

double votca::xtp::ToFGraph::Temperature ( ) const
inline

Definition at line 196 of file tofgraph.h.

◆ Thickness()

double votca::xtp::ToFGraph::Thickness ( ) const
inline

thickness of the box along the normal

Definition at line 181 of file tofgraph.h.

Member Data Documentation

◆ carrier_

QMStateType votca::xtp::ToFGraph::carrier_
private

Definition at line 204 of file tofgraph.h.

◆ cut_pairs_

Index votca::xtp::ToFGraph::cut_pairs_ = 0
private

Definition at line 215 of file tofgraph.h.

◆ db_deviation_

double votca::xtp::ToFGraph::db_deviation_ = 0.0
private

Definition at line 222 of file tofgraph.h.

◆ disconnected_sources_

std::vector<Index> votca::xtp::ToFGraph::disconnected_sources_
private

Definition at line 213 of file tofgraph.h.

◆ edges_

std::vector<Edge> votca::xtp::ToFGraph::edges_
private

Definition at line 209 of file tofgraph.h.

◆ escape_rates_

std::vector<double> votca::xtp::ToFGraph::escape_rates_
private

Definition at line 211 of file tofgraph.h.

◆ field_

Eigen::Vector3d votca::xtp::ToFGraph::field_
private

Definition at line 206 of file tofgraph.h.

◆ ignored_sites_

Index votca::xtp::ToFGraph::ignored_sites_ = 0
private

Definition at line 216 of file tofgraph.h.

◆ length_

double votca::xtp::ToFGraph::length_ = 0.0
private

Definition at line 220 of file tofgraph.h.

◆ normal_

Eigen::Vector3d votca::xtp::ToFGraph::normal_ = Eigen::Vector3d::Zero()
private

Definition at line 218 of file tofgraph.h.

◆ offsets_

std::vector<Index> votca::xtp::ToFGraph::offsets_
private

Definition at line 210 of file tofgraph.h.

◆ opt_

Options votca::xtp::ToFGraph::opt_
private

Definition at line 203 of file tofgraph.h.

◆ reversible_

bool votca::xtp::ToFGraph::reversible_ = false
private

Definition at line 221 of file tofgraph.h.

◆ sinks_

std::vector<Index> votca::xtp::ToFGraph::sinks_
private

Definition at line 214 of file tofgraph.h.

◆ sites_

std::vector<Site> votca::xtp::ToFGraph::sites_
private

Definition at line 208 of file tofgraph.h.

◆ sites_without_sink_

Index votca::xtp::ToFGraph::sites_without_sink_ = 0
private

Definition at line 217 of file tofgraph.h.

◆ sources_

std::vector<Index> votca::xtp::ToFGraph::sources_
private

Definition at line 212 of file tofgraph.h.

◆ temperature_

double votca::xtp::ToFGraph::temperature_
private

Definition at line 205 of file tofgraph.h.

◆ thickness_

double votca::xtp::ToFGraph::thickness_ = 0.0
private

Definition at line 219 of file tofgraph.h.


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