A four-dimensional toric code with non-Clifford transversal gates

The design of a four-dimensional toric code is explored with the goal of finding a lattice capable of implementing a logical $\mathsf{CCCZ}$ gate transversally. The established lattice is the octaplex tessellation, which is a regular tessellation of four-dimensional Euclidean space whose underlying 4-cell is the octaplex, or hyper-diamond. This differs from the conventional 4D toric code lattice, based on the hypercubic tessellation, which is symmetric with respect to logical $X$ and $Z$ and only allows for the implementation of a transversal Clifford gate. This work further develops the established connection between topological dimension and transversal gates in the Clifford hierarchy, generalizing the known designs for the implementation of transversal $\mathsf{CZ}$ and $\mathsf{CCZ}$ in two and three dimensions, respectively.

ally D-dimensional color codes have transversal e iπZ/2 D gates [17,18]. It should be noted, while these higherdimensional codes have more exotic gates, they cannot have both a transversal e iπZ/2 D gate with D > 2 while also having a transversal Hadamard as this would violate no-go theorems for transversal, universal gate sets [19,20].
In order to better define the relationship between spatial dimension and the transversal gates that are accessible, consider the Clifford hierarchy. The n-qubit Clifford hierarchy is defined recursively, where the first level is the n-qubit Pauli group P n : In general, topological codes in D dimensions will be limited to having transversal gates that are in the D-th level of the Clifford hierarchy [21]. The 2D toric code has a transversal controlled-Z (CZ) gate, which is in the second level of the Clifford hierarchy. Recently, Vasmer and Browne showed that the 3D toric code has a transversal controlled-CZ (CCZ) gate [22], a gate in the third level of the Clifford hierarchy, provided the codes are chosen appropriately. Rather surprisingly, the different codeblocks are not identical. Given the aforementioned prior work, it is natural to ask whether some choice of 4D toric code has a transversal multi-qubit gate in the fourth level of the Clifford hierarchy. In this work, we explore 4D toric codes and show a particular choice of 4D toric code that has an underlying CCCZ gate, a gate in the fourth level of the Clifford hierarchy. The underlying lattice of the code is not a simple generalization of the cubic lattice, such has a hypercubic tessellation, but a rather more exotic lattice that allows for the appropriate overlap conditions of the underlying stabilizers of the four codeblocks.
The paper is organized as follows: Sec. II is reserved for a review of prior results. In II A we review the necessary algebraic conditions for CSS codes to have transversal multi-controlled-Z gates. In Sec. II C we review Schläfli symbols and summarize their relationship to constructing 2D and 3D toric codes in Secs. II D and II E, respectively. In Sec. II F we present the conditions we will require for searching for a 4D toric code with a transver-sal CCCZ. Sec. III provides all the details of the 4D lattice containing a transversal CCCZ, the octaplex tessellation, while Sec. IV discusses placing boundaries on such a lattice. Sec. V discusses metachecks and single-shot error correction in the context of this code. Finally, Sec. VI provides a discussion on the difficulty in finding higherdimensional generalizations and other open questions.

II. BACKGROUND
A. Transversal (multi-)controlled-Z gates in CSS codes Suppose we have multiple codeblocks, each composed of n qubits and containing equal numbers of logical qubits. We denote a Pauli operator P on qubit i of codeblock c as P The controlled-Z (CZ) is a two-qubit Clifford gate that under conjugation maps Pauli X on one qubit to itself times Pauli Z on the other qubit. Mathematically, this relation is expressed as X i , where the CZ gate is acting on qubits i of codeblocks a, b. We label this a CZ (a,b) i gate. Additionally, CZ leaves any Pauli Z operator unchanged under conjugation. Therefore, if we have two CSS codeblocks [23,24] of n qubits and we perform a transversal CZ, that is n i=1 CZ (a,b) i , then the stabilizer generators are transformed as follows: As such, in order for the codespace to be preserved we require that the X stabilizers from one codeblock map onto Z stabilizers in the other codeblock. Equivalently, as long as the X stabilizers of a given codeblock overlap an even number of times with the X stabilizers and X logical operators of the other codeblock, the codespace will be preserved. That is: ∀ i, j, The expression M∩N indicates the overlap in support of two Pauli operators M, N while |O| is the total weight of a given operator O modulo 2. Given the above equations are satisfied, transversal CZ will be a logical operator. Yet, in order for it to implement a logical CZ gate there are additional conditions the logical operators must satisfy: ∀ i, j, We can generalize these constraints to the controlledcontrolled-Z (CCZ) gate as well. Note that under conjugation, the CCZ gate maps Pauli X on one codeblock onto CZ on the other two codeblocks, that is X . Additionally, given it is again a diagonal operator CCZ leaves and Pauli Z operator unchanged. The X stabilizer of one codeblock will therefore undergo the following transformation under the action of transversal CCZ: Therefore, in order to preserve the stabilizer group, we require that k∈X (a) i CZ (b,c) k be logical identity, which is equivalent to imposing Eqs. 2, but restricted to the support of the X stabilizer on codeblock a. Therefore, the generalized requirement is: Given the above requirements are satisfied, the transversal CCZ maps Pauli X onto a transversal CZ, limited by the support of the Pauli X of the original code. This CZ must in turn perform a logical CZ operation on the other two codes, which impose the additional set of constraints: where we have used the Iverson bracket [25] to denote the overlap being odd when all logical indices are matching, and 0 otherwise. Finally, one can straightforwardly generalize this process to multi-controlled-Z operations. The set of requirements for the transversal CCCZ gate to implement a logical CCCZ on four codeblocks is: ∀ i, j, k, l, B. Pauli sandwich trick One advantage of implementing a CCCZ gate transversally is that if the resulting logical gate couples multiple Pauli sandwich trick: inserting a Pauli X operator between two CCCZ gates results in a CCZ gate on the other three qubits along with the implemented Pauli X. This can be generalized for any multi-controlled-Z operation.
Assume transversal CCCZ implements the logical gate as shown containing a set of four logical CCCZ gates. Then, by sandwiching a single logical X operator on a given logical qubit between rounds of transversal CCCZ the resulting logical action is a targeted CCZ. Given any Pauli gate can be implemented transversally in a stabilizer code, the global action also remains transversal.
logical qubits, such as the 3D toric code with periodic boundaries or in instances of Pin codes [26], one may still be able to achieve a targeted CCZ gate by repeated uses of the transversal gate. The idea is to insert a logical X gate (which can always be implemented transversally in a stabilizer code) between two instances of the transversal gate implementing logical CCCZ, which results in implementing a CCZ gate on the other three logical codeblocks, see Fig. 1. For example, as will be shown in this work, there will be a version of a 4D toric code with periodic boundaries, encoding four logical qubits, that exhibits a transversal CCCZ. The resulting action of the gate will couple the four logical qubits by implementing four separate logical CCCZ gates across the four codeblocks, see Fig. 2. By sandwiching the appropriate logical X gate we can achieve a transversal implementation of a targeted CCZ logical gate.

C. Schläfli symbols
In order to clarify the upcoming constructions to 4D lattices, we will briefly describe Schläfli symbols and  their relationship to regular tessellations. A Schläfli symbol is a succinct description of regular polytopes and tessellations that is defined recursively. Given an integer n, the Schläfli symbol {n} represents an n-sided regular convex polygon. A Schläfli symbol with two integer entries {n, m} represents a geometric object with m symmetrically distributed objects {n} around each vertex. For example, a {3, 3} represents a tetrahedron as each vertex has 3 adjacent faces corresponding to equilateral triangles {3}, see Fig. 3 for further examples. While it is most straightforward to view Schläfli symbols {n, m} as regular convex polytopes in three dimensions, they may also represent tessellations in twodimensional Euclidean or hyperbolic space. For example, the Schläfli symbol {4, 4} represents a square tessellation of 2D space as every vertex is adjacent to 4 squares. The distinction between these two interpretations can either be made based on context or by use of the words cell/polytope and lattice/tessellation.
In a similar manner, a Schläfli symbol {n, m, l} can represent a regular 4-cell or a tessellation of 3D space, where adjacent to every edge (1-cell) are l objects {n, m}. Importantly for our discussions, the cubic lattice in 3D is described by Schläfli symbol {4, 3, 4} as adjacent to every Finally, the full generalization of the recursive definition of the Schläfli symbol is as follows: an object with Schläfli symbol {r 1 , · · · , r d } has r d objects with Schläfli symbol {r 1 , · · · , r d−1 } adjacent to every (d − 2)-cell.
We define the vertex operator of a regular polytope/tessellation to be an object centered at a vertex whose x-cells are placed along (x + 1)-cells of the original polytope tessellation. For example, the vertex operator of an octohedron is a square, as adjacent to every vertex are four edges whom each share a face with two of the other aforementioned edges. A shorthand method for determining the vertex operator is again through the Schläfli symbol, as the vertex operator of an object {r 1 , · · · , r d } is an object whose Schläfli symbol comes from removing the first entry: {r 2 , · · · , r d }. We shall occasionally also refer to an edge operator which is just the vertex operator of a vertex operator whose Schläfli symbol is determined by removing the first two entries.

D. 2D toric code
Consider a square lattice {4, 4} with periodic boundary conditions in both spatial dimensions. The 2D toric code is defined by placing physical qubits on the edges of the graph and defining the Z stabilizers at the vertices and the X stabilizers on the plaquettes 1 .
Given that the stabilizer code is CSS, we can treat any set of errors by considering separately the individual X and Z components of the error (as the measurement of the stabilizers will project the error onto distinct sets of X and Z errors). Any Pauli string of X/Z errors that does not form a closed loop will violate the stabilizers at the end points of the error string. As such, we say that the errors result in point-like excitations in the 2D toric code, and the fact they come in pairs as a consequence of the underlying Z 2 symmetry. Any closed loop of X/Z errors will commute with the stabilizers and thus return a state in the codespace. If the closed loop is contractible, then it is the product of all stabilizers within the loop, while if it is non-contractible it forms a logical operator.
We can obtain a transversal controlled-Z (CZ) gate between two layers of the 2D toric code if the second copy has swapped the locations of the X and Z stabilizers. It is then straightforward to verify the conditions of section II A as the X stabilizers will clearly overlap an even number of times by construction. Moreover, given the switching of the X and Z logical operators between the two code copies, it is clear that logical X from one codeblock will be mapped onto logical Z on the other codeblock, implementing a logical CZ. 2

E. 3D toric code
In this subsection we review the transversal CCZ gate for the 3D toric code due to Vasmer and Browne [22]. Consider the cubic lattice {4, 3, 4} with qubits residing on edges of the lattice. There are three qubits per edge, one for each codeblock. We can then color the cubes in the lattice in two colors, say red and blue, such that cubes of the same color do not share a face (but can share an edge), see Fig. 6a. Again, we will focus on the case of periodic boundary conditions in all three spatial dimensions, this condition can be relaxed with an appropriate choice of boundaries.
The first codeblock is defined to have X stabilizers supported on the red cubes, while the second codeblock is defined to have X stabilizers supported on the blue cubes. These are weight-12 stabilizers because there are 12 edges to a cube. The third codeblock has weight-6 X stabilizers defined by the vertices of the lattice, with the stabilizer supported on neighboring edges, as shown in Fig. 6b.
Any Z error will give rise to a pair of violated X stabilizers, as in the 2D toric code. As such, a noncontractible loop spanning the lattice forms a logical Z operator. There are three independent logical operators for the 3D toric code defined on a periodic lattice, one for each dimension. The X logical operator is formed from a 2D plane orthogonal to its conjugate Z logical string pair. See Fig. 6c for a pictorial representation of planar X logical operators for the red and blue codeblocks, whose intersection forms a non-contractible loop whose support is that of a Z logical operator for the yellow codeblock.
We can then straightforwardly verify the orthogonality conditions, presented in Sec. II A, for the existence of a Addition of X stabilizers from third codeblock, labelled codeblock 0, which corresponds to edges sharing the same vertex. (c) X logical operators for first two codeblocks whose intersection forms a 1D closed loop corresponding to the Z logical operator of codeblock 0. (d) Dual lattice, where physical qubits will reside on 2-cells (faces) and X stabilizers from first two codeblocks will be represented by vertices. Support of the X stabilizers is given by all faces sharing a given vertex.
transversal CCZ gate. The intersection of X stabilizers from the first two codeblocks corresponds to a weight-4 face belonging to the cubes, such a face will intersect any neighboring vertex operator at the two corresponding adjacent edges of that vertex belonging to the face. Therefore, the intersection of X stabilizers from the three different codeblocks will either be trivial or weight 2. The Z stabilizers of a codeblock can then be given by all possible intersections of pairs of X stabilizers from the other two codeblocks, see Fig. 7.
The transversal CCZ gate is a logical CCZ gate as described above the intersection of pairs of logical X operators from different codeblocks corresponds to the support of the Z logical operator of the third codeblock, as required.

F. The dual picture
The dual of a lattice of dimension D is again a Ddimensional lattice, where every D-cell is replaced by a vertex (0-cell), every (D − 1)-cell is replaced by an edge (1-cell) connecting two vertices when the corresponding original D-cells share the (D − 1)-cell, and so forth. Conveniently, the dual to any object with Schläfli symbol {r 1 , · · · , r d } is the object with Schläfli symbol {r d , · · · , r 1 }. That is, one reverses the ordering of the integers in the symbol. For example, the dual of a cube {4, 3} is an octahedron {3, 4} and the cubic lattice {4, 3, 4} is self-dual.
In the original 2D toric code picture, the X stabilizers are associated to faces, while the Z stabilizers are associated to vertices. The dual of the square lattice is also a square lattice, with faces and vertices interchanged. Therefore, to describe the 2D-toric code in the dual picture, qubits are still placed on edges, but X stabilizers are instead associated to vertices and Z stabilizers to faces.
The 3D-toric codes on the cubic lattice can also be described in the dual picture. The dual of the cubic lattice is again the cubic lattice, but qubits now reside on faces rather than edges. Moreover, X stabilizers of the first two codeblocks are associated with vertices in the dual lattice. The choice of X stabilizers for the two codeblocks is equivalent to a 2-coloring of the vertices in the dual lattice, where vertices of the same color share only faces (never an edge), as shown in Fig. 6d. The X stabilizers of the third codeblock (originally the vertex operators) are associated with cubes in the dual lattice. The condition, see Eq. 3a, that X stabilizers from the three codeblocks only ever intersect at an even number of qubits can be viewed in the dual picture as any edge (intersection between two vertices corresponding to X stabilizers of codeblocks 1 & 2) sharing only 2 faces with a given cube.
An additional important property from the 2D and 3D toric codes is that the Z logical operator is a noncontractible 1D loop. From the view point of excitations, this arises due to excitations coming in pairs. When a single or connected string of Z errors occur, the only violated syndromes are those at the endpoints of the string, and thus closing the string annihilates the excitations and forms a logical operator. The logical operator is non-trivial (not the product of stabilizers, therefore not the identity operator) if it forms a non-contractible loop. Essential to this reasoning is that Z errors lead to a pair of violated X syndromes, in all codeblocks. Therefore, in the dual picture, any qubit (edge in 2D, face in 3D) includes exactly two vertices of the any one color. In 2D this condition is satisfied trivially, however in 3D it demands that faces must be squares with opposite corners colored the same.
Therefore, in our quest for regular tessellations in D-dimensions that yield interesting multi-controlled-Z gates, we propose the following criteria: 1. Qubits are placed on edges of the underlying graph.
Conversely, qubits are placed on (D −1)-cells in the dual lattice. In this dual-lattice description, qubits correspond to (D − 1)-cells. The X stabilizers of codeblocks 1, . . . , D − 1 correspond to vertices of the corresponding colors, 1, . . . , D − 1. That is, given a vertex, the corresponding X-stabilizer is supported on qubits at all (D −1)-cells that contain the vertex. Codeblock 0 is different from the rest in that its X stabilizers are defined by the D-cells in the dual lattice, where each X stabilizer is supported on the set of (D − 1)-cells belonging to a given D-cell.

III. 4D CODE WITH TRANSVERSAL CCCZ
We seek a tessellation of 4D space with the required desiderata laid out in the previous section. We consider the dual lattice, where X stabilizers from the first three codeblocks are given by vertices. Since the lattice should be 3-colorable, such that the 3-cells have two vertices of each color, we require the underlying lattice to be composed of octahedra. Therefore, the Schläfli symbol of the tessellation should read: {3, 4, a, b}, where a and b are integer degrees of freedom. There is only one such regular tessellation in Euclidean 4-space, the octaplex tessella- It should be noted that this lattice was theorized as a potential candidate for the implementation of 4D CCCZ using the theory of Coxeter diagrams [27], which share many of the features of Schläfli symbols.

A. Stabilizer weights
The X stabilizers of codeblock 0 are represented by 4-cells in the 4D tessellation (recall we are working with the dual lattice). That is, each X stabilizer is supported on all 3-cells contained within a 4-cell. By definition, the 4D tessellation is composed of octaplexes {3, 4, 3}. Now, since each octaplex is self-dual, the number of 3cells within a given octaplex, and the weight of any X stabilizer, is equal to its number of vertices: 24. In order to determine the weight of the Z stabilzers, we must consider the common intersection of X stabilizers from each of the other codeblocks. Each X stabilizer from the other codeblocks is represented by a different colored vertex and they will only commonly intersect if they form a triangular face in the tessellation. The weight of the Z stabilizer will thus be the number of 3-cells which contain a given face. This can be determined by recursively taking the vertex figure three times. 5 The resulting geometrical object will have Schläfli symbol {3}, a triangle, and as such each face is adjacent to three 3-cells (vertices in the triangle). Therefore, the Z stabilizers will have weight 3.
By construction, codeblocks 1-3 have X stabilizers that are represented by each of the three colors of vertices in the octaplex tessellation. The support of each X stabilizer is the set of 3-cells containing the given vertex. As such, in order to calculate the weight of the X stabilizers we can consider the vertex figure: {4, 3, 3}, a tesseract. Given the tesseract has 24 faces and each face in the vertex figure represents a 3-cell containing a given vertex, each of the X stabilizers from codeblocks 1-3 are each of weight 24. The Z stabilizers will be the intersection of an edge (containing two colored vertices) and a 4-cell. That is, we must determine how many 3-cells support a given edge within a given 4-cell. Again this can simply be read off from the Schläfli symbol, as by definition a {3, 4, 3} is the geometric object such that 3 octahedra ({3, 4}) surround each edge. Therefore, the Z stabilizers for codeblocks 1-3 also have weight 3.
By construction, the fact that codeblock 0 and codeblocks 1-3 each are composed of X stabilizers of weight 24 and Z stabilizer of weight 3 would appear to be coincidental, yet as will become evident in the description in the following subsection and subsection III E, there is indeed an additional symmetry in the octaplex tessellation that implies that all four codeblocks are equivalent codes.

B. Coordinate system for the octaplex tessellation
We now give an explicit construction of the octaplex tessellation. First, take the tesseractic tessellation {4, 3, 3, 4} on a periodic lattice of size L with integer vertices (x, y, z, w) ∈ Z 4 L and tesseracts centered at halfinteger coordinates (x+ 1 2 , y+ 1 2 , z + 1 2 , w+ 1 2 ) ∈ (Z L + 1 2 ) 4 . The vertices of the octaplex tessellation can be identified with the faces of the tesseractic tessellation, that is coordinates (x, y, z, w) such that two are integers, and two are half-integers 6 . Vertices share edges if and only if they are distance 1/ √ 2 apart in 2-norm. We can then label all of the vertices of the octaplex tessellation as one of three colors: 6 Such faces correspond to the intersection of 4 tesseracts.
It is straightforward to verify that no two vertices of the same color will share an edge as they will be at least distance 1 away from one another in 2-norm.
The 4-cells of the octaplex tessellation are given by coordinates (x, y, z, w) ∈ Z 4 L or (x + 1 2 , y + 1 2 , z + 1 2 , w + 1 2 ) ∈ (Z L + 1 2 ) 4 (that is the same coordinates as the vertices and centers of the hypercubes of the original tesseractic tessellation) and form 24-body objects called octaplexes. The vertices belonging to a octaplex centered at coordinates (x, y, z, w) will be all vertices distance 1 √ 2 in 2-norm from the corresponding center of the octaplex. For example, for the octaplex centered at the origin, all neighboring vertices will be the set of points (±1/2, ±1/2, 0, 0) with each ± taken independently and their permutations, thus totaling a set of 24 vertices. We label the set of 4cells by O.
The 3-cells correspond to intersections of two neighboring 4-cells, which come in three different types: (3i) the intersection of two 4-cells with integer coordinates differing by ±1 in a single coordinate (the center of this type of 3-cell has three integer coordinates and one half-integer), (3ii) the intersection of two 4-cells with half-integer coordinates again differing by ±1 in a single coordinate (centered at points with three half-integer and one integer coordinates), or (3iii) the intersection of 4-cells, one with integer and one with half-integer coordinates, differing by ± 1 2 in each coordinate (centered at points with four quarter-integer coordinates, that is, points whose entries are odd multiples of 1 4 ). Each 3-cell contains all vertices that are distance 1 2 away in 2-norm from its center. Given a 3-cell characterized of type (3i), centered say at (x, y, z, w + 1 2 ) for integers x, y, z, w, there are 6 vertices belonging to the 3-cell: (x ± 1 2 , y, z, w + 1 2 ), (x, y ± 1 2 , z, w + 1 2 ), and (x, y, z ± 1 2 , w + 1 2 ). Thus, the 3-cell is an octahedron with 3-coloring as required by Fig. 8a. A symmetric argument holds for 3-cells of type (3ii). For the 3-cells of type (3iii), the associated vertices are all ± 1 4 in each coordinate such that two are integer and half-integer and thus there are 6 = 4 2 such coordinates, again forming an octahedron with appropriate coloring as required. We label the set of 3-cells by Q.
It will also be useful to characterize the 2-cells (faces) as they will defined the Z stabilizers for codeblock 0. As described in Sec. III A, the 2-faces are formed from the intersection of three neighboring 3-cells. In fact, each 2-cell will have one neighboring 3-cell of type (3i) or (3ii) and two of type (3iii). Without loss of generality, consider the following 3-cell of type (3i): (x + 1 2 , y + 1 2 , z + 1 2 , w) and in particular the face whose vertices are: {(x + 1 2 , y + 1 2 , z, w), (x + 1 2 , y, z + 1 2 , w), (x, y + 1 2 , z + 1 2 , w)}. Such a face cannot belong to a 3-cell of type (3ii) as any face belonging to such a 3-cell will have to have one of the coordinates being fixed as a half-integer (rather than integer w above). The neighboring 3-cells of type (3iii) will be of the following form: (x + 1 4 , y + 1 4 , z + 1 4 , w ± 1 4 ). Therefore, we label such a 2-cell to be given by the set of coordinates: (x+ 1 4 , y + 1 4 , z + 1 4 , w) 7 . Any 2-cell whose coordinates are composed of 3 quarter-integer and one integer coordinate will be denoted type (2i). Symmetrically, any 2-cell whose coordinates are composed of 3 quarter integer and 1 half-integer coordinate will be labelled as type (2ii).
Finally, it is rather straightforward to verify that 1cells will always have one integer and half-integer fixed among the vertices at their endpoints, and will alter between an integer and half-integer in the other two coordinates. As such, the 1-cells are all labelled by a set of coordinates composed of one integer, one half-integer and two quarter-integers.
To summarize, the geometric objects of the octaplex tessellation will be specified by the following forms of cartesian coordinates: • 0-cells (vertices, V r , V g , V b ): Two integer and two half-integer coordinates.
(2ii) One half-integer and three quarter-integer coordinates.  An object with dimension D is composed of several objects of dimension D − 1. In this algebraic construction of the lattice, a D-dimensional located at point P is composed of all (D − 1)-dimensional objects nearest to P in 2-norm. We provide more detail in each of the cases.
In the language of chain complexes, we have provided a simple description of the boundary operators. The X stabilizers of codeblock 0 are associated to 4-cells, which are given by either integer coordinates (x, y, z, w) ∈ Z 4 2 or half integer coordinates (x + 1 2 , y + 1 2 , z + 1 2 , w + 1 2 ). As discussed in the previous subsection, each of the X stabilizers will be weight-24 operators whose support is given by the set of 3-cells that are closest in distance from the given 4-cell.
The Z stabilizers are formed from the intersection of the X stabilizers of the other codes. The X stabilizers represented by different colored vertices only have nontrivial intersection if they form a face in the octaplex tessellation. They correspond to weight-3 operators whose support is given by the 3-cells that contain the given face, see the previous subsection for more details.

D. Logical operators of codeblock 0
We begin by defining the Z logical operators, which recall are going to be non-contractible loops as per our desiderata. Take the qubit defined by the following 3cell: (0, 0, 0, 1 2 ), which corresponds to the intersection of the two 24-cells (0, 0, 0, 0) and (0, 0, 0, 1). Therefore, a Z error on such a qubit would cause a pair of excitations in theŵ direction, indicating that this qubit should belong to a logical Z operator along that axis. Therefore, the following operator will be a valid logical Z operator: as it will intersect every X stabilizer (0, 0, 0, w) at two locations (for all w, assuming periodic boundary conditions). While this operator commutes with the stabilizers of the code, what remains to be shown is that it is indeed a logical (non-identity) Pauli operator, which implies we must be able to find a logical X with which it anti-commutes. Before searching for such an operator, note that we can translate the above Z operator by multiplying it by a set of Z stabilizers. As discussed in the last subsection, there is a Z-stabilizer supported on qubits in the set: As such, this Z stabilizer will shift any operator supported at (x, y, z, w + 1 2 ) by 1 4 in thex,ŷ,ẑ directions while also shifting its support ± 1 4 inŵ. Note that by choosing different sets of v r , v g , v b we could have also shifted by − 1 4 in any of thex,ŷ,ẑ directions. We can then continue this shift by multiplying by the Z stabilizer generated by the colored vertices v r = (x + 1 2 , y + 1 2 , z, w), v g = (x + 1 2 , y, z + 1 2 , w), v b = (x, y + 1 2 , z + 1 2 , w) resulting in the weight-3 operator: Taking the product of these two weight-3 operators thus results in a weight-4 Z stabilizer with support: which shifts the logical operator from Eq. 6 as follows: , where the terms given by coordinates ( ) cancel each other out given periodic boundary conditions. It is worth pointing out that by choosing a different set of Z stabilizers we could have shifted the above logical operator ± 1 2 in anyx,ŷ,ẑ direction and as such by iterating this process we can show that all of the following representations are equivalent: for all x, y, z ∈ Z L and α, β, γ ∈ Z 2 . Therefore, given that the Z logical operator can be shifted in anyx,ŷ,ẑ direction the corresponding X logical operator will have to span these three axes, thus forming a hyperplane. This is analogous to the X logical operator spanning a plane orthogonal to the Z loop operator in the 3D toric code. In fact, by the above observation that we can find three disjoint representatives according to theŵ coordinate being either an integer, half-integer, or quarter-integer, the cooresponding X logical operator will be composed of three hyperplanes with a fixedŵ coordinate of each of these three types. We propose the following X logical operator to be that which is orthogonal to Z (0) w : .
We leave the proof that this operator commutes with the stabilizer group, and is thus a logical operator, to Appendix A. It is straightforward to verify that it intersects the logical Z representative from Eq. 6 at a single qubit given by coordinate (0, 0, 0, 1 2 ), and as such the two operator anti-commute. Finally, given codeblock 0 is symmetric with respect to all four spatial directions, we can define the other three pairs of logical operators as follows: .

E. Equivalence of all four codeblocks
Recall the other codeblocks are defined by X stabilizers that are supported on the vertices of a given color. In order to show equivalence between codeblocks 0 and 1, suppose we introduce new vertices where all of the 4-cells are centered, while eliminating all of the red vertices and introducing edges following the same rules as in Section III B. The new set of vertices will be: where vertices share an edge if they are distance 1 √ 2 in 2-norm and we define 4-cells centered where all of the old red vertices were located V r , where each 4-cell contains all vertices again at distance 1 √ 2 in 2-norm. If we then introduce the change of coordinates: (x, y, z, w) → (x + 1 2 , y + 1 2 , z, w), we note we have the exact same lattice as previously where the rolls of different sets of vertices and 4-cells have been exhanged: Thus, under this new labelling, codeblock 1 has X stabilizers that were previously labelled by the red vertices and are now defined by 4-cells, with Z stabilizers defined by the intersection of different colored vertices in the new labelling. As such, the properties of codeblock 1 mirror those of codeblock 0. Given our choice of which colored vertices to eliminate was arbitrary all codeblocks are indeed symmetric.
Given the symmetry of the codeblocks, we can use the above change of basis to determine the logical operators for the other codeblocks as well. For example, the logical Z (1) w (red codeblock) will be a shifted version of that from codeblock 0: We can find the Pauli logical oeprators for all other codeblocks in a systematic way by modifing the change of coordinates, we list them all in Appendix C.

F. Transversal CCCZ gate
Given the code construction, transversal CCCZ results in a logical operator. We now verify that it indeed implements the logical CCCZ across the four logical qubits. A detailed proof that the given logical operators satisfy the criteria established in Section II A is given in Appendix C, yet we summarize the result here.
As presented in the Sec. III D, each of the logical Z operators can be represented by non-contractible strings in each of the Cartesian directions. Each corresponding logical X is a hyperplane orthogonal to the direction of the logical Z. As such, when considering the overlap of different logical X operators from different codeblocks, those that have non-trivial overlap span different directions. The intersection of two hyperplanes that are not parallel is a two-dimensional plane. Taking the intersection with yet another orthogonal hyperplane gives rise to a 1D string. Therefore, the intersection of three non-parallel logical X operators is a 1D non-contractible string in the fourth codeblock, which corresponds exactly to the support of the fourth logical Z operator on that code, as required for the transversality of the logical CCCZ.
Transversal CCCZ thus results in a logical CCCZ that couples the following quartets of labelling of the logical operators: y , X z , X w }.
Note, that rather than logical operators with the same index being coupled it is those with different indices that are coupled. This reflects that the logical operators must span directions that are orthogonal from one another.
In terms of the criteria in Eq. 4e, the right side of the equality would be 1 if and only if the indices on the left come from one of the sets above.

IV. BOUNDARY CONDITIONS
Thus far, in order to simply the discussion, we have presented a code construction with periodic boundary conditions, encoding 4 logical qubits across the 4 codeblocks. Moreover, as in the 2D and 3D toric codes, we can also introduce boundary conditions such that the code does not have to be defined on a periodic lattice at the cost of now only encoding a single logical qubit 8 .
As first introduced in the 2D toric code [28], we can introduce two types of boundaries, rough and smooth, that can serve as endpoints for the different types of logical Pauli operators X and Z, respectively. As discussed in the previous section, in order to have a transversal logical CCCZ gate on the single logical qubit, we require that the logical Z operators of the four codeblocks span orthogonal axes. As such, the associated rough boundaries should be hyperplanes that are each orthogonal to the respective logical Z operators in each code. The smooth boundaries in each of the codeblocks should be hyperplanes orthogonal to the other three axes. This is analogous to the case of the 2D and 3D toric codes with boundaries presented in Fig. 10.
The main idea for constructing the code with boundaries is to begin with the periodic case and remove hyperplanes of qubits, thereby cutting the lattice along each of the Cartesian coordinates. As such, we remove a set of X stabilizers along the hyperplane cut and modify any X stabilizers at the boundary to have slightly smaller support (analogous to both the 2D and 3D cases). Given a CSS code can be defined just in terms of its X stabilizers and logical operators (with the Z-stabilizers derivable from these alone), we define these sets for the four codeblocks and determine the associated Z stabilizers and logical operators, where there is a single logical operator per codeblock.
We begin with codeblock 0: that is the codeblock where X stabilizers are defined by 4 integer (x, y, z, w) or 4 half-integer (x + 1 2 , y + 1 2 , z + 1 2 , w + 1 2 ) coordinates, where previously we were working with periodic coordinates in Z L . We want to choose boundary conditions such that the logical Z operator defined in Eq. 6 has aŵ coordinate that runs between [ 1 2 , L]. Therefore, we must choose X stabilizers (x, y, z, w), (x+ 1 2 , y + 1 2 , z + 1 2 , w + 1 2 ) such that w ∈ [1, L − 1]. Therefore, we remove all qubits whose support in theŵ coordinate falls outside the interval [ 1 2 , L]. By the symmetry arguments of the subsection III E, similar qubits are removed along the other axes as well, thus removing any qubits with a coordinate outside the aforementioned set [1, L]. The associated Z logical operator has the following support: , where x, y, z are any integers in the set [1, L]. The corresponding logical X operator is: . Now, it should be noted that while we only preserve the X stabilizers whoseŵ coordinate is in the interval [1, L − 1 2 ], in the other coordinate directions we will also include those stabilizers whose coordinates are in the set { 1 2 , L} and such stabilizers will have smaller support as some of their original qubits have been removed. This is analogous to the boundary stabilizers in the 2D and 3D toric codes, whose support is also smaller than in the original periodic lattice. Moreover, it is the addition of these stabilizers that prevent the boundaries along these axes from being smooth, and thus preventing a logical Z operator from terminating there. For example, consider the stabilizer whose coordinates are: ( 1 2 , y + 1 2 , z + 1 2 , w + 1 2 ), then the analogous logical operator Z (0) x , in thex direction, would not commute with the example stabilizer as they would intersect at only one qubit: (1, y + 1 2 , z + 1 2 , w + 1 2 ). See Appendix F for a summary of the stabilizers at the boundary and their support.
The Z stabilizers of a given codeblock are formed by taking the intersection of the X stabilizers of the other three codeblocks, thus preserving the requirements for transversal CCCZ.

V. COUNTING STABILIZERS: METACHECKS AND SINGLE-SHOT Z STABILIZER MEASUREMENT
In this section we count the degrees of freedom in the code and show that there are indeed only 4 logical qubits in the 4D octaplex tessellation. This is due to the high amount of redundancy in the Z stabilizer checks. We refer to these redundancies as metachecks following the language of Ref. [29].
Given we have established a symmetry between all of the codeblocks (see Sec. III E), we focus on codeblock 0 as on a periodic lattice. Physical qubits are given by the following coordinates found in Sec. III B: (3i) one integer and three half-integer, (3ii) three integer and one halfinteger, and (3iii) four quarter-integer. Therefore, the total number of physical qubits is: In codeblock 0, the X stabilizers are associated with the 4-cells of the tessellation, which have coordinates that are either all integer or half-integer. As such, the number of such stabilizers is 2L 4 and their product is identity, yielding a independent generator set of size 2L 4 − 1. We call this redundancy in the stabilizer generators a global metacheck as it corresponds to a global symmetry of the lattice. The redundancy of one of the X stabilizers is represented by the bottom metacheck in Fig. 11 relating all 4-cells.
Recall the Z stabilizers of codeblock 0 are identified with by the triangular faces (with three different colored vertices) in the octaplex tessellation. Therefore, in order to count the number of such faces it is sufficient to count the associated faces to which a single vertex belongs to, which amounts to determining the number of edges in the vertex operator (see Section II C for a review of vertex operators). The vertex operator of the octaplex tessellation has Schläfli symbol {4, 3, 3}, a tesseract, and as such has 32 edges. The number of vertices of a given color is 2L 4 and as such the number of Z stabilizers corresponding to triangular faces is 64L 4 . Of course, these stabilizers are not all independent and we shall review their dependencies here.
Each 2-cell is a face belonging to three adjacent 3cells, which corresponds to the qubit support of the Pauli operator defined on the 2-cell. Therefore, a set of 2-cells is said to be dependent if their overlap is even across all 3-cells. There are two forms of such symmetries for the 2cells: local symmetries which are the result of a product of local faces that result in the identity operator, or global symmetries which result from a product of faces that span the lattice that result in identity.
We begin with the local symmetry: consider an edge in the octaplex tessellation and the associated triangular faces that contain the given edge. There are four such faces as the associated edge operator 9 is a tetrahe- dron {3, 3}, where the vertices of the tetrahedron represent neighboring faces and the edges represent neighboring 3-cells. Each neighboring 3-cell is adjacent to two such faces and as such the product over all such faces yields the identity 10 . Therefore, each edge in the octaplex tessellation provides a redundancy in the Z stabilizers. Each vertex belongs to 16 edges (number of vertices in the vertex operator) and as such given the total number of vertices is 6L 4 then the total number of edges is: 1 2 · 16 · 6L 4 = 48L 4 . We represent the local constraints by black squares in Fig. 11. As for the global symmetries with regards to the 2-cells, they are formed by taking the product of faces that form two-dimensional planes of which there are six, as shown in Appendix D. They are labelled by red triangles in Fig. 11.
However, not all edges, leading to the aforementioned redundancies in the stabilizers, are themselves independent. As above, a set of 1-cells (edges) is deemed dependent if they overlap an even number of times across all neighboring 2-cells. Again, the symmetries giving rise to these dependencies come in two forms: local and global. 10 An equivalent description of the same statement is that if one were to take the dual of the octaplex tessellation, the 16-cell honeycomb {3, 3, 4, 3}, then the underlying 3-cells of the dual (corresponding to edges in the octaplex tessellation) must be tetrahedra. Given qubits are associated with edges in the dual, taking the product over faces of a tetrahedron yields identity.
The local symmetry arises by considering the set of edges emerging from each of the vertices in the lattice. If we then consider all faces that these edges share, each face must have two of its edges in this set as by definition the chosen vertex is a vertex belonging to the face. Therefore, each vertex provides an additional constraint on the relationship between the 1-cells and there are 6L 4 such constraints, represented by black diamonds at the top of Fig. 11. The global symmetries on the 1-cells emerge from taking the product of all 1-cells (edges) forming a hyperplane, totaling 4 such constraints as presented in detail in Appendix E, represented by the four red squares in Fig. 11. Finally, there is one additional global symmetry for the vertices themselves each edge in the lattice is in the support of two vertices, therefore taking the product over all vertices in the lattice results in a global symmetry as their support on the edges is all even.
Finally, we would like to make a comment on the singleshot ability to perform the Z stabilizer measurements. The metachecks of the 0-and 1-cells in Fig. 11 form the checks for a classical code where the bits of the code are the measurement outcomes of the Z stabilizer measurements. As such, when a measurement error occurs, it causes a violation in the metachecks, allowing for its correction without having to repeat measurements, unlike the 2D toric code for example. Given a measurement error will lead to a violation of a metacheck on its three neighboring edges, we can think of the analogy to excitations in the 2D color code where excitations come in triples where the color of an edge can be the complementary color to the color of its two neighboring endpoints. This alone should be sufficient to guarantee single-shot correction of the Z stabilizer measurements, however we have the additional layer of redundancy that is given by the 0-cells that can identify when violations of 1-cells are misidentified, which further increases the protection against measurement errors.

VI. DISCUSSION
We have established the existence of a 4D topological code with a transversal CCCZ gate. It is then natural to ask whether the presented techniques could be generalized to arbitrary dimension. The natural candidate in 5D would be to consider lattices with Schläfli symbol: {3, 3, 4, a, b}, where a, b are integer degrees of freedom. This choice is motivated by the fact that underlying 4-cells composing the lattice are hyperoctahedra, which are the 4D analog of the octahedron. This would allow for the potential 4-coloring of the vertices as required by the conditions from Sec. II F. However, the only regular tessellation of 5D Euclidean space is from the hypercubic family: {4, 3, 3, 3, 4}, and thus no regular tessellation with the required conditions exist. Yet, there does exist a regular tessellation in hyperbolic space ({3, 3, 4, 3, 3}) which may have the desired properties and could be of independent interest as it may encode a macroscopic number of logical qubits if the correct boundary conditions can be established. It is worth pointing out again that we only consider regular lattices in this work, where all vertices, edges, etc. are equivalent. It would be natural to conjecture that in higher dimensions breaking full symmetry within the lattice may allow for the implementation of a transversal multi-controlled-Z operation by analogy to what is possible in higher-dimensional color codes [17].
It may also be of independent interest to consider hyperbolic 3D space for the existence of regular lattices that may allow for the implementation of CCZ on a growing number of logical qubits. For example, the lattice given by Schläfli symbol {4, 3, 5} could be a candidate, yet establishing the correct boundary conditions, whether open or closed, remains open. One direction could be to adapt the approach take in other hyperbolic constructions, which were studied with regards to logical memory and decoding [30], and adapt them to 3D hyperbolic space.