Quantum Phenomena Explorer 7.9.8
Interactive quantum-phenomena Explorer Tutor — source documentation
Loading...
Searching...
No Matches
experimentdocument2d.h
Go to the documentation of this file.
1/**
2 * @file experimentdocument2d.h
3 * @brief Declares the schema-28 experiment persistence document and JSON conversion API.
4 * @ingroup qpe_experiments
5 *
6 * Source: @c core/experiments/experimentdocument2d.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
33
34#include <QMap>
35#include <QString>
36#include <QVariant>
37
38class QJsonObject;
39
40namespace qpe {
41
42// Portable configuration document for a reproducible Quantum Phenomena Explorer
43// experiment. It intentionally stores controls/parameters, not the evolved
44// wavefunction, sampled hits, detector accumulation or analysis history.
45/**
46 * @brief Serializable experiment document used by QPE schema 28.
47 *
48 * This type is the persistence boundary between GUI controls and saved experiment JSON. Parsing is intentionally strict enough to reject structurally incomplete documents instead of silently inventing simulation controls.
49 */
51{
52 static const int CurrentSchemaVersion = 28;
53
55 QString name;
56 QString sourcePreset;
57 QMap<QString, QVariant> controls;
58
59 // Step 15+: optional multi-object potential scene. Schema v1 documents do
60 // not contain it. Schema v3 adds smooth analytic-object parameters while
61 // remaining backward-compatible with schema v2 geometric scenes.
64
65 // Step 18: preparation is still a reproducible configuration, not an
66 // evolved snapshot. Bound eigenstates are recomputed from V(x) on load.
67 int initialPreparationMode = 0; // 0 Gaussian, 1 eigenstate, 2 superposition, 3 Talbot comb, 4 vortex, 5 Anderson dual lane, 6 kicked rotor, 7 quantum Zeno dual lane, 8 Berry first-excited doublet state, 9 Moshinsky shutter edge, 10 Kapitza-Dirac beam, 11 Aharonov-Bohm incident beam, 12 Landau magnetic state, 13 quantum Hall edge packet, 14 quantum backflow positive-momentum state, 15 Dirac/Zitterbewegung spinor state, 16 Dirac/Klein incident state
68 int boundStateA = 0;
69 int boundStateB = 3;
71
72 // Step 19: configuration only. A collapse outcome itself is transient and
73 // is never persisted as an evolved wavefunction snapshot.
74 double collapseResolution = 0.65;
75
76 // Step 21: deterministic recipe for a one-shot Hamiltonian quench.
78
79 // Step 22: deterministic sinusoidal drive recipe.
81
82 // Step 24/25: deterministic finite linear sweep recipe. Schema 9 extends
83 // it with an optional return leg and turnaround hold for Stueckelberg
84 // interferometry.
86
87 // Step 26/27: deterministic Ramsey sequence, optionally with Hahn-echo pi pulse.
89
90 // Step 28: analysis-only Gaussian static-detuning ensemble.
92
93 // Step 32: reproducible periodic-comb initial preparation.
95
96 // Step 34: reproducible off-axis vortex initial preparation.
98
99 // Step 35: reproducible equal two-lane Anderson comparison preparation.
101
102 // Step 36: reproducible kicked-rotor preparation and kick train.
105
106 // Step 37: reproducible watched-escape preparation and measurement train.
109
110 // Step 38: reproducible quantum-scar analysis settings.
112
113 // Step 39: reproducible geometric-phase loop settings.
115
116 // Step 40: reproducible quantum time-reversal / Loschmidt-echo settings.
118
119 // Step 41: reproducible Moshinsky shutter preparation and release settings.
122
123 // Step 42: reproducible Kapitza-Dirac beam and standing-wave pulse settings.
126
127 // Step 43: gauge-covariant Aharonov-Bohm flux tube.
129
130 // Step 44: uniform-B Landau/cyclotron configuration.
132
133 // Step 45: chiral quantum Hall edge configuration.
135
136 // Step 46: free positive-momentum quantum-backflow configuration.
138
139 // Step 47: free Dirac packet with optional positive-energy control projection.
141
142 // Step 48: Dirac Klein-tunneling scalar barrier.
144};
145
146/**
147 * @brief Implements the Experiment Document2D Json component.
148 *
149 * The class provides one focused service within the QPE architecture and is documented here independently of the experiment-level Help.
150 */
152{
153public:
154 /**
155 * @brief Performs format id.
156 */
157 static QString formatId();
158
159 /**
160 * @brief Performs to json.
161 * @param document The document value used by the operation.
162 */
163 static QJsonObject toJson(const ExperimentDocument2D &document);
164 /**
165 * @brief Performs from json.
166 * @param json The json value used by the operation.
167 * @param document The document value used by the operation.
168 * @param errorMessage The error message value used by the operation.
169 */
170 static bool fromJson(const QJsonObject &json,
171 ExperimentDocument2D &document,
172 QString &errorMessage);
173
174 /**
175 * @brief Saves file.
176 * @param fileName Filesystem name/path.
177 * @param document The document value used by the operation.
178 * @param errorMessage The error message value used by the operation.
179 */
180 static bool saveFile(const QString &fileName,
181 const ExperimentDocument2D &document,
182 QString &errorMessage);
183 /**
184 * @brief Loads file.
185 * @param fileName Filesystem name/path.
186 * @param document The document value used by the operation.
187 * @param errorMessage The error message value used by the operation.
188 */
189 static bool loadFile(const QString &fileName,
190 ExperimentDocument2D &document,
191 QString &errorMessage);
192};
193
194} // namespace qpe
Implements the Experiment Document2D Json component.
static bool fromJson(const QJsonObject &json, ExperimentDocument2D &document, QString &errorMessage)
Performs from json.
static QJsonObject toJson(const ExperimentDocument2D &document)
Performs to json.
static bool saveFile(const QString &fileName, const ExperimentDocument2D &document, QString &errorMessage)
Saves file.
static bool loadFile(const QString &fileName, ExperimentDocument2D &document, QString &errorMessage)
Loads file.
static QString formatId()
Performs format id.
Implements the Potential Scene2D component.
Declares the potentialscene2d physics/numerical component used by QPE experiments.
Declares the quantumaharonovbohm2d physics/numerical component used by QPE experiments.
Declares the quantumanderson2d physics/numerical component used by QPE experiments.
Declares the quantumbackflow2d physics/numerical component used by QPE experiments.
Declares the quantumberryphase2d physics/numerical component used by QPE experiments.
Declares the quantumhalledge2d physics/numerical component used by QPE experiments.
Declares the quantumkapitzadirac2d physics/numerical component used by QPE experiments.
Declares the quantumkickedrotor2d physics/numerical component used by QPE experiments.
Declares the quantumkleintunneling2d physics/numerical component used by QPE experiments.
Declares the quantumlandau2d physics/numerical component used by QPE experiments.
Declares the quantumloschmidt2d physics/numerical component used by QPE experiments.
Declares the quantummoshinsky2d physics/numerical component used by QPE experiments.
Declares the quantumscar2d physics/numerical component used by QPE experiments.
Declares the quantumtalbot2d physics/numerical component used by QPE experiments.
Declares the quantumvortex2d physics/numerical component used by QPE experiments.
Declares the quantumzeno2d physics/numerical component used by QPE experiments.
Declares the quantumzitterbewegung2d physics/numerical component used by QPE experiments.
Declares the ramseyinterferometry2d physics/numerical component used by QPE experiments.
Serializable experiment document used by QPE schema 28.
QuantumVortexInitialState2DConfig vortexInitialState
QMap< QString, QVariant > controls
QuantumTalbotInitialState2DConfig talbotInitialState
QuantumBackflow2DConfig quantumBackflow
QuantumLoschmidt2DConfig quantumLoschmidt
LinearPotentialSweep2DConfig linearSweep
QuantumLandau2DConfig quantumLandau
QuantumKickedRotor2DConfig kickedRotor
PeriodicPotentialDrive2DConfig periodicDrive
QuantumAharonovBohm2DConfig quantumAharonovBohm
static const int CurrentSchemaVersion
QuantumBerryLoop2DConfig quantumBerry
QuantumMoshinsky2DConfig quantumMoshinsky
RamseyEnsemble2DConfig ramseyEnsemble
QuantumKapitzaDiracInitialState2DConfig kapitzaDiracInitialState
QuantumZitterbewegung2DConfig quantumZitterbewegung
QuantumHallEdge2DConfig quantumHallEdge
QuantumMoshinskyInitialState2DConfig moshinskyInitialState
QuantumAndersonInitialState2DConfig andersonInitialState
QuantumKapitzaDirac2DConfig quantumKapitzaDirac
RamseyPulseSequence2DConfig ramseySequence
QuantumKleinTunneling2DConfig quantumKleinTunneling
QuantumZenoInitialState2DConfig quantumZenoInitialState
QuantumKickedRotorInitialState2DConfig kickedRotorInitialState
QuantumQuench2DConfig quench
Configuration values for Linear Potential Sweep2D Config.
Configuration values for Periodic Potential Drive2D Config.
Configuration values for Quantum Aharonov Bohm2D Config.
Configuration values for Quantum Anderson Initial State2D Config.
Configuration values for Quantum Backflow2D Config.
Configuration values for Quantum Berry Loop2D Config.
Configuration values for Quantum Hall Edge2D Config.
Configuration values for Quantum Kapitza Dirac2D Config.
Configuration values for Quantum Kapitza Dirac Initial State2D Config.
Configuration values for Quantum Kicked Rotor2D Config.
Configuration values for Quantum Kicked Rotor Initial State2D Config.
Configuration values for Quantum Klein Tunneling2D Config.
Configuration values for Quantum Landau2D Config.
Configuration values for Quantum Loschmidt2D Config.
Configuration values for Quantum Moshinsky2D Config.
Configuration values for Quantum Moshinsky Initial State2D Config.
Configuration values for Quantum Quench2D Config.
Data structure used by the Quantum Scar Config2D component.
Configuration values for Quantum Talbot Initial State2D Config.
Configuration values for Quantum Vortex Initial State2D Config.
Configuration values for Quantum Zeno2D Config.
Configuration values for Quantum Zeno Initial State2D Config.
Configuration values for Quantum Zitterbewegung2D Config.
Configuration values for Ramsey Ensemble2D Config.
Configuration values for Ramsey Pulse Sequence2D Config.
Declares the timedependentpotential2d physics/numerical component used by QPE experiments.