RealTimeTransport 1.0.0
Real-time simulation of quantum transport processes
Loading...
Searching...
No Matches
RenormalizedPT/MemoryKernel.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 MemoryKernel.h
9///
10/// \brief Renormalized perturbation theory memory kernel.
11///
12
13#ifndef REAL_TIME_TRANSPORT_RENORMALIZED_PT_MEMORY_KERNEL_H
14#define REAL_TIME_TRANSPORT_RENORMALIZED_PT_MEMORY_KERNEL_H
15
16#include "../BlockMatrices/BlockDiagonalCheb.h"
17#include "../Model.h"
18#include "../Propagator.h"
19#include "../RealTimeTransport_export.h"
20
21namespace RealTimeTransport
22{
23
24namespace RenormalizedPT
25{
26
27///
28/// \defgroup RenPT 2. Renormalized perturbation theory
29///
30/// \brief Implementation of the renormalized perturbation theory.
31///
32/// This page ontains classes and methods related to the implementation of the renormalized perturbation theory.
33///
34/// \{
35///
36
37///
38/// @brief Defines the order of the approximation.
39///
40enum class Order
41{
42 /// @brief Leading order.
43 _1 = 1,
44
45 /// @brief Next-to-leading order.
46 _2 = 2
47};
48
49///
50/// @brief Defines the renormalized memory kernel.
51///
52/// Defines the memory kernel computed via the renormalized perturbation theory.
53///
55{
56 public:
57 /// @brief Constructor.
58 MemoryKernel() noexcept;
59
60 /// @brief Move constructor.
61 MemoryKernel(MemoryKernel&& other) noexcept;
62
63 /// @brief Copy constructor.
65
66 /// @brief Move assignment operator.
68
69 /// @brief Copy assignment operator.
71
72 MemoryKernel(const Model* model, Order order, SciCore::Real tMax, SciCore::Real errorGoal, int block = -1)
73 {
74 initialize(model, order, tMax, errorGoal, nullptr, block);
75 }
76
77 MemoryKernel(
78 const Model* model,
79 Order order,
80 SciCore::Real tMax,
81 SciCore::Real errorGoal,
82 tf::Executor& executor,
83 int block = -1)
84 {
85 initialize(model, order, tMax, errorGoal, &executor, block);
86 }
87
88 ///
89 /// @brief Computes the memory kernel for a given model.
90 ///
91 /// Computes the memory kernel for a given model.
92 ///
93 /// @param model The model for which the memory kernel is computed.
94 /// @param order The order of the renormalized perturbation series.
95 /// @param tMax Maximum time until the memory kernel is resolved.
96 /// @param errorGoal Error goal of the memory kernel computation.
97 /// @param block Computes the complete memory kernel if \a block==-1, otherwise
98 /// computes only a single block with index \a block.
99 ///
101 const std::unique_ptr<Model>& model,
102 Order order,
103 SciCore::Real tMax,
104 SciCore::Real errorGoal,
105 int block = -1)
106 {
107 initialize(model.get(), order, tMax, errorGoal, nullptr, block);
108 }
109
110 ///
111 /// @brief Computes the memory mernel for a given model in parallel.
112 ///
113 /// Computes the memory mernel for a given model in parallel.
114 ///
115 /// @param model The model for which the memory kernel is computed.
116 /// @param order The order of the renormalized perturbation series.
117 /// @param tMax Maximum time until the memory kernel is resolved.
118 /// @param errorGoal Error goal of the memory kernel computation.
119 /// @param executor An excecutor managing multiple threads.
120 /// @param block Computes the complete memory kernel if \a block==-1, otherwise
121 /// computes only a single block with index \a block.
122 ///
124 const std::unique_ptr<Model>& model,
125 Order order,
126 SciCore::Real tMax,
127 SciCore::Real errorGoal,
128 tf::Executor& executor,
129 int block = -1)
130 {
131 initialize(model.get(), order, tMax, errorGoal, &executor, block);
132 }
133
134 void initialize(
135 const Model* model,
136 Order order,
137 SciCore::Real tMax,
138 SciCore::Real errorGoal,
139 tf::Executor* executor = nullptr,
140 int block = -1,
141 SciCore::Real hMin = -1,
142 const std::vector<SciCore::RealVector>* initialChebSections = nullptr);
143
144 ///
145 /// @brief Operator testing for equality.
146 ///
147 bool operator==(const MemoryKernel& other) const noexcept;
148
149 ///
150 /// @brief Operator testing for inequality.
151 ///
152 bool operator!=(const MemoryKernel& other) const noexcept;
153
154 ///
155 /// @brief Returns a pointer to the model.
156 ///
157 const Model* model() const noexcept;
158
159 ///
160 /// @brief Returns the maximum simulation time.
161 ///
162 SciCore::Real tMax() const;
163
164 ///
165 /// @brief Returns the error goal of the computation.
166 ///
167 SciCore::Real errorGoal() const noexcept;
168
169 ///
170 /// @brief Returns the renormalized Liouvillian \f$-i L_{\infty}\f$.
171 ///
172 const BlockDiagonalMatrix& LInfty() const noexcept;
173
174 ///
175 /// @brief Returns \f$-i K(t)\f$, where \f$K(t)\f$ denotes the renormalized memory kernel.
176 ///
177 BlockDiagonalCheb& K() noexcept;
178
179 ///
180 /// @brief Returns \f$-i K(t)\f$, where \f$K(t)\f$ denotes the renormalized memory kernel.
181 ///
182 const BlockDiagonalCheb& K() const noexcept;
183
184 ///
185 /// @brief Returns \f$-i L_{\infty} -i \hat K(0)\f$, where \f$L_{\infty}\f$ denotes the renormalized Liouvillian and \f$\hat K(0)\f$ the renormalized memory kernel at zero frequency.
186 ///
188
189 ///
190 /// @brief Returns the stationary state. This method assumes that the stationary state is unique.
191 ///
193
194 template <class Archive>
195 void serialize(Archive& archive)
196 {
197 archive(_model, _errorGoal, _minusILInfty, _minusIK);
198 }
199
200 private:
201 std::unique_ptr<Model> _model;
202 SciCore::Real _errorGoal;
203
204 BlockDiagonalMatrix _minusILInfty;
205 BlockDiagonalCheb _minusIK;
206};
207
208/// \} // end of RenPT
209
210} // namespace RenormalizedPT
211
212///
213/// @ingroup RenPT
214///
215/// @brief Computes the memory kernel for a given model.
216///
217/// Computes the memory kernel for a given model.
218///
219/// @param model The model for which the memory kernel is computed.
220/// @param order The order of the renormalized perturbation series.
221/// @param tMax Maximum time until the memory kernel is resolved.
222/// @param errorGoal Error goal of the memory kernel computation.
223/// @param block Computes the complete memory kernel if \a block==-1, otherwise
224/// computes only a single block with index \a block.
225///
227 const std::unique_ptr<Model>& model,
228 RenormalizedPT::Order order,
229 SciCore::Real tMax,
230 SciCore::Real errorGoal,
231 int block = -1)
232{
233 return RenormalizedPT::MemoryKernel(model, order, tMax, errorGoal, block);
234}
235
236///
237/// @ingroup RenPT
238///
239/// @brief Computes the memory mernel for a given model in parallel.
240///
241/// Computes the memory mernel for a given model in parallel.
242///
243/// @param model The model for which the memory kernel is computed.
244/// @param order The order of the renormalized perturbation series.
245/// @param tMax Maximum time until the memory kernel is resolved.
246/// @param errorGoal Error goal of the memory kernel computation.
247/// @param executor An excecutor managing multiple threads.
248/// @param block Computes the complete memory kernel if \a block==-1, otherwise
249/// computes only a single block with index \a block.
250///
252 const std::unique_ptr<Model>& model,
253 RenormalizedPT::Order order,
254 SciCore::Real tMax,
255 SciCore::Real errorGoal,
256 tf::Executor& executor,
257 int block = -1)
258{
259 return RenormalizedPT::MemoryKernel(model, order, tMax, errorGoal, executor, block);
260}
261
262///
263/// @ingroup RenPT
264///
265/// @brief Computes the propagator corresponding to a given memory kernel.
266///
267/// Computes the propagator corresponding to a given memory kernel. This is done my numerically
268/// solving the time-nonlocal master equation.
269///
270/// @param memoryKernel The memory kernel.
271/// @param block Computes the complete propagator if \a block==-1, otherwise
272/// computes only a single block with index \a block.
273///
274REALTIMETRANSPORT_EXPORT Propagator computePropagator(const RenormalizedPT::MemoryKernel& memoryKernel, int block = -1);
275
276} // namespace RealTimeTransport
277
278#endif // REAL_TIME_TRANSPORT_RENORMALIZED_PT_MEMORY_KERNEL_H
#define REALTIMETRANSPORT_EXPORT
Definition RealTimeTransport_export.h:15
This class represents a parameter dependent block diagonal matrix.
Definition BlockDiagonalCheb.h:54
Represents a block diagonal matrix.
Definition BlockDiagonalMatrix.h:33
Abstract class representing a model.
Definition Model.h:47
Type representing the propagator (dynamical map).
Definition Propagator.h:23
Defines the renormalized memory kernel.
Definition RenormalizedPT/MemoryKernel.h:55
const BlockDiagonalCheb & K() const noexcept
Returns , where denotes the renormalized memory kernel.
MemoryKernel(const MemoryKernel &other)
Copy constructor.
SciCore::Real errorGoal() const noexcept
Returns the error goal of the computation.
bool operator!=(const MemoryKernel &other) const noexcept
Operator testing for inequality.
MemoryKernel(const std::unique_ptr< Model > &model, Order order, SciCore::Real tMax, SciCore::Real errorGoal, tf::Executor &executor, int block=-1)
Computes the memory mernel for a given model in parallel.
Definition RenormalizedPT/MemoryKernel.h:123
MemoryKernel(MemoryKernel &&other) noexcept
Move constructor.
Model::OperatorType stationaryState(int block=-1) const
Returns the stationary state. This method assumes that the stationary state is unique.
MemoryKernel & operator=(MemoryKernel &&other)
Move assignment operator.
bool operator==(const MemoryKernel &other) const noexcept
Operator testing for equality.
BlockDiagonalMatrix zeroFrequency() const
Returns , where denotes the renormalized Liouvillian and the renormalized memory kernel at zero fre...
const Model * model() const noexcept
Returns a pointer to the model.
MemoryKernel(const std::unique_ptr< Model > &model, Order order, SciCore::Real tMax, SciCore::Real errorGoal, int block=-1)
Computes the memory kernel for a given model.
Definition RenormalizedPT/MemoryKernel.h:100
const BlockDiagonalMatrix & LInfty() const noexcept
Returns the renormalized Liouvillian .
BlockDiagonalCheb & K() noexcept
Returns , where denotes the renormalized memory kernel.
MemoryKernel & operator=(const MemoryKernel &other)
Copy assignment operator.
SciCore::Real tMax() const
Returns the maximum simulation time.
REALTIMETRANSPORT_EXPORT RenormalizedPT::MemoryKernel computeMemoryKernel(const std::unique_ptr< Model > &model, RenormalizedPT::Order order, SciCore::Real tMax, SciCore::Real errorGoal, int block=-1)
Computes the memory kernel for a given model.
Definition RenormalizedPT/MemoryKernel.h:226
Order
Defines the order of the approximation.
Definition RenormalizedPT/MemoryKernel.h:41
REALTIMETRANSPORT_EXPORT RenormalizedPT::MemoryKernel computeMemoryKernel(const std::unique_ptr< Model > &model, RenormalizedPT::Order order, SciCore::Real tMax, SciCore::Real errorGoal, tf::Executor &executor, int block=-1)
Computes the memory mernel for a given model in parallel.
Definition RenormalizedPT/MemoryKernel.h:251
REALTIMETRANSPORT_EXPORT Propagator computePropagator(const RenormalizedPT::MemoryKernel &memoryKernel, int block=-1)
Computes the propagator corresponding to a given memory kernel.