RealTimeTransport 1.0.0
Real-time simulation of quantum transport processes
Loading...
Searching...
No Matches
ConductanceKernel.h
Go to the documentation of this file.
1//
2// This Source Code Form is subject to the terms of the Mozilla Public
3// License, v. 2.0. If a copy of the MPL was not distributed with this
4// file, You can obtain one at https://mozilla.org/MPL/2.0/.
5//
6
7///
8/// \file ConductanceKernel.h
9///
10/// \brief Renormalized perturbation theory for the conductance kernel.
11///
12
13#ifndef REAL_TIME_TRANSPORT_RENORMALIZED_PT_CONDUCTANCE_KERNEL_H
14#define REAL_TIME_TRANSPORT_RENORMALIZED_PT_CONDUCTANCE_KERNEL_H
15
16#include "../RealTimeTransport_export.h"
17#include "CurrentKernel.h"
18
19namespace RealTimeTransport
20{
21
22namespace RenormalizedPT
23{
24
25///
26/// @ingroup RenPT
27///
28/// @brief Defines the renormalized conductance kernel.
29///
30/// This class computes the conductance kernel via the renormalized perturbation theory. This kernel can be used
31/// to compute the stationary conductance \f$ dI_r/d\mu_r \f$ of reservoir \f$ r \f$ without numerical differentiation,
32/// which is numerically more stable. The memory and current kernel must be computed first in order to use this class.
33/// A cross conductance \f$ dI_r/d\mu_{r'} \f$ can be obtained by first computing the current kernel for resrevoir
34/// \f$ r \f$, and then the conductance kernel for reservoir \f$ r' \f$.
35///
37{
38 public:
39 /// @brief Constructor.
41
42 /// @brief Move constructor.
44
45 /// @brief Copy constructor.
47
48 /// @brief Move assignment operator.
50
51 /// @brief Copy assignment operator.
53
54 ///
55 /// @brief Computes the conductance kernel for a given model.
56 ///
57 /// Computes the conductance kernel for a given model.
58 ///
59 /// @param K The memory kernel of the model.
60 /// @param KI The current kernel of the model.
61 /// @param stationaryState The Stationary state of the model.
62 /// @param r Index of the reservoir \f$ r=0,1,\dots \f$
63 /// @param order The order of the renormalized perturbation series.
64 /// @param tMax Maximum time until the conductance kernel is resolved.
65 /// @param errorGoal Error goal of the conductance kernel computation.
66 /// @param block Computes the complete conductance kernel if \a block==-1, otherwise
67 /// computes only a single block with index \a block.
68 ///
70 const MemoryKernel& K,
71 const CurrentKernel& KI,
72 const Model::OperatorType& stationaryState,
73 int r,
74 Order order,
75 SciCore::Real tMax,
76 SciCore::Real errorGoal,
77 int block = -1)
78 {
79 _initialize(K, KI, stationaryState, r, order, tMax, errorGoal, nullptr, block);
80 }
81
82 ///
83 /// @brief Computes the conductance kernel for a given model in parallel.
84 ///
85 /// Computes the conductance kernel for a given model in parallel.
86 ///
87 /// @param K The memory kernel of the model.
88 /// @param KI The current kernel of the model.
89 /// @param stationaryState The Stationary state of the model.
90 /// @param r Index of the reservoir \f$ r=0,1,\dots \f$
91 /// @param order The order of the renormalized perturbation series.
92 /// @param tMax Maximum time until the conductance kernel is resolved.
93 /// @param errorGoal Error goal of the conductance kernel computation.
94 /// @param executor A Taskflow executor managing threads.
95 /// @param block Computes the complete conductance kernel if \a block==-1, otherwise
96 /// computes only a single block with index \a block.
97 ///
99 const MemoryKernel& K,
100 const CurrentKernel& KI,
101 const Model::OperatorType& stationaryState,
102 int r,
103 Order order,
104 SciCore::Real tMax,
105 SciCore::Real errorGoal,
106 tf::Executor& executor,
107 int block = -1)
108 {
109 _initialize(K, KI, stationaryState, r, order, tMax, errorGoal, &executor, block);
110 }
111
112 ///
113 /// @brief Returns the reservoir index for which the conductance kernel was computed.
114 ///
115 int r() const noexcept;
116
117 ///
118 /// @brief Returns the maximum simulation time.
119 ///
120 SciCore::Real tMax() const;
121
122 ///
123 /// @brief Returns the error goal of the computation.
124 ///
125 SciCore::Real errorGoal() const noexcept;
126
127 ///
128 /// @brief Returns the (stationary) conductance.
129 ///
131
132 ///
133 /// @brief Returns the stationary state derivative \f$ d\rho/d\mu_r \f$.
134 ///
136
137 template <class Archive>
138 void serialize(Archive& archive)
139 {
140 archive(
141 _model, _r, _errorGoal, _rhoStat, _d_dmu_rhoStat, _currentKernelZeroFreq, _d_dmu_memoryKernel,
142 _d_dmu_currentKernel);
143 }
144
145 private:
146 std::unique_ptr<Model> _model;
147 int _r;
148 SciCore::Real _errorGoal;
149
150 Model::SupervectorType _rhoStat;
151 Model::SupervectorType _d_dmu_rhoStat;
152 Model::SuperRowVectorType _currentKernelZeroFreq;
153 BlockDiagonalCheb _d_dmu_memoryKernel;
154 SciCore::ChebAdaptive<Model::SuperRowVectorType> _d_dmu_currentKernel;
155
156 void _initialize(
157 const MemoryKernel& K,
158 const CurrentKernel& KI,
159 const Model::OperatorType& stationaryState,
160 int r,
161 Order order,
162 SciCore::Real tMax,
163 SciCore::Real errorGoal,
164 tf::Executor* executor,
165 int block,
166 SciCore::Real hMin = -1);
167};
168
169} // namespace RenormalizedPT
170
171///
172/// @ingroup RenPT
173///
174/// @brief Computes the conductance kernel for a given model in the same reservoir for which the current kernel was computed.
175///
176/// Computes the conductance kernel for a given model in the same reservoir for which the current kernel was computed.
177///
178/// @param K The memory kernel for a given model.
179/// @param KI The current kernel for a given model.
180/// @param order The order of the renormalized perturbation series.
181/// @param block Computes the complete conductance kernel if \a block==-1, otherwise
182/// computes only a single block with index \a block.
183///
185 const RenormalizedPT::MemoryKernel& K,
186 const RenormalizedPT::CurrentKernel& KI,
187 RenormalizedPT::Order order,
188 int block = -1)
189{
190 return RenormalizedPT::ConductanceKernel(
191 K, KI, K.stationaryState(block), KI.r(), order, K.tMax(), K.errorGoal(), block);
192}
193
194///
195/// @ingroup RenPT
196///
197/// @brief Computes the conductance kernel for a given model.
198///
199/// Computes the conductance kernel which gives access to the (cross)conductance \f$dI_{r_1}/d\mu_{r_2}\f$ for a given model.
200/// Here \f$r_1\f$ is determined by the current kernel _KI_, and \f$r_2\f$ by the parameter _r_.
201///
202/// @param K The memory kernel for a given model.
203/// @param KI The current kernel for a given model.
204/// @param r Reservoir at which the derivative of the chemical potential is taken.
205/// @param order The order of the renormalized perturbation series.
206/// @param block Computes the complete conductance kernel if \a block==-1, otherwise
207/// computes only a single block with index \a block.
208///
210 const RenormalizedPT::MemoryKernel& K,
211 const RenormalizedPT::CurrentKernel& KI,
212 int r,
213 RenormalizedPT::Order order,
214 int block = -1)
215{
216 return RenormalizedPT::ConductanceKernel(K, KI, K.stationaryState(block), r, order, K.tMax(), K.errorGoal(), block);
217}
218
219} // namespace RealTimeTransport
220
221#endif // REAL_TIME_TRANSPORT_RENORMALIZED_PT_CONDUCTANCE_KERNEL_H
#define REALTIMETRANSPORT_EXPORT
Definition RealTimeTransport_export.h:15
This class represents a parameter dependent block diagonal matrix.
Definition BlockDiagonalCheb.h:54
Defines the renormalized conductance kernel.
Definition ConductanceKernel.h:37
ConductanceKernel & operator=(ConductanceKernel &&other)
Move assignment operator.
int r() const noexcept
Returns the reservoir index for which the conductance kernel was computed.
ConductanceKernel(const ConductanceKernel &other)
Copy constructor.
ConductanceKernel & operator=(const ConductanceKernel &other)
Copy assignment operator.
ConductanceKernel(const MemoryKernel &K, const CurrentKernel &KI, const Model::OperatorType &stationaryState, int r, Order order, SciCore::Real tMax, SciCore::Real errorGoal, int block=-1)
Computes the conductance kernel for a given model.
Definition ConductanceKernel.h:69
SciCore::Real errorGoal() const noexcept
Returns the error goal of the computation.
ConductanceKernel(ConductanceKernel &&other) noexcept
Move constructor.
SciCore::Real conductance() const
Returns the (stationary) conductance.
ConductanceKernel(const MemoryKernel &K, const CurrentKernel &KI, const Model::OperatorType &stationaryState, int r, Order order, SciCore::Real tMax, SciCore::Real errorGoal, tf::Executor &executor, int block=-1)
Computes the conductance kernel for a given model in parallel.
Definition ConductanceKernel.h:98
Model::OperatorType dState() const
Returns the stationary state derivative .
SciCore::Real tMax() const
Returns the maximum simulation time.
Defines the renormalized current kernel.
Definition RenormalizedPT/CurrentKernel.h:35
int r() const noexcept
Returns the reservoir index for which the current kernel was computed.
Defines the renormalized memory kernel.
Definition RenormalizedPT/MemoryKernel.h:55
REALTIMETRANSPORT_EXPORT RenormalizedPT::ConductanceKernel computeConductanceKernel(const RenormalizedPT::MemoryKernel &K, const RenormalizedPT::CurrentKernel &KI, int r, RenormalizedPT::Order order, int block=-1)
Computes the conductance kernel for a given model.
Definition ConductanceKernel.h:209
REALTIMETRANSPORT_EXPORT RenormalizedPT::ConductanceKernel computeConductanceKernel(const RenormalizedPT::MemoryKernel &K, const RenormalizedPT::CurrentKernel &KI, RenormalizedPT::Order order, int block=-1)
Computes the conductance kernel for a given model in the same reservoir for which the current kernel ...
Definition ConductanceKernel.h:184
Order
Defines the order of the approximation.
Definition RenormalizedPT/MemoryKernel.h:41