Quantum Phenomena Explorer 7.9.8
Interactive quantum-phenomena Explorer Tutor — source documentation
Loading...
Searching...
No Matches
timedependentpotential2d.h
Go to the documentation of this file.
1/**
2 * @file timedependentpotential2d.h
3 * @brief Declares the timedependentpotential2d physics/numerical component used by QPE experiments.
4 * @ingroup qpe_quantum
5 *
6 * Source: @c core/quantum/timedependentpotential2d.h. This file is part of Quantum Phenomena Explorer (QPE),
7 * maintained by Officina Turini. See LICENSE_IT.txt / LICENSE.txt for the
8 * QPE freeware source-available terms and THIRD_PARTY_NOTICES.txt for
9 * third-party components.
10 */
11
12#pragma once
13
15
16#include <cstdint>
17
18namespace qpe {
19
20// A compact vocabulary for parameters that may be controlled by H(t).
21/**
22 * @brief Enumerates the supported Time Potential Parameter2D values.
23 *
24 * The enumeration is part of the typed interface used to keep experiment configuration and analysis routing explicit.
25 */
27{
28 ObjectValue = 0,
29 CenterX = 1,
30 CenterY = 2,
34 LinearSlopeX = 6,
35 LinearSlopeY = 7
36};
37
38// Step 21: abrupt one-shot change.
39/**
40 * @brief Configuration values for Quantum Quench2D Config.
41 *
42 * The structure groups parameters that are passed together so the associated numerical/analysis component can be configured reproducibly.
43 */
53
54/**
55 * @brief Data record containing Quantum Quench2D State.
56 *
57 * The structure carries computed data without coupling the numerical component to the GUI or renderer.
58 */
60{
61 bool valid = false;
62 bool fired = false;
63 double currentValue = 0.0;
64};
65
66// Step 22: smooth sinusoidal drive. The controlled parameter follows
67// q(t)=meanValue+amplitude*sin(angularFrequency*t+phase).
68/**
69 * @brief Configuration values for Periodic Potential Drive2D Config.
70 *
71 * The structure groups parameters that are passed together so the associated numerical/analysis component can be configured reproducibly.
72 */
83
84/**
85 * @brief Data record containing Periodic Potential Drive2D State.
86 *
87 * The structure carries computed data without coupling the numerical component to the GUI or renderer.
88 */
90{
91 bool valid = false;
92 double currentValue = 0.0;
93 double phaseRadians = 0.0;
94};
95
96// Step 24: finite linear sweep. The controlled parameter is held at
97// startValue before startTime, ramps linearly to endValue during duration,
98// then remains at endValue. This is the drive used for adiabatic passage /
99// Landau-Zener experiments.
100/**
101 * @brief Configuration values for Linear Potential Sweep2D Config.
102 *
103 * The structure groups parameters that are passed together so the associated numerical/analysis component can be configured reproducibly.
104 */
106{
107 bool enabled = false;
108 std::uint64_t targetObjectId = 0;
110 double startValue = 0.35;
111 double endValue = -0.35;
112 double startTime = 0.0;
113 double duration = 40.0;
114
115 // Step 25: optional return passage for Landau-Zener-Stueckelberg
116 // interferometry. When enabled, the parameter ramps Start -> End during
117 // duration, waits at End for holdDuration, then ramps End -> Start during
118 // returnDuration. Step-24 one-way sweeps keep this disabled.
119 bool returnEnabled = false;
120 double holdDuration = 0.0;
121 double returnDuration = 4.0;
122};
123
124
125// Step 26: Ramsey pulse sequence. Two finite sinusoidal pulses are separated
126// by a field-free evolution interval. Each pulse starts with its own local
127// phase reference, so the otherwise invisible phase accumulated by psi during
128// the free interval is converted into a final population difference.
129/**
130 * @brief Configuration values for Ramsey Pulse Sequence2D Config.
131 *
132 * The structure groups parameters that are passed together so the associated numerical/analysis component can be configured reproducibly.
133 */
135{
136 bool enabled = false;
137 std::uint64_t targetObjectId = 0;
139 double meanValue = 0.0;
140 double amplitude = 0.10;
141 double angularFrequency = 0.305536;
144 double startTime = 0.0;
145 double pulseDuration = 14.35;
147
148 // Step 27: optional Hahn-echo refocusing pulse. When enabled the free
149 // interval is split in half and a pi pulse is inserted between the two
150 // halves: pi/2 -> tau/2 -> pi -> tau/2 -> pi/2.
151 bool echoEnabled = false;
152 double echoPulseDuration = 28.70;
154};
155
156/**
157 * @brief Enumerates the supported Ramsey Pulse Segment2D values.
158 *
159 * The enumeration is part of the typed interface used to keep experiment configuration and analysis routing explicit.
160 */
162{
163 Before = 0,
164 FirstPulse = 1,
165 FreeEvolution = 2,
166 EchoFreeFirst = 3,
167 EchoPulse = 4,
168 EchoFreeSecond = 5,
169 SecondPulse = 6,
170 Finished = 7
171};
172
173/**
174 * @brief Data record containing Ramsey Pulse Sequence2D State.
175 *
176 * The structure carries computed data without coupling the numerical component to the GUI or renderer.
177 */
186
187/**
188 * @brief Data record containing Linear Potential Sweep2D State.
189 *
190 * The structure carries computed data without coupling the numerical component to the GUI or renderer.
191 */
193{
194 bool valid = false;
195 bool finished = false;
196 bool returning = false;
197 bool holding = false;
198 double currentValue = 0.0;
199 double progress = 0.0;
200};
201
202/**
203 * @brief Implements the Time Dependent Potential2D component.
204 *
205 * The class provides one focused service within the QPE architecture and is documented here independently of the experiment-level Help.
206 */
208{
209public:
210 /**
211 * @brief Performs validate.
212 * @param scene The scene value used by the operation.
213 * @param config Configuration to apply.
214 */
215 static bool validate(const PotentialScene2D &scene,
216 const QuantumQuench2DConfig &config) noexcept;
217
218 /**
219 * @brief Validates periodic.
220 * @param scene The scene value used by the operation.
221 * @param config Configuration to apply.
222 */
223 static bool validatePeriodic(const PotentialScene2D &scene,
224 const PeriodicPotentialDrive2DConfig &config) noexcept;
225
226 /**
227 * @brief Validates sweep.
228 * @param scene The scene value used by the operation.
229 * @param config Configuration to apply.
230 */
231 static bool validateSweep(const PotentialScene2D &scene,
232 const LinearPotentialSweep2DConfig &config) noexcept;
233
234 /**
235 * @brief Validates ramsey.
236 * @param scene The scene value used by the operation.
237 * @param config Configuration to apply.
238 */
239 static bool validateRamsey(const PotentialScene2D &scene,
240 const RamseyPulseSequence2DConfig &config) noexcept;
241
242 /**
243 * @brief Applies parameter.
244 * @param object The object value used by the operation.
245 * @param parameter The parameter value used by the operation.
246 * @param value Value to assign or evaluate.
247 */
248 static bool applyParameter(PotentialObject2D &object,
249 TimePotentialParameter2D parameter,
250 double value) noexcept;
251
252 /**
253 * @brief Performs parameter value.
254 * @param object The object value used by the operation.
255 * @param parameter The parameter value used by the operation.
256 * @param value Value to assign or evaluate.
257 */
258 static bool parameterValue(const PotentialObject2D &object,
259 TimePotentialParameter2D parameter,
260 double &value) noexcept;
261
262 /**
263 * @brief Performs periodic value.
264 * @param config Configuration to apply.
265 * @param time Simulation time in solver units.
266 */
267 static double periodicValue(const PeriodicPotentialDrive2DConfig &config,
268 double time) noexcept;
269
270 /**
271 * @brief Performs sweep value.
272 * @param config Configuration to apply.
273 * @param time Simulation time in solver units.
274 */
275 static double sweepValue(const LinearPotentialSweep2DConfig &config,
276 double time) noexcept;
277
278 /**
279 * @brief Performs sweep total duration.
280 * @param config Configuration to apply.
281 */
282 static double sweepTotalDuration(const LinearPotentialSweep2DConfig &config) noexcept;
283
284 /**
285 * @brief Performs ramsey value.
286 * @param config Configuration to apply.
287 * @param time Simulation time in solver units.
288 */
289 static double ramseyValue(const RamseyPulseSequence2DConfig &config,
290 double time) noexcept;
291
292 /**
293 * @brief Performs ramsey total duration.
294 * @param config Configuration to apply.
295 */
296 static double ramseyTotalDuration(const RamseyPulseSequence2DConfig &config) noexcept;
297
298 /**
299 * @brief Performs ramsey segment.
300 * @param config Configuration to apply.
301 * @param time Simulation time in solver units.
302 * @param localPulseTime Time value expressed in the units documented by the calling component.
303 */
305 const RamseyPulseSequence2DConfig &config,
306 double time,
307 double *localPulseTime = nullptr) noexcept;
308
309 // Rasterize the scene at a requested simulation time. For t < quenchTime
310 // the configured beforeValue is used; for t >= quenchTime afterValue is
311 // used. This makes reset/replay deterministic and also lets the solver use
312 // the midpoint time of a split step when deciding whether the quench has
313 // happened.
314 /**
315 * @brief Performs rasterize.
316 * @param baseScene The base scene value used by the operation.
317 * @param config Configuration to apply.
318 * @param time Simulation time in solver units.
319 * @param target The target value used by the operation.
320 */
321 static QuantumQuench2DState rasterize(const PotentialScene2D &baseScene,
322 const QuantumQuench2DConfig &config,
323 double time,
324 PotentialField2D &target);
325
326 // Rasterize a sinusoidally driven scene without modifying baseScene.
327 /**
328 * @brief Performs rasterize periodic.
329 * @param baseScene The base scene value used by the operation.
330 * @param config Configuration to apply.
331 * @param time Simulation time in solver units.
332 * @param target The target value used by the operation.
333 */
335 const PotentialScene2D &baseScene,
336 const PeriodicPotentialDrive2DConfig &config,
337 double time,
338 PotentialField2D &target);
339
340 /**
341 * @brief Performs rasterize sweep.
342 * @param baseScene The base scene value used by the operation.
343 * @param config Configuration to apply.
344 * @param time Simulation time in solver units.
345 * @param target The target value used by the operation.
346 */
348 const PotentialScene2D &baseScene,
349 const LinearPotentialSweep2DConfig &config,
350 double time,
351 PotentialField2D &target);
352
353
354 /**
355 * @brief Performs rasterize ramsey.
356 * @param baseScene The base scene value used by the operation.
357 * @param config Configuration to apply.
358 * @param time Simulation time in solver units.
359 * @param target The target value used by the operation.
360 */
362 const PotentialScene2D &baseScene,
363 const RamseyPulseSequence2DConfig &config,
364 double time,
365 PotentialField2D &target);
366};
367
368} // namespace qpe
Implements the Potential Field2D component.
Implements the Potential Scene2D component.
Implements the Time Dependent Potential2D component.
static RamseyPulseSequence2DState rasterizeRamsey(const PotentialScene2D &baseScene, const RamseyPulseSequence2DConfig &config, double time, PotentialField2D &target)
Performs rasterize ramsey.
static bool parameterValue(const PotentialObject2D &object, TimePotentialParameter2D parameter, double &value) noexcept
Performs parameter value.
static bool validatePeriodic(const PotentialScene2D &scene, const PeriodicPotentialDrive2DConfig &config) noexcept
Validates periodic.
static bool validateSweep(const PotentialScene2D &scene, const LinearPotentialSweep2DConfig &config) noexcept
Validates sweep.
static double sweepValue(const LinearPotentialSweep2DConfig &config, double time) noexcept
Performs sweep value.
static bool validateRamsey(const PotentialScene2D &scene, const RamseyPulseSequence2DConfig &config) noexcept
Validates ramsey.
static RamseyPulseSegment2D ramseySegment(const RamseyPulseSequence2DConfig &config, double time, double *localPulseTime=nullptr) noexcept
Performs ramsey segment.
static bool applyParameter(PotentialObject2D &object, TimePotentialParameter2D parameter, double value) noexcept
Applies parameter.
static double ramseyValue(const RamseyPulseSequence2DConfig &config, double time) noexcept
Performs ramsey value.
static double ramseyTotalDuration(const RamseyPulseSequence2DConfig &config) noexcept
Performs ramsey total duration.
static PeriodicPotentialDrive2DState rasterizePeriodic(const PotentialScene2D &baseScene, const PeriodicPotentialDrive2DConfig &config, double time, PotentialField2D &target)
Performs rasterize periodic.
static double sweepTotalDuration(const LinearPotentialSweep2DConfig &config) noexcept
Performs sweep total duration.
static QuantumQuench2DState rasterize(const PotentialScene2D &baseScene, const QuantumQuench2DConfig &config, double time, PotentialField2D &target)
Performs rasterize.
static bool validate(const PotentialScene2D &scene, const QuantumQuench2DConfig &config) noexcept
Performs validate.
static double periodicValue(const PeriodicPotentialDrive2DConfig &config, double time) noexcept
Performs periodic value.
static LinearPotentialSweep2DState rasterizeSweep(const PotentialScene2D &baseScene, const LinearPotentialSweep2DConfig &config, double time, PotentialField2D &target)
Performs rasterize sweep.
TimePotentialParameter2D
Enumerates the supported Time Potential Parameter2D values.
RamseyPulseSegment2D
Enumerates the supported Ramsey Pulse Segment2D values.
Declares the potentialscene2d physics/numerical component used by QPE experiments.
Configuration values for Linear Potential Sweep2D Config.
Data record containing Linear Potential Sweep2D State.
Configuration values for Periodic Potential Drive2D Config.
Data record containing Periodic Potential Drive2D State.
Data structure used by the Potential Object2D component.
Configuration values for Quantum Quench2D Config.
TimePotentialParameter2D parameter
Data record containing Quantum Quench2D State.
Configuration values for Ramsey Pulse Sequence2D Config.
Data record containing Ramsey Pulse Sequence2D State.