23 double rightBoundary)
noexcept
30 if (leftBoundary > rightBoundary) {
31 std::swap(leftBoundary, rightBoundary);
34 const double cellArea =
static_cast<double>(field.dx()) *
35 static_cast<double>(field.dy());
37 for (std::size_t y = 0; y < field.height(); ++y) {
38 for (std::size_t x = 0; x < field.width(); ++x) {
39 const auto &v = field(x, y);
40 const double re =
static_cast<double>(v.real());
41 const double im =
static_cast<double>(v.imag());
42 const double p = (re * re + im * im) * cellArea;
46 if (px < leftBoundary) {
48 }
else if (px > rightBoundary) {
56 if (out.
total > 0.0 && std::isfinite(out.
total)) {
57 const double inv = 1.0 / out.
total;
Owning Cartesian grid of complex scalar samples.
static double xCoordinate(const ComplexField2D &field, std::size_t x) noexcept
Performs x coordinate.
static ScatteringRegions2D measureX(const ComplexField2D &field, double leftBoundary, double rightBoundary) noexcept
Measures x.
Declares the gaussianpacket2d physics/numerical component used by QPE experiments.
Declares the scatteringobservables2d physics/numerical component used by QPE experiments.
Data structure used by the Scattering Regions2D component.
double interactionFraction