A four-dimensional toric code on the D4 lattice

A four-dimensional toric code on the D
4
lattice:
[[16L
4
, 6, 2L
2
]] with weight-4 X-stabilizers
Raghu Kulkarni
SSMTheory Group, IDrive Inc., Calabasas, CA 91302, USA
raghu@idrive.com
Abstract
We construct a four-dimensional toric code on the D
4
lattice, the densest lattice packing in
four dimensions, by placing qubits on the 16L
4
triangles of its Delaunay decomposition into
regular 16-cells. Each X-stabilizer acts on the 4 triangles of a tetrahedron, the smallest weight
such a check can have, and each Z-stabilizer on the 8 triangles meeting along an edge. We
prove that the code is [[16L
4
, 6, 2L
2
]] for every even L ≥ 4. A logical operator must cast a
shadow covering a two-dimensional cross-section of the torus, and a single triangle shadows
an area of at most 1/2, so at least 2L
2
qubits are needed; a close-packed plane of the lattice
attains this bound exactly. Because the distance is twice the hypercubic value at equal side
length, the code reaches distance d with 4d
2
physical qubits against 6d
2
for the hypercubic
four-dimensional toric code. A hook-error analysis shows that the weight-8 checks cost no
more at circuit level than the weight-4 ones. Neither sector has point-like excitations, and the
code’s equal-time slices are the face-centred-cubic lattice. Flat four-space has three regular
honeycombs, and this code completes the regular case. All results are verified by published
scripts.
Keywords: quantum error correction; four-dimensional toric code; D
4
lattice; 16-cell honey-
comb; code distance; self-correcting quantum memory; hook errors
1 Introduction
The four-dimensional toric code is the standard example of a quantum memory that protects
itself. In two dimensions, errors form strings whose ends are free to wander, and a chain of errors
costs no more energy than a short one. In four dimensions both kinds of error form closed loops
instead, and a big loop costs more energy than a small one. Thermal noise is therefore pushed
back rather than allowed to spread [1, 12, 13]. On the hypercubic lattice the code is [[6L
4
, 6, L
2
]],
with qubits on square faces and weight-6 checks on edges and cubes [1, 4].
Known variants change the shape of the space or the shape of the support. Codes with qubits
on the 2-faces of regular tessellations of hyperbolic four-space keep the sheet-like logical operators
and gain a growing rate: Guth and Lubotzky built the first such family [14], Londe and Leverrier
used the {4, 3, 3, 5} tessellation by hypercubes [15], and Breuckmann and Londe used the self-
dual {5, 3, 3, 5} tessellation by 120-cells and decoded it single-shot [16]. Brell placed the code
on fractal subsets of the hypercubic lattice that fit in three dimensions [5], and four-dimensional
colour codes are self-correcting as well [17, 6]. Closest to this work, Jochym-O’Connor and Yoder
built four-dimensional toric codes on the 24-cell tessellation with qubits on 3-cells [7], and Kubica
and Vasmer showed those codes to be gauge fixings of their four-dimensional subsystem toric
1
code, with the 16-cell honeycomb turning up as the alternated lattice of that correspondence [2].
In that correspondence the qubits of the 16-cell honeycomb sit on its edges, which under duality
are the 3-cells of the 24-cell honeycomb. The code on this lattice is then the (1, 3) toric code,
whose logical operators are strings and volumes [7, 9].
Here we take a different sector of the same geometry and put the qubits on the triangles, which
gives the (2, 2) code. Both kinds of logical operator are then sheets and both kinds of excitation
are loops, which is the structure that makes the four-dimensional toric code self-correcting [3]. The
honeycomb carries exactly three such sectors, with qubits on edges, triangles or tetrahedra. The
first and third are codes of the same type, with strings and volumes as logical operators and the
roles of X and Z exchanged. The middle one is self-dual: duality takes triangles of this honeycomb
to 2-cells of the 24-cell honeycomb, so its code is the face code of either honeycomb. So this sector
is not the dual of the (1, 3) code and does not appear in that correspondence, and it is the only
self-correcting sector the lattice has. Building a (2, 2) code on a four-dimensional complex is a
standard construction, and in hyperbolic space it has been done on regular tessellations [14, 15, 16].
Flat four-space has exactly three regular honeycombs. The tesseractic one gives the hypercubic
code. The 16-cell and 24-cell honeycombs are dual to each other, so their (2, 2) codes are one code
with X and Z exchanged, and that code is the subject of this paper. It is the remaining regular
case in flat space. What is new here is that code and its exact parameters. We are not aware of
a previous construction of it.
We use the lattice that four-dimensional geometry singles out. D
4
is the four-dimensional
checkerboard: the densest lattice packing in four dimensions, in which every point touches 24
others [25]. Its gaps are all of one kind, which is special to D
4
, and filling them in gives a
honeycomb of identical regular 16-cells. The resulting code has three properties we want to set
out first.
(i) The X-checks are as small as they can be. The 3-cells of this honeycomb are tetra-
hedra, so every X-check touches 4 qubits. A 3-cell has at least 4 faces, so no check of this
type can be smaller. The price is a weight-8 Z-sector.
(ii) The distance is 2L
2
. That is twice the hypercubic value at the same L. Section 5 proves
it. Section 8 works out what this costs in hardware: at a fixed target distance the code
needs one third fewer qubits than the hypercubic code.
(iii) Slicing gives the FCC lattice. Cutting at a fixed value of the fourth coordinate leaves the
face-centred-cubic lattice, and the cut passes cleanly through the honeycomb. A minimum-
weight logical operator of the whole four-dimensional code lies inside one such slice.
Every claim is checked by computer at L = 4; the scripts are listed in the Data Availability
Statement and run in minutes. Structural claims hold for all even L ≥ 4 by the arguments given.
The case L = 2 is degenerate, the torus is too small and edges collapse, so L ≥ 4 throughout. A
related construction on the three-dimensional close-packed lattice appears in [27].
2 The lattice and its honeycomb
Take the points of Z
4
whose coordinates add up to an even number:
D
4
= {x ∈ Z
4
: x
1
+ x
2
+ x
3
+ x
4
is even},
and wrap them on a four-dimensional torus of even side L. Two points are neighbours when they
differ by a root: a vector with two entries equal to ±1 and two entries equal to 0. There are 24
2
roots, so every point has 24 neighbours. That is the largest number possible in four dimensions
[25, 26]. The same lattice appears elsewhere in quantum error correction as the phase-space lattice
of a two-mode Gottesman-Kitaev-Preskill code [23]. That use is unrelated: there D
4
is a lattice
of oscillator displacements, while here it supplies the cells of a qubit code.
The gaps between the points come in three families, odd-sum integer points and two families
of half-integer points, but they are all the same shape. Each gap is surrounded by 8 lattice points
forming a regular 16-cell (Fig. 1a). Filling every gap tessellates the torus with 3L
4
/2 identical
16-cells. This is the Delaunay decomposition of D
4
.
Counting the pieces of the honeycomb:
points edges triangles tetrahedra 16-cells
count L
4
/2 6L
4
16L
4
12L
4
3L
4
/2
L = 4 128 1536 4096 3072 384
The alternating sum is zero, as it must be on a torus. The way the pieces fit together, checked
exhaustively at L = 4 (Fig. 1d): every triangle lies in 3 tetrahedra and in 3 16-cells; every
tetrahedron lies in exactly 2 16-cells; every edge lies in 8 triangles. Triangles are two steps down
from the top dimension here, which is why 3 appears rather than the 2 one expects for a face of
a solid. The number 2 for tetrahedra is the one that matters later. It is what forces error signals
into loops.
3 The code
Definition 1 (D
4
face code). Put one qubit on each triangle of the 16-cell honeycomb. Then:
X-stabilizers: for each tetrahedron, apply X to its 4 triangles (weight 4);
Z-stabilizers: for each edge, apply Z to the 8 triangles containing that edge (weight 8).
Every X-check has weight 4 and every Z-check has weight 8, with no exceptions anywhere on
the torus. Each qubit is touched by 3 checks of each type. The two check types commute because
a tetrahedron and an edge always share an even number of triangles; in the language of chain
complexes, H
X
= ∂
T
3
and H
Z
= ∂
2
, so H
X
H
T
Z
= 0 follows from ∂∂ = 0. We verify it numerically
anyway (Data Availability Statement). This is the hypercubic construction with squares replaced
by triangles and cubes by tetrahedra.
4 What the computer confirms
Theorem 1 (Parameters at L = 4). At L = 4 the code is a valid CSS code with
n = 4096, rk(H
Z
) = 1405, rk(H
X
) = 2685, k = n − rk(H
Z
) − rk(H
X
) = 6.
The number of logical qubits is fixed by the shape of the space rather than by the lattice.
A four-dimensional torus has
4
2
= 6 independent two-dimensional sheets, so k = 6 at every L.
The six X-type logical operators are sheets that wrap the torus; the six Z-type ones are sheets in
the dual honeycomb, which is the 24-cell honeycomb. Both are sheets, as in the hypercubic case
[1, 3].
3
(a) One 16-cell: 8 corners, 24 edges
qubit = triangle (blue),
X
-check = tetrahedron (orange)
(b) The same 16-cell cut by a slice
4 corners in the slice (blue), 4 just outside (red)
X
-check
(this code)
X
-check
(hypercubic)
Z
-check
(this code)
Z
-check
(hypercubic)
0
2
4
6
8
qubits touched by one check
4
6
8
6
smallest possible
(c) Check weights
counted at
L
= 4
value
triangle sits in how many tetrahedra 3
triangle sits in how many 16-cells 3
tetrahedron sits in how many 16-cells 2
edge sits in how many triangles 8
checks touching one qubit 3 + 3
(d) How the pieces
fi
t together
"tetrahedron in 2 16-cells" is why errors make loops
Figure 1: The building blocks. (a) One 16-cell of the honeycomb, drawn in three dimensions:
8 corners and 24 edges. A qubit lives on each triangle (blue); each tetrahedron inside carries
a weight-4 X-check (orange). (b) The same 16-cell cut by a slice: its 8 corners split 4 and 4,
one group in the slice and one group just outside. This is the geometric content of Section 7.
(c) Check weights against the hypercubic four-dimensional toric code: the X-sector reaches the
smallest weight a check of this kind can have; the Z-sector pays weight 8. (d) The verified
incidence counts.
As a further check, an exhaustive scan over all
4096
2
pairs of qubits finds that the only weight-
4 operators that commute with every Z-check are the 3072 tetrahedron boundaries, that is, the
X-stabilizers themselves, with nothing extra, and that no weight-4 operator commutes with every
X-check. Both facts are consistent with the distance computed next.
5 The distance is exactly 2L
2
Here is the argument in words before we give it properly. A logical operator is a sheet that wraps
the torus. Look at its shadow: pick two of the four coordinates and squash the torus onto that
two-dimensional cross-section. A wrapping sheet has to shadow the whole cross-section, with no
gaps. The cross-section has area L
2
, and one triangle can shadow at most an area of 1/2, so at
least 2L
2
triangles are needed. A close-packed plane of the lattice has exactly that many.
4
This is the systolic argument that underlies distance bounds for homological codes [18, 14].
What is particular to this lattice is the local constant, and the fact that it is attained exactly.
The local ingredient comes first.
Lemma 1 (How big a shadow can be). Let π
ij
be the map that keeps only the coordinates x
i
and x
j
. Every triangle f of the honeycomb has area(π
ij
(f)) ≤
1
2
, and every 2-cell f
∗
of the dual
24-cell honeycomb has area(π
ij
(f
∗
)) ≤
1
4
. Both values are reached.
Proof. A triangle is {v, v + r, v + s} where r, s and r − s are all roots, so its shadow is a triangle
of area
1
2
|r
i
s
j
− r
j
s
i
|. A root has exactly two nonzero entries, each ±1, so |r
i
s
j
− r
j
s
i
| ≤ 2. The
value 2 needs r and s to both live on the coordinates i and j with opposite sign patterns, say
r = (1, 1, 0, 0) and s = (1, −1, 0, 0). But then r − s and r + s each have a single entry ±2, and
neither is a root, so there is no such triangle. Hence |r
i
s
j
− r
j
s
i
| ≤ 1 and the area is at most
1
2
.
It is reached, for instance by r = (1, 1, 0, 0) and s = (1, 0, 1, 0) shadowed onto (x
1
, x
2
).
A 2-cell of the dual honeycomb is the triangle joining the centres of the 3 16-cells that contain
a given triangle (Section 2). Running through the 96 kinds of triangle and all 6 coordinate pairs
gives a largest shadow of
1
4
. The computation is the published script projection.py (Data
Availability Statement); it is exact arithmetic and takes a second.
Theorem 2 (Lower bound). For even L ≥ 4, every X-type logical operator has weight at least
2L
2
, and every Z-type logical operator has weight at least 4L
2
.
Proof. Let z be an X-type logical operator, that is, a sheet that wraps the torus in a way no
stabilizer can undo. Its wrapping class lives in H
2
(T
4
; F
2
), which has a basis labelled by the six
pairs of coordinates; choose a pair (i, j) appearing in the class of z, and write π for the shadow
map onto (x
i
, x
j
).
Suppose some point p of the cross-section were missed by the shadow. Then z would lie entirely
inside the part of the torus lying over the punctured cross-section. A punctured two-dimensional
torus carries no wrapping sheets at all, so the class of z would have to be trivial in the (i, j)
direction , contradicting the choice of (i, j). So the shadow covers every point of the cross-section.
Areas can only add up, so
X
f∈supp z
area
π(f)
≥ area
cross-section
= L
2
.
By Lemma 1 each term is at most
1
2
, so z contains at least 2L
2
triangles.
A Z-type logical operator is the same kind of object in the dual honeycomb, where the qubits
correspond one-to-one to dual 2-cells. The same argument with the constant
1
4
gives at least
4L
2
.
Theorem 3 (A logical operator of exactly this size). Let L be even and c even, and let
Π
c
= {x : x
1
+ x
2
+ x
3
≡ c mod L, x
4
= 0}.
Then Π
c
contains exactly L
2
lattice points, and the 2L
2
triangles they span are triangles of the
honeycomb and form an X-type logical operator. Hence d
X
≤ 2L
2
.
Proof. Because L is even, fixing x
1
+ x
2
+ x
3
modulo L also fixes it modulo 2; for c even all L
2
solutions have even coordinate sum and so lie in D
4
. The roots that stay inside Π
c
are those with
r
4
= 0 and r
1
+ r
2
+ r
3
= 0, of which there are six, so the points of Π
c
form a triangular lattice,
5
a close-packed plane (Fig. 2a). A triangular lattice with N points on a two-dimensional torus
has 3N edges and 2N triangles, and every edge belongs to exactly two of them. Every Z-check
therefore sees an even number of triangles, so the set commutes with all of them; and the sheet
wraps the torus, so no product of stabilizers can remove it. With N = L
2
its weight is 2L
2
.
Corollary 1 (Parameters). For every even L ≥ 4 the D
4
face code has d
X
= 2L
2
and d
Z
≥ 4L
2
,
so
d = min(d
X
, d
Z
) = 2L
2
, and the code is [[ 16L
4
, 6, 2L
2
]].
The bound is tight for a reason one can see in the picture. Each of the 2L
2
triangles of Π
c
shadows an area of exactly
1
2
, the most allowed, and the shadows tile the cross-section once with
no overlaps and no gaps (Fig. 2b). Nothing is wasted, which is why the constant comes out exact
instead of only having the right order.
(a) A minimum-weight logical operator
a close-packed plane of the lattice (grey = other lattice points)
0 1 2 3 4
x
1
0
1
2
3
4
x
2
(b) Its shadow covers the square exactly once
32 shadows of area
1/2
add to
16 =
L
2
: nothing wasted
6 8 10 12 14 16 18 20 22 24 26 28 30 32
weight of the operator
no logical operator exists
at any of these weights
2
L
2
= 32
(c) Brute-force search on the slice code,
L
= 4
odd weights are ruled out on parity grounds
10 20 30 40 50 60 70 80
distance
d
0
5000
10000
15000
20000
25000
30000
35000
40000
physical qubits
n
one third fewer
qubits
(d) Cost at the same distance
hypercubic:
6
d
2
D
4
face code:
4
d
2
Figure 2: The distance. (a) A minimum-weight logical operator: a close-packed plane of the
lattice, L
2
points carrying 2L
2
triangles. Grey dots are the other lattice points nearby. (b) Its
shadow on a two-dimensional cross-section at L = 4: 32 triangles, each of area 1/2, tiling an
area of 16 = L
2
exactly once. Nothing is wasted, which is why the bound is attained. (c) The
brute-force search on the slice code at L = 4: no logical operator exists at weight 30 or below,
and one exists at 32, matching what the shadow argument predicts. Odd weights need not be
tested, by the parity remark in Section 5. (d) Physical qubits needed to reach a given distance,
against the hypercubic four-dimensional toric code.
6
Only even weights can occur. Every triangle lies on 3 edges, so adding up all the Z-checks
gives the operator acting on every qubit at once. Anything commuting with all the Z-checks must
overlap that operator evenly, and so has even weight. Every triangle also lies in 3 tetrahedra, so
the same holds in the other sector. Odd weights are therefore impossible on both sides. The first
argument also holds on a slice, where each triangle still lies on 3 edges, which is why the search
below tests even weights only.
A check on the argument. The shadow argument applies just as well to the three-dimensional
face code on a slice, where it again predicts a smallest logical operator of weight 2L
2
. That code
is small enough to settle by brute force. We encoded “there is a logical operator of weight at most
w” as a satisfiability problem, with parity constraints from the checks, one constraint forcing
the operator to be nontrivial, and a counter limiting the weight, and raised w one step at a time
(script slice3d distance.py, Data Availability Statement). At L = 4 the answer is unsatisfiable
at every even weight up to 30 and satisfiable at 32. The slice code therefore has smallest logical
operator of weight exactly 32 = 2L
2
, which is what the shadow argument says it should be. We
have not run the same search on the four-dimensional code, where n = 4096 puts it out of reach;
there the distance rests on Corollary 1.
On the Z side, reducing logical operators greedily against the Z-stabilizers stops at weight
exactly 64 = 4L
2
, so the bound of Theorem 2 is attained and d
Z
= 4L
2
at L = 4.
Which logical qubits have flat operators. Not all six do. A flat sheet spans two roots
whose difference is again a root, and such a pair always lies inside three of the four coordinates.
Its wrapping class is therefore built from the three coordinate pairs inside that triple, and there
are only four triples, whose classes add up to zero. Flat sheets thus reach only a three-dimensional
slice of the six-dimensional space of classes. An exhaustive search at L = 4 finds 128 flat sheets,
every one of weight 32, realising four classes that span three dimensions, and every one of them
lying inside a slice x
i
= const, that is, inside a copy of the FCC lattice (Section 7). Classes outside
that three-dimensional part have no flat operator at all, which is the homological restatement of
the fact that a flat coordinate plane of D
4
contains no triangles. We have not found their minimum
weights. A seeded search at L = 4, one class in each of three independent directions outside the
flat part, finds operators of weight 78, 116 and 126. These are upper bounds, not minima. They
do not change d, which is a minimum over all classes.
6 Excitations are loops, never points
Theorem 4 (No point excitations). Neither sector of the D
4
face code has point-like excitations:
(a) no error can light up a single X-check. The linear system H
X
y = e
t
has no solution for
one tetrahedron t (verified directly). The reason is that every tetrahedron sits in exactly two
16-cells, so the lit checks around each 16-cell must come in pairs and the pattern closes into
a loop in the dual honeycomb;
(b) no error can light up a single Z-check, for a reason that needs no computation: the pattern
of lit edges is always the boundary of a set of triangles, and a boundary is always a closed
loop. A single edge is not a closed loop.
Loops in both sectors are what make the hypercubic four-dimensional toric code self-correcting.
Making an excitation costs energy in proportion to its length, so noise cannot spread cheaply [1, 3],
7
and the D
4
face code has the same structure. This settles the excitations, not the thermodynam-
ics. A free-energy barrier calculation on this honeycomb, matching what has been done for the
hypercubic code [1, 12, 4], is still to be done. One detail matters for anyone building a decoder:
a single error lights up 3 checks of each type, an odd number, which follows from the triangular
geometry and is more familiar from colour codes.
7 Slicing gives the FCC lattice
Cut the lattice at a fixed value of the fourth coordinate. What is left is exactly the face-centred-
cubic lattice, and the honeycomb cuts cleanly along with it. All of the following is verified at
L = 4:
(a) the slice contains L
3
/2 points, 3L
3
edges, 4L
3
triangles and L
3
tetrahedra, which are the
points, edges, triangles and tetrahedra of the three-dimensional tetrahedron-octahedron
honeycomb, the complex obtained by filling the gaps of the FCC lattice; its octahedra
appear as cross-sections of 16-cells, item (c);
(b) every edge in the slice lies in exactly 4 triangles of the slice, which is the Z-check weight of
the three-dimensional face code on that lattice;
(c) the gaps cut cleanly. A 16-cell centred in the slice meets it in an octahedron (6 of its 8
corners); a 16-cell centred between slices meets it in a tetrahedron (4 of 8, with the other 4
in the next slice, Fig. 1b); a 16-cell a full step away meets it in a single corner and contributes
nothing.
The slices carry the code’s best logical operators. By Theorem 3 a minimum-weight logical
operator of the whole four-dimensional code is a close-packed plane of one of them, and by the
last part of Section 5 every flat logical operator lies in a slice.
Someone has already built a decoder for this geometry. The FCC lattice of a slice carries
a known three-dimensional toric code with qubits on its edges [22, 2], and it is dual to the rhombic
dodecahedral lattice. On that lattice Vasmer, Browne and Kubica proved that a local decoder
based on the sweep rule has a non-zero error threshold, and they measured how well it works
when the checks themselves are noisy [10]. The sweep rule works on any locally Euclidean lattice,
and the sweep decoder built from it covers toric codes in three or more dimensions [11], so it is
the first thing to try here.
Two warnings. The slice inherits the geometry but not the code. A tetrahedron that straddles
a slice leaves only one of its triangles inside, so cutting the checks down to a slice gives weight-1
operators rather than the three-dimensional code. We have also not run the sweep decoder on
the 16-cell honeycomb or measured its threshold there. The slice says where to start looking.
The 16-cell honeycomb is also the alternated lattice through which Kubica and Vasmer relate
the four-dimensional subsystem toric code to the 24-cell toric codes of Jochym-O’Connor and
Yoder [2, 7], and the three-dimensional subsystem toric code of that same correspondence is the
standard single-shot code [2, 8]. The lattice is already present in the single-shot and self-correction
literature; the triangle sector is not. Writing down a dimension-jump protocol [24] along a slice
remains open.
8
8 Comparison with the hypercubic code
The natural comparison is at equal distance, not at equal side length. Side length is not compa-
rable between two different lattices; distance is what a device designer is buying. The hypercubic
code needs L
2
= d, hence n = 6d
2
qubits. The D
4
face code needs 2L
2
= d, hence n = 16L
4
= 4d
2
.
hypercubic [1, 4] D
4
face code (this work)
lattice Z
4
D
4
(densest packing)
qubit cell square faces triangles
parameters [[6L
4
, 6, L
2
]] [[16L
4
, 6, 2L
2
]]
qubits at equal d 6d
2
4d
2
X-check weight 6 4 (smallest possible)
Z-check weight 6 8
checks per qubit 4+4 3+3
point excitations none none (verified)
three-dimensional slice cubic lattice FCC (tet–oct) lattice
Comparing instead at equal side length would suggest the D
4
code spends 8/3 times as many
qubits. That comparison is misleading, because at the same L the D
4
code also has twice the
distance. At equal distance it uses two thirds as many qubits as the hypercubic code, with smaller
X-checks and fewer checks per qubit in both sectors. What it pays for this is a weight-8 Z-sector.
The largest check in the code grows from 6 to 8. On hardware where cost is set by the largest
check rather than by the qubit count, that is the number to weigh.
8.1 The weight-8 checks and hook errors
A bigger check takes a longer circuit to measure, and a longer circuit gives a single fault more
chances to spread onto data qubits. This is the natural worry about a weight-8 sector, so we
checked it.
Measure a weight-w Z-check by preparing an ancilla in |0⟩, applying one CNOT from each
data qubit, and measuring the ancilla. A Z fault on the ancilla after k of the CNOTs travels back
through the remaining w − k and lands as a Z error on that suffix of the data qubits. One fault
can therefore produce a data error of weight up to w − 1: up to 7 here. These are the hook errors
of Ref. [1].
What matters is not the raw weight but the smallest weight the error can be reduced to using
the stabilizers, since two errors differing by a stabilizer are the same error. Adding the whole check
turns a suffix of length s into the complementary prefix of length w − s, so the long suffixes are
cheap and the middle one is the worst. Running every suffix through an exact minimum-weight
coset search (script hooks.py; the code is translation invariant, so one check of each type settles
it) gives:
suffix length 1 2 3 4 5 6 7
weight-8 Z-check, reduced to 1 2 3 4 3 2 1
weight-4 X-check, reduced to 1 2 1
9
So one fault behaves like a weight-2 error in the X sector and a weight-4 error in the Z sector,
and the circuit distances are at least
d
X
2
=
2L
2
2
= L
2
,
d
Z
4
≥
4L
2
4
= L
2
.
The two sectors come out equal. The Z sector has twice the distance and twice the hook weight,
and the factors cancel, so the weight-8 checks are no worse in this respect than the weight-4 ones.
Both sectors lose a factor of 2, which is the usual price of going to circuit level.
Two limits on this. It is a lower bound from counting, not a measured circuit distance, so
the true value may be higher. And it covers single faults; correlated multi-fault events are not
included. It is the standard check, and it says the weight-8 sector is not the weak point one might
expect, but it is not a threshold.
9 Open problems
The Z-distance for general L. We prove d
Z
≥ 4L
2
everywhere and exhibit a weight-4L
2
operator
at L = 4, so d
Z
= 4L
2
there. A general-L construction would close this. It does not affect d,
which is 2L
2
either way.
The classes with no flat operator. Their smallest logical operators weigh at least 2L
2
, and
the search at L = 4 finds operators of weight 78, 116 and 126 in three independent directions.
Identifying them would complete the picture of the code’s logical structure.
Thermodynamics. Loop-only excitations put the code in the self-correcting class, but the
size of the energy barrier and how long the memory survives at a given temperature deserve the
treatment the hypercubic code has received [1, 12, 4].
Decoding. A decoder matched to the triangular geometry, where a single error lights 3 checks
of each type, is the practical next step. The hypercubic four-dimensional toric code already has
several: local decoders based on Toom’s rule [19], a renormalisation-group decoder [20], neural-
network decoders [21], and the sweep decoder [11]. The first three are written for the hypercubic
lattice, while the sweep rule is defined on any locally Euclidean lattice; none has been run on
this honeycomb. There is also a three-dimensional starting point. By Section 7 the slices carry
the rhombic dodecahedral geometry, and a sweep decoder with a proven threshold already exists
there [10]. Section 8.1 shows the weight-8 checks cost the same factor of 2 at circuit level as
the weight-4 ones, so they are not the obstacle. What is still missing is a measured threshold.
Adapting the sweep decoder and running it under a depolarizing gate model would turn the qubit
counts of Section 8 into claims about performance.
Single-shot decoding through a slice. Given the code’s place in the subsystem toric code
correspondence [2, 7], a dimension-jump protocol [24] in which the four-dimensional memory
hands logical information to a three-dimensional code along a slice looks natural. Making it
explicit is the most interesting problem this construction poses.
10 Conclusion
Filling the gaps of the D
4
lattice gives a honeycomb of regular 16-cells, and putting qubits on its
triangles gives a four-dimensional toric code with parameters
[[ 16L
4
, 6, 2L
2
]]
10
for every even L ≥ 4: uniform weight-4 X-checks, which is the smallest possible, weight-8 Z-
checks, three checks of each type per qubit, and no point-like excitations in either sector. The
distance follows from the observation that a logical operator must shadow a whole cross-section
of the torus while a single triangle can shadow only an area of 1/2; a close-packed plane of the
lattice meets that bound exactly, tiling the cross-section once with nothing wasted. Because the
distance is twice the hypercubic value at equal side length, the code reaches a given distance with
4d
2
physical qubits where the hypercubic code needs 6d
2
. Everything needed to reproduce these
statements is in the published scripts and runs in minutes on a laptop.
Data Availability Statement
No data were generated or analysed beyond the code that verifies the results. All scripts are avail-
able as a single archive at https://github.com/raghu91302/ssmtheory/blob/main/d4_toric_
code_scripts.zip. Apart from projection.py, which is a local computation, each rebuilds the
lattice from scratch at L = 4 (and L = 6 where stated) and prints its results. verify all.py
checks every structural number in the paper, including the cell counts, the incidence structure,
CSS validity, the parameters of Theorem 1, both shadow constants, the close-packed plane, the
flat sheets, the slice property and Theorem 4(a), printing a pass or fail for each; a few minutes.
projection.py computes the two shadow constants of Lemma 1 in exact arithmetic and needs
only the standard library; seconds. supplementary.py reproduces the weight-4 scan of Section 4,
the weight-64 Z-type operator of Section 5, and the search over classes with no flat operator;
about ten minutes. slice3d distance.py (with satdist.py) is the brute-force check on the
slice code, and hooks.py reproduces the hook-error table of Section 8.1; a few minutes each.
lemmas.py checks the flat sheets and the classes they span, planes.py checks the close-packed
planes at L = 4 and L = 6, and make figs.py regenerates both figures. Some scripts need numpy;
only the two brute-force searches need python-sat.
Author Contributions
R.K. conceived the study, developed the construction and the proofs, wrote the verification code,
prepared the figures, and wrote the manuscript. The author has read and agreed to the published
version of the manuscript.
Funding
This research received no external funding.
Institutional Review Board Statement
Not applicable.
Informed Consent Statement
Not applicable.
11
Conflicts of Interest
The author declares no conflicts of interest.
References
[1] E. Dennis, A. Kitaev, A. Landahl, and J. Preskill, “Topological quantum memory,” J. Math.
Phys. 43, 4452 (2002). doi:10.1063/1.1499754, arXiv:quant-ph/0110143.
[2] A. Kubica and M. Vasmer, “Single-shot quantum error correction with the three-dimensional
subsystem toric code,” Nat. Commun. 13, 6272 (2022). doi:10.1038/s41467-022-33923-4,
arXiv:2106.02621.
[3] Error Correction Zoo, “(2, 2) Loop toric code,” https://errorcorrectionzoo.org/c/4d_
surface.
[4] T. Bergamaschi, R. Gheissari, and Y. Liu, “Rapid mixing for Gibbs states within a logical
sector: a dynamical view of self-correcting quantum memories,” arXiv:2507.10976 (2025).
[5] C. G. Brell, “A proposal for self-correcting stabilizer quantum memories in 3 dimensions (or
slightly less),” New J. Phys. 18, 013050 (2016). doi:10.1088/1367-2630/18/1/013050.
[6] V. V. Albert and P. Faist, Handbook of Error-Correcting Codes, arXiv:2606.11484 (2026).
[7] T. Jochym-O’Connor and T. J. Yoder, “Four-dimensional toric code with
non-Clifford transversal gates,” Phys. Rev. Research 3, 013118 (2021).
doi:10.1103/PhysRevResearch.3.013118.
[8] H. Bomb´ın, “Single-shot fault-tolerant quantum error correction,” Phys. Rev. X 5, 031043
(2015). doi:10.1103/PhysRevX.5.031043, arXiv:1404.5504.
[9] Error Correction Zoo, “D
4
hyper-diamond lattice,” https://errorcorrectionzoo.org/c/
dfour.
[10] M. Vasmer, D. E. Browne, and A. Kubica, “Cellular automaton decoders for topolog-
ical quantum codes with noisy measurements and beyond,” Sci. Rep. 11, 2027 (2021).
doi:10.1038/s41598-021-81138-2, arXiv:2004.07247.
[11] A. Kubica and J. Preskill, “Cellular-automaton decoders with provable thresholds for topo-
logical codes,” Phys. Rev. Lett. 123, 020501 (2019). doi:10.1103/PhysRevLett.123.020501,
arXiv:1809.10145.
[12] R. Alicki, M. Horodecki, P. Horodecki, and R. Horodecki, “On thermal stability
of topological qubit in Kitaev’s 4D model,” Open Syst. Inf. Dyn. 17, 1 (2010).
doi:10.1142/S1230161210000023, arXiv:0811.0033.
[13] B. J. Brown, D. Loss, J. K. Pachos, C. N. Self, and J. R. Wootton, “Quantum memories at
finite temperature,” Rev. Mod. Phys. 88, 045005 (2016). arXiv:1411.6643.
[14] L. Guth and A. Lubotzky, “Quantum error correcting codes and 4-dimensional arith-
metic hyperbolic manifolds,” J. Math. Phys. 55, 082202 (2014). doi:10.1063/1.4891487,
arXiv:1310.5555.
[15] V. Londe and A. Leverrier, “Golden codes: quantum LDPC codes built from regular tessel-
lations of hyperbolic 4-manifolds,” arXiv:1712.08578.
12
[16] N. P. Breuckmann and V. Londe, “Single-shot decoding of linear rate LDPC quantum codes
with high performance,” arXiv:2001.03568.
[17] H. Bomb´ın, R. W. Chhajlany, M. Horodecki, and M. A. Martin-Delgado, “Self-correcting
quantum computers,” New J. Phys. 15, 055023 (2013). doi:10.1088/1367-2630/15/5/055023,
arXiv:0907.5228.
[18] M. H. Freedman, D. A. Meyer, and F. Luo, “Z
2
-systolic freedom and quantum codes,” in
Mathematics of Quantum Computation (Chapman and Hall/CRC, Boca Raton, 2002).
[19] N. P. Breuckmann, K. Duivenvoorden, D. Michels, and B. M. Terhal, “Local decoders for
the 2D and 4D toric code,” Quantum Inf. Comput. 17, 181 (2017). arXiv:1609.00510.
[20] K. Duivenvoorden, N. P. Breuckmann, and B. M. Terhal, “Renormalization group decoder for
a four-dimensional toric code,” IEEE Trans. Inf. Theory 65, 2545 (2019). arXiv:1708.09286.
[21] N. P. Breuckmann and X. Ni, “Scalable neural network decoders for higher dimensional
quantum codes,” arXiv:1710.09489.
[22] M. Vasmer and D. E. Browne, “Three-dimensional surface codes: transversal gates and fault-
tolerant architectures,” Phys. Rev. A 100, 012312 (2019). doi:10.1103/PhysRevA.100.012312,
arXiv:1801.04255.
[23] B. Royer, S. Singh, and S. M. Girvin, “Encoding qubits in multimode grid states,” PRX
Quantum 3, 010335 (2022). doi:10.1103/PRXQuantum.3.010335, arXiv:2201.12337.
[24] H. Bomb´ın, “Dimensional jump in quantum error correction,” New J. Phys. 18, 043038
(2016). arXiv:1412.5079.
[25] J. H. Conway and N. J. A. Sloane, Sphere Packings, Lattices and Groups, 3rd ed. (Springer,
New York, 1999). doi:10.1007/978-1-4757-6568-7.
[26] O. R. Musin, “The kissing number in four dimensions,” Ann. Math. 168, 1 (2008).
arXiv:math/0309430.
[27] R. Kulkarni, “A 67%-rate CSS code on the FCC lattice: [[192, 130, 3]] from weight-12 stabi-
lizers,” arXiv:2603.20294 (2026).
13