Quantum Phenomena Explorer 7.9.8
Interactive quantum-phenomena Explorer Tutor — source documentation
Loading...
Searching...
No Matches
probabilitycontours2d.h
Go to the documentation of this file.
1/**
2 * @file probabilitycontours2d.h
3 * @brief Declares the probabilitycontours2d physics/numerical component used by QPE experiments.
4 * @ingroup qpe_quantum
5 *
6 * Source: @c core/quantum/probabilitycontours2d.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 <vector>
16
17namespace qpe {
18
19class ComplexField2D;
20
21/**
22 * @brief Enumerates the supported Probability Contour Spacing2D values.
23 *
24 * The enumeration is part of the typed interface used to keep experiment configuration and analysis routing explicit.
25 */
27{
28 Linear = 0,
30};
31
32/**
33 * @brief Data structure used by the Probability Contour Segment2D component.
34 *
35 * The structure keeps related values explicit and testable across the QPE physics, analysis, or persistence layers.
36 */
38{
39 float x1 = 0.0f;
40 float y1 = 0.0f;
41 float x2 = 0.0f;
42 float y2 = 0.0f;
43 float level = 0.0f;
44 float normalizedLevel = 0.0f;
45};
46
47/**
48 * @brief Data record containing Probability Contours2D Result.
49 *
50 * The structure carries computed data without coupling the numerical component to the GUI or renderer.
51 */
53{
54 std::vector<float> levels;
55 std::vector<ProbabilityContourSegment2D> segments;
56 float maximumProbability = 0.0f;
58 float logDecades = 4.0f;
59 std::size_t samplingStride = 1u;
60
61 /**
62 * @brief Returns whether the object contains no data.
63 * @param empty The empty value used by the operation.
64 */
65 bool empty() const noexcept { return segments.empty(); }
66};
67
68/**
69 * @brief Implements the Probability Contours2D component.
70 *
71 * The class provides one focused service within the QPE architecture and is documented here independently of the experiment-level Help.
72 */
74{
75public:
76 // Extract |psi(x,y)|^2 = constant curves using Marching Squares.
77 // Linear spacing distributes levels uniformly between zero and max(|psi|^2).
78 // Logarithmic spacing distributes levels over the requested number of decades
79 // below the current maximum and is useful for revealing weak wave structure.
80 // To keep the live overlay responsive on large grids, extraction automatically
81 // downsamples to at most targetSamplesPerAxis samples per axis.
82 /**
83 * @brief Performs compute.
84 * @param field Field data to read or modify.
85 * @param requestedLevels The requested levels value used by the operation.
86 * @param spacing The spacing value used by the operation.
87 * @param logDecades The log decades value used by the operation.
88 * @param targetSamplesPerAxis The target samples per axis value used by the operation.
89 */
91 const ComplexField2D &field,
92 std::size_t requestedLevels,
94 float logDecades = 4.0f,
95 std::size_t targetSamplesPerAxis = 384u);
96};
97
98} // namespace qpe
Owning Cartesian grid of complex scalar samples.
Implements the Probability Contours2D component.
static ProbabilityContours2DResult compute(const ComplexField2D &field, std::size_t requestedLevels, ProbabilityContourSpacing2D spacing, float logDecades=4.0f, std::size_t targetSamplesPerAxis=384u)
Performs compute.
ProbabilityContourSpacing2D
Enumerates the supported Probability Contour Spacing2D values.
Data structure used by the Probability Contour Segment2D component.
Data record containing Probability Contours2D Result.
ProbabilityContourSpacing2D spacing
bool empty() const noexcept
Returns whether the object contains no data.
std::vector< ProbabilityContourSegment2D > segments