Directional Codes in Quantum Systems
- Directional codes are constructions that explicitly encode directional or anisotropic structure in systems like quantum LDPC codes and finite-precision number representations.
- They provide a unified framework for optimizing hardware schedules, decoder design, and topological phase engineering across quantum error correction and geometric signal processing.
- By leveraging directional strategies, these codes improve error rates, decoding efficiency, and angular fidelity while unifying distinct methodologies in coding theory and neural representations.
Directional codes are a class of constructions in which directional, orientational, or anisotropic structure is made explicit in the code definition rather than treated as incidental. In current arXiv literature, the term is used in several technically distinct ways. The most specific usage denotes a family of hardware-motivated quantum low-density parity-check (qLDPC) codes defined by stabilizer-measurement routes on square- and hex-grid hardware (Gehér et al., 25 Jul 2025). Closely related work studies the algebraic structure of such route-generated CSS codes (Rowshan, 22 Feb 2026), directionally informed decoding for quantum codes (Rowshan, 12 Jan 2026), and topological-code modifications with explicit anyonic confinement along one spatial direction (Rubio, 27 Jun 2025). In another line of work, “directional codes” denotes product-structured finite alphabets for preserving vector direction under low-precision quantization (Zadeh et al., 8 May 2026). A related geometric theme also appears in spatio-directional neural encodings on (Weier et al., 5 Mar 2026).
1. Directional Codes as qLDPC codes on local-connectivity hardware
The qLDPC family called “Directional Codes” is defined on the infinite square lattice , with data qubits on
and ancilla qubits on the complementary checkerboard sublattice. A code is specified by a direction sequence with , a layout assigning each ancilla to an -type or -type plaquette, and two lattice vectors used to wrap the plane onto a torus (Gehér et al., 25 Jul 2025).
Syndrome extraction is implemented by simultaneous layers of controlled-Pauli-then-swap gates. For an 0 plaquette ancilla 1, the elementary operation is
2
and for a 3 plaquette ancilla the CX is replaced by CZ. Up to single-qubit Cliffords, both CXSWAP and CZSWAP are equivalent to the native iSWAP gate. In each round, ancillas are reset in 4, the 5 directional layers are applied, and ancillas are measured in the 6 basis. Each ancilla thereby “slides” across the lattice and measures a weight-7 plaquette operator supported on the data qubits it visits. Under mild nondegeneracy conditions on the torus identification, this yields a finite CSS stabilizer code on 8 (Gehér et al., 25 Jul 2025).
Several small-weight families were isolated explicitly. The weight-4 NEEN sequence yields a linear transform of the distance-9 toric code. The weight-5 0 family uses only hexagonal-grid connectivity, degree-1 per qubit. The weight-6 2 family admits a rectangular torus on the square grid, and the weight-7 3 family admits a layout on square or hex grid (Gehér et al., 25 Jul 2025).
The principal finite families studied numerically encode 4, 5, or 6 logical qubits.
| Family | Parameters | Connectivity or performance claim |
|---|---|---|
| 7 | 8, 9, distance 0 | Hexagonal-grid connectivity; comparable to four RPC copies at 1 of the total qubit count at 2 |
| 3 | 4, 5, distance 6 | Beats six RPC copies using 7 of qubits |
| 8 | 9 or 0, 1, distance 2 | Beats twelve RPC copies using 3 of qubits at equal distance 4 |
The numerical evaluation used the superconducting-inspired SI-1000 circuit-level Pauli noise model over five full QEC rounds, with BP-OSD decoding. At 5, the reported logical error probabilities were favorable relative to repeated rotated planar code instances. A representative 6 comparison gave RPC7 with 8 total qubits and 9, versus 0 1 with 2 total qubits and 3, 4 5 with 6 total qubits and 7, and 8 9 with 0 total qubits and 1 (Gehér et al., 25 Jul 2025).
2. Word-first structural theory of route-generated codes
A later structural treatment places these qLDPC constructions into a “word-first” framework for route-generated, translation-invariant CSS codes on rectangular tori (Rowshan, 22 Feb 2026). The starting object is a direction word
2
over the alphabet
3
With partial sums
4
the route-to-support lemma defines midpoint offsets
5
On a checkerboard torus 6, an ancilla at 7 interacts with data qubits at 8, and the support pattern is
9
This supplies a closed-form route-to-support map (Rowshan, 22 Feb 2026).
The central commutation invariant is the odd-multiplicity difference lattice. From the multiset of pairwise differences
0
one extracts
1
The layout coset theorem states that on the infinite checkerboard lattice any commuting CSS layout 2 must be constant on cosets of 3:
4
Conversely, any such coset-constant labeling gives a translation-invariant CSS code satisfying 5–6 commutation (Rowshan, 22 Feb 2026).
The same framework gives conservative finite-torus admissibility criteria. Defining
7
a sufficient bound is
8
Under these inequalities, no nonzero relevant offset vanishes modulo 9, so the infinite-lattice schedule remains collision-free on the torus (Rowshan, 22 Feb 2026).
The theory also quotients the search over direction words by dihedral lattice symmetries 0, reversal plus inversion, and cyclic shifts. The equivalence class has size at most 1, and canonicalization chooses the lexicographically smallest representative in expanded-letter form. An inverse problem is solved as well: a translation-invariant support pattern 2 is realizable by a single route iff, for some ordering 3, one has 4, each difference 5 lies in
6
and the recursion
7
stays in 8 at every step. Failure certifies non-realizability (Rowshan, 22 Feb 2026).
As a case study, the word 9 has
0
1
For thin rectangles 2 with row alternation, the exact criterion is
3
This makes the dependence of code dimension on boundary conditions completely explicit (Rowshan, 22 Feb 2026).
3. Decoding anisotropy and directional confinement in related quantum-code constructions
The directional-code program in quantum error correction extends beyond code construction to decoding and topological phase engineering. In directionally informed BP decoding for CSS codes, one assigns nonnegative orientation weights 4 to Tanner-graph edges and aggregates them into per-qubit weights
5
For a fixed syndrome 6, each degeneracy class is scored by the minimum weighted Hamming cost
7
leading to the directional degeneracy enumerator
8
A single bias parameter 9 maps the weights to site-dependent log-likelihood ratios through
00
which plug directly into standard BP01OSD decoders without altering the code itself (Rowshan, 12 Jan 2026).
The framework yields weighted-distance bounds,
02
and a MacWilliams-type expression for the global directional enumerator. Finite-length code-capacity simulations were reported for a planar NE3N code 03 on an 04 lattice and a toric code 05 with 06. For both families, a modest bias strength 07 reduced the logical error rate by one to two orders of magnitude at physical error rates in the 08–09 range, with a clear optimum around 10–11 in the toric-code example (Rowshan, 12 Jan 2026).
A different use of directional structure appears in twisted toric codes with explicit anyonic confinement along one spatial direction. There, vertical plaquette terms are twisted by a group 12-cocycle through projective representations of 13. A vertical string
14
excites 15 plaquettes, so its energy cost grows linearly with vertical length, whereas horizontal strings of 16 remain deconfined. Binding a left-confined string and a right-confined string produces
17
which creates dipolar excitations that can move vertically without extra plaquette cost but cannot move horizontally without breaking the bound state. On a torus, the logical-operator structure depends on the parity of 18: when 19 is odd, there are two logical operators and one logical qubit; when 20 is even, there are four logical operators and two logical qubits (Rubio, 27 Jun 2025).
These two developments are technically distinct. One alters priors and degeneracy accounting for a fixed quantum code (Rowshan, 12 Jan 2026); the other alters the Hamiltonian itself to induce anisotropic excitation structure (Rubio, 27 Jun 2025). This suggests that “directionality” in quantum coding theory now functions at three levels: code construction, decoder design, and phase engineering.
4. Direction-preserving number representations
In low-precision numerical computing, directional codes are product-structured codes induced by a finite scalar alphabet 21 common to all coordinates (Zadeh et al., 8 May 2026). For block dimension 22, the achievable directions are
23
and worst-case angular fidelity is measured by the spherical covering radius
24
Equivalently,
25
For alphabet size 26, the best achievable product-code coverage is
27
The theory compares these product codes with unconstrained spherical codes of the same total size. In dimension 28, the exact planar optimum is 29. If 30, then 31. Otherwise,
32
Except for the antipodal binary case, every two-coordinate product code is therefore strictly worse than the best unconstrained 33-D spherical code with the same number of points (Zadeh et al., 8 May 2026).
In high dimension with fixed alphabet size 34, the gap persists asymptotically. A harmonic-witness lower bound gives
35
where 36. A sphere-covering upper bound via Wyner’s theorem shows that for any 37 there exists 38 such that for all 39,
40
Combining the two yields
41
for large 42. Thus, for fixed bit-width 43 with 44, no product-code alphabet of size 45 matches the angular coverage of the best spherical code under the same storage budget (Zadeh et al., 8 May 2026).
Within the product-code class, standard scalar formats are also suboptimal. For any 46-bit floating-point family, including fixed-point and two’s complement as special cases,
47
whereas an optimal 48-symbol alphabet satisfies
49
For 50, the latter constant is strictly larger; for 51, the asymptotic constant-factor gap is at least 52 (Zadeh et al., 8 May 2026).
The paper then optimizes alphabets numerically by sampling one million random directions on 53, using the scale-search algorithm of Theorem A.18 inside a derivative-free optimizer, with global Differential Evolution and local Powell refinement. By scale invariance, the smallest nonzero level is set to 54. For 55 bits and 56, the optimized positive levels are
57
The sampled worst-case angular errors reported for 58 were as follows (Zadeh et al., 8 May 2026):
| Format | Errors across 59 |
|---|---|
| Optimized | 60 |
| E2M1 (NVFP4) | 61 |
| INT/E1M2 | 62 |
| E3M0 | 63 |
The near-optimality of NVIDIA’s E2M1 is therefore given a geometric explanation: it closely approximates the optimized alphabet for 64-bit settings and target block sizes up to at least 65 (Zadeh et al., 8 May 2026).
5. Spatio-directional neural encodings
A related, though terminologically distinct, development appears in neural scene representation and rendering, where the problem is to encode directional signals on 66 without the distortions, singularities, and discontinuities induced by Cartesian parameterizations (Weier et al., 5 Mar 2026). The “hash-sphere” encoding begins from a hierarchical geodesic grid: level 67 tessellates the unit sphere into the 68 triangular faces of a regular icosahedron, and each higher level subdivides every triangle into 69 sub-triangles by bisecting edges and projecting new points back onto 70. At level 71, the vertex set satisfies 72.
For a query direction 73, one finds the enclosing triangle 74 with vertices 75, computes barycentric coordinates 76, and interpolates learned features:
77
The final directional feature is
78
which is passed to a small MLP, for example 79 layers with 80 neurons and identity or ReLU activations, with final exponential or sigmoid depending on the application (Weier et al., 5 Mar 2026).
The five-dimensional “hash-grid-sphere” couples this directional encoding to the spatial hash-grid of Müller et al. 2022. Using the same number of spatial levels 81 but only 82 directional refinement levels, controlled by a map such as 83, the per-level feature at query 84 is
85
The stated theoretical advantages are that factored interpolation respects 86 topology and 87 topology independently, angular and spatial resolution are controlled separately through 88, hashing bounds memory by 89 rather than 90, and each sample touches only 91 entries per level versus 92 for a 93-D grid (Weier et al., 5 Mar 2026).
The implementation measurements were reported on an RTX 4070 in half precision. For a pure directional task with 94, 95, and 96, hash-sphere used 97 MB and 98 ms/frame; a 99-D polar hash-grid used 00 MB and 01 ms; and a 02-D Cartesian hash-grid used 03 MB and 04 ms. In a 5D radiance-field experiment on the Phone scene, 05D hash-grid + SH(100) used 06 MB and 07 ms, a 08D hash-grid used 09 MB and 10 ms, and hash-grid-sphere used 11 MB and 12 ms. For neural path guiding on an HD frame with 13 candidates, the baseline hash-grid + One-Blob with a large MLP used 14 MB and 15 ms, whereas hash-grid-sphere with a small MLP used 16 MB and 17 ms (Weier et al., 5 Mar 2026).
Empirically, the path-guiding results reported up to 18 lower variance for equal rendering time. Across the scenes “Veach Caustics,” “Kitchen Indirect,” “Living Room Indirect,” and “Staircase,” the method with 19 candidates consistently outperformed the baseline with 20. In simple single-bounce diffuse scenes both encodings performed similarly, whereas in multi-bounce glossy scenes the baseline produced “splotchy” cache artifacts and the hash-grid-sphere remained stable (Weier et al., 5 Mar 2026).
6. Terminological scope and conceptual distinctions
The literature therefore uses “directional codes” in more than one formal sense. In qLDPC theory, a directional code is a route-generated stabilizer code whose checks are induced by a direction word and measured through local iSWAP-compatible circuits on checkerboard lattices (Gehér et al., 25 Jul 2025). In the structural analysis of those codes, the direction word is elevated to the primary algebraic object, from which one derives support patterns, commutation lattices, equivalence classes, and boundary-sensitive dimension formulas (Rowshan, 22 Feb 2026). In decoding, direction enters as an anisotropic prior over qubits and as a degeneracy-weighting scheme on Tanner graphs (Rowshan, 12 Jan 2026). In low-precision arithmetic, directional codes are product codes on 21 evaluated by worst-case angular coverage (Zadeh et al., 8 May 2026). In neural representation, the analogous object is a directional encoding on 22 coupled to a spatial hash-grid (Weier et al., 5 Mar 2026).
These usages suggest a shared methodological pattern: direction is not merely metadata but an organizing variable that changes the combinatorics, geometry, or energetics of the representation. The consequences are domain-specific. In qLDPC constructions, direction words determine stabilizer footprints and hardware schedules (Gehér et al., 25 Jul 2025, Rowshan, 22 Feb 2026). In twisted toric codes, direction determines which anyons are linearly confined and which dipoles remain mobile (Rubio, 27 Jun 2025). In product-structured number representations, direction determines the governing approximation metric, namely worst-case angular error (Zadeh et al., 8 May 2026). In neural rendering, direction determines the topology of the latent grid and the interpolation rule on 23 (Weier et al., 5 Mar 2026).
By contrast, “codes for directional solidification” in phase-field benchmarking refers to massively parallel simulation implementations rather than to code constructions in the coding-theoretic or geometric sense (Tian et al., 10 Feb 2026). That distinction is useful because it separates terminological overlap from substantive continuity. The primary continuous thread across the actual directional-code literature is the formalization of anisotropy: route anisotropy in lattice codes, noise anisotropy in decoding, confinement anisotropy in topological order, angular anisotropy in finite alphabets, and spherical anisotropy in neural signal representations.