Quantum Phenomena Explorer 7.9.8
Interactive quantum-phenomena Explorer Tutor — source documentation
Loading...
Searching...
No Matches
boundstates1d.h
Go to the documentation of this file.
1/**
2 * @file boundstates1d.h
3 * @brief Declares the boundstates1d physics/numerical component used by QPE experiments.
4 * @ingroup qpe_quantum
5 *
6 * Source: @c core/quantum/boundstates1d.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 <cstdint>
16#include <string>
17#include <vector>
18
19namespace qpe {
20
21class ComplexField2D;
22class PotentialField2D;
23
24/**
25 * @brief Data structure used by the Bound State1D component.
26 *
27 * The structure keeps related values explicit and testable across the QPE physics, analysis, or persistence layers.
28 */
30{
32 double energy = 0.0;
33 int nodeCount = 0;
34 std::vector<float> amplitude;
35};
36
37/**
38 * @brief Data structure used by the Bound State Spectrum1D 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 std::string message;
46 double dx = 0.0;
47 double mass = 1.0;
48 double hbar = 1.0;
49 double continuumThreshold = 0.0;
50 std::uint64_t sourceSignature = 0;
51 std::vector<double> x;
52 std::vector<double> potential;
53 std::vector<BoundState1D> states;
54};
55
56/**
57 * @brief Configuration values for Bound State Solver1D Params.
58 *
59 * The structure groups parameters that are passed together so the associated numerical/analysis component can be configured reproducibly.
60 */
62{
63 double mass = 1.0;
64 double hbar = 1.0;
65 double imaginaryTimeStep = 0.02;
66 int maxIterations = 2600;
67 int maxStates = 5;
68 double energyTolerance = 1.0e-10;
69 double yInvarianceTolerance = 1.0e-5;
70};
71
72// Bound-state extractor for potentials that are (approximately) invariant in Y.
73// The X eigenmodes are obtained by imaginary-time split-step evolution with a
74// radix-2 spectral kinetic operator, followed by Gram-Schmidt deflation.
75// This deliberately mirrors the real-time solver's spectral philosophy rather
76// than introducing an unrelated textbook-only discretization.
77/**
78 * @brief Implements the Bound States1D component.
79 *
80 * The class provides one focused service within the QPE architecture and is documented here independently of the experiment-level Help.
81 */
83{
84public:
85 /**
86 * @brief Performs solve.
87 * @param potential Potential field used by the operation.
88 * @param params Parameter block to apply.
89 */
90 static BoundStateSpectrum1D solve(const PotentialField2D &potential,
91 const BoundStateSolver1DParams &params);
92
93 /**
94 * @brief Returns whether y invariant.
95 * @param potential Potential field used by the operation.
96 * @param tolerance The tolerance value used by the operation.
97 */
98 static bool isYInvariant(const PotentialField2D &potential,
99 double tolerance = 1.0e-5) noexcept;
100
101 /**
102 * @brief Performs potential signature.
103 * @param potential Potential field used by the operation.
104 */
105 static std::uint64_t potentialSignature(const PotentialField2D &potential) noexcept;
106
107 /**
108 * @brief Performs matches.
109 * @param spectrum The spectrum value used by the operation.
110 * @param potential Potential field used by the operation.
111 * @param mass The mass value used by the operation.
112 * @param hbar The hbar value used by the operation.
113 */
114 static bool matches(const BoundStateSpectrum1D &spectrum,
115 const PotentialField2D &potential,
116 double mass,
117 double hbar = 1.0) noexcept;
118
119 /**
120 * @brief Prepares eigenstate.
121 * @param field Field data to read or modify.
122 * @param spectrum The spectrum value used by the operation.
123 * @param stateIndex Zero-based index used to select the requested item.
124 */
125 static bool prepareEigenstate(ComplexField2D &field,
126 const BoundStateSpectrum1D &spectrum,
127 int stateIndex);
128
129 /**
130 * @brief Prepares superposition.
131 * @param field Field data to read or modify.
132 * @param spectrum The spectrum value used by the operation.
133 * @param stateIndexA The state index a value used by the operation.
134 * @param stateIndexB The state index b value used by the operation.
135 * @param relativePhaseRadians The relative phase radians value used by the operation.
136 */
137 static bool prepareSuperposition(ComplexField2D &field,
138 const BoundStateSpectrum1D &spectrum,
139 int stateIndexA,
140 int stateIndexB,
141 double relativePhaseRadians = 0.0);
142};
143
144} // namespace qpe
Implements the Bound States1D component.
static bool isYInvariant(const PotentialField2D &potential, double tolerance=1.0e-5) noexcept
Returns whether y invariant.
static bool prepareEigenstate(ComplexField2D &field, const BoundStateSpectrum1D &spectrum, int stateIndex)
Prepares eigenstate.
static bool matches(const BoundStateSpectrum1D &spectrum, const PotentialField2D &potential, double mass, double hbar=1.0) noexcept
Performs matches.
static BoundStateSpectrum1D solve(const PotentialField2D &potential, const BoundStateSolver1DParams &params)
Performs solve.
static std::uint64_t potentialSignature(const PotentialField2D &potential) noexcept
Performs potential signature.
static bool prepareSuperposition(ComplexField2D &field, const BoundStateSpectrum1D &spectrum, int stateIndexA, int stateIndexB, double relativePhaseRadians=0.0)
Prepares superposition.
Owning Cartesian grid of complex scalar samples.
Implements the Potential Field2D component.
Data structure used by the Bound State1D component.
std::vector< float > amplitude
Configuration values for Bound State Solver1D Params.
Data structure used by the Bound State Spectrum1D component.
std::vector< double > x
std::vector< BoundState1D > states
std::vector< double > potential
std::uint64_t sourceSignature