votca 2026-dev
Loading...
Searching...
No Matches
trapfinder.h
Go to the documentation of this file.
1/*
2 * Copyright 2009-2026 The VOTCA Development Team
3 * (http://www.votca.org)
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License")
6 *
7 * You may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 */
19
20#pragma once
21#ifndef VOTCA_XTP_TRAPFINDER_H
22#define VOTCA_XTP_TRAPFINDER_H
23
24// Standard includes
25#include <vector>
26
27// Local VOTCA includes
28#include "eigen.h"
29#include "tofgraph.h"
30
31namespace votca {
32namespace xtp {
33
71 public:
72 struct Settings {
73 double threshold = 0.9; // the paper's a
76 double gap = 10.0;
79 double mass = 0.5;
81 Index modes = 50; // eigenvalues considered
82 Index max_sites = 5000; // dense eigenvalue problem
83 };
84
85 struct Trap {
86 std::vector<Index> sites; // graph site indices, deepest first
87 double weight = 0.0; // equilibrium probability
91 double relaxation_rate = 0.0;
92 double release_rate = 0.0; // relaxation_rate (1 - weight)
93 double capture_rate = 0.0; // relaxation_rate weight
96 double hop_rate = 0.0;
97 };
98
99 struct Result {
101 std::vector<double> eigenvalues;
102 double gap = 0.0; // largest ratio l_{i+1}/l_i
103 Index slow_modes = 0; // i of the largest ratio
104 std::vector<Trap> traps; // empty if gap < Settings::gap
105 std::vector<double> occupation; // stationary distribution per site
106 };
107
108 static Result Find(const ToFGraph& graph, const Settings& settings);
109 static Result Find(const ToFGraph& graph) { return Find(graph, Settings()); }
110};
111
112} // namespace xtp
113} // namespace votca
114
115#endif // VOTCA_XTP_TRAPFINDER_H
Hopping graph for time-of-flight (ToF) transport.
Definition tofgraph.h:77
Identifies traps (single sites or clusters) of a charge transport network from the slow modes of the ...
Definition trapfinder.h:70
static Result Find(const ToFGraph &graph)
Definition trapfinder.h:109
static Result Find(const ToFGraph &graph, const Settings &settings)
Definition trapfinder.cc:48
Provides a means for comparing floating point numbers.
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26
std::vector< double > occupation
Definition trapfinder.h:105
std::vector< Trap > traps
Definition trapfinder.h:104
std::vector< double > eigenvalues
the smallest eigenvalues of -Q (relaxation rates, 1/s)
Definition trapfinder.h:101
std::vector< Index > sites
Definition trapfinder.h:86