30bool near(
double a,
double b,
double tolerance)
32 return std::fabs(a - b) <= tolerance;
70 const float fullWidth = 40.96f;
71 potential.
addRectangle(0.0f, 0.0f, fullWidth, 0.64f, 120.0f);
72 potential.
addRectangle(0.0f, 9.76f, fullWidth, 0.48f, 120.0f);
73 potential.
addRectangle(0.0f, -9.76f, fullWidth, 0.48f, 120.0f);
74 potential.
addRectangle(-9.0f, 4.8f, 0.64f, 8.60f, 120.0f);
75 potential.
addRectangle(-9.0f, -4.8f, 0.64f, 8.60f, 120.0f);
91 return near(field.
norm2(), 1.0, 3.0e-5) &&
92 near(control, 0.5, 2.0e-3) && near(watched, 0.5, 2.0e-3);
109 field, config, watchedTarget, result,
nullptr))
return false;
113 near(controlBefore, controlAfter, 5.0e-6) &&
148 double cumulative = 1.0;
149 std::size_t measurementCount = 0u;
151 while (solver.
time() < 15.0 - 1.0e-9) {
152 const double epsilon = 0.5 *
static_cast<double>(params.
dt) + 1.0e-9;
153 while (solver.
time() + epsilon >=
157 field, config, targetWatched, result,
nullptr))
return false;
161 solver.
step(field, potential);
162 absorber.
apply(field);
166 field, config, solver.
time(), measurementCount, cumulative, initialControl);
170 return measurementCount > 100u &&
171 sample.controlSurvival < 0.75 &&
172 sample.watchedCumulativeSurvival > 0.80 &&
173 sample.watchedCumulativeSurvival > sample.controlSurvival + 0.18 &&
174 sample.watchedConditionalAcceptance > 0.97 &&
175 sample.totalNorm > 0.70 && sample.totalNorm < 1.10;
182 return testDualLaneInitialization() &&
183 testMeasurementPreservesControlAndRenormalizesWatched() &&
184 testWatchedEscapeSuppression();
Declares the absorbingboundary2d physics/numerical component used by QPE experiments.
Precomputed smooth absorber for FFT domains that should behave as open.
void configure(const ComplexField2D &field, float dt, const AbsorbingBoundary2DParams ¶ms)
Returns configure.
void apply(ComplexField2D &field) const
Performs apply.
Owning Cartesian grid of complex scalar samples.
double norm2() const noexcept
Returns the discrete integral of |psi|^2 including dx*dy.
Implements the Potential Field2D component.
void addRectangle(float centerX, float centerY, float width, float height, Value value)
Adds rectangle.
static bool runAll()
Runs all.
static QuantumZenoSample2D measure(const ComplexField2D &field, const QuantumZeno2DConfig &config, double time, std::size_t measurementCount, double watchedCumulativeSurvival, double initialControlLaneNorm) noexcept
Performs measure.
static bool initializeDualLane(ComplexField2D &field, const QuantumZenoInitialState2DConfig &config, std::string *reason=nullptr)
Initializes dual lane.
static double scheduledMeasurementTime(const QuantumZeno2DConfig &config, std::size_t measurementIndex) noexcept
Performs scheduled measurement time.
static double laneNorm(const ComplexField2D &field, const QuantumZeno2DConfig &config, bool watchedLane) noexcept
Performs lane norm.
static bool applySurvivalMeasurement(ComplexField2D &field, const QuantumZeno2DConfig &config, double targetWatchedLaneNorm, QuantumZenoMeasurementResult2D &result, std::string *reason=nullptr)
Applies survival measurement.
Symmetric split-step Fourier solver for the scalar 2D Schrodinger equation.
double time() const noexcept
Returns accumulated simulation time in solver units.
void preparePotential(const PotentialField2D &potential)
Precomputes the scalar-potential half-step phase cache.
void prepare(const ComplexField2D &field)
Precomputes spectral kinetic phase factors for a specific grid.
void step(ComplexField2D &field, const PotentialField2D &potential)
Advances the scalar wave function by one second-order Strang step.
bool testMeasurementPreservesControlAndRenormalizesWatched()
Performs test measurement preserves control and renormalizes watched.
QuantumZeno2DConfig guidedConfig()
Performs guided config.
bool testDualLaneInitialization()
Performs test dual lane initialization.
bool testWatchedEscapeSuppression()
Performs test watched escape suppression.
void buildGuidedPotential(PotentialField2D &potential)
Builds guided potential.
QuantumZenoInitialState2DConfig guidedInitial()
Performs guided initial.
Declares the potentialfield2d physics/numerical component used by QPE experiments.
Declares the quantumzeno2d physics/numerical component used by QPE experiments.
Declares regression and invariant tests for quantumzeno2d tests.
Declares the two-dimensional split-step Fourier propagator for the scalar Schrodinger branch.
Parameters controlling QPE's smooth complex absorbing boundary.
float strength
Dimensionless damping strength in the exponential mask.
bool enabled
Enables/disables damping while retaining the same API path.
float widthFraction
Fraction of each domain edge occupied by the absorbing layer.
float exponent
Smoothness exponent controlling how damping rises toward the edge.
Configuration values for Quantum Zeno2D Config.
double firstMeasurementTime
Configuration values for Quantum Zeno Initial State2D Config.
Data structure used by the Quantum Zeno Measurement Result2D component.
double watchedNormAfterRenormalization
double acceptanceProbability
Data structure used by the Quantum Zeno Sample2D component.
Physical/numerical parameters for scalar split-step propagation.
float hbar
Reduced Planck constant in simulation units.
float dt
Propagation step in simulation time units.
float mass
Particle/effective mass in simulation units.