Universal resource-efficient topological measurement-based quantum computation via color-code-based cluster states

Topological measurement-based quantum computation (MBQC) enables one to carry out universal fault-tolerant quantum computation via single-qubit Pauli measurements with a family of large entangled states called cluster states as resources. Raussendorf's three-dimensional cluster states (RTCSs) based on the surface codes are mainly considered for topological MBQC. In such schemes, however, the fault-tolerant implementation of the logical Hadamard, phase ($Z^{1/2}$), and $T$ ($Z^{1/4}$) gates which are essential for building up arbitrary logical gates has not been achieved to date without using state distillation, while the controlled-NOT (CNOT) gate does not require it, to best of our knowledge. State distillation generally consumes many ancillary logical qubits, thus it is a severe obstacle against practical quantum computing. To solve this problem, we suggest an MBQC scheme via a family of cluster states called color-code-based cluster states (CCCSs) based on the two-dimensional color codes instead of the surface codes. We define logical qubits, construct elementary logical gates, and describe error correction schemes. We show that all the logical Clifford gates including the CNOT, Hadamard, and phase gates can be implemented fault-tolerantly without state distillation, although the fault-tolerant $T$ gate still requires it. We further prove that the minimal number of physical qubits per logical qubit in a CCCS is at most approximately 1.8 times smaller than the case of an RTCS. We lastly show that the error threshold of MBQC via CCCSs for logical-$Z$ errors is 2.7-2.8%, which is comparable to the value for RTCSs, assuming a simple error model where physical qubits have $X$-measurement or $Z$ errors independently with the same probability.


I. INTRODUCTION
Three major theoretical challenges for quantum computation (QC) are universality, fault-tolerance, and resource-efficiency. Universality indicates the ability of a quantum computer to initialize logical qubits to the computational basis state, perform any unitary gate, and measure them in the computational basis. It is known that the controlled-not (cnot), Hadamard, and phase (Z 1/2 ) gates completely generate the Clifford group, and together with the T (Z 1/4 ) gate, any unitary gate may be approximated to an arbitrary accuracy [1,2].
To achieve fault-tolerance, various quantum errorcorrecting (QEC) codes have been proposed from simple codes with few physical qubits [3][4][5][6][7] to topological stabilizer codes defined on lattice structures of qubits allowing only local interactions which are easily scalable [8]. Several simple codes also have been demonstrated experimentally in assorted systems for small code distances [9][10][11][12][13][14][15][16][17]. Particularly, the surface codes [18][19][20][21][22][23][24][25], a family of topological codes defined on two-dimensional (2D) lattices, have high error thresholds up to about 12% [24], thus they are one of the most promising candidates for fault-tolerant QC. The 2D color codes is another family of topological codes [8,[26][27][28] which enable transversal [29] implementation of the logical cnot, Hadamard, and phase gates thanks to their self-duality. Moreover, threedimensional (3D) gauge color codes even allow transversal implementation of the logical T gate as well as the Clifford gates, thus have been getting much attention recently [30][31][32][33][34][35][36][37]. * h.jeong37@gmail.com Lastly, fault-tolerant QC typically requires enormous resource overheads, which makes it tough to realize it. It is not only because a single logical qubit is composed of multiple physical qubits, but also because state distillation, which generally demand many ancillary logical qubits, is required for non-Clifford gates and sometimes for several Clifford gates to be fault-tolerant [22,24,38,39], e.g., one round of a typical protocol to distill an |A L := 1 to date without using costly state distillation, while the cnot gate does not require it [40,[43][44][45], to best of our knowledge. Fault-tolerant non-Clifford gates (including the T gate) demand state distillation for most topological QEC codes, but it is uncommon that it is needed even for some Clifford gates (the Hadamard and phase gates), which is fatal to resource-efficiency. To solve this problem, we consider recent studies on generalizing the relation between RTCSs and surfaces codes to any Calderbank-Steane-Shor (CSS) codes [60,61] and later to any stabilizer codes [62]. We also consider Ref. [27] on 2D color code computation introducing "defects" for logical operations since a similar approach on the surface codes leads to the protocol for MBQC via RTCSs. Motivated by these works, we propose a new MBQC scheme via a family of cluster states based on the 2D color codes instead of the surface codes, called color-code-based cluster states (CCCSs).
Throughout this paper, we show that MBQC via CCCSs is a competitive candidate on realistic QC, regarding the three challenges mentioned at the very first. We describe the fault-tolerant implementation of the logical cnot, Hadamard, and phase gates without state distillation, thus show that arbitrary Clifford gates do not require it to be fault-tolerant unlike MBQC via RTCSs, although non-Clifford gates still demand it. We then prove that it requires a smaller amount of physical qubits per logical qubits than the case of RTCSs, which makes it resource-efficient even more. Finally, we show that they have a similar level of fault-tolerance by comparing their error thresholds. This paper is structured as follows. In Sec. II, we review the concept of cluster states and the general process of MBQC. In Sec. III, we construct CCCSs and describe their properties, especially about their stabilizers called correlation surfaces. In Sec. IV, we define logical qubits and suggest the schemes for their initialization and measurements, elementary logical gates, and state injection for state distillation. In Sec. V, we present the methods for error correction. In Sec. VI, we calculate resource overheads and error thresholds of MBQC via CCCSs and compare them with the results for RTCSs. We conclude with final remarks in Sec. VII.

II. CLUSTER STATES AND MEASUREMENT-BASED QUANTUM COMPUTATION
To define a cluster state, we consider a graph G = (V, E), where V and E are the sets of vertices and edges, respectively. The cluster state |G is constructed by attaching a qubit to every vertex in V , initializing them to the |+ states where |± := (|0 ± |1 )/ √ 2, then applying a controlled-Z (cz) gate on every pair of qubits connected by an edge.
The constructed cluster state has a stabilizer generator (SG) S(v) for each vertex v ∈ V defined as where adj(v) := {v ∈ V | (v, v ) ∈ E} is the set of adjacent vertices of v and X(v) and Z(v) are the X and Z operators, respectively, on the qubit at the vertex v denoted by Q(v). In other words, g |G = |G holds for all g ∈ S, where S is the stabilizer group generated by {S(v)|v ∈ V }. We say that S(v) is around v or Q(v), called its center vertex or qubit, respectively. Examples of cluster states are presented in Fig. 1. For MBQC, modified versions of cluster states are used, where some qubits do not need to be initialized to the |+ states. S(v) where Q(v) is each of such qubits is then no longer a stabilizer, but others still remain as SGs.
General MBQC via a cluster state to implement a quantum circuit is processed through the following three steps [40-42, 44,  Note that the preparation and measurement steps may be performed simultaneously; after a qubit q and its neighbors are prepared and cz gates are applied on them, it is allowed that q is measured before the other qubits are prepared. One of the spatial axes may be regarded as the simulating time axis, or simply the time axis, along which qubits are prepared and then measured in order. It is thus possible to minimize the number of unmeasured physical qubits in a moment by measuring each qubit as soon as possible after preparing it.
The cores of MBQC are the structure of the cluster state and the measurement pattern. We illustrate them one by one over the next two sections.

III. COLOR-CODE-BASED CLUSTER STATES
In this section, we define color-code-based cluster states and describe their properties. Based on the work on the foliation of CSS codes [60], we consider a particular family of cluster states derived from a 2D color-code lattice, called color-code-based cluster states (CCCSs).

A. Two-dimensional color-code lattices
We first present 2D color-code lattices on which CCCSs are based. We consider a lattice L 2D on a 2D plane which is 3-valent and has 3-colorable faces; namely, three edges meet at each vertex and one of the three colors (red, green, or blue) is assigned to each face in such a way that neighboring faces have different colors. Note that each edge, called link, is also colorable with the color of the faces it connects. Two typical examples (4-8-8 and 6-6-6) of such lattices are shown in Fig. 2. In the original 2D color codes, a qubit is attached to each vertex and two SGs (X-and Z-type) correspond to each face. Details on the codes are described in Ref. [8,26].
Regarding a color-code lattice L 2D , three shrunk lattices are defined, one for each color by shrinking all the faces of that color, as shown in Fig. 3. For example, in the red shrunk lattice, each vertex corresponds to a red face in L 2D and each face corresponds to a blue or green face in L 2D . Edges of the red shrunk lattice then correspond to red links in L 2D . The blue and green shrunk lattices are also defined analogously.

B. Construction of color-code-based cluster states
The graph G for a CCCS based on a color-code lattice L 2D has a 3D structure composed of multiple identical 2D layers stacked along the simulating time (t) axis. The layer of t = t 0 is referred to as the t 0 -layer.
The structure of each layer is originated from L 2D , as illustrated in Fig. 4(a) for the case of the 4-8-8 lattice. Each vertex in the layer is located at either a vertex of L 2D or the center of a face of L 2D ; the corresponding qubit is called a code qubit (CQ) or an ancilla qubit (AQ), respectively. Each AQ is colorable with the color of the corresponding face in L 2D . For each face in L 2D , the layer has an edge connecting the corresponding AQ and each surrounding CQ, on which a cz gate is applied. Each pair of CQs connected by a link in L 2D is called link here as well. Note that links are not edges of G.
Next, we stack multiple identical layers along the time axis as shown in Fig. 4(b). Every pair of CQs adjacent along the time axis is connected by an edge in G. The vertices (CQs and AQs) and edges (between CQs and AQs Each black circle is a code qubit (CQ) located at a vertex of L2D. Each colored square is an ancilla qubit (AQ) with that color, located at the center of a face of L2D with that color. Each AQ is connected with surrounding CQs by edges (cz gates), some of which are drawn as black solid lines. Two adjacent CQs are connected by a link, some of which are drawn as colored lines. (b) Stack of multiple identical layers along the simulating time axis. Each pair of two CQs adjacent along the time axis is connected by an edge, some of which are presented as black solid lines. One of the primalities ("primal" and "dual") is alternatively assigned to each layer. An AQ (a CQ or link) is primal (dual) if it is in a primal layer, and vice versa for a dual layer. Labels of some elements defined in Sec. III B are shown.
in the same layer and between CQs in the adjacent layers) constructed above finally complete the graph G of the cluster state.
We assign each layer, qubit or link a "primality": either primal or dual. Each layer is primal (dual) if it has an even (odd) time. An AQ is primal (dual) if it is in a primal (dual) layer, while a CQ or link is primal (dual) if it is in a dual (primal) layer. We label each qubit or link in an abbreviated form with its primality ("p" for primal and "d" for dual), color ("r" for red, "g" for green, and "b" for blue; omitted for CQs), and type ("AQ," "CQ," and "L" for a link). For example, a pgAQ means a primal green ancilla qubit. We also frequently use "c" instead of a specific color (r, g, or b) for a variable on colors.

C. Stabilizer generators
We now present stabilizer generators (SGs) of a CCCS. Remark that, for each vertex v in G, S(v) given in Eq. (1) is a SG if Q(v) is initialized to |+ . We define A-and C-type SGs shown in Fig. 5(a) and (b) as follows.
Definition 1 (A-and C-type SGs). An A-or C-type SG is the SG given in Eq. (1) around an AQ or a CQ, respectively.
The support [63] of a C-type SG is distributed in three adjacent layers, while that of an A-type SG is contained in a layer. Definition 2 (L-type SG). The L-type SG around a link l is the product of two C-type SGs whose center qubits constitute l.
and (v 0 , v 3 ) are links with different colors. S I := S 1 S 2 S 3 is then the J-type SG around the CQ Q(v 0 ).
A-, L-, and J-type SGs together generate the stabilizer group over-completely. To see this, regarding a J-type SG S I , we consider an L-type SG S Li := S 0 S i for each i ∈ {0, 1, 2, 3}, where S i 's are defined in Definition 3. Then S 0 = S L1 S L2 S L3 S I holds, thus any C-type SG can be written as the product of L-and J-type SGs.
Let the P -support supp P (O) of a multi-qubit Pauli operator O for P ∈ {X, Y, Z} be the subset of supp(O) corresponding to the P operator. Note that, for every SG regardless of its type, qubits in its X-and Z-support always have different primalities.

D. Shrunk lattices and correlation surfaces
Almost every discussion from now on is symmetric between the two primalities. Thus, throughout the rest of this paper, we frequently discuss only one of them, which implies that the other side can be treated similarly.
We now construct the shrunk lattices of a CCCS, which are analogous to those of the 2D color codes in Fig. 3. We then define correlation surfaces [40,43,44] within each shrunk lattice, through which logical gates are built for MBQC.
The primal c-colored shrunk lattice L pc is a 3D lattice containing every pcAQ as a vertex. Note that the vertices are only in primal layers. There are two types of edges connecting them: "spacelike" and "timelike" edges. Each spacelike edge corresponds to a pcL and connects two vertices in a layer. Each timelike edge connects two vertices adjacent along the time axis and contains a dcAQ between them. Faces and cells are then naturally defined by the vertices and edges. Cells in each primal shrunk lattice are visualized in Fig. 6 for 4-8-8 CCCSs. Note that each primal layer in L pc is identical with the c-colored shrunk lattice of the 2D color code on which the CCCS is based.
Each element (vertex, edge, face, or cell) in a shrunk lattice corresponds to an AQ or a link, as presented in Table I. Here Q(b) for an element b denotes the set of qubits corresponding to b. Note that an element is colorable with the color of AQ or link corresponding to it. In particular, cells and spacelike faces have colors different from the color of the shrunk lattice, e.g., L pr is composed of green and blue cells.
We now regard the shrunk lattices as chain complexes [40,43,44]. Let B pc i for i = 0, 1, 2, or 3 be the set of vertices, edges, faces, or cells in L pc , respectively. We then consider a vector space H pc i generated by B pc i over Z 2 . Each primal shrunk lattice may be regarded as a chain complex: where Q(h i ) := bi∈hi Q(b i ) and P (q) is the tensor product of the P operator on the qubit q and the identity operator on all the other qubits. We now define correlation TABLE I. Qubits Q(b) corresponding to each element (vertex, edge, face, or cell) b in L pc . The results for L dc can be obtained by changing each p or d. surfaces (CSs), essential elements for constructing logical operations through MBQC.

Definition 4 (Correlation surface). For each 2-chain
is a primal (dual) c-colored correlation surface, referred to as a " p(d)c-CS." It is straightforward to see that, for a spacelike or timelike face f , S CS (f ) is an A-or L-type SG around the AQ or link corresponding to f , respectively. The following theorem relates general 2-chains to stabilizers of the CCCS.

Theorem 1 (CSs as stabilizers). For a 2-chain
which is a stabilizer. The proof is analogous for dual 2-chains.
(Only if part) Since qubits in Q IN are not initialized to the |+ states, the A-and C-type SGs around each of them do not exist. Therefore, the X-support of any stabilizer cannot contain qubits in Q IN .
Regarding a primal CS S := S CS (h 2 ), Q(h 2 ) is called the interior of S, in which every qubit is primal and in supp X (S). Similarly, Q(∂h 2 ) is called the boundary of S, in which every qubit is dual and in supp Z (S). We say that S is timelike (spacelike) if h 2 is composed of timelike (spacelike) faces only.
CSs discussed above include all A-and L-type SGs, but not J-type SGs in Fig. 5(d). Each J-type SG can be regarded as three primal timelike CSs with different colors "joined" along a timelike series of CQs as Fig. 7(a), in the sense that each "wing" of a color c may be extended by multiplying ordinary pc-CSs. Note that the CQs along the joint are not included in the support.
A question arising naturally may be about "spacelike" joints, and those are also possible as presented in Fig. 7(b). A timelike pc-CS and two spacelike primal CSs with the other two colors may be joined along a spacelike series of pcLs. Such a joint can be obtained by multiplying several A-type SGs along a spacelike boundary of the timelike CS. Note that the ends of spacelike and timelike joints may fit perfectly with each other, in the sense that all the Z operators on the joint cancel out when multiplying them.
A general joint of CSs with different colors can be obtained as Fig. 7(c) by multiplying several spacelike and timelike joints together with ordinary CSs. We refer to such a primal CS with a joint as a "pj-CS." For consistency with ordinary CSs, we define the interior (boundary) of a pj-CS by its X(Z)-support, which is intuitive In this section, we describe MBQC via CCCSs. We first introduce defects and define logical qubits using them. We then describe initialization and measurements of logical qubits and construct elementary logical gates including the identity, cnot, Hadamard, and phase gates, which together generate the Clifford group. We lastly present the state injection scheme to prepare an arbitrary logical state and implement the logical T gate.
Each logical initialization, measurement, gate, or state injection process can be regarded as an independent circuit "block" implemented by the process presented in Sec. II. In each block, the input logical state is given in the input qubits Q IN (Q IN = ∅ for the initialization) and the output logical state is produced in the output qubits Q OUT (Q OUT = ∅ for the logical measurements) after the single-qubit Pauli measurements of all the qubits except Q OUT . An arbitrary quantum circuit can be formed by connecting multiple blocks in a way that the output qubits of each block are used as the input qubits of the next block.
Without loss of generality, we assume that the singlequbit measurements are performed layer by layer along the simulating time (t) axis. In that case, the output qubits of an initialization, gate, or state injection block are the last several layers of it, called the output layers. On the other hands, it is sufficient that the input qubits of a measurement or gate block contain only the first layer of it, called the input layer. Two subsequent blocks can be connected in a way that the input layer of the second block overlap with the first output layer of the first block. To see this, let us assume that the output layers of the first block are the layers of t 0 ≤ t ≤ t 1 . We first consider applying all the cz gates between qubits of t 0 ≤ t ≤ t 1 again on the post-measurement state of the first block. Since the measurements of the qubits of t < t 0 commute with those cz gates, the qubits of t 0 < t ≤ t 1 simply return to the initial |+ states. The t 0 -layer is then used for the input layer of the second block and the cz gates in the second block restore the output state of the first block to be used as the input state of the second block. Of course, the above argument is just a theoretical trick to connect two blocks; it is unnecessary to apply cz gates multiple times in a real implementation.

A. Measurement pattern
Remark that each qubit except the output qubits is measured in a Pauli basis determined by a predefined measurement pattern. Such a qubit is included in an area with one of the four types: vacuum, defect, Y-plane, and injection qubit. There may be multiple defects, Y-planes, and injection qubits, and the entire remaining area is the vacuum. We denote the set of all vacuum (defect) qubits as V (D).
Defects are key ingredients for the protocol; all the logical operations completely depend on how to place them. Y-planes are used in fault-tolerant Y -measurements on physical qubits for the logical Hadamard and phase gates. Lastly, each injection qubit is a special area for state injection and consists of a single qubit. Qubits in each area are measured as follows: Arranging these elements besides the vacuum properly is the key for implementing logical qubits and gates, which is what we cover in this section.

B. Defects and related correlation surfaces
Defects are defined as follows and visualized in Fig. 8(a) schematically.
Definition 5 (Defect). Consider a defect area, a continuous area stretching along a direction. A primal (dual) c-colored defect, referred to as a " p(d)c-D," is the largest contained completely in the defect area. Qubits in Q(h 1 ) are called defect qubits and measured in the Z basis during the measurement step.
We say that a defect is timelike or spacelike if the defect area stretches timelikely or spacelikely, respectively. After the measurement step, only CSs commuting with the measurement pattern survive. We say a CS is compatible with a set of qubits if it survives after the measurements of the qubits. If it is compatible with all the qubits except the output qubits, we say that it is a compatible CS. The following theorem gives the conditions which such CSs satisfy.
Theorem 2 (Compatible CSs). Considering only the vacuum and defects, a CS S is compatible with a set Q of qubits if and only if the followings hold: where Q int(bnd) (S) is the interior (boundary) of S and Q IN(OUT) is the set of input (output) qubits.
We particularly want to emphasize that a compatible CS cannot end in the vacuum qubits. Note that Q IN is excluded in the right-hand side (RHS) of Eq. (4a) due to Theorem 1. Table II shows allowed positional relations between a pc-D d and a compatible CS with each primality and color, derived from Theorem 2 and Table I. Remark that d is composed of pcAQs and pCQs. A pc -CS has primal interior qubits which should be measured in the X basis for the CS to be compatible, thus can overlap with d unless they share common qubits, which is possible only if c = c and the overlapped region of the CS is spacelike [64]. Since its boundary qubits are dual, it cannot end at d. A dc -CS has primal boundary qubits, thus can end at d if the boundary qubits are in d, which is possible if c = c [65]. Since its interior qubits are dual, it can freely pass d.
We mainly concern two types of CSs with respect to a pc-D: pc-CSs surrounding the defect and dc-CSs ending at it, as shown schematically in Fig. 8(a) and (b) and explicitly in Fig. 8(c) and (d). Each of such CSs is compatible with all the qubits except the boundary qubits in the two ends about the direction of the defect.

C. Defining a logical qubit
We first define connected 1-chains as follows. To define a logical qubit, we consider three parallel timelike defects with different colors passing through the t 0 -and (t 0 + 1)-layer for a given integer t 0 , as visualized schematically in Fig. 9(a). The constructed logical qubit is primal (dual) if the defects are primal (dual) and t 0 is odd (even).
We define a logical qubit by specifying the logical-X (X L ) and logical-Z (Z L ) operators. To define X L , we consider two closed connected spacelike 1-chains h Xdcc  Fig. 9(a) for the case of (c, c ) = (b, r). Note that the two 1-chains consist of pcLs and dcLs, respectively. We then define Note that supp Z (X L ) = Q h Xpcc' 1 may be in the boundary of a pc-CS since the boundary is a 1-chain in H pc 1 as well. The colors c and c can be any pair of different colors, and they are proven to be equivalent in Sec. IV E 2.
For the Z L operator, we consider an open connected spacelike 1-chain h Zc 1 ∈ H dc 1 for each color c, which is located in the t 0 -layer and connects the pc-D and a common pCQ q I , as shown in Fig. 9(a) and (b). Note that h Zc 1 is composed of pcLs. We define Note that q I is out of supp(Z L ). It is worth noticing that supp(Z L ) may be in the boundary of a dj-CS, which is verifiable by comparing supp(Z L ) and the structure of a timelike joint of CSs shown in Fig. 7(c).
X L and Z L defined above anticommute with each other, considering that supp Z (Z L ) and supp X (X L ) meet at a pCQ q anti in Fig. 9(a). A dual logical qubit is defined analogously, but now the logical operators are defined oppositely; supp(Z L ) surrounds a defect and supp(X L ) ends at each defect.

D. Initialization and measurement of a logical qubit
We first describe initializing a primal logical qubit to an eigenstate of X L or Z L . Initialization of a dual logical qubit can be analogously done. As mentioned at the beginning of this section, in each block of logical initialization, there is no input layer and the initialized state is prepared in the output layers Q OUT (t 0 -and (t 0 + 1)layer) after the measurement step.
The X L -initialization of a primal logical qubit is done by making the defects start from the t 0 -layer. X L given in Eq. (5) is then a part of a "cup-shaped" pc-CS S X as shown in Fig. 9(c). Since X L S X has the support out of the output qubits and commutes with each singlequbit measurement in the measurement step, the postmeasurement state is an eigenstate of X L S X . S X is a stabilizer both before and after the measurement step due to Theorems 1 and 2. Therefore, the post-measurement state is also an eigenstate of X L and the eigenvalue is determined by the measurement result of X L S X .
The Z L -initialization of a primal logical qubit is done by extending the defects to meet at a qubit before the t 0 -layer, as shown in Fig. 9(d). Z L given in Eq. (6) is then a part of a dj-CS S Z which is a stabilizer. From an analogous argument, the post-measurement state is an eigenstate of Z L and the eigenvalue is determined by the measurement result of Z L S Z . The X L -or Z L -measurement is done by reversing the time order from the corresponding initialization process, as shown in Fig. 9(e) and (f). This time, Q IN is the t 0 -layer and Q OUT is empty. Regarding the X Lmeasurement, there exists a pb-CS S X which is a stabilizer before the measurement step such that X L S X commutes with each single-qubit measurement in the measurement step. Therefore, X L is equivalent to X L := X L S X ; namely, ψ|X L |ψ = ψ|X L |ψ holds for every stabilized state |ψ before the measurement step, thus redefining X L to X L does not change the logical state encoded in |ψ . The measurement result of X L can be directly obtained from the results of the measurement step. The Z L -measurement process can be verified analogously.

Identity gate
The identity gate of a primal logical qubit is constructed just by extending the defects along the time axis between Q IN (t 0 -layer) and Q OUT (t 1 -and (t 1 + 1)-layer) as shown in Fig. 10. Let X L and X L be the logical-X operators of the input and output logical qubits, respectively: X L := F br X (t 0 ) and X L := F br is given in Eq. (5). We consider a pb-CS S X which surrounds the pr-D and ends at supp Z (X L ) and supp Z (X L ), as shown in Fig. 10(a). Since S X is a stabilizer, X L is equivalent to where V X := supp(S X X L X L ) ⊂ V \ Q OUT . After the measurements of the qubits of t < t 1 , X L is transformed into where x q (z q ) is the X(Z)-measurement result of the qubit q. In other words, holds, where |ψ and |ψ are the states before and after the measurements (see Appendix A for the proof).
We do a similar thing on the Z L operators. Denoting those of the input and output logical qubits as Z L and Z L , respectively, we consider a dj-CS S Z ending at supp(Z L ), supp(Z L ), and the defects, as Fig. 10(b). Z L is then equivalent to After the measurements of the qubits of t < t 1 , Z L transforms into x Z z Z Z L where x Z := q∈V Z x q and z Z := q∈D Z z q .
The transformations of the logical operators are summarized as More explicitly, they are written as where |ψ and |ψ are the states before and after the measurement step, respectively. Therefore, the input logical state |ψ L encoded in |ψ with the logical Pauli operators {X L , Z L } is transformed into entire circuit and finally merged with the logical measurements [24].
The above arguments show the basic ideas for implementing logical gates. Regarding n logical qubits, let P Li for each P ∈ {X, Z} and integer i ≤ n denote the logical-P operator of the ith logical qubit. To construct a general logical gate U for n logical qubits, one should find a configuration of defects (and Y-planes for some gates) where a CS S P i exists for each P Li satisfying the following conditions: Condition 1. S P i should connect P Li of the input logical qubits and U P Li U † of the output logical qubits. X L (Z L ) of a logical qubit can be connected with primal (dual) CSs. Condition 2. S P i should be compatible with all the qubits except the output qubits and supp(P Li ); it satisfies the relationships shown in Table II in that region.
If such CSs exist, the configuration implements the desired logical gate with some byproduct operators obtained from the measurement results.

cnot and primality-switching gates
We first consider the logical cnot gate between a primal logical qubit (target) and a dual one (control). Figure 11 illustrates the defect configuration, where the pg-D of the primal logical qubit and the dr-D of the dual one are twisted one round with each other, which is commonly called defect braiding. The logical Pauli operators are transformed as where the tensor product symbols and the sign terms such as x X , x Z , and z Z in Eq. qubit. The above transformation is exactly the Heisenberg picture of the cnot gate where the primal logical qubit is the target.
We need to find CSs satisfying two Conditions presented in Sec. IV E 1 to verify the transformations in Eq. (10). A dual CS for the transformation of Z p L ⊗ I d L is presented schematically in Fig. 11. Note that the "tunnel" of the CS along the dr-D must be formed since the dr-D cannot overlap with a dg-CS (see Table II). A CS for I p L ⊗ X d L can be constructed analogously; now, a tunnel of a pr-CS is made along the pg-D. The other two transformations are straightforward.
Exploiting the cnot gate discussed above, it is possible to make the primality-switching gate which changes a primal logical qubit to a dual one, by "closing" the input part of the dual one and the output part of the primal one, as shown in Fig. 12(a). Remark that these closures indicate the Z L -measurement of the primal one and the X L -initialization of the dual one. The modified configuration is thus equivalent to the circuit in Fig. 12(b) up to byproduct operators, which implements the identity or X L gate while changing the primality. Alternatively, this result is directly obtainable by finding appropriate CSs; for example, the dj-CS in Fig. 12(a) verify the transformation of Z p L to Z d L . The primality-switching gate from a dual logical qubit to a primal one can be made in a similar manner.
The primality-switching gate enables the cnot gate between logical qubits with arbitrary primalities. Regardless of the primalities of the input logical qubits, one can switch them to primal (target) or dual (control), and apply the cnot gate in Fig. 11.
Note that the equivalence between the different definitions of the X L operator, related to the choice of the color pair (c, c ) in Eq. (5), can be proven with the primalityswitching gate. We consider a chain of two primalityswitching gates: primal → dual → primal. No matter how X L is defined in the first primal logical qubit, it becomes symmetric about the color in the dual one. We can thus transform it into any definition of X L in the final primal one.

Hadamard gate
To construct the logical Hadamard gate, the logical Pauli operators should be transformed as It is simple if the gate is located just after the state injection presented in the Sec. IV F: injecting the unencoded state to a dual logical qubit instead of a primal one. This method is valid since the definitions of X L and Z L are opposite for primal and dual logical qubits.
If the Hadamard gate is located in the middle of the circuit, it is a bit tricky. Since X L and Z L of a logical qubit can be connected only with primal or dual CSs, respectively, there should be a CS having different primalities near the input and output layers, to achieve the transformation. To solve this problem, we construct a defect structure starting with a primal logical qubit and ending with a dual one as shown in Fig. 13, where the primal one stops at the primal t H -layer and the dual one starts from the dual (t H + 1)-layer. Each pair of defects with the same color must have exactly the same spatial structure at t = t H and t = t H + 1. Note that such a configuration is possible thanks to the self-duality of the 2D color codes which makes primal and dual layers have exactly the same structure.
We consider two pairs of overlapping primal and dual CSs: (S Zp , S Xd ) and (S Xp , S Zd ), where S Xp , S Zp , S Xd , and S Zd are a pr-CS, dj-CS, pj-CS, and dr-CS defined in Fig. 13, respectively. S ZX := S Zp S Xd then transforms Z L of the input primal logical qubit to X L of the output dual one. Similarly, S XZ := S Xp S Zd transforms the input X L to the output Z L . Condition 1 in Sec. IV E 1 is thus satisfied with these two "hybrid" CSs. What remains is Condition 2. Since S ZX and S XZ contain Y operators on some CQs in the overlapping regions, the qubits should be measured in the Y basis for the CSs to be compatible.
To make the Y -measurements fault-tolerant, we introduce Y-planes: Definition 7 (Y-plane). A primal (dual) Y-plane is the set of p(d)CQs in a continuous area contained in a dual (primal) layer. CQs in Y-planes are measured in the Y basis.
Errors in Y-planes can be corrected by an error correction procedure presented in Sec. IV B. Therefore, the Y -measurements for the Hadamard gate can be faulttolerantly done by placing wide enough Y-planes to cover supp Y (S ZX ) and supp Y (S XZ ) completely.

Phase gate
We now complete the generating set of the Clifford group with the construction of the logical phase (S L ) gate. The phase gate is achieved indirectly by utilizing an ancilla logical qubit; the circuit in Fig. 14 implements S L if the Y L -measurement of the ancilla logical qubit gives the result of +1 and S L Z L if the result is y A = −1.
All the elements in the circuit already have been described except the Y L -measurement. For the Y Lmeasurement of a input primal logical qubit, we extend (a) 15. (a) pj-CS SX and (b) dj-CS SZ for the YL-measurement of a primal logical qubit. Near the input layer, SX connected with XL of the input logical qubit has the form of a pb-CS surrounding the pr-D. On the t1-layer, it is divided into three CSs with different colors through a spacelike joint. Each CS is then deformed appropriately so that the joint is extended along the black dashed line. The 1-chains (colored dotted lines) on the t2-layer are in the X-support of SX . On the t3-layer, the joint becomes spacelike again. After that, SX has the form of a pb-CS until the t4-layer on which SX is closed. SZ simply connects ZL and the 1-chains (colored dashed lines) on the t2-layer. (c) supp(SZ SX YL) on the t2-layer. A Y-plane is placed to cover supp Y (SZ SX YL). The junction of the pb-D and the blue 1-chain is explicitly shown below. the defects straight along the time axis to a layer (t 2 ). As shown in Fig. 15, there exists a pj-CS S X (connected with X L ) and dj-CS S Z (connected with Z L ) which are stabilizers, such that S Z S X Y L = i(S Z Z L )(S X X L ) contains X operators on vacuum qubits and Y operators along "Y"shaped connected 1-chains on the t 2 -layer. Hence, the Y L -measurement can be done by placing a Y-plane on the t 2 -layer as Fig. 15(c).
We conclude that all the elements in the circuit of Fig. 14 can be implemented fault-tolerantly, thus the fault-tolerant phase gate can be made up to byproduct operators.

F. State injection
Preparation of an arbitrary logical qubit a |0 L + b |1 L is essential for implementing the logical T gate as well as quantum computation with arbitrary input states. This is done in our scheme by injecting the corresponding unencoded state into a physical qubit.
We start from the configuration for the Z L -initialization of a primal logical qubit shown in Fig. 9(c), where three defects meet at a point. First, a qubit q inj in the pc-D for any color c is selected as an injection qubit which is the only input qubit in Q IN . We assume that the defect is "thicknessless" at q inj ; namely, its cross-section at q inj contains at most one qubit as shown in Fig. 16(a). The desired initial state is injected into q inj in an unencoded form |ψ = a |0 +b |1 , then the associated cz gates are applied. Remark that q inj is measured in the X basis as stated in Eq. (3). The X (Z) operator on q inj is transformed into X L (Z L ) up to a sign factor as shown in Fig. 16, thus the logical state |ψ L = a |0 L + b |1 L is prepared up to byproduct operators.
Note that the state injection procedure is inherently not fault-tolerant, since it uses an unprotected singlequbit state and the defect is thicknessless at q inj . Therefore, magic state distillation is essential for the faithful T gate.

V. ERROR CORRECTION
Now we describe error correction schemes in CCCSs. The scheme varies with the area of the qubits: the vacuum, defects, and Y-planes.

A. Error correction in the vacuum and defects
For error correction in the vacuum, we exploit paritycheck operators (PCs) defined as follows: PCs are classified into six groups according to primalities and cell colors. Here, the primality of a PC S CS (∂c) is that of the shrunk lattice L containing the cell c, and its cell color is the color of the AQ Q(c). Remark that the cell color is different from the color of L, as shown in Table I. We refer to a primal c-colored PC as a "pc-PC." Remark that a given dcAQ q corresponds to two primal cells, one for each of L pc 1 and L pc 2 where c, c 1 , and c 2 are all different colors. However, the PCs corresponding to the cells are indeed the same, comparing Fig. 6(a) and (b) as an example. We can thus regard that one AQ (q) corresponds to one PC, and denote it as S PC (q). The support of the pc-PC S PC (q) for a dcAQ q contains two pcAQs and multiple pCQs around q as shown in Fig. 17(a) We first consider only vacuum qubits. Since they are measured in the X basis, all PCs survive as stabilizers after the measurement step. Any Z error before the measurement or any X-measurement (M X ) error flips several PC outcomes. Note that X errors do not affect the outcomes at all, so can be ignored. The final step for error correction is to decode errors from them and correct the errors.
An error may occur on either an AQ or a CQ. An error on a pcAQ q flips two pc-PCs sandwiching q along the time axis as shown in Fig. 17(b). An error on a pCQ q flips pr-PC, pg-PC, and pb-PC surrounding q spatially, as shown in Fig. 17(c). If both the pCQs constituting a pcL l have errors, the two pc-PCs connected by l are flipped.
Combining the above facts, we conclude that, if every qubit in Q(h dc 1 ) for a connected dual 1-chain h dc 1 ∈ H dc 1 has an error, the pc-PC S PC (q) for each qubit q ∈ Q(∂h dc 1 ) is flipped, as shown in Fig. 17(d). Such an error set in the vacuum is called a primal c-colored error chain, referred to as a "pc-EC." Formally, a pc-EC is written as the tensor product of the Z operators on the error qubits. Furthermore, starting from an error on a pCQ, each flipped PC may be "moved" by multiplying a primal error chain of the corresponding color ending at the PC. An error set constructed by this way flips three primal PCs located at its ends and is referred to as a "pj-EC." General error chains are obtained by connecting multiple pc-ECs for each color c and pj-ECs.
We now investigate the effects of a pc-D d to the nearby PCs. First, all primal PCs whose supports contain any defect qubit no longer survive, while dual PCs are unaffected. Such incompatible PCs may be multiplied with each others to form larger compatible stabilizers, as shown in Fig. 18 where two pg-PCs and a pr-PC are merged. Like normal PCs, these merged PCs also can detect errors, although decoding errors from PCs may get more ambiguous. Some PCs for which such multiplication is impossible have no choice but to be discarded, as the pb-PC in Fig. 18. As a consequence, a pc-EC ending at d is not detected by any PC near d.
A pc-D may make some dual CSs survive additionally. The dc-CS S CS (f ) for a face f ∈ B dc 2 , where Q(∂f ) is in the defect as shown in Fig. 18, is compatible, thus can serve as a PC for detecting errors. We call such CSs defect PCs. A notable thing is that they may detect not only errors on vacuum qubits but also X or Z-measurement (M Z ) errors on defect qubits.
We then identify nontrivial undetectable error chains, where "nontrivial" here means that they incur logical errors. Such an error chain is closed or ends at defects with the same primality and color. Considering the identity gate of a primal logical qubit, the shortest error chain inducing an X L error is a pj-EC ending at the three defects, and the shortest one inducing a Z L error is a closed dc-EC surrounding the pc -D (c = c), as shown schematically in Fig. 10 and explicitly in Fig. 18. Note that a closed dc-EC penetrating a defect is detected by defect PCs, although not detected by ordinary PCs. The code distance of a logical qubit is defined by the size of the smallest nontrivial undetectable error set, and it increases as the defects get thicker or get farther from each other [66].

B. Error correction in Y-planes
To correct errors in Y-planes, we use hybrid PCs defined with open PCs, which are visualized in Fig. 19(a). Remark that CQs in Y-planes are measured in the Y basis, thus ordinary PCs whose supports contain those CQs are incompatible with the qubits. Instead of them, we use hybrid PCs whose Y -supports are on the Y-planes, as shown in Fig. 19(b). Error correction in the Y-planes is done with a set of hybrid PCs covering the entire Yplanes.

A. Resource overheads
We now calculate and compare the resource overheads of MBQC via RTCSs or CCCSs. For each case, we consider a periodic hexagonal arrangement of parallel timelike primal defects, where primal logical qubits with the code distances of d are compactly packed in the space. In other words, the intervals of the arrangement are determined to minimize the number of physical qubits per logical qubit while keeping all the possible nontrivial undetectable error chains to contain d or more qubits. We present such arrangements of defects in Appendix B. Table III shows the calculated numbers of physical qubits (n) and cz gates (N cz ) per layer in terms of d and the number of logical qubits (k), considering the optimal hexagonal arrangements. It is worth noticing that MBQC via CCCSs is definitely more resource-efficient than MBQC via RTCSs; n/k is about 1.7-1.8 times smaller for CCCSs than for RTCSs. Note that the com-TABLE III. Resource overheads of MBQC via RTCSs or CCCSs, evaluated by the numbers of physical qubits (n) and cz gates (Ncz) per layer in terms of the code distance (d) and the number of logical qubits (k), regarding optimal hexagonal arrangements of parallel timelike primal defects. Only the leading-order terms on d are presented. Two types of color codes are considered: the 4-8-8 and 6-6-6 lattices.

B. Error thresholds
We numerically calculate and compare error thresholds of MBQC via RTCSs and CCCSs.

Error model
We assume a simple error model where vacuum qubits have Z (M X ) errors independently with the same probability p Z (p M X ). Since a Z error just before the measurement and an M X error have the same effect, it is enough to consider the net error probability p phy := p Z + p M X − p Z p M X . Note that X errors on the vacuum qubits do not affect the X-measurement results at all, thus we neglect them.

Simulation methods
For each simulation with a code distance of d, we consider the logical identity gate of a primal logical qubit covering consecutive 2T +1 layers with T = 4d+1 starting from a primal layer. Simplified defect models presented in Appendix C 1 are used, instead of considering big areas containing the entire defects. We calculate the Z L error probability per layer with the Monte Carlo method; we repeat a sampling cycle many times enough to obtain a desired confidence interval of the Z L error probability. Each cycle is structured as follows.
We first prepare a cluster state whose shape and size are determined by d and T . Here we assume perfect preparation, namely, no qubit losses or failures of cz gates. Errors are then randomly assigned to primal qubits with a given probability p phy , except those in the first and final layers to prevent error chains ending at these layers. After that, the outcomes of primal PCs are calculated, then decoded to locate errors. Edmonds' minimum-weight perfect matching (MWPM) algorithm [67][68][69] via Blossom V software [70] is used for decoding (once for RTCSs and six times for CCCSs), where the details are presented in Appendix C 2. We then identify primal error chains connecting different defects which incur Z L errors by comparing the assigned and decoded errors. We count such error chains while repeating the cycles and obtain the Z L error probability per layer P log . The error threshold p thrs is obtained from the calculated P log results for different values of d and p phy ; P log decreases as d increases if p phy < p thrs and vice versa otherwise. 3. Results Figure 20 shows the results of the simulations. The obtained error thresholds are p thrs ≈ 3.0% for 4-8-8 and 6-6-6 CCCSs and p thrs ≈ 3.5% for RTCSs. The values for CCCSs are slightly lower than the value for RTCSs, but they have similar orders of magnitude.

VII. REMARKS
In this paper, we have proposed a new topological measurement-based quantum computation (MBQC) scheme via color-code-based cluster states (CCCSs). We have shown that our scheme is comparable with or even better than the conventional scheme via Raussendorf's 3D cluster states (RTCSs) [40,[43][44][45], in the three aspects mentioned at the very beginning: 1. Universality.
Initialization and measurements of logical qubits and all the elementary logical gates constituting a universal set of gates (cnot, Hadamard, phase, and T gates) can be implemented via appropriate placement of defects and Y-planes. We described each one of them explicitly in Sec. IV.
2. Fault-tolerance. We suggested the error correction scheme for each area of qubits in Sec. V. We further verified in Sec. VI B that the error thresholds for Z or X-measurement errors have a similar order of magnitude comparing with the value for RTCSs.
3. Resource-efficiency. Contrary to the case of using RTCSs, the Hadamard and phase gates do not require state distillation, which typically consumes many ancillary logical qubits [22,38,40], as shown in Sec. IV E, thanks to the nature of the self-duality of the 2D color codes. Moreover, we found out in Sec. VI A that the minimal number of physical qubits per logical qubit in our scheme is about 1.7-1.8 times smaller than the value for RTCSs. As a consequence, MBQC via CCCSs requires a significantly smaller amount of resources than MBQC via RTCSs.
We particularly emphasize the last aspect on resourceefficiency as a definite improvement from the previous schemes, which makes our scheme a more easy-toimplement alternative to those. Our work has several limitations. First, the logical T gate still needs costly state distillation. Some methods to significantly reduce the cost of distillation have been proposed, such as using logical qubits with low code distances as ancilla qubits [71] or exploiting redundant ancilla encoding and flag qubits [72]. Moreover, 3D gauge color codes [30][31][32][33][34][35][36][37] enables the implementation of a universal set of gates without distillation. It may be possible to translate these protocols to be applicable for our MBQC scheme. We also assume the perfect preparation of states, which is unrealistic. It is unclear how much the fault-tolerance gets weaker if we consider qubits losses or failures of cz gates, which is particularly related to photon losses in optical systems. It will be interesting future works to further investigate and resolve these problems.
Lastly, we would like to mention a recent work on a general topological MBQC scheme using the Walker-Wang model for the 3-Fermion anyon theory [73]. It provides a general framework on universal QC with defect braiding, which produces the MBQC scheme via RTCSs as an example. There may be some connections between this work and our scheme, which is worth further investigation. Each black, red, green, or blue square is a defect, where its color means the color of the defect if it is in (b). Each purple rectangle surrounded by dashed lines is an area occupied by a logical qubit. Dotted lines indicate all the possible types of error chains which may be the shortest ones, which are used for obtaining the values of the marked intervals minimizing the area of a logical qubit. Note that, in (b), counterparts of some error chains regarding the exchange of blue and green defects are omitted, since the two lattices (4-8-8 and 6-6-6) which we concern have symmetry on those defects. The optimal intervals for RTCSs are directly presented in (a). For CCCSs, they are (α, β, γ, δ, ) = ( 1 4 d, 1 4 d, 0, 1 2 d, 1 2 d) for 4-8-8 and (α, β, γ, δ, ) ≈ (0.23d, 0.23d, 0.38d, 0.53d, 0.38d) for 6-6-6. Here, the unit length is a side of a unit cell in RTCSs (see Fig. 1(b)), the distance between adjacent prAQ and pgAQ in 4-8-8 CCCSs (see Fig. 4(a)), and half the distance between two adjacent prAQs in 6-6-6 CCCSs (see Fig. 2(b)). Purples triangles indicate the qubits in the error chains, which show that the code distances are three. Defect models for d > 3 can be constructed analogously by increasing the distances between the boundaries while keeping their shapes.

Appendix C: Details on calculation of error thresholds
We here present some details on the calculation of error thresholds presented in Sec. VI B.

Simplified defect models
As mentioned in the main text, we simplify the defect models for efficient simulations. Instead of considering big regions containing the entire defects, we consider only regions surrounded by boundaries corresponding to the defects. That is, we only take account of error chains located in the "inner" regions surrounded by the defects. Since those error chains are strictly shorter than error chains passing outside the regions, we conjecture that this assumption does not affect the resulting Z L error probabilities much. Figure 22 shows single layers of the three simplified defect models for the simulations regarding RTCSs, 4-8-8 CCCSs, and 6-6-6 CCCSs, respectively. Each layer of the concerned RTCSs has the shape of a square with a side length of d−1 in the units of cells for the code distance d, where the boundaries are of different types (primal and dual). Any error chain connecting the two primal boundaries incurs a Z L error. For CCCSs, we consider a region surrounded by three boundaries of different colors, where each boundary can be regarded as a part of a defect. Any error chain connecting the three boundaries incurs a Z L error.

a. Raussendorf 's 3D cluster states
In an RTCS, the PC outcomes are decoded to locate errors at vacuum qubits via Edmonds' minimum-weight perfect matching algorithm (MWPM) [67][68][69], as frequently used in the literature [43,46,47,74]. Remark that an error chain flips at most two PCs located at its ends, and if it flips one PC, it ends at the boundary. Hence, our goal is to figure out the most probable set of error chains based on the PC outcomes.
The decoding procedure is briefly summarized as follows. First, a graph is constructed from the PC outcomes. The vertex set of the graph contains two vertices for each flipped PC: one is the PC itself and the other is the "boundary vertex." An edge is connected between each pair of different PCs, each pair of a PC and the corresponding boundary vertex, and each pair of different boundary vertices. A "weight" value is assigned to each edge as follows. If both the vertices are PCs, the weight is the number of qubits in the shortest path between them. If only one of them is a PC, the weight is the number of qubits in the shortest path between the PC and the closest boundary. If both of them are boundary vertices, the weight is zero.
We use the MWPM algorithm via Blossom V software [70] to search for a set of edges of the graph constructed above which covers all the vertices, does not contain duplicated vertices, and minimizes the total weight. Each edge in the resulting set corresponds to a pair of PCs flipped by an error chain or a PC flipped by an error chain ending at the boundary, unless the edge connects two boundary vertices, which is ignored. We can thus locate errors from the error chain along the shortest path for each edge. Since the total weight is minimized, we get the smallest of the sets of edges producing the same PC outcomes, which is the most probable assuming that the error probabilities are independent and the same between qubits.

b. Color-code-based cluster states
The decoding method for RTCSs is not directly applicable to CCCSs, since an error in a CCCS flips at most three PCs, unlike the case of an RTCS. The decoding for each sample requires the application of the MWPM algorithm six times.
First, the outcomes of pb-PCs and pg-PCs are decoded to find the faces in L pr with odd numbers of errors, via the method analogous to that for RTCSs. This is possible since each of such faces flips at most two (blue or green) PCs like an error in an RTCS. Remark that each face in L pr corresponds to a pbAQ, pgAQ, or prL. Errors at pbAQs and pgAQs are thus obtained from this process.
Next, the left results for prLs and the outcomes of pr-PCs are decoded to locate errors at prAQs and pCQs, regarding the parity of the number of errors in each prL as a PC. This is possible since an error at a prAQ or pCQ flips at most two PCs (pr-PCs and prLs).
All the errors are finally located by the above process. However, to make the decoding more accurate, we repeat it for L pb and L pg analogously and select the smallest set of decoded errors among the three results.