Quantum Phenomena Explorer 7.9.8
Interactive quantum-phenomena Explorer Tutor — source documentation
Loading...
Searching...
No Matches
quantumanderson2d.h
Go to the documentation of this file.
1/**
2 * @file quantumanderson2d.h
3 * @brief Declares the quantumanderson2d physics/numerical component used by QPE experiments.
4 * @ingroup qpe_quantum
5 *
6 * Source: @c core/quantum/quantumanderson2d.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
16
17#include <cstddef>
18#include <string>
19#include <vector>
20
21namespace qpe {
22
23/**
24 * @brief Configuration values for Quantum Anderson Initial State2D Config.
25 *
26 * The structure groups parameters that are passed together so the associated numerical/analysis component can be configured reproducibly.
27 */
29{
30 double centerX = 0.0;
31 double cleanLaneY = 4.0;
32 double disorderLaneY = -4.0;
33 double sigma = 0.35;
35};
36
37/**
38 * @brief Data structure used by the Quantum Anderson Lattice2D component.
39 *
40 * The structure keeps related values explicit and testable across the QPE physics, analysis, or persistence layers.
41 */
43{
44 bool valid = false;
45 double cleanLaneY = 0.0;
46 double disorderLaneY = 0.0;
47 double spacing = 0.0;
48 double siteSigmaX = 0.0;
49 double siteSigmaY = 0.0;
50 double cleanDepth = 0.0;
51 double disorderDepthMean = 0.0;
52 double disorderDepthStdDev = 0.0;
53 std::vector<double> siteX;
54 std::vector<double> cleanDepths;
55 std::vector<double> disorderDepths;
56};
57
58/**
59 * @brief Data structure used by the Quantum Anderson Lane Sample2D component.
60 *
61 * The structure keeps related values explicit and testable across the QPE physics, analysis, or persistence layers.
62 */
64{
65 double probability = 0.0;
66 double meanX = 0.0;
67 double sigmaX = 0.0;
68 double siteParticipation = 0.0;
70 double localizationLength = 0.0;
72 double profileXMin = 0.0;
73 double profileDx = 0.0;
74 std::vector<float> marginalX;
75};
76
77/**
78 * @brief Data structure used by the Quantum Anderson Sample2D component.
79 *
80 * The structure keeps related values explicit and testable across the QPE physics, analysis, or persistence layers.
81 */
89
90/**
91 * @brief Implements the Quantum Anderson2D component.
92 *
93 * The class provides one focused service within the QPE architecture and is documented here independently of the experiment-level Help.
94 */
96{
97public:
98 /**
99 * @brief Validates config.
100 * @param config Configuration to apply.
101 * @param reason The reason value used by the operation.
102 */
103 static bool validateConfig(const QuantumAndersonInitialState2DConfig &config,
104 std::string *reason = nullptr);
105 /**
106 * @brief Initializes dual lane.
107 * @param field Field data to read or modify.
108 * @param config Configuration to apply.
109 * @param reason The reason value used by the operation.
110 */
111 static bool initializeDualLane(ComplexField2D &field,
113 std::string *reason = nullptr);
114 /**
115 * @brief Returns identify lattice.
116 * @param scene The scene value used by the operation.
117 * @param lattice The lattice value used by the operation.
118 * @param reason The reason value used by the operation.
119 */
120 static bool identifyLattice(const PotentialScene2D &scene,
122 std::string *reason = nullptr);
123 /**
124 * @brief Measures lane.
125 * @param field Field data to read or modify.
126 * @param lattice The lattice value used by the operation.
127 * @param cleanLane The clean lane value used by the operation.
128 */
130 const QuantumAndersonLattice2D &lattice,
131 bool cleanLane);
132 /**
133 * @brief Performs free gaussian sigma.
134 * @param time Simulation time in solver units.
135 * @param sigma0 The sigma0 value used by the operation.
136 * @param mass The mass value used by the operation.
137 * @param hbar The hbar value used by the operation.
138 */
139 static double freeGaussianSigma(double time, double sigma0,
140 double mass, double hbar) noexcept;
141};
142
143/**
144 * @brief Implements the Quantum Anderson History2D component.
145 *
146 * The class provides one focused service within the QPE architecture and is documented here independently of the experiment-level Help.
147 */
149{
150public:
151 /**
152 * @brief Performs quantum anderson history2 d.
153 * @param maxSamples The max samples value used by the operation.
154 */
155 explicit QuantumAndersonHistory2D(std::size_t maxSamples = 1200u);
156
157 /**
158 * @brief Performs clear.
159 */
160 void clear();
161 /**
162 * @brief Returns configure.
163 * @param config Configuration to apply.
164 * @param lattice The lattice value used by the operation.
165 */
168 /**
169 * @brief Returns configured.
170 */
171 bool configured() const noexcept;
172 /**
173 * @brief Performs empty.
174 */
175 bool empty() const noexcept;
176 /**
177 * @brief Performs append.
178 * @param time Simulation time in solver units.
179 * @param field Field data to read or modify.
180 */
181 void append(double time, const ComplexField2D &field);
182
183 /**
184 * @brief Returns config.
185 */
186 const QuantumAndersonInitialState2DConfig &config() const noexcept;
187 /**
188 * @brief Performs lattice.
189 */
190 const QuantumAndersonLattice2D &lattice() const noexcept;
191 /**
192 * @brief Samples s.
193 */
194 const std::vector<QuantumAndersonSample2D> &samples() const noexcept;
195
196private:
197 /**
198 * @brief Performs trim.
199 */
200 void trim();
201
202 std::size_t maxSamples_ = 1200u;
203 bool configured_ = false;
206 std::vector<QuantumAndersonSample2D> samples_;
207};
208
209} // namespace qpe
Owning Cartesian grid of complex scalar samples.
Implements the Potential Scene2D component.
Implements the Quantum Anderson2D component.
static QuantumAndersonLaneSample2D measureLane(const ComplexField2D &field, const QuantumAndersonLattice2D &lattice, bool cleanLane)
Measures lane.
static double freeGaussianSigma(double time, double sigma0, double mass, double hbar) noexcept
Performs free gaussian sigma.
static bool initializeDualLane(ComplexField2D &field, const QuantumAndersonInitialState2DConfig &config, std::string *reason=nullptr)
Initializes dual lane.
static bool identifyLattice(const PotentialScene2D &scene, QuantumAndersonLattice2D &lattice, std::string *reason=nullptr)
Returns identify lattice.
static bool validateConfig(const QuantumAndersonInitialState2DConfig &config, std::string *reason=nullptr)
Validates config.
Implements the Quantum Anderson History2D component.
void append(double time, const ComplexField2D &field)
Performs append.
QuantumAndersonInitialState2DConfig config_
QuantumAndersonLattice2D lattice_
const QuantumAndersonInitialState2DConfig & config() const noexcept
Returns config.
const QuantumAndersonLattice2D & lattice() const noexcept
Performs lattice.
QuantumAndersonHistory2D(std::size_t maxSamples=1200u)
Performs quantum anderson history2 d.
void configure(const QuantumAndersonInitialState2DConfig &config, const QuantumAndersonLattice2D &lattice)
Returns configure.
const std::vector< QuantumAndersonSample2D > & samples() const noexcept
Samples s.
std::vector< QuantumAndersonSample2D > samples_
bool configured() const noexcept
Returns configured.
bool empty() const noexcept
Performs empty.
Declares the complex scalar field container representing two-dimensional wave functions.
Declares the potentialscene2d physics/numerical component used by QPE experiments.
Configuration values for Quantum Anderson Initial State2D Config.
Data structure used by the Quantum Anderson Lane Sample2D component.
Data structure used by the Quantum Anderson Lattice2D component.
std::vector< double > disorderDepths
std::vector< double > cleanDepths
Data structure used by the Quantum Anderson Sample2D component.
QuantumAndersonLaneSample2D disorder
QuantumAndersonLaneSample2D clean