Quantum Phenomena Explorer 7.9.8
Interactive quantum-phenomena Explorer Tutor — source documentation
Loading...
Searching...
No Matches
qpe::SplitStepFourierSolver2D Class Reference

Symmetric split-step Fourier solver for the scalar 2D Schrodinger equation. More...

#include <splitstepfouriersolver2d.h>

Public Member Functions

 SplitStepFourierSolver2D ()=default
 Constructs a solver with the default reduced-unit parameters.
 
 SplitStepFourierSolver2D (const SplitStepFourier2DParams &params)
 Constructs a solver with explicit parameters.
 
void setParameters (const SplitStepFourier2DParams &params)
 Replaces physical/time-step parameters and invalidates prepared caches.
 
const SplitStepFourier2DParams & parameters () const noexcept
 Returns the currently active solver parameters.
 
void prepare (const ComplexField2D &field)
 Precomputes spectral kinetic phase factors for a specific grid.
 
bool isPreparedFor (const ComplexField2D &field) const noexcept
 Returns whether the kinetic cache matches the supplied field geometry.
 
void preparePotential (const PotentialField2D &potential)
 Precomputes the scalar-potential half-step phase cache.
 
bool isPotentialPreparedFor (const PotentialField2D &potential) const noexcept
 Returns whether the potential half-step cache still matches potential.
 
void step (ComplexField2D &field, const PotentialField2D &potential)
 Advances the scalar wave function by one second-order Strang step.
 
void stepGaugeCovariant (ComplexField2D &field, const PotentialField2D &potential, const U1GaugeField2D &gauge)
 Advances one gauge-covariant Schrodinger step using U(1) links.
 
void stepFree (ComplexField2D &field)
 Advances a free (V=0) scalar field by one cached kinetic step.
 
void resetClock () noexcept
 Resets the shared solver time and step counter to zero.
 
void advanceExternalClock () noexcept
 Advances only QPE's shared clock for an alternative authoritative propagator.
 
double time () const noexcept
 Returns accumulated simulation time in solver units.
 
std::size_t stepCount () const noexcept
 Returns the number of propagated/shared-clock steps since reset.
 

Private Member Functions

void invalidatePreparation () noexcept
 Invalidates prepared numerical state.
 
void invalidatePotentialPreparation () noexcept
 Invalidates the cached potential preparation.
 
void applyPotentialHalfStep (ComplexField2D &field) const
 Applies potential half step.
 
void applyKineticStep (ComplexField2D &field) const
 Applies kinetic step.
 
void applyGaugeCayleyX (ComplexField2D &field, const U1GaugeField2D &gauge, double interval) const
 Applies gauge cayley x.
 
void applyGaugeCayleyY (ComplexField2D &field, const U1GaugeField2D &gauge, double interval) const
 Applies gauge cayley y.
 
void advanceClock () noexcept
 Advances clock.
 

Static Private Member Functions

static void validateParameters (const SplitStepFourier2DParams &params)
 Validates parameters.
 

Private Attributes

SplitStepFourier2DParams params_
 
std::size_t width_ = 0
 
std::size_t height_ = 0
 
float dx_ = 0.0f
 
float dy_ = 0.0f
 
std::vector< std::complex< float > > kineticPhase_
 
const PotentialField2D * potentialSource_ = nullptr
 
std::uint64_t potentialRevision_ = 0
 
std::size_t potentialWidth_ = 0
 
std::size_t potentialHeight_ = 0
 
float potentialDx_ = 0.0f
 
float potentialDy_ = 0.0f
 
std::vector< std::complex< float > > potentialHalfPhase_
 
double time_ = 0.0
 
std::size_t stepCount_ = 0
 

Detailed Description

Symmetric split-step Fourier solver for the scalar 2D Schrodinger equation.

For time-independent scalar potentials the propagator uses Strang splitting, applying potential half steps around a kinetic FFT step. Visual post-processing is never fed back into the propagated wave function.

Definition at line 58 of file splitstepfouriersolver2d.h.

Constructor & Destructor Documentation

◆ SplitStepFourierSolver2D() [1/2]

qpe::SplitStepFourierSolver2D::SplitStepFourierSolver2D ( )
default

Constructs a solver with the default reduced-unit parameters.

◆ SplitStepFourierSolver2D() [2/2]

qpe::SplitStepFourierSolver2D::SplitStepFourierSolver2D ( const SplitStepFourier2DParams & params)
explicit

Constructs a solver with explicit parameters.

Parameters
paramsParameters copied into the solver.

Definition at line 54 of file splitstepfouriersolver2d.cpp.

References setParameters().

Member Function Documentation

◆ advanceClock()

void qpe::SplitStepFourierSolver2D::advanceClock ( )
privatenoexcept

Advances clock.

Definition at line 424 of file splitstepfouriersolver2d.cpp.

References qpe::SplitStepFourier2DParams::dt, params_, stepCount_, and time_.

Referenced by advanceExternalClock(), step(), stepFree(), and stepGaugeCovariant().

◆ advanceExternalClock()

void qpe::SplitStepFourierSolver2D::advanceExternalClock ( )
noexcept

Advances only QPE's shared clock for an alternative authoritative propagator.

Definition at line 238 of file splitstepfouriersolver2d.cpp.

References advanceClock().

Referenced by MainWindow::advanceSimulation(), and MainWindow::singleStep().

◆ applyGaugeCayleyX()

void qpe::SplitStepFourierSolver2D::applyGaugeCayleyX ( ComplexField2D & field,
const U1GaugeField2D & gauge,
double interval ) const
private

Applies gauge cayley x.

Parameters
fieldField data to read or modify.
gaugeThe gauge value used by the operation.
intervalThe interval value used by the operation.

Definition at line 342 of file splitstepfouriersolver2d.cpp.

References qpe::ComplexField2D::dx(), qpe::SplitStepFourier2DParams::hbar, qpe::ComplexField2D::height(), qpe::U1GaugeField2D::linkX(), qpe::SplitStepFourier2DParams::mass, params_, and qpe::ComplexField2D::width().

Referenced by stepGaugeCovariant().

◆ applyGaugeCayleyY()

void qpe::SplitStepFourierSolver2D::applyGaugeCayleyY ( ComplexField2D & field,
const U1GaugeField2D & gauge,
double interval ) const
private

Applies gauge cayley y.

Parameters
fieldField data to read or modify.
gaugeThe gauge value used by the operation.
intervalThe interval value used by the operation.

Definition at line 383 of file splitstepfouriersolver2d.cpp.

References qpe::ComplexField2D::dy(), qpe::SplitStepFourier2DParams::hbar, qpe::ComplexField2D::height(), qpe::U1GaugeField2D::linkY(), qpe::SplitStepFourier2DParams::mass, params_, and qpe::ComplexField2D::width().

Referenced by stepGaugeCovariant().

◆ applyKineticStep()

void qpe::SplitStepFourierSolver2D::applyKineticStep ( ComplexField2D & field) const
private

Applies kinetic step.

Parameters
fieldField data to read or modify.

Definition at line 298 of file splitstepfouriersolver2d.cpp.

References qpe::ComplexField2D::data(), kineticPhase_, and qpe::ComplexField2D::size().

Referenced by step(), and stepFree().

◆ applyPotentialHalfStep()

void qpe::SplitStepFourierSolver2D::applyPotentialHalfStep ( ComplexField2D & field) const
private

Applies potential half step.

Parameters
fieldField data to read or modify.

Definition at line 290 of file splitstepfouriersolver2d.cpp.

References qpe::ComplexField2D::data(), potentialHalfPhase_, and qpe::ComplexField2D::size().

Referenced by step(), and stepGaugeCovariant().

◆ invalidatePotentialPreparation()

void qpe::SplitStepFourierSolver2D::invalidatePotentialPreparation ( )
privatenoexcept

Invalidates the cached potential preparation.

Definition at line 279 of file splitstepfouriersolver2d.cpp.

References potentialDx_, potentialDy_, potentialHalfPhase_, potentialHeight_, potentialRevision_, potentialSource_, and potentialWidth_.

Referenced by setParameters().

◆ invalidatePreparation()

void qpe::SplitStepFourierSolver2D::invalidatePreparation ( )
privatenoexcept

Invalidates prepared numerical state.

Definition at line 270 of file splitstepfouriersolver2d.cpp.

References dx_, dy_, height_, kineticPhase_, and width_.

Referenced by setParameters().

◆ isPotentialPreparedFor()

bool qpe::SplitStepFourierSolver2D::isPotentialPreparedFor ( const PotentialField2D & potential) const
noexcept

Returns whether the potential half-step cache still matches potential.

Parameters
potentialPotential to compare with the cache identity/revision.

Definition at line 158 of file splitstepfouriersolver2d.cpp.

Referenced by qpe::tests::runSplitStepFourierSolver2DTests(), step(), and stepGaugeCovariant().

◆ isPreparedFor()

bool qpe::SplitStepFourierSolver2D::isPreparedFor ( const ComplexField2D & field) const
noexcept

Returns whether the kinetic cache matches the supplied field geometry.

Parameters
fieldField to compare with the prepared geometry.

Definition at line 115 of file splitstepfouriersolver2d.cpp.

Referenced by step(), and stepFree().

◆ parameters()

const SplitStepFourier2DParams & qpe::SplitStepFourierSolver2D::parameters ( ) const
noexcept

◆ prepare()

◆ preparePotential()

void qpe::SplitStepFourierSolver2D::preparePotential ( const PotentialField2D & potential)

◆ resetClock()

void qpe::SplitStepFourierSolver2D::resetClock ( )
noexcept

Resets the shared solver time and step counter to zero.

Definition at line 232 of file splitstepfouriersolver2d.cpp.

References stepCount_, and time_.

Referenced by MainWindow::resetSimulation(), qpe::tests::runSplitStepFourierSolver2DTests(), and setParameters().

◆ setParameters()

void qpe::SplitStepFourierSolver2D::setParameters ( const SplitStepFourier2DParams & params)

◆ step()

◆ stepCount()

std::size_t qpe::SplitStepFourierSolver2D::stepCount ( ) const
noexcept

◆ stepFree()

void qpe::SplitStepFourierSolver2D::stepFree ( ComplexField2D & field)

Advances a free (V=0) scalar field by one cached kinetic step.

Parameters
fieldWave function modified in place.

Definition at line 219 of file splitstepfouriersolver2d.cpp.

References advanceClock(), applyKineticStep(), qpe::FFT2D::forward(), qpe::FFT2D::inverse(), isPreparedFor(), and prepare().

Referenced by qpe::tests::runQuantumTalbot2DTests(), qpe::tests::runSplitStepFourierSolver2DTests(), and qpe::tests::runWavePacketObservables2DTests().

◆ stepGaugeCovariant()

void qpe::SplitStepFourierSolver2D::stepGaugeCovariant ( ComplexField2D & field,
const PotentialField2D & potential,
const U1GaugeField2D & gauge )

Advances one gauge-covariant Schrodinger step using U(1) links.

Parameters
fieldWave function modified in place.
potentialScalar potential sampled on the field grid.
gaugeU(1) link field encoding the vector-potential connection.

A symmetric X/2 - Y - X/2 Cayley/ADI kinetic factorization preserves the lattice gauge transformation law and is norm preserving before any CAP.

Definition at line 195 of file splitstepfouriersolver2d.cpp.

References advanceClock(), applyGaugeCayleyX(), applyGaugeCayleyY(), applyPotentialHalfStep(), qpe::SplitStepFourier2DParams::dt, isPotentialPreparedFor(), qpe::PotentialField2D::matchesGrid(), qpe::U1GaugeField2D::matchesGrid(), params_, and preparePotential().

Referenced by MainWindow::advanceSimulation(), qpe::tests::anonymous_namespace{quantumhalledge2d_tests.cpp}::runOne(), qpe::tests::runQuantumAharonovBohm2DTests(), qpe::tests::runQuantumLandau2DTests(), and MainWindow::singleStep().

◆ time()

double qpe::SplitStepFourierSolver2D::time ( ) const
noexcept

◆ validateParameters()

void qpe::SplitStepFourierSolver2D::validateParameters ( const SplitStepFourier2DParams & params)
staticprivate

Validates parameters.

Parameters
paramsParameter block to apply.

Definition at line 253 of file splitstepfouriersolver2d.cpp.

References qpe::SplitStepFourier2DParams::dt, qpe::SplitStepFourier2DParams::hbar, and qpe::SplitStepFourier2DParams::mass.

Referenced by prepare(), preparePotential(), and setParameters().

Member Data Documentation

◆ dx_

float qpe::SplitStepFourierSolver2D::dx_ = 0.0f
private

Definition at line 194 of file splitstepfouriersolver2d.h.

Referenced by invalidatePreparation(), and prepare().

◆ dy_

float qpe::SplitStepFourierSolver2D::dy_ = 0.0f
private

Definition at line 195 of file splitstepfouriersolver2d.h.

Referenced by invalidatePreparation(), and prepare().

◆ height_

std::size_t qpe::SplitStepFourierSolver2D::height_ = 0
private

Definition at line 193 of file splitstepfouriersolver2d.h.

Referenced by invalidatePreparation(), and prepare().

◆ kineticPhase_

std::vector<std::complex<float> > qpe::SplitStepFourierSolver2D::kineticPhase_
private

Definition at line 197 of file splitstepfouriersolver2d.h.

Referenced by applyKineticStep(), invalidatePreparation(), and prepare().

◆ params_

◆ potentialDx_

float qpe::SplitStepFourierSolver2D::potentialDx_ = 0.0f
private

Definition at line 203 of file splitstepfouriersolver2d.h.

Referenced by invalidatePotentialPreparation(), and preparePotential().

◆ potentialDy_

float qpe::SplitStepFourierSolver2D::potentialDy_ = 0.0f
private

Definition at line 204 of file splitstepfouriersolver2d.h.

Referenced by invalidatePotentialPreparation(), and preparePotential().

◆ potentialHalfPhase_

std::vector<std::complex<float> > qpe::SplitStepFourierSolver2D::potentialHalfPhase_
private

◆ potentialHeight_

std::size_t qpe::SplitStepFourierSolver2D::potentialHeight_ = 0
private

Definition at line 202 of file splitstepfouriersolver2d.h.

Referenced by invalidatePotentialPreparation(), and preparePotential().

◆ potentialRevision_

std::uint64_t qpe::SplitStepFourierSolver2D::potentialRevision_ = 0
private

Definition at line 200 of file splitstepfouriersolver2d.h.

Referenced by invalidatePotentialPreparation(), and preparePotential().

◆ potentialSource_

const PotentialField2D* qpe::SplitStepFourierSolver2D::potentialSource_ = nullptr
private

Definition at line 199 of file splitstepfouriersolver2d.h.

Referenced by invalidatePotentialPreparation(), and preparePotential().

◆ potentialWidth_

std::size_t qpe::SplitStepFourierSolver2D::potentialWidth_ = 0
private

Definition at line 201 of file splitstepfouriersolver2d.h.

Referenced by invalidatePotentialPreparation(), and preparePotential().

◆ stepCount_

std::size_t qpe::SplitStepFourierSolver2D::stepCount_ = 0
private

Definition at line 208 of file splitstepfouriersolver2d.h.

Referenced by advanceClock(), resetClock(), and stepCount().

◆ time_

double qpe::SplitStepFourierSolver2D::time_ = 0.0
private

Definition at line 207 of file splitstepfouriersolver2d.h.

Referenced by advanceClock(), resetClock(), and time().

◆ width_

std::size_t qpe::SplitStepFourierSolver2D::width_ = 0
private

Definition at line 192 of file splitstepfouriersolver2d.h.

Referenced by invalidatePreparation(), and prepare().


The documentation for this class was generated from the following files: