neuralqx.graph.hypercube module¶
- class HypercubeGraph(N, *, plot=False, non_planar=False, random_embedding=False, random_embedding_mean=0.0, random_embedding_std=5.0, random_embedding_seed=123)¶
Bases:
Graph\(N\)-dimensional hypercube graph \(Q_N\).
Vertices correspond to bit-strings of length \(N\), i.e. \(\{0,1\}^N\), and two vertices are adjacent iff they differ in exactly one bit (Hamming distance one). Consequently:
\[|V| = 2^N,\qquad |E| = N\,2^{N-1}.\]The graph is constructed from
networkx.generators.hypercube_graph(), then relabelled to consecutive integer vertex labels before being passed toGraph. Ifnon_planar=True, vertices are relabelled to 3-tuples and may be given a random spatial embedding.- Parameters:
N (
int) – Hypercube dimension.plot (
bool) – If True, produce a visualisation via the base graph machinery.non_planar (
bool) – If True, relabel vertices to 3-tuples to trigger the non-planar pipeline.random_embedding (
bool) – If True, assign a random 3D embedding to vertices (non-planar only).random_embedding_mean (
float) – Mean of the Gaussian used for the random embedding.random_embedding_std (
float) – Standard deviation of the Gaussian used for the random embedding.random_embedding_seed (
int) – Seed controlling the random embedding.
- property N¶