RealTimeTransport 1.0.0
Real-time simulation of quantum transport processes
Loading...
Searching...
No Matches
RenormalizedPT/CurrentKernel.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 CurrentKernel.h
9///
10/// \brief Renormalized perturbation theory current kernel.
11///
12
13#ifndef REAL_TIME_TRANSPORT_RENORMALIZED_PT_CURRENT_KERNEL_H
14#define REAL_TIME_TRANSPORT_RENORMALIZED_PT_CURRENT_KERNEL_H
15
16#include <SciCore/ChebAdaptive.h>
17
18#include "../RealTimeTransport_export.h"
19#include "MemoryKernel.h"
20
21namespace RealTimeTransport
22{
23
24namespace RenormalizedPT
25{
26
27///
28/// @ingroup RenPT
29///
30/// @brief Defines the renormalized current kernel.
31///
32/// Defines the current kernel computed via the renormalized perturbation theory.
33///
35{
36 public:
37 /// @brief Constructor.
38 CurrentKernel() noexcept;
39
40 /// @brief Move constructor.
41 CurrentKernel(CurrentKernel&& other) noexcept;
42
43 /// @brief Copy constructor.
45
46 /// @brief Move assignment operator.
48
49 /// @brief Copy assignment operator.
51
52 CurrentKernel(const Model* model, int r, Order order, SciCore::Real tMax, SciCore::Real errorGoal, int block = -1)
53 {
54 _initialize(model, r, order, tMax, errorGoal, nullptr, block);
55 }
56
57 CurrentKernel(
58 const Model* model,
59 int r,
60 Order order,
61 SciCore::Real tMax,
62 SciCore::Real errorGoal,
63 tf::Executor& executor,
64 int block = -1)
65 {
66 _initialize(model, r, order, tMax, errorGoal, &executor, block);
67 }
68
69 ///
70 /// @brief Computes the current kernel for a given model.
71 ///
72 /// Computes the current kernel for a given model.
73 ///
74 /// @param model The model for which the current kernel is computed.
75 /// @param r Index of the reservoir \f$ r=0,1,\dots \f$
76 /// @param order The order of the renormalized perturbation series.
77 /// @param tMax Maximum time until the current kernel is resolved.
78 /// @param errorGoal Error goal of the current kernel computation.
79 /// @param block Computes the complete current kernel if \a block==-1, otherwise
80 /// computes only a single block with index \a block.
81 ///
83 const std::unique_ptr<Model>& model,
84 int r,
85 Order order,
86 SciCore::Real tMax,
87 SciCore::Real errorGoal,
88 int block = -1)
89 {
90 _initialize(model.get(), r, order, tMax, errorGoal, nullptr, block);
91 }
92
93 ///
94 /// @brief Computes the current kernel for a given model in parallel.
95 ///
96 /// Computes the current kernel for a given model in parallel.
97 ///
98 /// @param model The model for which the current kernel is computed.
99 /// @param r Index of the reservoir \f$ r=0,1,\dots \f$
100 /// @param order The order of the renormalized perturbation series.
101 /// @param tMax Maximum time until the current kernel is resolved.
102 /// @param errorGoal Error goal of the current kernel computation.
103 /// @param executor An excecutor managing multiple threads.
104 /// @param block Computes the complete current kernel if \a block==-1, otherwise
105 /// computes only a single block with index \a block.
106 ///
108 const std::unique_ptr<Model>& model,
109 int r,
110 Order order,
111 SciCore::Real tMax,
112 SciCore::Real errorGoal,
113 tf::Executor& executor,
114 int block = -1)
115 {
116 _initialize(model.get(), r, order, tMax, errorGoal, &executor, block);
117 }
118
119 ///
120 /// @brief Returns a pointer to the model.
121 ///
122 const Model* model() const noexcept;
123
124 ///
125 /// @brief Returns the reservoir index for which the current kernel was computed.
126 ///
127 int r() const noexcept;
128
129 ///
130 /// @brief Returns the maximum simulation time.
131 ///
132 SciCore::Real tMax() const;
133
134 ///
135 /// @brief Returns the error goal of the computation.
136 ///
137 SciCore::Real errorGoal() const noexcept;
138
139 ///
140 /// @brief Returns \f$ -i \Sigma_{\infty} \f$, where \f$ \Sigma_{\infty} \f$ denotes the infinite temperature current kernel.
141 ///
142 const Model::SuperRowVectorType& SigmaInfty() const noexcept;
143
144 ///
145 /// @brief Returns \f$ -i K \f$, where \f$ K \f$ denotes the current kernel.
146 ///
147 const SciCore::ChebAdaptive<Model::SuperRowVectorType>& K() const noexcept;
148
149 ///
150 /// @brief Returns \f$-i \Sigma_{\infty} -i K(0)\f$, where \f$\Sigma_{\infty}\f$ denotes infinite temperature current kernel and \f$K(0)\f$ the current kernel at zero frequency.
151 ///
153
154 ///
155 /// @brief Returns the stationary current.
156 ///
158
159 template <class Archive>
160 void serialize(Archive& archive)
161 {
162 archive(_model, _r, _errorGoal, _minusISigmaInfty, _minusIK);
163 }
164
165 private:
166 std::unique_ptr<Model> _model;
167 int _r;
168 SciCore::Real _errorGoal;
169
170 Model::SuperRowVectorType _minusISigmaInfty;
171 SciCore::ChebAdaptive<Model::SuperRowVectorType> _minusIK;
172
173 void _initialize(
174 const Model* model,
175 int r,
176 Order order,
177 SciCore::Real tMax,
178 SciCore::Real errorGoal,
179 tf::Executor* executor,
180 int block);
181};
182
183} // namespace RenormalizedPT
184
185///
186/// @ingroup RenPT
187///
188/// @brief Computes the current kernel for a given model.
189///
190/// Computes the current kernel for a given model.
191///
192/// @param model The model for which the current kernel is computed.
193/// @param r Index of the reservoir \f$ r=0,1,\dots \f$
194/// @param order The order of the renormalized perturbation series.
195/// @param tMax Maximum time until the current kernel is resolved.
196/// @param errorGoal Error goal of the current kernel computation.
197/// @param block Computes the complete current kernel if \a block==-1, otherwise
198/// computes only a single block with index \a block.
199///
201 const std::unique_ptr<Model>& model,
202 int r,
203 RenormalizedPT::Order order,
204 SciCore::Real tMax,
205 SciCore::Real errorGoal,
206 int block = -1)
207{
208 return RenormalizedPT::CurrentKernel(model, r, order, tMax, errorGoal, block);
209}
210
211///
212/// @ingroup RenPT
213///
214/// @brief Computes the current kernel for a given model in parallel.
215///
216/// Computes the current kernel for a given model in parallel.
217///
218/// @param model The model for which the current kernel is computed.
219/// @param r Index of the reservoir \f$ r=0,1,\dots \f$
220/// @param order The order of the renormalized perturbation series.
221/// @param tMax Maximum time until the current kernel is resolved.
222/// @param errorGoal Error goal of the current kernel computation.
223/// @param executor An excecutor managing multiple threads.
224/// @param block Computes the complete current kernel if \a block==-1, otherwise
225/// computes only a single block with index \a block.
226///
228 const std::unique_ptr<Model>& model,
229 int r,
230 RenormalizedPT::Order order,
231 SciCore::Real tMax,
232 SciCore::Real errorGoal,
233 tf::Executor& executor,
234 int block = -1)
235{
236 return RenormalizedPT::CurrentKernel(model, r, order, tMax, errorGoal, executor, block);
237}
238
239///
240/// @ingroup RenPT
241///
242/// @brief Computes the transient current for a given initial state.
243///
244/// Computes the transient current for a given initial state.
245///
246/// @param KCurrent The current kernel.
247/// @param propagator The propagator of the dynamics.
248/// @param rho0 The initial state.
249///
252 const Propagator& propagator,
253 const Model::OperatorType& rho0);
254
255} // namespace RealTimeTransport
256
257#endif // REAL_TIME_TRANSPORT_RENORMALIZED_PT_CURRENT_KERNEL_H
#define REALTIMETRANSPORT_EXPORT
Definition RealTimeTransport_export.h:15
Abstract class representing a model.
Definition Model.h:47
Defines the renormalized current kernel.
Definition RenormalizedPT/CurrentKernel.h:35
const Model * model() const noexcept
Returns a pointer to the model.
CurrentKernel & operator=(const CurrentKernel &other)
Copy assignment operator.
SciCore::Real tMax() const
Returns the maximum simulation time.
Model::SuperRowVectorType zeroFrequency() const
Returns , where denotes infinite temperature current kernel and the current kernel at zero frequenc...
CurrentKernel(const CurrentKernel &other)
Copy constructor.
const SciCore::ChebAdaptive< Model::SuperRowVectorType > & K() const noexcept
Returns , where denotes the current kernel.
CurrentKernel(CurrentKernel &&other) noexcept
Move constructor.
SciCore::Real errorGoal() const noexcept
Returns the error goal of the computation.
int r() const noexcept
Returns the reservoir index for which the current kernel was computed.
SciCore::Real stationaryCurrent(const Model::OperatorType &stationaryState) const
Returns the stationary current.
CurrentKernel & operator=(CurrentKernel &&other)
Move assignment operator.
CurrentKernel(const std::unique_ptr< Model > &model, int r, Order order, SciCore::Real tMax, SciCore::Real errorGoal, tf::Executor &executor, int block=-1)
Computes the current kernel for a given model in parallel.
Definition RenormalizedPT/CurrentKernel.h:107
CurrentKernel(const std::unique_ptr< Model > &model, int r, Order order, SciCore::Real tMax, SciCore::Real errorGoal, int block=-1)
Computes the current kernel for a given model.
Definition RenormalizedPT/CurrentKernel.h:82
const Model::SuperRowVectorType & SigmaInfty() const noexcept
Returns , where denotes the infinite temperature current kernel.
REALTIMETRANSPORT_EXPORT RenormalizedPT::CurrentKernel computeCurrentKernel(const std::unique_ptr< Model > &model, int r, RenormalizedPT::Order order, SciCore::Real tMax, SciCore::Real errorGoal, int block=-1)
Computes the current kernel for a given model.
Definition RenormalizedPT/CurrentKernel.h:200
REALTIMETRANSPORT_EXPORT RenormalizedPT::CurrentKernel computeCurrentKernel(const std::unique_ptr< Model > &model, int r, RenormalizedPT::Order order, SciCore::Real tMax, SciCore::Real errorGoal, tf::Executor &executor, int block=-1)
Computes the current kernel for a given model in parallel.
Definition RenormalizedPT/CurrentKernel.h:227
REALTIMETRANSPORT_EXPORT SciCore::ChebAdaptive< SciCore::Real > computeCurrent(const RenormalizedPT::CurrentKernel &KCurrent, const Propagator &propagator, const Model::OperatorType &rho0)
Computes the transient current for a given initial state.
Order
Defines the order of the approximation.
Definition RenormalizedPT/MemoryKernel.h:41