20namespace qpe {
namespace tests {
33 errorMessage = why;
return false;
35 if (std::abs(s.
norm2()-1.0) > 2.0e-5) {
36 errorMessage =
"Klein incident state is not normalized";
return false;
42 !std::isfinite(masslessState.
norm2()) || std::abs(masslessState.
norm2()-1.0) > 2.0e-5) {
43 errorMessage =
"exact massless Klein incident state is invalid";
return false;
47 errorMessage =
"Klein barrier rasterization failed";
return false;
50 errorMessage =
"default Klein preset is not in the Klein zone";
return false;
54 errorMessage =
"Klein momentum/regime helper regression";
return false;
59 errorMessage =
"Klein evanescent-regime classifier regression";
return false;
64 errorMessage =
"Klein positive-branch classifier regression";
return false;
68 errorMessage =
"Klein initial partition is invalid";
return false;
72 for (
int i=0;i<20;++i) solver.
step(s,p);
73 if (std::abs(s.
norm2()-1.0) > 2.0e-4) {
74 errorMessage =
"Dirac scalar-barrier step lost norm";
return false;
78 for (
int i=0;i<20;++i) masslessSolver.
step(masslessState,p);
79 if (!std::isfinite(masslessState.
norm2()) || std::abs(masslessState.
norm2()-1.0) > 2.0e-4) {
80 errorMessage =
"massless Dirac scalar-barrier step lost norm";
return false;
82 std::cout <<
"QuantumKleinTunneling2D tests OK\n";
Two-component complex spinor field used by the QPE Dirac branch.
double norm2() const noexcept
Returns norm2.
Two-component split-step solver for the effective 2D Dirac equation.
void step(DiracSpinor2D &spinor, const PotentialField2D &potential)
Advances one symmetric scalar-potential/free-Dirac split step.
Implements the Potential Field2D component.
Value maximum() const noexcept
Performs maximum.
static double incidentEnergy(const QuantumKleinTunneling2DConfig &config) noexcept
Performs incident energy.
static double incidentMomentumMagnitude(const QuantumKleinTunneling2DConfig &config) noexcept
Performs incident momentum magnitude.
static bool prepareIncidentState(DiracSpinor2D &spinor, const QuantumKleinTunneling2DConfig &config, double hbar=1.0, std::string *reason=nullptr) noexcept
Prepares incident state.
static QuantumKleinTunnelingSample2D measure(const DiracSpinor2D &spinor, const QuantumKleinTunneling2DConfig &config, double time) noexcept
Performs measure.
static QuantumKleinBarrierRegime2D classifyBarrierRegime(const QuantumKleinTunneling2DConfig &config) noexcept
Performs classify barrier regime.
static bool inKleinZone(const QuantumKleinTunneling2DConfig &config) noexcept
Performs in klein zone.
static bool rasterizeBarrier(PotentialField2D &potential, const QuantumKleinTunneling2DConfig &config, std::string *reason=nullptr) noexcept
Performs rasterize barrier.
Declares the two-component split-step Dirac propagator used by the relativistic and graphene-like QPE...
bool runQuantumKleinTunneling2DTests(std::string &errorMessage)
Runs quantum klein tunneling2 d tests.
@ PositiveBranchPropagation
Declares the potentialfield2d physics/numerical component used by QPE experiments.
Declares the quantumkleintunneling2d physics/numerical component used by QPE experiments.
Parameters of the two-component effective Dirac propagator.
float restMass
Rest/effective mass; exactly zero is supported.
float dt
Propagation step in simulation time units.
float hbar
Reduced Planck constant in simulation units.
float lightSpeed
Dirac characteristic velocity c_D.
Configuration values for Quantum Klein Tunneling2D Config.
Data structure used by the Quantum Klein Tunneling Sample2D component.