Quantum Phenomena Explorer 7.9.8
Interactive quantum-phenomena Explorer Tutor — source documentation
Loading...
Searching...
No Matches
observablestimeseries2d.h
Go to the documentation of this file.
1/**
2 * @file observablestimeseries2d.h
3 * @brief Declares the observablestimeseries2d physics/numerical component used by QPE experiments.
4 * @ingroup qpe_quantum
5 *
6 * Source: @c core/quantum/observablestimeseries2d.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
14#include <cstddef>
15#include <vector>
16
17namespace qpe {
18
19/**
20 * @brief Data record containing Observables Time Series2D Sample.
21 *
22 * The structure carries computed data without coupling the numerical component to the GUI or renderer.
23 */
25{
26 double time = 0.0;
27 double meanX = 0.0;
28 double meanY = 0.0;
29 double sigmaX = 0.0;
30 double sigmaY = 0.0;
31 double norm = 0.0;
32 double absorbedProbability = 0.0;
35 double kineticEnergy = 0.0;
36 double potentialEnergy = 0.0;
37 double totalEnergy = 0.0;
38 double energyDriftPercent = 0.0;
39 bool hasScattering = false;
40
41 // Step 20: coherent tunnelling in a symmetric double well.
42 double leftWellProbability = 0.0;
45 bool hasDoubleWell = false;
46
47 // Step 23: projection of the live 2D wavefunction onto the two lowest
48 // stationary states of the undriven double well.
49 double twoLevelPopulationA = 0.0;
50 double twoLevelPopulationB = 0.0;
52 bool hasDrivenTwoLevel = false;
53
54 // Step 24: Landau-Zener projections in the zero-bias two-state basis and
55 // its instantaneous adiabatic rotation.
61 bool hasLandauZener = false;
62
63 // Step 25: double-passage Landau-Zener-Stueckelberg interferometry.
69 bool hasStueckelberg = false;
70
71 // Step 26: Ramsey pulse-sequence populations in the stationary two-level
72 // basis. These are projections of the live 2D field, not a separate state.
73 double ramseyPopulationA = 0.0;
74 double ramseyPopulationB = 0.0;
76 bool hasRamsey = false;
77};
78
79// Small bounded history used by the Analysis dock. It deliberately stores
80// already-computed observables rather than wavefunction snapshots, so memory
81// use stays tiny even for long runs and large 2D grids.
82/**
83 * @brief Implements the Observables Time Series2D component.
84 *
85 * The class provides one focused service within the QPE architecture and is documented here independently of the experiment-level Help.
86 */
88{
89public:
90 /**
91 * @brief Constructs a Observables Time Series 2D instance.
92 * @param maximumSamples The maximum samples value used by the operation.
93 */
94 explicit ObservablesTimeSeries2D(std::size_t maximumSamples = 4096u);
95
96 /**
97 * @brief Clears stored state and returns the component to its empty/default state.
98 */
99 void clear() noexcept;
100 /**
101 * @brief Sets maximum samples.
102 * @param maximumSamples The maximum samples value used by the operation.
103 */
104 void setMaximumSamples(std::size_t maximumSamples);
105 /**
106 * @brief Carries out maximum samples.
107 */
108 std::size_t maximumSamples() const noexcept { return maximumSamples_; }
109
110 /**
111 * @brief Carries out append.
112 * @param sample The sample value used by the operation.
113 */
114 void append(const ObservablesTimeSeries2DSample &sample);
115
116 /**
117 * @brief Samples s.
118 */
119 const std::vector<ObservablesTimeSeries2DSample> &samples() const noexcept
120 {
121 return samples_;
122 }
123
124 /**
125 * @brief Returns whether the object contains no data.
126 * @param empty The empty value used by the operation.
127 */
128 bool empty() const noexcept { return samples_.empty(); }
129 /**
130 * @brief Returns size.
131 * @param size The size value used by the operation.
132 */
133 std::size_t size() const noexcept { return samples_.size(); }
134
135private:
136 /**
137 * @brief Carries out trim to limit.
138 */
139 void trimToLimit();
140
141 std::size_t maximumSamples_ = 4096u;
142 std::vector<ObservablesTimeSeries2DSample> samples_;
143};
144
145} // namespace qpe
Implements the Observables Time Series2D component.
void setMaximumSamples(std::size_t maximumSamples)
Sets maximum samples.
void clear() noexcept
Clears stored state and returns the component to its empty/default state.
std::size_t size() const noexcept
Returns size.
bool empty() const noexcept
Returns whether the object contains no data.
ObservablesTimeSeries2D(std::size_t maximumSamples=4096u)
Constructs a Observables Time Series 2D instance.
std::size_t maximumSamples() const noexcept
Carries out maximum samples.
std::vector< ObservablesTimeSeries2DSample > samples_
const std::vector< ObservablesTimeSeries2DSample > & samples() const noexcept
Samples s.
void append(const ObservablesTimeSeries2DSample &sample)
Carries out append.
void trimToLimit()
Carries out trim to limit.
Data record containing Observables Time Series2D Sample.