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