neuralqx.hilbert.u1.layout.strided module¶
Strided gauge-copy layout utilities for U(1) Hilbert spaces.
This module defines StridedGaugeCopyLayout,
the concrete layout used by U(1) LQG Hilbert spaces.
If each gauge copy contains \(E\) edge degrees of freedom and there are \(G\) copies, the flattened configuration has length \(N = E G\) and is stored as contiguous blocks,
The layout is the bijection between:
a pair
(g, e)with gauge-copy index \(g \in \{0,\ldots,G-1\}\) and within-copy edge index \(e \in \{0,\ldots,E-1\}\), andthe flattened site index \(s \in \{0,\ldots,EG-1\}\),
given by
- class GaugeCoord(gauge_copy, edge_index)¶
Bases:
objectStructured coordinate for a gauge-copy strided layout.
This coordinate is used by
StridedGaugeCopyLayoutand represents a site asgauge_copy: which gauge-copy block the site belongs to
edge_index: position inside that copy block
The coordinate is intentionally small and immutable so that it is safe to pass around in indexing-heavy code.
- class StridedGaugeCopyLayout(edges_per_copy, gauge_dimensions)¶
Bases:
AbstractBasisLayout[GaugeCoord]Strided gauge-copy layout with contiguous copy blocks.
This is the concrete U(1) layout implementation used by neuralqx for multiple gauge copies (i.e. U(1)^N gauge group structure).
If each gauge copy contains \(E\) edge degrees of freedom and there are \(G\) copies, the flattened configuration has length
\[N = E G\]and is stored as contiguous blocks
\[(\sigma^{(0)}_0, \ldots, \sigma^{(0)}_{E-1}, \sigma^{(1)}_0, \ldots, \sigma^{(1)}_{E-1}, \ldots, \sigma^{(G-1)}_0, \ldots, \sigma^{(G-1)}_{E-1}).\]The structured coordinate is
GaugeCoord(gauge_copy, edge_index)and the flattening map is\[s = gE + e.\]This class exposes two API layers
- Generic layout API
site_of()coord_of()
- Convenience API
encode(gauge_copy, edge_index)()decode(site) -> (gauge_copy, edge_index)()
- class GaugeLayout(edges_per_copy, gauge_dimensions)¶
Bases:
StridedGaugeCopyLayoutDeprecated alias for StridedGaugeCopyLayout.