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

Implements the Potential Field2D component. More...

#include <potentialfield2d.h>

Public Types

using Value = float
 

Public Member Functions

 PotentialField2D ()=default
 Performs potential field2 d.
 
 PotentialField2D (std::size_t width, std::size_t height, float dx=1.0f, float dy=1.0f)
 Performs potential field2 d.
 
void resize (std::size_t width, std::size_t height, float dx=1.0f, float dy=1.0f)
 Performs resize.
 
void clear () noexcept
 Performs clear.
 
void fill (Value value) noexcept
 Performs fill.
 
bool empty () const noexcept
 Performs empty.
 
std::size_t width () const noexcept
 Returns width.
 
std::size_t height () const noexcept
 Returns height.
 
std::size_t size () const noexcept
 Returns size.
 
float dx () const noexcept
 Performs dx.
 
float dy () const noexcept
 Performs dy.
 
Value operator() (std::size_t x, std::size_t y) const noexcept
 Returns the potential sample at a grid coordinate without bounds checking.
 
Value at (std::size_t x, std::size_t y) const
 Performs at.
 
void set (std::size_t x, std::size_t y, Value value) noexcept
 Performs set.
 
void setAt (std::size_t x, std::size_t y, Value value)
 Sets at.
 
void accumulate (const PotentialField2D &other, Value scale=1.0f)
 Performs accumulate.
 
const Value * data () const noexcept
 Performs data.
 
bool matchesGrid (const ComplexField2D &field) const noexcept
 Performs matches grid.
 
Value minimum () const noexcept
 Performs minimum.
 
Value maximum () const noexcept
 Performs maximum.
 
std::uint64_t revision () const noexcept
 Performs revision.
 
double xCoordinate (std::size_t x) const noexcept
 Performs x coordinate.
 
double yCoordinate (std::size_t y) const noexcept
 Performs y coordinate.
 
void addRectangle (float centerX, float centerY, float width, float height, Value value)
 Adds rectangle.
 
void addCircle (float centerX, float centerY, float radius, Value value)
 Adds circle.
 
void addBarrier (float x1, float y1, float x2, float y2, float thickness, Value value)
 Adds barrier.
 
void addPolygon (const std::vector< PotentialPoint2D > &vertices, Value value)
 Adds polygon.
 
void addSingleSlit (float centerX, float barrierWidth, float slitCenterY, float slitHeight, Value value)
 Adds single slit.
 
void addDoubleSlit (float centerX, float barrierWidth, float slitCenterY, float slitSeparation, float slitHeight, Value value)
 Adds double slit.
 
void addGaussian (float centerX, float centerY, float sigmaX, float sigmaY, Value amplitude)
 Adds gaussian.
 
void addHarmonic (float centerX, float centerY, Value offset, float curvatureX, float curvatureY)
 Adds harmonic.
 
void addQuadrupole (float centerX, float centerY, Value q1, Value q2)
 Adds quadrupole.
 
void addStandingWaveX (float period, Value depth, float phaseDegrees=0.0f)
 Adds standing wave x.
 
void addLinear (float centerX, float centerY, Value offset, float slopeX, float slopeY)
 Adds linear.
 
void addSoftenedRadial (float centerX, float centerY, Value coupling, float softening)
 Adds softened radial.
 
void addStadiumExterior (float centerX, float centerY, float straightLength, float radius, Value value)
 Adds stadium exterior.
 

Private Member Functions

std::size_t index (std::size_t x, std::size_t y) const noexcept
 Returns index.
 
std::size_t checkedIndex (std::size_t x, std::size_t y) const
 Checks ed index.
 
void touch () noexcept
 Performs touch.
 

Private Attributes

std::size_t width_ = 0
 
std::size_t height_ = 0
 
float dx_ = 1.0f
 
float dy_ = 1.0f
 
std::vector< Value > data_
 
std::uint64_t revision_ = 0
 

Detailed Description

Implements the Potential Field2D component.

The class provides one focused service within the QPE architecture and is documented here independently of the experiment-level Help.

Definition at line 43 of file potentialfield2d.h.

Member Typedef Documentation

◆ Value

Definition at line 46 of file potentialfield2d.h.

Constructor & Destructor Documentation

◆ PotentialField2D() [1/2]

qpe::PotentialField2D::PotentialField2D ( )
default

Performs potential field2 d.

◆ PotentialField2D() [2/2]

qpe::PotentialField2D::PotentialField2D ( std::size_t width,
std::size_t height,
float dx = 1.0f,
float dy = 1.0f )

Performs potential field2 d.

Parameters
widthThe width value used by the operation.
heightThe height value used by the operation.
dxThe dx value used by the operation.
dyThe dy value used by the operation.

Definition at line 87 of file potentialfield2d.cpp.

References dx(), dy(), height(), resize(), and width().

Member Function Documentation

◆ accumulate()

void qpe::PotentialField2D::accumulate ( const PotentialField2D & other,
Value scale = 1.0f )

Performs accumulate.

Parameters
otherThe other value used by the operation.
scaleThe scale value used by the operation.

Definition at line 176 of file potentialfield2d.cpp.

References data_, dx_, dy_, height_, touch(), and width_.

Referenced by qpe::PotentialScene2D::rasterize().

◆ addBarrier()

void qpe::PotentialField2D::addBarrier ( float x1,
float y1,
float x2,
float y2,
float thickness,
Value value )

Adds barrier.

Parameters
x1The x1 value used by the operation.
y1The y1 value used by the operation.
x2The x2 value used by the operation.
y2The y2 value used by the operation.
thicknessThe thickness value used by the operation.
valueValue to assign or evaluate.

Definition at line 298 of file potentialfield2d.cpp.

References data_, dx(), dy(), height_, index(), touch(), width_, xCoordinate(), and yCoordinate().

Referenced by MainWindow::buildSelectedPotential(), qpe::anonymous_namespace{potentialscene2d.cpp}::rasterizeObject(), and qpe::tests::runPotentialField2DTests().

◆ addCircle()

void qpe::PotentialField2D::addCircle ( float centerX,
float centerY,
float radius,
Value value )

Adds circle.

Parameters
centerXThe center x value used by the operation.
centerYThe center y value used by the operation.
radiusThe radius value used by the operation.
valueValue to assign or evaluate.

Definition at line 273 of file potentialfield2d.cpp.

References data_, dx(), dy(), height_, index(), touch(), width_, xCoordinate(), and yCoordinate().

Referenced by qpe::QuantumAharonovBohm2D::buildFields(), MainWindow::buildSelectedPotential(), qpe::anonymous_namespace{potentialscene2d.cpp}::rasterizeObject(), and qpe::tests::runPotentialField2DTests().

◆ addDoubleSlit()

void qpe::PotentialField2D::addDoubleSlit ( float centerX,
float barrierWidth,
float slitCenterY,
float slitSeparation,
float slitHeight,
Value value )

Adds double slit.

Parameters
centerXThe center x value used by the operation.
barrierWidthThe barrier width value used by the operation.
slitCenterYThe slit center y value used by the operation.
slitSeparationThe slit separation value used by the operation.
slitHeightThe slit height value used by the operation.
valueValue to assign or evaluate.

Definition at line 404 of file potentialfield2d.cpp.

References data_, height_, index(), touch(), width_, xCoordinate(), and yCoordinate().

Referenced by MainWindow::buildSelectedPotential(), qpe::anonymous_namespace{potentialscene2d.cpp}::rasterizeObject(), and qpe::tests::runPotentialField2DTests().

◆ addGaussian()

void qpe::PotentialField2D::addGaussian ( float centerX,
float centerY,
float sigmaX,
float sigmaY,
Value amplitude )

Adds gaussian.

Parameters
centerXThe center x value used by the operation.
centerYThe center y value used by the operation.
sigmaXThe sigma x value used by the operation.
sigmaYThe sigma y value used by the operation.
amplitudeThe amplitude value used by the operation.

Definition at line 442 of file potentialfield2d.cpp.

References data_, dx(), dy(), height_, index(), touch(), width_, xCoordinate(), and yCoordinate().

Referenced by MainWindow::buildSelectedPotential(), qpe::anonymous_namespace{potentialscene2d.cpp}::rasterizeObject(), qpe::tests::runBoundStates1DTests(), and qpe::tests::runPotentialField2DTests().

◆ addHarmonic()

void qpe::PotentialField2D::addHarmonic ( float centerX,
float centerY,
Value offset,
float curvatureX,
float curvatureY )

Adds harmonic.

Parameters
centerXThe center x value used by the operation.
centerYThe center y value used by the operation.
offsetThe offset value used by the operation.
curvatureXThe curvature x value used by the operation.
curvatureYThe curvature y value used by the operation.

Definition at line 468 of file potentialfield2d.cpp.

References data_, dx(), dy(), height_, index(), touch(), width_, xCoordinate(), and yCoordinate().

Referenced by MainWindow::buildSelectedPotential(), qpe::anonymous_namespace{potentialscene2d.cpp}::rasterizeObject(), qpe::tests::runPotentialField2DTests(), and qpe::anonymous_namespace{quantumkickedrotor2d_tests.cpp}::testDynamicalLocalizationSignature().

◆ addLinear()

void qpe::PotentialField2D::addLinear ( float centerX,
float centerY,
Value offset,
float slopeX,
float slopeY )

Adds linear.

Parameters
centerXThe center x value used by the operation.
centerYThe center y value used by the operation.
offsetThe offset value used by the operation.
slopeXThe slope x value used by the operation.
slopeYThe slope y value used by the operation.

Definition at line 539 of file potentialfield2d.cpp.

References data_, dx(), dy(), height_, index(), touch(), width_, xCoordinate(), and yCoordinate().

Referenced by MainWindow::buildSelectedPotential(), qpe::anonymous_namespace{potentialscene2d.cpp}::rasterizeObject(), and qpe::tests::runPotentialField2DTests().

◆ addPolygon()

void qpe::PotentialField2D::addPolygon ( const std::vector< PotentialPoint2D > & vertices,
Value value )

Adds polygon.

Parameters
verticesThe vertices value used by the operation.
valueValue to assign or evaluate.

Definition at line 348 of file potentialfield2d.cpp.

References data_, height_, index(), touch(), width_, xCoordinate(), and yCoordinate().

Referenced by MainWindow::buildSelectedPotential(), qpe::anonymous_namespace{potentialscene2d.cpp}::rasterizeObject(), and qpe::tests::runPotentialField2DTests().

◆ addQuadrupole()

void qpe::PotentialField2D::addQuadrupole ( float centerX,
float centerY,
Value q1,
Value q2 )

Adds quadrupole.

Parameters
centerXThe center x value used by the operation.
centerYThe center y value used by the operation.
q1The q1 value used by the operation.
q2The q2 value used by the operation.

Definition at line 493 of file potentialfield2d.cpp.

References data_, dx(), dy(), height_, index(), touch(), width_, xCoordinate(), and yCoordinate().

Referenced by qpe::QuantumBerryPhase2D::rasterize().

◆ addRectangle()

void qpe::PotentialField2D::addRectangle ( float centerX,
float centerY,
float width,
float height,
Value value )

◆ addSingleSlit()

void qpe::PotentialField2D::addSingleSlit ( float centerX,
float barrierWidth,
float slitCenterY,
float slitHeight,
Value value )

Adds single slit.

Parameters
centerXThe center x value used by the operation.
barrierWidthThe barrier width value used by the operation.
slitCenterYThe slit center y value used by the operation.
slitHeightThe slit height value used by the operation.
valueValue to assign or evaluate.

Definition at line 373 of file potentialfield2d.cpp.

References data_, height_, index(), touch(), width_, xCoordinate(), and yCoordinate().

Referenced by MainWindow::buildSelectedPotential(), qpe::anonymous_namespace{potentialscene2d.cpp}::rasterizeObject(), and qpe::tests::runPotentialField2DTests().

◆ addSoftenedRadial()

void qpe::PotentialField2D::addSoftenedRadial ( float centerX,
float centerY,
Value coupling,
float softening )

Adds softened radial.

Parameters
centerXThe center x value used by the operation.
centerYThe center y value used by the operation.
couplingThe coupling value used by the operation.
softeningThe softening value used by the operation.

Definition at line 564 of file potentialfield2d.cpp.

References data_, dx(), dy(), height_, index(), touch(), width_, xCoordinate(), and yCoordinate().

Referenced by MainWindow::buildSelectedPotential(), qpe::anonymous_namespace{potentialscene2d.cpp}::rasterizeObject(), and qpe::tests::runPotentialField2DTests().

◆ addStadiumExterior()

void qpe::PotentialField2D::addStadiumExterior ( float centerX,
float centerY,
float straightLength,
float radius,
Value value )

Adds stadium exterior.

Parameters
centerXThe center x value used by the operation.
centerYThe center y value used by the operation.
straightLengthThe straight length value used by the operation.
radiusThe radius value used by the operation.
valueValue to assign or evaluate.

Definition at line 609 of file potentialfield2d.cpp.

References data_, dx(), height_, index(), touch(), width_, xCoordinate(), and yCoordinate().

Referenced by MainWindow::buildSelectedPotential(), and qpe::anonymous_namespace{potentialscene2d.cpp}::rasterizeObject().

◆ addStandingWaveX()

void qpe::PotentialField2D::addStandingWaveX ( float period,
Value depth,
float phaseDegrees = 0.0f )

Adds standing wave x.

Parameters
periodThe period value used by the operation.
depthThe depth value used by the operation.
phaseDegreesThe phase degrees value used by the operation.

Definition at line 515 of file potentialfield2d.cpp.

References data_, height_, index(), touch(), width_, and xCoordinate().

Referenced by qpe::QuantumKapitzaDirac2D::rasterize().

◆ at()

PotentialField2D::Value qpe::PotentialField2D::at ( std::size_t x,
std::size_t y ) const

Performs at.

Parameters
xX coordinate/value.
yY coordinate/value.

Definition at line 159 of file potentialfield2d.cpp.

References checkedIndex(), and data_.

◆ checkedIndex()

std::size_t qpe::PotentialField2D::checkedIndex ( std::size_t x,
std::size_t y ) const
private

Checks ed index.

Parameters
xX coordinate/value.
yY coordinate/value.

Definition at line 593 of file potentialfield2d.cpp.

References height_, index(), and width_.

Referenced by at(), and setAt().

◆ clear()

◆ data()

const PotentialField2D::Value * qpe::PotentialField2D::data ( ) const
noexcept

◆ dx()

◆ dy()

◆ empty()

◆ fill()

◆ height()

◆ index()

std::size_t qpe::PotentialField2D::index ( std::size_t x,
std::size_t y ) const
privatenoexcept

◆ matchesGrid()

bool qpe::PotentialField2D::matchesGrid ( const ComplexField2D & field) const
noexcept

◆ maximum()

◆ minimum()

PotentialField2D::Value qpe::PotentialField2D::minimum ( ) const
noexcept

◆ operator()()

PotentialField2D::Value qpe::PotentialField2D::operator() ( std::size_t x,
std::size_t y ) const
noexcept

Returns the potential sample at a grid coordinate without bounds checking.

Parameters
xZero-based X sample index.
yZero-based Y sample index.
Returns
Potential value at (x,y).

Definition at line 153 of file potentialfield2d.cpp.

◆ resize()

void qpe::PotentialField2D::resize ( std::size_t width,
std::size_t height,
float dx = 1.0f,
float dy = 1.0f )

Performs resize.

Parameters
widthThe width value used by the operation.
heightThe height value used by the operation.
dxThe dx value used by the operation.
dyThe dy value used by the operation.

Definition at line 95 of file potentialfield2d.cpp.

References data_, dx(), dx_, dy(), dy_, height(), height_, touch(), width(), and width_.

Referenced by PotentialField2D(), qpe::QuantumAharonovBohm2D::buildFields(), qpe::QuantumHallEdge2D::buildFields(), MainWindow::resetSimulation(), and qpe::tests::runQuantumLandau2DTests().

◆ revision()

std::uint64_t qpe::PotentialField2D::revision ( ) const
noexcept

◆ set()

void qpe::PotentialField2D::set ( std::size_t x,
std::size_t y,
Value value )
noexcept

Performs set.

Parameters
xX coordinate/value.
yY coordinate/value.
valueValue to assign or evaluate.

Definition at line 164 of file potentialfield2d.cpp.

Referenced by qpe::tests::runBoundStates1DTests(), qpe::tests::runPotentialContours2DTests(), qpe::tests::runPotentialField2DTests(), qpe::tests::runQuantumTextureFrame2DTests(), and qpe::tests::runSplitStepFourierSolver2DTests().

◆ setAt()

void qpe::PotentialField2D::setAt ( std::size_t x,
std::size_t y,
Value value )

Sets at.

Parameters
xX coordinate/value.
yY coordinate/value.
valueValue to assign or evaluate.

Definition at line 170 of file potentialfield2d.cpp.

References checkedIndex(), data_, and touch().

Referenced by qpe::tests::runPotentialField2DTests().

◆ size()

std::size_t qpe::PotentialField2D::size ( ) const
noexcept

◆ touch()

◆ width()

◆ xCoordinate()

◆ yCoordinate()

Member Data Documentation

◆ data_

◆ dx_

float qpe::PotentialField2D::dx_ = 1.0f
private

Definition at line 400 of file potentialfield2d.h.

Referenced by accumulate(), dx(), and resize().

◆ dy_

float qpe::PotentialField2D::dy_ = 1.0f
private

Definition at line 401 of file potentialfield2d.h.

Referenced by accumulate(), dy(), and resize().

◆ height_

◆ revision_

std::uint64_t qpe::PotentialField2D::revision_ = 0
private

Definition at line 403 of file potentialfield2d.h.

Referenced by revision(), and touch().

◆ width_


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