Quantum Phenomena Explorer 7.9.8
Interactive quantum-phenomena Explorer Tutor — source documentation
Loading...
Searching...
No Matches
positionmeasurement2d.h
Go to the documentation of this file.
1/**
2 * @file positionmeasurement2d.h
3 * @brief Declares the positionmeasurement2d physics/numerical component used by QPE experiments.
4 * @ingroup qpe_quantum
5 *
6 * Source: @c core/quantum/positionmeasurement2d.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 <vector>
17
18namespace qpe {
19
20class ComplexField2D;
21
22/**
23 * @brief Data record containing Position Measurement2D Point.
24 *
25 * The structure carries computed data without coupling the numerical component to the GUI or renderer.
26 */
28{
29 float x = 0.0f;
30 float y = 0.0f;
31};
32
33// Samples ideal position measurements from the discrete in-domain density
34// P(x,y) = |psi(x,y)|^2. The wavefunction is never modified.
35//
36// If an absorbing boundary has reduced the field norm below one, sampling is
37// conditional on the particle still being inside the simulated domain.
38/**
39 * @brief Implements the Position Measurement2D component.
40 *
41 * The class provides one focused service within the QPE architecture and is documented here independently of the experiment-level Help.
42 */
44{
45public:
46 /**
47 * @brief Performs sample.
48 * @param field Field data to read or modify.
49 * @param shots The shots value used by the operation.
50 */
51 static std::vector<PositionMeasurement2DPoint> sample(
52 const ComplexField2D &field,
53 std::size_t shots);
54
55 // Deterministic overload used by tests and reproducible demonstrations.
56 /**
57 * @brief Samples seeded.
58 * @param field Field data to read or modify.
59 * @param shots The shots value used by the operation.
60 * @param seed The seed value used by the operation.
61 */
62 static std::vector<PositionMeasurement2DPoint> sampleSeeded(
63 const ComplexField2D &field,
64 std::size_t shots,
65 std::uint32_t seed);
66};
67
68} // namespace qpe
Owning Cartesian grid of complex scalar samples.
Implements the Position Measurement2D component.
static std::vector< PositionMeasurement2DPoint > sampleSeeded(const ComplexField2D &field, std::size_t shots, std::uint32_t seed)
Samples seeded.
static std::vector< PositionMeasurement2DPoint > sample(const ComplexField2D &field, std::size_t shots)
Performs sample.
Data record containing Position Measurement2D Point.