Quantum Phenomena Explorer 7.9.8
Interactive quantum-phenomena Explorer Tutor — source documentation
Loading...
Searching...
No Matches
absorbingboundary2d.h
Go to the documentation of this file.
1/**
2 * @file absorbingboundary2d.h
3 * @brief Declares the absorbingboundary2d physics/numerical component used by QPE experiments.
4 * @ingroup qpe_quantum
5 *
6 * Source: @c core/quantum/absorbingboundary2d.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
15
16#include <cstddef>
17#include <vector>
18
19namespace qpe {
20
21/**
22 * @brief Parameters controlling QPE's smooth complex absorbing boundary.
23 *
24 * The absorber is a numerical open-boundary device applied after each physical
25 * propagation step. It intentionally removes norm near the edge of the finite
26 * FFT domain; that norm loss represents probability leaving the simulated
27 * region rather than non-unitarity of the interior propagator.
28 */
30{
31 bool enabled = true; ///< Enables/disables damping while retaining the same API path.
32 float widthFraction = 0.15f; ///< Fraction of each domain edge occupied by the absorbing layer.
33 float strength = 8.0f; ///< Dimensionless damping strength in the exponential mask.
34 float exponent = 3.0f; ///< Smoothness exponent controlling how damping rises toward the edge.
35};
36
37// Smooth absorbing boundary for FFT-based propagation.
38//
39// The split-step FFT solver itself remains periodic. This class suppresses
40// the artificial wrap-around by multiplying psi after every physical time
41// step by a smooth non-unitary mask:
42//
43// psi <- psi * exp[-eta * dt * f(x,y)]
44//
45// where f is zero in the interior and rises smoothly inside a peripheral
46// layer. This is equivalent to a simple complex absorbing potential (CAP).
47// Norm loss is therefore intentional and represents probability leaving the
48// simulated open region.
49/**
50 * @brief Precomputed smooth absorber for FFT domains that should behave as open.
51 *
52 * For an edge profile `f(x,y)`, the post-step mask has the form
53 * \f[
54 * \psi \leftarrow \psi\,\exp[-\eta\,\Delta t\,f(x,y)].
55 * \f]
56 * The class keeps this numerical device separate from physical scalar
57 * potentials so analysis can distinguish intended CAP norm loss.
58 */
60{
61public:
62 /**
63 * @brief Performs absorbing boundary2 d.
64 */
66
67 /**
68 * @brief Returns configure.
69 * @param field Field data to read or modify.
70 * @param dt Time increment in solver units.
71 * @param params Parameter block to apply.
72 */
73 void configure(const ComplexField2D &field,
74 float dt,
75 const AbsorbingBoundary2DParams &params);
76
77 /**
78 * @brief Returns parameters.
79 */
80 const AbsorbingBoundary2DParams &parameters() const noexcept;
81 /**
82 * @brief Performs enabled.
83 */
84 bool enabled() const noexcept;
85 /**
86 * @brief Returns whether prepared for.
87 * @param field Field data to read or modify.
88 */
89 bool isPreparedFor(const ComplexField2D &field) const noexcept;
90
91 /**
92 * @brief Performs apply.
93 * @param field Field data to read or modify.
94 */
95 void apply(ComplexField2D &field) const;
96
97 /**
98 * @brief Performs minimum mask.
99 */
100 float minimumMask() const noexcept;
101 /**
102 * @brief Performs maximum mask.
103 */
104 float maximumMask() const noexcept;
105
106private:
107 /**
108 * @brief Performs validate.
109 * @param dt Time increment in solver units.
110 * @param params Parameter block to apply.
111 */
112 static void validate(float dt, const AbsorbingBoundary2DParams &params);
113
115 std::size_t width_ = 0;
116 std::size_t height_ = 0;
117 float dx_ = 0.0f;
118 float dy_ = 0.0f;
119 float dt_ = 0.0f;
120 float minimumMask_ = 1.0f;
121 float maximumMask_ = 1.0f;
122 std::vector<float> mask_;
123};
124
125} // namespace qpe
Precomputed smooth absorber for FFT domains that should behave as open.
float minimumMask() const noexcept
Performs minimum mask.
static void validate(float dt, const AbsorbingBoundary2DParams &params)
Performs validate.
AbsorbingBoundary2D()=default
Performs absorbing boundary2 d.
void configure(const ComplexField2D &field, float dt, const AbsorbingBoundary2DParams &params)
Returns configure.
float maximumMask() const noexcept
Performs maximum mask.
const AbsorbingBoundary2DParams & parameters() const noexcept
Returns parameters.
void apply(ComplexField2D &field) const
Performs apply.
bool isPreparedFor(const ComplexField2D &field) const noexcept
Returns whether prepared for.
bool enabled() const noexcept
Performs enabled.
AbsorbingBoundary2DParams params_
Owning Cartesian grid of complex scalar samples.
Declares the complex scalar field container representing two-dimensional wave functions.
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.