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