neuralqx.graph.core package¶
- class AbstractGraph(edges, plot=False, *, random_embedding=False, random_embedding_mean=0.0, random_embedding_std=5.0, random_embedding_seed=123)¶
Bases:
ABCAbstract base class for neuraLQX graphs.
An
AbstractGraphowns aGraphHandlerinstance and delegates all low level construction to it. The class exposes a stable API used by Hilbert spaces, operators, solvers, and callbacks, independent of whether the graph is planar or non planar.Edges¶
Edges are treated as oriented multigraph edges. Each edge is represented as a triple
(u, v, key)whereuis the tail,vis the head, andkeydistinguishes parallel edges between the same endpoints.Dual graph¶
The dual graph is defined as the line graph of the primal graph, so dual vertices correspond to primal edges. The handler maintains a bijection between a primal edge and its dual vertex index.
Minimal loops¶
Concrete subclasses must implement access to minimal loops and their dressed variants. In this context, minimal loops refer to the shortest cycles in a cycle basis of the underlying undirected graph. Dressing attaches an orientation dependent label to each edge along the loop, which is typically used to select creation or annihilation type actions in operator kernels.
Sign data¶
The property :pyattr:`signs` exposes local orientation signs used in volume like constructions. For non planar embeddings this is based on the determinant of three tangent vectors, while for planar embeddings this reduces to a 2D oriented area convention.
- type edges:
- param edges:
List of oriented edges. Each edge is
(u, v)or(u, v, key).- type plot:
- param plot:
If True, the handler may create and display diagnostic plots during construction.
- type random_embedding:
- param random_embedding:
If True, treat the input as non planar and redraw all vertex coordinates from a Gaussian distribution.
- type random_embedding_mean:
- param random_embedding_mean:
Mean \(\mu\) used when random_embedding is True.
- type random_embedding_std:
- param random_embedding_std:
Standard deviation \(\sigma\) used when random_embedding is True.
- type random_embedding_seed:
- param random_embedding_seed:
Seed controlling the random embedding when random_embedding is True.
- raises ValueError:
If the graph cannot be constructed from the provided edges.