neuralqx.hilbert.u1.unconstrained_core module¶
Unconstrained \(U(1)\) Hilbert-space core.
This module implements UnconstrainedHilbertU1Core, the concrete core backend for the
kinematical (unconstrained) Hilbert space of \(U(1)\)-valued edge degrees of freedom on a given
graph.
A configuration (basis state) is represented as a 1D array sigma of length
where \(E\) is the number of edge sites in a single gauge copy and \(G\) is the number of
gauge copies (gauge_dimensions). The layout is block-strided:
so that copy g occupies indices [g*E, (g+1)*E).
No gauge-fixing or Gauss constraints are imposed in this core: all tensor-product basis
configurations built from the local domain are admissible. The local domain itself is defined by
the base class neuralqx.hilbert._abstract_hilbert_core.AbstractHilbertSpace from the
parameters cutoff, step, positive_qn, and qn_start.
- class UnconstrainedHilbertU1Core(graph, cutoff, *, step=1, gauge_dimensions=1, positive_qn=False, qn_start=None)¶
Bases:
AbstractHilbertSpaceUnconstrained \(U(1)\) Hilbert-space core.
This core represents the full tensor-product Hilbert space for \(U(1)\) edge variables on a graph, without imposing gauge invariance or gauge fixing. It is the implementation backend used by
neuralqx.hilbert.u1.HilbertU1whenis_gauge_invariant=False.- Degrees of freedom and layout
Let \(E\) be the number of edge sites in a single gauge copy (in neuraLQX this is typically the number of dual-graph vertices, i.e. one site per primal edge degree of freedom), and let \(G\) be
gauge_dimensions. A basis configuration is stored as a flat vector \(\sigma \in \mathbb{R}^{N}\) (or \(\mathbb{Z}^{N}\)) with\[N = G\,E.\]Conceptually, the same data may be viewed as a rank-2 array \(q_{g,e}\) of shape \((G, E)\) (gauge copy \(g\), edge site \(e\)), using the block layout
\[\sigma_{gE + e} = q_{g,e}.\]- Local basis (single-site domain)
The allowed local values are constructed by the base class
neuralqx.hilbert._abstract_hilbert_core.AbstractHilbertSpaceas anetket.utils.StaticRange. In the common symmetric case (positive_qn=False), the domain is\[\mathcal{Q} = \{-c,\,-c+s,\,\ldots,\,c-s,\,c\},\]where \(c\) is
cutoffand \(s\) isstep. Whenpositive_qn=True, the domain is restricted to a non-negative range starting atqn_start(defaulting to 0 if omitted); the exact endpoint is determined by the base-class construction.- NetKet representation
This core builds a flat NetKet
netket.hilbert.HomogeneousHilbertwith:N = E * Gsites,the local states given by
self.allowed_basis_states.
- Dimension bookkeeping
If the NetKet Hilbert is indexable (
self.hilbert.is_indexable), the total number of basis states is taken fromself.hilbert.n_states. Otherwise, the core stores the formal tensor size\[\dim(\mathcal{H}) = |\mathcal{Q}|^{N},\]which grows exponentially in \(N\) and may be extremely large. A scientific-notation string is cached for readable representations.
- Parameters:
graph (
AbstractGraph) – Graph defining the edge degrees of freedom and edge-index mappings.cutoff (
Union[int,float]) – Cutoff controlling the extent of the local \(U(1)\) basis.step (
Union[int,float]) – Step size between consecutive allowed local values.gauge_dimensions (
int) – Number of gauge copies \(G\) in the flattened block layout.positive_qn (
bool) – IfTrue, restrict the local domain to non-negative values.qn_start (
Optional[int]) – Starting value for the local domain whenpositive_qn=True(defaults to 0 if omitted).
- Returns:
None.
- Raises:
ValueError – If
gauge_dimensions < 1(validated by the base class).
- property layout: StridedGaugeCopyLayout¶
U(1) contiguous strided layout over gauge-copy blocks.
- edge_to_site(edge, gauge_copy=0)¶
Map a graph edge token to a flattened U(1) site index.
- Return type:
- site_to_edge(site)¶
Inverse map from flat site index to
(gauge_copy, edge_token).
- view(sigma)¶
Reshape flat state(s) into
(G, E)or(B, G, E)view.- Return type:
Array
- flatten(sigma_view)¶
Flatten
(G, E)or(B, G, E)view back to NetKet layout.- Return type:
Array
- random_state(key, size=1)¶
Generate random U(1) unconstrained basis state(s).
- Return type:
Array
- flip_state(sigma, key, number_of_edges=1, *, adjacency=False, scope='single')¶
Propose U(1) unconstrained updates using dispatched U(1) move logic.
- Return type:
Array