44 using Link = std::complex<float>;
56 float dx = 1.0f,
float dy = 1.0f);
66 float dx = 1.0f,
float dy = 1.0f);
68 void clear() noexcept;
73 bool empty() const noexcept;
82 float dx() const noexcept {
return dx_; }
84 float dy() const noexcept {
return dy_; }
87 Link linkX(std::size_t x, std::size_t y)
const noexcept;
89 Link linkY(std::size_t x, std::size_t y)
const noexcept;
91 void setLinkX(std::size_t x, std::size_t y,
Link value)
noexcept;
93 void setLinkY(std::size_t x, std::size_t y,
Link value)
noexcept;
101 std::size_t
index(std::size_t x, std::size_t y)
const noexcept
102 {
return y *
width_ + x; }
Owning Cartesian grid of complex scalar samples.
Discrete U(1) gauge connection for gauge-covariant Schrodinger experiments.
Link linkY(std::size_t x, std::size_t y) const noexcept
Returns the +Y parallel-transport link at a site.
void setLinkY(std::size_t x, std::size_t y, Link value) noexcept
Assigns the +Y link at a lattice site.
bool matchesGrid(const ComplexField2D &field) const noexcept
Tests whether dimensions and spacing match a scalar field.
void setLinkX(std::size_t x, std::size_t y, Link value) noexcept
Assigns the +X link at a lattice site.
std::size_t index(std::size_t x, std::size_t y) const noexcept
Returns index.
void resize(std::size_t width, std::size_t height, float dx=1.0f, float dy=1.0f)
Resizes the lattice and resets all links to the identity phase.
bool empty() const noexcept
Returns whether the lattice contains no links.
void clear() noexcept
Releases the link arrays and resets the geometry.
U1GaugeField2D()=default
Constructs an empty gauge-link field.
std::complex< float > Link
std::vector< Link > yLinks_
void fillIdentity() noexcept
Sets every X/Y link to complex unity (zero gauge phase).
float dx() const noexcept
Returns the X lattice spacing.
float dy() const noexcept
Returns the Y lattice spacing.
std::size_t height() const noexcept
Returns the number of lattice sites along Y.
Link linkX(std::size_t x, std::size_t y) const noexcept
Returns the +X parallel-transport link at a site.
std::vector< Link > xLinks_
std::size_t width() const noexcept
Returns the number of lattice sites along X.