43 const Link one(1.0f, 0.0f);
55 return !empty() && width_ == field.width() && height_ == field.height() &&
56 dx_ == field.dx() && dy_ == field.dy();
61 return xLinks_[index(x, y)];
65 return yLinks_[index(x, y)];
69 xLinks_[index(x, y)] = value;
73 yLinks_[index(x, y)] = value;
Owning Cartesian grid of complex scalar samples.
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.
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.
Declares the complex scalar field container representing two-dimensional wave functions.
Declares the U(1) lattice gauge field used by magnetic-flux, Landau, and Hall-edge experiments.