20namespace qpe {
namespace tests {
29bool near(
double a,
double b,
double tolerance)
31 return std::abs(a - b) <= tolerance;
52 if (!near(m.
total, 12.0, 1.0e-12) ||
53 !near(m.
left, 4.0, 1.0e-12) ||
55 !near(m.
right, 4.0, 1.0e-12) ||
59 std::ostringstream ss;
60 ss <<
"region integration mismatch: total=" << m.
total
63 <<
" right=" << m.
right;
70 if (!near(reversed.
left, m.
left, 1.0e-12) ||
73 error =
"reversed boundaries changed the result";
Owning Cartesian grid of complex scalar samples.
void fill(const Value &value)
Assigns one complex value to every grid sample.
std::complex< float > Value
static ScatteringRegions2D measureX(const ComplexField2D &field, double leftBoundary, double rightBoundary) noexcept
Measures x.
Declares the complex scalar field container representing two-dimensional wave functions.
bool runScatteringObservables2DTests(std::string &error)
Runs scattering observables2 d tests.
Declares the scatteringobservables2d physics/numerical component used by QPE experiments.
Declares regression and invariant tests for scatteringobservables2d tests.
Data structure used by the Scattering Regions2D component.
double interactionFraction