This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

footnotetext: both authors contributed equally

Encoder Circuit For Surface Code using Measurement-Based Quantum Computing Model

Priyam Srivastava1{}^{1^{\dagger}}, Vaibhav Katyal2{}^{2^{\dagger}}, Ankur Raina3 1 Department of Physics, Indian Institute of Science Education and Research, Bhopal, India. 2 Institute of Theoretical Physics, University of Göttingen, 37077 Göttingen, Germany. 3 Department of Electrical Engineering and Computer Science, Indian Institute of Science Education and Research, Bhopal, India. [email protected], [email protected], [email protected]
Abstract

Surface codes are one of the most important topological stabilizer codes in the theory of quantum error correction. In this paper, we provide an efficient way to obtain surface codes through Measurement-based quantum computation (MBQC) using cluster state as the resource state. Simple two-dimensional surface codes are studied and analyzed using stabilizer formalism. We also present an algorithm to computationally obtain the stabilizer of the surface codes, through which we later determine the distance of the codes. We note the difference in the stabilizers of the surface codes obtained by Fowler et al. [1] wherein they used CNOT entangling operation to create the resource state as opposed to the cluster state which is formed using CZ entangling operation. We provide a theoretical calculation to understand this difference. The obtained surface codes can be used practically as an encoder circuit to encode one logical qubit.

Keywords— surface code, quantum error correction, measurement-based quantum computation, MBQC.

1 Introduction

Quantum information theory [2] is a rapidly growing field with the potential to revolutionize computing and cryptography. It offers the prospect of speeding up computational tasks like factorization [3] and database searching [4], which may be beyond the capabilities of present-day classical computers. However, building a large-scale, reliable quantum computer that can perform practical computations remains a significant challenge. This challenge arises from the complex interactions and correlations between quantum systems, which form the fundamental building blocks of such devices, and their surrounding environment.

These quantum devices rely on entanglement as a core mechanism for interactions. However, the entanglement that mediates these interactions is susceptible to various environmental influences, leading to unwanted errors during computation. Unlike classical information, quantum information is highly fragile and easily corrupted by noise and other sources of interference. For instance, in classical communication, we send a stream of bits (0s and 1s) through a classical channel, where some bits may flip due to noise (i.e., from 0 to 1 or from 1 to 0). Similarly, in quantum communication [5], we send qubits (represented as |0⟩ and |1⟩) through a quantum channel, which also preserves the quantum coherence of the system. In this case, errors can manifest as bit flips, phase changes (α\alpha, the relative phase between the qubits), or a combination of both. For example, we may encounter the following errors:

|0\displaystyle|0\rangle |1,\displaystyle\rightarrow|1\rangle, (1)
|1\displaystyle|1\rangle eiα|1.\displaystyle\rightarrow e^{i\alpha}|1\rangle.

To protect quantum information against such errors, the field of quantum error correction [6] plays a critical role. Quantum error correction involves developing codes capable of detecting and correcting errors in devices of interest by encoding the information-carrying quantum states into a larger quantum system and using measurements to detect and correct errors. The surface code [1] is one such family of quantum error-correcting codes that can protect quantum information against a wide range of errors. It is based on the principle of stabilizer codes [7]. The surface code consists of a two-dimensional lattice of qubits, where each qubit is connected to its four nearest neighbors (assuming a square lattice). The code works by measuring the parity of sets of qubits, known as stabilizers, which form closed loops on the lattice. By repeatedly measuring these stabilizers, errors can be detected and corrected without destroying the quantum information. The encoder circuit for the surface code typically involves connecting or entangling qubits using CNOT gates, which aligns with a gate-based model of computation. In this entangling scheme, control and target qubits are defined based on the measurement pattern followed by a set of qubits called measure qubits in surface codes. The code can correct any single-qubit error and any two-qubit error involving two adjacent lattice qubits. It is desirable because it is relatively simple to implement and can correct multiple errors simultaneously.

Our work proposes a different encoder scheme for implementing such a circuit by employing the resource state used in the measurement-based quantum computation model. In this model, the traditional quantum circuit is replaced by a quantum state called a cluster state, which is prepared by entangling multiple qubits through Ising-type interactions [8]. Computation is performed by measuring individual qubits in a specific order and using the measurement outcomes to guide the computation. This model enables fault-tolerant quantum computing schemes [9] with significantly high error thresholds [10].

In this paper, we aim to study the circuit required to implement surface code computation using a cluster-based MBQC scheme. We begin by introducing different definitions involved in the field of quantum error correction, along with the stabilizer formalism, in Section 2. This foundation will enable us to explore quantum error-correcting principles effectively. In Section 3, we delve into the theoretical background of measurement-based quantum computation, providing a comprehensive understanding of how measuring a qubit in the cluster state can control the necessary operations in this computational model. Moving forward, Section 4 provides an overview of existing surface code implementation schemes that utilize CNOT entangling operations. It briefly describes the operations involved in implementing such a circuit. Building upon the various concepts discussed in the previous section, we introduce an encoder circuit for implementing similar surface code operations using the measurement-based model in Section 5. Implementing the surface code using a different scheme involves encoding the quantum information into a large cluster state, followed by an ordered measurement to detect and correct errors. To achieve this, we present an algorithm to realize the stabilizer evolution of our encoder circuit for the surface code and define the stabilizer generators of such a circuit. We implement the algorithm and study the stabilizer evolution of our 3x3 and 5x5 cluster states as examples. We demonstrate the contrast in stabilizer evolution between our 3x3 cluster state with CZ operation and one entangled by CNOT gates. Furthermore, we provide a theoretical study to explain the reason for such a contrast. Finally, we explore the stabilizer evolution of a 5x5 cluster state and define the logical operators and distance of such a circuit to further investigate its error-correcting properties.
Notation

X, Y, Z Measurement in σx\sigma_{x}, σy\sigma_{y}, and σz\sigma_{z} respectively
XL Logical X-Operator
ZL Logical Z-Operator
𝐇\mathbf{H} Hadamard Gate
\mathcal{E} Set of all errors
CZ diag(1,1,1,-1)
CZij CZ operation between ithi^{\mathrm{th}} and jthj^{\mathrm{th}} qubit
n\mathbb{P}_{n} Pauli Groups acting on nn qubits
2\mathbb{Z}_{2} Cyclic Group of Order 2 containing elements {0,1}
𝕊\mathbb{S} Stabilizer Group
𝕊\mathbb{N}_{\mathbb{S}} Normalizer Group of 𝕊\mathbb{S}
𝕊\mathcal{H_{\mathbb{S}}} Eigenspace corresponding to 𝕊\mathbb{S}
𝕊\𝕊\mathbb{N_{S}\backslash S} Elements in 𝕊\mathbb{N_{S}} but outside of 𝕊\mathbb{S}
𝕊/𝕊\mathbb{N_{S}/S} Quotient Group
\mathcal{M} Measurement Array
𝒞\mathcal{C} Cluster state
𝐊(j)\mathbf{K}^{(j)} Stabilizer of jthj^{\mathrm{th}} node in a cluster state

2 Quantum Error Correction

Quantum error correction (QEC) is a procedure to protect the quantum information from unwanted environmental noise [11][12]. QEC forms one of the most important aspects of quantum computation, and we can safely say that quantum computers would be of no practical use without QEC. Among all the unwanted noise encountered in quantum computation the most prevalent and difficult to correct is decoherence [13]. In decoherence, due to the interaction between the environment and the quantum device, quantum information gets nonlocally correlated with the environment. Practically, that means loss of quantum information. Errors due to decoherence degrade the quantum information quickly and render a quantum computer useless. Apart from decoherence, qubit flip and phase error also occurs during quantum computation. Qubit flip error corresponds to applying an X-quantum gate on the state written in the computational basis states |0|0\rangle and |1|1\rangle. It is analogous to bit flip error in classical error correction. Qubit phase error introduces a relative phase of π\pi between the basis states of the qubit and corresponds to applying a Z-quantum gate on the state. From quantum mechanics, we know that, unlike the global phase, relative phases are important as they change the state, and hence the probability density, of the system. There is no analog of phase errors in classical error correction.

2.1 Difficulties faced while correcting quantum errors

The first complication we face while correcting quantum errors is that there is no way to protect the quantum information by making extra copies of it, as done in classical coding schemes. No-cloning theorem prohibits making a copy of the qubit thus making quantum error correction difficult to implement.

The second complication is that quantum computers are susceptible to both bit (𝐗\mathbf{X})-flip and phase (𝐙\mathbf{Z})-flip errors. We should be able to correct both errors simultaneously. But since there is no classical analog of phase flip errors it is hard to devise a quantum error correcting code that allows us to achieve simultaneous correction of both 𝐗\mathbf{X}- and 𝐙\mathbf{Z}-errors.

The last complication is due to the fact that we cannot measure qubits without losing quantum information. The problem of wavefunction collapse due to measurement renders quantum error correction hard to achieve as we would not be able to detect and correct errors without measuring the qubits. We will see in the later sections how stabilizer formalism allows us to overcome this complication.

2.2 Quantum error-correcting codes

Despite the obstacles, it turns out that quantum error correction is possible. Quantum error-correcting codes (QECC) can be viewed as a mapping from kk qubits to nn qubits, that is, it maps a Hilbert space of 2k2^{k} dimensions to a Hilbert space of 2n2^{n} dimensions. The extra nkn-k qubits allow us to store the information stored in the kk logical qubits in a redundant manner, thereby protecting it from errors. The basic principles required to construct a QECC are: 1) To construct a code it is necessary to have an idea of the errors that we want to correct; 2) The principle of redundant information is used in QECC. If a part of the resource is damaged by errors, the logical qubit can still be accurately recovered from the rest of the redundant qubits.

We already saw in the previous section the types of errors that may occur in quantum computation. One of the four possible things can happen to the qubit: nothing (𝐈\mathbf{I}), qubit flip (𝐗\mathbf{X}), phase flip (𝐙\mathbf{Z}), or both (𝐘=i𝐗𝐙\mathbf{Y}=i\mathbf{X}\mathbf{Z}). In an nn-qubit Hilbert space, the evolution of qubit can be expanded in terms of the operators n={𝐈,𝐗,𝐘,𝐙}n\mathbb{P}_{n}=\left\{\mathbf{I},\mathbf{X},\mathbf{Y},\mathbf{Z}\right\}^{\otimes n}. Thus, we can express the action of a unitary operator (𝐔\mathbf{U}) on n-qubits and their environment as

𝐔:|ψ|0Ea𝐄a|ψ|eaE\mathbf{U}:|\psi\rangle\otimes|0\rangle_{E}\rightarrow\sum_{a}\mathbf{E}_{a}|\psi\rangle\otimes|e_{a}\rangle_{E} (2)

where 𝐄an\mathbf{E}_{a}\in\mathbb{P}_{n} are the nn-qubit Pauli operator, aa runs over all 22n2^{2n} possible combinations of n\mathbb{P}_{n} and |eaE|e_{a}\rangle_{E} are the states of the environment. Some important properties of the Pauli group n\mathbb{P}_{n} are:

  • Each element of n\mathbb{P}_{n} is unitary.

  • 𝐌n\forall\mathbf{M}\in\mathbb{P}_{n}; 𝐌2=𝐈\mathbf{M}^{2}=\mathbf{I} or 𝐌2=𝐈\mathbf{M}^{2}=-\mathbf{I}

  • Any two elements 𝐌,𝐍n\mathbf{M},\mathbf{N}\in\mathbb{P}_{n} either commute, i.e., [𝐌,𝐍]=0[\mathbf{M},\mathbf{N}]=0, or anticommute, i.e., {𝐌,𝐍}=0\left\{\mathbf{M},\mathbf{N}\right\}=0.

To understand how to construct a QECC we will first define some important quantities:

Definition 1: Each Pauli operator can be assigned a weight tt which is an integer with 0tn0\leq t\leq n; the weight is the number of qubits acted upon by non-trivial Pauli operators, that is 𝐗\mathbf{X}, 𝐘\mathbf{Y}, and 𝐙\mathbf{Z}. For example, let us look at some Pauli operators acting on a 4-qubit Hilbert space

𝐗𝐈𝐈𝐈:Weight 1,\displaystyle\mathbf{X}\otimes\mathbf{I}\otimes\mathbf{I}\otimes\mathbf{I}:\;\text{Weight}\;1, (3)
𝐗𝐙𝐙𝐈:Weight 3.\displaystyle\mathbf{X}\otimes\mathbf{Z}\otimes\mathbf{Z}\otimes\mathbf{I}:\;\text{Weight}\;3.

Using this definition we see that if we are able to devise a QECC that can identify a subset n\mathcal{E}\subseteq\mathbb{P}_{n} whose elements have weight tt, then that QECC can correct tt errors.

Definition 2: Choose a subgroup 𝕊n\mathbb{S}\subseteq\mathbb{P}_{n} which satisfies [𝐌,𝐍]=0[\mathbf{M},\mathbf{N}]=0 𝐌,𝐍𝕊\forall\;\mathbf{M},\mathbf{N}\in\mathbb{S}. Such a subgroup 𝕊\mathbb{S} defines an eigenspace 𝕊2n\mathcal{H}_{\mathbb{S}}\subseteq\mathcal{H}_{2^{n}}. This space is called code subspace. Basis vectors of code subspace are protected from errors. Important properties of code subspace are:

  • If the subgroup 𝕊\mathbb{S} has nkn-k generators, then the space 𝕊\mathcal{H}_{\mathbb{S}} has 2k2^{k} dimensions.

  • Any operator 𝐌𝕊\mathbf{M}\in\mathbb{S} is a stabilizer of any state |ψ𝕊|\psi\rangle\in\mathcal{H}_{\mathbb{S}}, that is

    𝐌|ψ=|ψ.\mathbf{M}|\psi\rangle=|\psi\rangle. (4)

This is why these QECCs are also called stabilizer codes. We will construct QECC in such a way that it is capable of correcting errors 𝐄a\mathbf{E}_{a}\in\mathcal{E} which anti-commutes with operators from the group 𝕊\mathbb{S}. Therefore, if 𝐌𝕊\mathbf{M}\in\mathbb{S} and 𝐄a\mathbf{E}_{a}\in\mathcal{E}, then for |ψ𝕊|\psi\rangle\in\mathcal{H}_{\mathbb{S}} we will have

𝐌𝐄a|ψ\displaystyle\mathbf{M}\mathbf{E}_{a}|\psi\rangle =𝐄a𝐌|ψ\displaystyle=-\mathbf{E}_{a}\mathbf{M}|\psi\rangle (5)
=𝐄a|ψ.\displaystyle=-\mathbf{E}_{a}|\psi\rangle.

We see that if the eigenvalue of the operator is -1 then the state is affected by the error 𝐄a\mathbf{E}_{a}. Therefore, when constructing a QECC we must proceed as follows: 1) Determine the error operators that we want to correct; 2) From all the possible Pauli operators, choose those which commute with themselves and at the same time anti-commute with the error operators.

Now, a necessary and sufficient condition that must be satisfied by code subspace to make QECC work [14] is,

i|𝐄a𝐄b|j=δabδij.\langle i|\mathbf{E}_{a}^{\dagger}\mathbf{E}_{b}|j\rangle=\delta_{ab}\delta_{ij}. (6)

Here, |i|i\rangle and |j|j\rangle are two codewords that belong to 𝕊\mathcal{H}_{\mathbb{S}}, and 𝐄a\mathbf{E}_{a} and 𝐄b\mathbf{E}_{b} are two different errors that we want to correct. Equation 6 is also known as the Knill-Laflamme error correction condition. In simple words, the above condition means that different errors should affect states differently. If two different errors change the state in the same way then there is no way to distinguish which error occurred and hence one cannot correct it too. To get a better understanding see Appendix 8.1 where we have explained, using a simple example, how quantum error correcting codes are devised.

2.3 General Stabilizer Codes

Definition 3: Let 𝕊\mathbb{S} be the stabilizer group and 𝕊\mathcal{H}_{\mathbb{S}} be the corresponding QECC, then we define [7] the normalizer 𝕊\mathbb{N}_{\mathbb{S}} of 𝕊\mathbb{S} in n\mathbb{P}_{n} as

𝕊={𝐍ns.t.𝐌𝐍=𝐍𝐌𝐌𝕊}.\mathbb{N}_{\mathbb{S}}=\left\{\mathbf{N}\in\mathbb{P}_{n}\;\text{s.t.}\;\mathbf{M}\mathbf{N}=\mathbf{N}\mathbf{M}\;\forall\;\mathbf{M}\in\mathbb{S}\right\}. (7)

Now, if we have an error 𝐄𝕊\mathbf{E}\in\mathbb{N}_{\mathbb{S}} then our QECC will not be able to detect this error. This is because the eigenvalue of 𝐄|ψ𝕊\mathbf{E}|\psi\rangle\in\mathcal{H}_{\mathbb{S}} when operated with 𝐌𝕊\mathbf{M}\in\mathbb{S} remains +1.

𝐌𝐄|ψ=𝐄𝐌|ψ=𝐄|ψ.\displaystyle\mathbf{M}\mathbf{E}|\psi\rangle=\mathbf{E}\mathbf{M}|\psi\rangle=\mathbf{E}|\psi\rangle.

Furthermore, errors in 𝕊\mathbb{S} are not really errors per se, because they leave the encoded state unchanged. This means that our QECC will detect all errors that are either in SS or anticommuting with some element of 𝕊\mathbb{S}, that is 𝐄𝕊(S)\mathbf{E}\in\mathbb{S}\cup(\mathbb{P}-\mathbb{N}_{S}). In simple words, we can say that QECC only detects errors that are outside of S\𝕊\mathbb{N}_{S}\backslash\mathbb{S}.

Definition 4: The distance dd of 𝕊\mathcal{H}_{\mathbb{S}} is the weight of the smallest Pauli operator 𝐍\mathbf{N} in 𝕊\𝕊\mathbb{N}_{\mathbb{S}}\backslash\mathbb{S}.

A stabilizer code with distance dd will correct d12\lfloor\frac{d-1}{2}\rfloor errors, or in other words, any QECC that corrects tt errors has distance 2tt+1. We can also think of the distance of QECC in the following way: If we look at a subset of d12\lfloor\frac{d-1}{2}\rfloor qubits, then no information is revealed about the encoded state, that is, the reduced density matrix tells nothing about the relative phases; hence the superposition persists. Logical operators belong to the normalizer set (S)\mathbb{N}(S). Fowler et al. [1] defined the distance of the surface code as the minimum number of physical qubit bit-flips or phase-flips needed to define a logical 𝐗L\mathbf{X}_{L} or 𝐙L\mathbf{Z}_{L} operator. We will look into this more deeply in Section 4.2
Definition 5: To define the error syndrome f(𝐌)f(\mathbf{M}) for a stabilizer code, let fM:n2f_{M}:\mathbb{P}_{n}\rightarrow\mathbb{Z}_{2}

fM(𝐄)={0if[𝐌,𝐄]=01if{𝐌,𝐄}=0.f_{M}(\mathbf{E})=\begin{cases}0&\text{if}\;[\mathbf{M},\mathbf{E}]=0\\ 1&\text{if}\;\{\mathbf{M},\mathbf{E}\}=0\end{cases}. (8)

Then f(𝐄)=(fM1(𝐄),,fMnk)f(\mathbf{E})=(f_{M_{1}}(\mathbf{E}),\dots,f_{M_{n-k}}), where M1,,MnkM_{1},\dots,M_{n-k} are the generators of 𝕊\mathbb{S}, is a (nkn-k)-bit binary number. Note that f(E)f(E) can have 2nk2^{n-k} different values. Two different errors 𝐄\mathbf{E} and 𝐅\mathbf{F} have the same error syndrome if they commute with the same set of generators of 𝕊\mathbb{S}. Then, this would mean that 𝐄𝐅𝕊\mathbf{E}^{\dagger}\mathbf{F}\in\mathbb{N}_{\mathbb{S}}. The error syndrome can distinguish different errors if 𝐄𝐅𝕊\mathbf{E}^{\dagger}\mathbf{F}\notin\mathbb{N}_{\mathbb{S}}. Further, if 𝐄𝐅𝕊\mathbf{E}^{\dagger}\mathbf{F}\in\mathbb{S} then 𝐄\mathbf{E} and 𝐅\mathbf{F} act in the same way on the codeword. Hence, there is no need to distinguish them. Therefore, we can conclude that the QECC corrects errors for which 𝐄𝐅𝕊\𝕊\mathbf{E}^{\dagger}\mathbf{F}\notin\mathbb{N}_{\mathbb{S}}\backslash\mathbb{S} for all pairs (𝐄,𝐅)(\mathbf{E},\mathbf{F}). From this condition, we can see how the distance of QECC is 2t+12t+1. If our QECC corrects tt errors the product EFE^{\dagger}F can act on at most 2tt qubits. Since to correct the errors 𝐄𝐅\mathbf{E}^{\dagger}\mathbf{F} must be outside 𝕊\𝕊\mathbb{N}_{\mathbb{S}}\backslash\mathbb{S}, we will have the weight of smallest Pauli operator in 𝕊\𝕊\mathbb{N}_{\mathbb{S}}\backslash\mathbb{S}, which is defined as the distance, as 2tt+1. Now, in order to perform an error correction operation, all we need to do is measure the eigenvalue of each generator of the stabilizer. For a non-degenerate code, error syndrome will be different for different errors and hence will exactly tell which error to correct. Unlike a non-degenerate code, for a degenerate code, there exist pairs of errors (𝐄,𝐅)(\mathbf{E},\mathbf{F}) that have the same error syndrome. This occurs if 𝕊\mathbb{S} has elements of weight less than distance dd.

We know that elements of 𝕊\mathbb{N}_{\mathbb{S}} commute with elements of the 𝕊\mathbb{S}, in fact, 𝕊\mathbb{S} lies inside 𝕊\mathbb{N}_{\mathbb{S}}. This means 𝕊\mathbb{N}_{\mathbb{S}} moves codewords around within 𝕊\mathcal{H}_{\mathbb{S}}, and hence we can interpret it as encoded operations on the codewords. Only elements in 𝕊/𝕊\mathbb{N}_{\mathbb{S}}/\mathbb{S} acts non-trivially on 𝕊\mathcal{H}_{\mathbb{S}}. Here, 𝕊/𝕊\mathbb{N}_{\mathbb{S}}/\mathbb{S} is the quotient or factor group, which is the set of cosets of 𝕊\mathbb{S} in 𝕊\mathbb{N}_{\mathbb{S}}, and is defined as

𝕊/𝕊={𝕊,a1𝕊,a2𝕊,,am𝕊}.\mathbb{N}_{\mathbb{S}}/\mathbb{S}=\left\{\mathbb{S},a_{1}\mathbb{S},a_{2}\mathbb{S},\dots,a_{m}\mathbb{S}\right\}. (9)

Note that we can only define quotient group 𝕊/𝕊\mathbb{N}_{\mathbb{S}}/\mathbb{S} when 𝕊\mathbb{S} is an invariant subgroup of 𝕊\mathbb{N}_{\mathbb{S}}. This is precisely the case here as, by definition, 𝕊\mathbb{N}_{\mathbb{S}} commutes with every element of 𝕊\mathbb{S}, and hence the right cosets (𝕊aiai𝕊\𝕊\mathbb{S}a_{i}\;\forall\;a_{i}\in\mathbb{N}_{\mathbb{S}}\backslash\mathbb{S}) will be the same as left cosets (ai𝕊ai𝕊\𝕊a_{i}\mathbb{S}\;\forall\;a_{i}\in\mathbb{N}_{\mathbb{S}}\backslash\mathbb{S}). It is possible to show that this group is a Pauli group with size knrk-n-r. Putting these considerations together we can define an automorphism 𝕊/𝕊k\mathbb{N}_{\mathbb{S}}/\mathbb{S}\rightarrow\mathbb{P}_{k}. We will write Xi and Zi, where i=1,,ki=1,\dots,k, as the encoded/logical operators. Xi maps to X in k\mathbb{P}_{k} and Zi maps to Z in k\mathbb{P}_{k}.

3 Measurement Based Quantum Computation

Measurement-based quantum computation (MBQC), which originated from the pioneering work of Raussendorf and Briegel [15], is a technique to perform quantum computation using only local measurements. The central physical ingredient of MBQC is the cluster state [16]. It is a special type of entangled state that allows for quantum computation using only one-qubit projective measurements. This scheme is also called the "one-way quantum computer" (1WQC) because the entanglement in the cluster state is destroyed by the one-qubit measurements and therefore it can only be used once. Before we go into the details, let us have a general picture of how 1WQC works.

The first step to 1WQC is to form the cluster state. Figure 1 shows a 2d cluster state. A cluster state can be created efficiently in any system using Ising-type interaction at very low temperatures. Next, we write the information onto the cluster through entanglement. Then, we apply local one-qubit measurements on the cluster state qubits to process the information. The processed information is then read out. We see that cluster state provides in advance all entanglement that is involved in the subsequent quantum computation. It is important, at this stage, to distinguish between cluster qubits and logical qubits. The logical qubits constitute the quantum information being processed, and cluster qubits are the qubits that form the cluster state. Measurements in the X - (and Y) basis propagate the quantum information through the circuit i.e., they act as a wire, and measurement in Z-basis removes the respective qubit from the cluster (Section 3.2). The processing is finished once all qubits except the last one on each wire have been measured. The remaining unmeasured qubits form the quantum register which is then read out. Results of previous measurements determine in which basis the output qubits need to be measured for the final readout.

Refer to caption
Figure 1: Two dimensional cluster state. Vertices represent qubits and the edges represent entanglement between the adjacent qubits.

3.1 Cluster States

The most important ingredient of MBQC is the cluster state. Cluster state is a special type of entangled state that allows for universal quantum computation using local measurement [17]. A 2DD cluster state, as shown in Figure 1, can be thought of as a blank slate upon which we can draw the quantum circuit using local measurements. Cluster states are a particular case of graph states. For a particular graph 𝒞\mathcal{C} = (CC, E), where CC are the vertices and EE edges; we use the following algorithm to generate cluster states: 1) To each vertex iCi\in C we associate the qubit |+|+\rangle; 2) Next all the pairs of neighboring qubits (i,j)E(i,j)\in E are entangled by the CZ operation which is defined as

CZij=|0i0|𝐈j+|1i1|𝐙j.\text{CZ}_{ij}=|0\rangle_{i}\langle 0|\otimes\mathbf{I}_{j}+|1\rangle_{i}\langle 1|\otimes\mathbf{Z}_{j}. (10)

As a result, we can write the cluster state 𝒞\mathcal{C} as

|GC=(i,j)ECZijiV|+i.|G\rangle_{C}=\prod_{(i,j)\in E}\text{CZ}_{ij}\bigotimes_{i\in V}|+\rangle_{i}. (11)

The cluster state |GC|G\rangle_{C} satisfies the following set of eigenvalue equations

(𝐗ijN(i)𝐙j)|GC=(1)λ|GC,\left(\mathbf{X}_{i}\prod_{j\in N(i)}\mathbf{Z}_{j}\right)|G\rangle_{C}=(-1)^{\lambda}|G\rangle_{C}, (12)

where N(i)N(i) is the set of neighbouring vertices of vertex ii. Also, λ{0,1}a𝒞\lambda\in\{0,1\}\;\forall\;a\in\mathcal{C}. We define K(a)K^{(a)}

K(a)=𝐗ajN(a)𝐙jK^{(a)}=\mathbf{X}_{a}\prod_{j\in N(a)}\mathbf{Z}_{j} (13)

as the stabilizers of the cluster state. We notice that stabilizers corresponding to different sites commute with each other. This means there exist a set of common eigenstates. All the eigenstates form a group and every one of them is equally good for computation. Eigenstates within this group with the same set of eigenvalues {κ}\{\kappa\} form an equivalence class. There are 2|C|2^{|C|} such equivalence classes corresponding to every 2|C|2^{|C|} eigenvalue sets {κ}\{\kappa\}. We can choose any one of the equivalence classes and select any one element from it as its representative. 2|C|2^{|C|} such representatives from every equivalence class forms the |CC|-qubit Hilbert space. Note that elements of the equivalence class are orthogonal to each other [18].

There are essentially two ways to create a cluster state. The first way is to measure all the stabilizers 𝐊(i)\mathbf{K}^{(i)} given in Equation 13 for iCi\in C on an arbitrary |C||C|-qubit state or to cool into the ground state of the Hamiltonian 𝐇^K=giCκa𝐊(i)\hat{\mathbf{H}}_{K}=-\hbar g\sum_{i\in C}\kappa_{a}\mathbf{K}^{(i)}. A more practical way is to first create a product state |+C=iC|+i|+\rangle_{C}=\bigotimes_{i\in C}|+\rangle_{i}. Then we apply a unitary transformation 𝐒(C)\mathbf{S}^{(C)}, which is given as

𝐒(C)=a,bC|baγD𝐒ab,\mathbf{S}^{(C)}=\prod_{a,b\in C|b-a\in\gamma_{D}}\mathbf{S}^{ab}, (14)

on the product state |+C|+\rangle_{C}. 𝐒ab\mathbf{S}^{ab} has the form

𝐒ab=12(𝐈+𝐙(a)+𝐙(b)𝐙(a)𝐙(b)).\mathbf{S}^{ab}=\dfrac{1}{2}\left(\mathbf{I}+\mathbf{Z}^{(a)}+\mathbf{Z}^{(b)}-\mathbf{Z}^{(a)}\otimes\mathbf{Z}^{(b)}\right). (15)

The condition baγDb-a\in\gamma_{D} in Equation 14 restricts the interaction of a qubit with only its nearest neighbors. Therefore, in dimension (D=1,2,3D=1,2,3), we will have γ1={1}\gamma_{1}=\{1\}, γ2={(1,0)T,(0,1)T}\gamma_{2}=\{(1,0)^{T},(0,1)^{T}\}, and γ3={(1,0,0)T,(0,1,0)T,(0,0,1)T}\gamma_{3}=\{(1,0,0)^{T},(0,1,0)^{T},(0,0,1)^{T}\}.

3.2 Removing redundant cluster qubits

There always exist qubits on the cluster state that are not needed in realizing a quantum circuit. We can remove these redundant qubits by measuring them in the 𝐙\mathbf{Z}- basis. The resulting entangled state is again a cluster state. To see this we write the cluster state after measurement as a product of entangled quantum state on the cluster CNC_{N} of the unmeasured qubits and product state on cluster C\CNC\backslash C_{N} of qubits which are measured. Therefore,

|GC|ZC\CN|GCN,|G\rangle_{C}\longrightarrow|Z\rangle_{C\backslash C_{N}}\otimes|G^{\prime}\rangle_{C_{N}}, (16)

where |ZC\CN=iC\CN|sii,z|Z\rangle_{C\backslash C_{N}}=\bigotimes_{i\in C\backslash C_{N}}|s_{i}\rangle_{i,z} and sis_{i} are the results of the σz\sigma_{z}-measurements. |GC|G\rangle_{C} is the initial cluster state. We notice that we can also write |ZC\CN|GCN|Z\rangle_{C\backslash C_{N}}\otimes|G^{\prime}\rangle_{C_{N}} as follows

|ZC\CN|GCN=(iC\CN1+(1)si𝐙(i)2)|GC.|Z\rangle_{C\backslash C_{N}}\otimes|G^{\prime}\rangle_{C_{N}}=\left(\bigotimes_{i\in C\backslash C_{N}}\dfrac{1+(-1)^{s_{i}}\mathbf{Z}^{(i)}}{2}\right)|G\rangle_{C}. (17)

The term in the above equation is the projection operator 𝒫\mathcal{P} corresponding to the 𝐙\mathbf{Z}-measurements. Since |GC|G\rangle_{C} satisfies Equation 12 we insert K(i)K^{(i)} with iCNi\in C_{N} in the r.h.s of the above equation between the projector and the state, and simplify it to obtain

|ZC\CN|GCN\displaystyle|Z\rangle_{C\backslash C_{N}}\otimes|G^{\prime}\rangle_{C_{N}} =(1)λ(iC\CN1+(1)si𝐙(i)2)K(i)|GC\displaystyle=(-1)^{\lambda}\left(\bigotimes_{i\in C\backslash C_{N}}\dfrac{1+(-1)^{s_{i}}\mathbf{Z}^{(i)}}{2}\right)K^{(i)}|G\rangle_{C} (18)
=(1)λ𝐗(i)bN(i)CN𝐙(b)bN(i)C\CN𝐙(b)|ZC\CN|GCN\displaystyle=(-1)^{\lambda}\mathbf{X}^{(i)}\bigotimes_{b\in N(i)\cap C_{N}}\mathbf{Z}^{(b)}\bigotimes_{b\in N(i)\cap C\backslash C_{N}}\mathbf{Z}^{(b)}|Z\rangle_{C\backslash C_{N}}\otimes|G^{\prime}\rangle_{C_{N}}
=(1)λK(a)|ZC\CN|GCN.\displaystyle=(-1)^{\lambda^{\prime}}K^{\prime(a)}|Z\rangle_{C\backslash C_{N}}\otimes|G^{\prime}\rangle_{C_{N}}.

with the new stabilizers of the remaining unmeasured qubits

K(a)=𝐗(a)bN(a)CN𝐙(b).K^{\prime(a)}=\mathbf{X}^{(a)}\bigotimes_{b\in N(a)\cap C_{N}}\mathbf{Z}^{(b)}. (19)

and the set {κa}\{\kappa_{a}^{\prime}\} specifying the eigenvalues

λ=(λ+bN(a)C\CNsb)mod 2.\lambda^{\prime}=(\lambda+\sum_{b\in N(a)\cap C\backslash C_{N}}s_{b})\;\text{mod}\;2. (20)

To obtain the second equality in Equation 18 we used the fact that projection operator 𝒫\mathcal{P} and correlation operator K(a)K^{(a)} commute with each other as they act on different qubits. To obtain the last equality we apply bN(a)C\CN𝐙(b)\bigotimes_{b\in N(a)\cap C\backslash C_{N}}\mathbf{Z}^{(b)} on |ZC\CN|Z\rangle_{C\backslash C_{N}} to get (1)bN(a)C\CNsb|ZC\CN(-1)^{\sum_{b\in N(a)\cap C\backslash C_{N}}s_{b}}|Z\rangle_{C\backslash C_{N}}. The new correlation operators K(a)K^{\prime(a)} act only on the cluster qubits in CNC_{N} and obey the following eigenvalue equations as can be seen from Equation 18

K(a)|GCN=(1)λ|GCN,aCN.K^{\prime(a)}|G^{\prime}\rangle_{C_{N}}=(-1)^{\lambda^{\prime}}|G^{\prime}\rangle_{C_{N}},\quad\forall\;a\in C_{N}. (21)

The above equation proves that the residual state |GCN|G^{\prime}\rangle_{C_{N}} is again a cluster state. We also note that the measurement results of the removed qubits influence the process of computation. Since, any cluster state |GCN|G^{\prime}\rangle_{C_{N}} is equally good for computation we can put λ=0\lambda^{\prime}=0. The above analysis shows that we can discard the redundant qubits by measuring them in the 𝐙\mathbf{Z}- basis.

3.3 Scheme to realize a gate on a cluster state

To implement a gate gg we take a cluster 𝒞(g)\mathcal{C}(g). We divide it into three sections; an input section 𝒞I(g)\mathcal{C}_{I}(g), a body 𝒞B(g)\mathcal{C}_{B}(g) and an output section 𝒞O(g)\mathcal{C}_{O}(g) such that

𝒞I(g)𝒞B(g)𝒞O(g)\displaystyle\mathcal{C}_{I}(g)\cup\mathcal{C}_{B}(g)\cup\mathcal{C}_{O}(g) =𝒞(g),\displaystyle=\mathcal{C}(g), (22)
𝒞I(g)𝒞B(g)\displaystyle\mathcal{C}_{I}(g)\cap\mathcal{C}_{B}(g) =,\displaystyle=\emptyset,
𝒞I(g)𝒞O(g)\displaystyle\mathcal{C}_{I}(g)\cap\mathcal{C}_{O}(g) =,\displaystyle=\emptyset,
𝒞B(g)𝒞O(g)\displaystyle\mathcal{C}_{B}(g)\cap\mathcal{C}_{O}(g) =.\displaystyle=\emptyset.

The input qubits in 𝒞I(g)\mathcal{C}_{I}(g) are prepared in the state |ψin \left|\psi_{\text{in }}\right\rangle on which we need to apply the gate gg, while the qubits in 𝒞B(g)𝒞O(g)\mathcal{C}_{B}(g)\cup\mathcal{C}_{O}(g) are in the usual |+=|0x|+\rangle=|0\rangle_{x} state. We entangle the qubits via the interaction 𝐒(𝒞(g))\mathbf{S}^{(\mathcal{C}(g))} given in equation 14. To realize the gate on the state |ψin \left|\psi_{\text{in }}\right\rangle appropriate measurements are applied to the qubits in 𝒞B(g)\mathcal{C}_{B}(g). It was seen that apart from required operation 𝐔g\mathbf{U}_{g} corresponding to the gate gg obtained on the output qubits 𝒞O(g)\mathcal{C}_{O}(g), we get an extra Pauli operation 𝐔e\mathbf{U}_{e} which depends on the measurement outcomes of the qubits measured in 𝒞B(g)\mathcal{C}_{B}(g) [18], that is,

|ψout =𝐔e𝐔g|ψin ,\left|\psi_{\text{out }}\right\rangle=\mathbf{U}_{e}\mathbf{U}_{g}\left|\psi_{\text{in }}\right\rangle, (23)

where

𝐔e=i=1n(𝐗[i])xi(𝐙[i])zi.\mathbf{U}_{e}=\bigotimes_{i=1}^{n}\left(\mathbf{X}^{[i]}\right)^{x_{i}}\left(\mathbf{Z}^{[i]}\right)^{z_{i}}. (24)

Here, n=|I|=|O|n=|I|=|O| and {𝐗,𝐙}[i]\{\mathbf{X},\mathbf{Z}\}^{[i]} denotes Pauli operator acting on the logical qubit ii and not the cluster qubits. The values xi,zi{0,1}x_{i},\;z_{i}\in\{0,1\} are computed from the measurement outcomes {sk|k𝒞I(g)𝒞B(g)}\{s_{k}|k\in\mathcal{C}_{I}(g)\cup\mathcal{C}_{B}(g)\}.

Now, we define a theorem that provides a criterion describing the functioning of the gate in MBQC.

Theorem 1: Let 𝒞(g)=𝒞I(g)𝒞B(g)𝒞O(g)\mathcal{C}(g)=\mathcal{C}_{I}(g)\cup\mathcal{C}_{B}(g)\cup\mathcal{C}_{O}(g) be a cluster used to implement a unitary transformation 𝐔\mathbf{U} corresponding to gate gg, and |ϕ𝒞g|\phi\rangle_{\mathcal{C}_{g}} be the cluster state. Suppose the state |ψ𝒞g=P{s}(𝒞B(g))()|ϕ𝒞(g)|\psi\rangle_{\mathcal{C}_{g}}=P_{\{s\}}^{\left(\mathcal{C}_{B}(g)\right)}(\mathcal{M})|\phi\rangle_{\mathcal{C}(g)} obeys the 2nn eigenvalue equations for the measurement pattern \mathcal{M},

𝐗(𝒞I(g),i)(𝐔𝐗(i)𝐔)(𝒞O(g))|ψ𝒞(g)=(1)λx,i|ψ𝒞(g),\displaystyle\mathbf{X}^{\left(\mathcal{C}_{I}(g),i\right)}\left(\mathbf{U}\mathbf{X}^{(i)}\mathbf{U}^{\dagger}\right)^{\left(\mathcal{C}_{O}(g)\right)}|\psi\rangle_{\mathcal{C}(g)}=(-1)^{\lambda_{x,i}}|\psi\rangle_{\mathcal{C}(g)}, (25)
𝐙(𝒞I(g),i)(𝐔𝐙(i)𝐔)(𝒞O(g))|ψ𝒞(g)=(1)λz,i|ψ𝒞(g),\displaystyle\mathbf{Z}^{\left(\mathcal{C}_{I(g),i)}\right.}\left(\mathbf{U}\mathbf{Z}^{(i)}\mathbf{U}^{\dagger}\right)^{\left(\mathcal{C}_{O}(g)\right)}|\psi\rangle_{\mathcal{C}(g)}=(-1)^{\lambda_{z,i}}|\psi\rangle_{\mathcal{C}(g)},

with λx,i,λz,i{0,1}\lambda_{x,i},\lambda_{z,i}\in\{0,1\} depends on the measurement outcomes of qubits in 𝒞M(g)\mathcal{C}_{M}(g) which are measured according to \mathcal{M} and 1in1\leq i\leq n. nn is the number of input qubits. We can, then, realize gate gg on the cluster state using Scheme 3.3 with measurement pattern described by \mathcal{M}, and the measurements of the qubits in 𝒞I(g)\mathcal{C}_{I}(g) being X measurement. After measurement, we can relate input and output states as

|ψout=𝐔𝐔Σ|ψin,|\psi_{out}\rangle=\mathbf{U}\mathbf{U}_{\Sigma}|\psi_{in}\rangle, (26)

where 𝐔Σ\mathbf{U}_{\Sigma} is the byproduct operator given by

𝐔Σ=(𝒞I(g)i)=1n(𝐙[i])si+λx,i(𝐗[i])λz,i,\mathbf{U}_{\Sigma}=\bigotimes_{\left(\mathcal{C}_{I}(g)\ni i\right)=1}^{n}\left(\mathbf{Z}^{[i]}\right)^{s_{i}+\lambda_{x,i}}\left(\mathbf{X}^{[i]}\right)^{\lambda_{z,i}}, (27)

where si{0,1}s_{i}\in\{0,1\} is the measurement outcome of 𝐗\mathbf{X} measurement performed on the 𝒞I(g)\mathcal{C}_{I}(g).

In the next section, we have implemented the theory we have developed till now to implement surface codes on 3×33\times 3 and 5×55\times 5 cluster states. Before we start discussing our work we would like to state an important lemma that would be helpful during our discussion on stabilizer evolution in the later sections

Lemma 1 If 𝕊={𝐒i}i=1m\mathbb{S}=\left\{\mathbf{S}_{i}\right\}_{i=1}^{m} are the stabilizers of a state |ψ|\psi\rangle then {𝐔𝐒i𝐔}i=1m\left\{\mathbf{U}\mathbf{S}_{i}\mathbf{U}^{\dagger}\right\}_{i=1}^{m} are the stabilizers of the state 𝐔|ψ\mathbf{U}|\psi\rangle, where 𝐔\mathbf{U} is an unitary operator.

4 Surface Code implementation

A surface code is a special type of stabilizer code. The idea behind surface codes is to encode information in "homological degrees of freedom" (See [19] and [20] to understand the topology of surface codes). See Appendix 8.3 for a brief introduction to homology. The surface code implementation, as done by Fowler et al. [1], utilizes an array of states initialized in the ground state (computational basis) followed by a patterned CNOT implementation based on whether a 𝐙\mathbf{Z}-measurement or 𝐗\mathbf{X}-measurement takes place on the measure qubit. However, the work demonstrated in this paper follows a slightly different pattern as the qubits are initialized in the |+\rangle state instead of the computational basis. The cluster of qubits initialized in such a manner is then entangled using the symmetric CZ gate instead of the previously mentioned CNOT which is not symmetric.

But before we discuss our work we will briefly talk about Fowler’s way of implementing surface codes. Figure 2 shows the surface code on a 2D array. Open circles represent data qubits and filled circles are the measurement qubits. The measurement qubits, essentially, are used to stabilize and manipulate the quantum state of the data qubits. There are two types of measurement qubits: ‘measure-Z’ qubits (colored green), and ‘measure-X’ qubits (colored orange). Each data qubit is coupled to two measure-Z qubits and two measure-X qubits, and each measurement qubit is coupled with four data qubits.

Refer to caption
Figure 2: (a) A two-dimensional array implementation of surface code. (b) Quantum circuit for one surface code cycle for a measure-X qubit, which stabilizes 𝐗a𝐗b𝐗c𝐗d\mathbf{X}_{a}\mathbf{X}_{b}\mathbf{X}_{c}\mathbf{X}_{d}. (c) Quantum circuit for one surface code cycle for a measure-Z qubit, which stabilizes 𝐙a𝐙b𝐙c𝐙d\mathbf{Z}_{a}\mathbf{Z}_{b}\mathbf{Z}_{c}\mathbf{Z}_{d}.[1]

All the measurement qubits are initialized in ground state |0|0\rangle. Figure 2b and c show one complete cycle for measure-X and measure-Z qubits. After projective measurement of all measure qubits, the state |ψ|\psi\rangle of all data qubits simultaneously satisfies 𝐙a𝐙b𝐙c𝐙d|ψ=Zabcd|ψ\mathbf{Z}_{a}\mathbf{Z}_{b}\mathbf{Z}_{c}\mathbf{Z}_{d}|\psi\rangle=Z_{abcd}|\psi\rangle with eigenvalues Zabcd=±1Z_{abcd}=\pm 1, and 𝐗a𝐗b𝐗c𝐗d|ψ=Xabcd|ψ\mathbf{X}_{a}\mathbf{X}_{b}\mathbf{X}_{c}\mathbf{X}_{d}|\psi\rangle=X_{abcd}|\psi\rangle with eigenvalues Xabcd=±1X_{abcd}=\pm 1. The state |ψ|\psi\rangle is called the quiescent state. In Figure 2, there are 12 measure qubits. This means there are 2122^{12} possible measurement outcomes. Corresponding to each outcome there will be quiescent state |ψ|\psi\rangle. We randomly select any one state |ψ|\psi\rangle from 2122^{12} possible states after one complete cycle as shown in Figure 2b and c. Once selected the same state |ψ|\psi\rangle will be maintained by each subsequent cycle of the sequence unless an error occurs. This is because all the stabilizers commute with each other. The commutation relation of stabilizers with no common data qubits is trivial to show. Here we show the commutation relation of the stabilizers which have two common data qubits

[𝐗a𝐗b𝐗c𝐗d,𝐙a𝐙b𝐙e𝐙f]\displaystyle{\left[\mathbf{X}_{a}\mathbf{X}_{b}\mathbf{X}_{c}\mathbf{X}_{d}\right.}\left.,\mathbf{Z}_{a}\mathbf{Z}_{b}\mathbf{Z}_{e}\mathbf{Z}_{f}\right] =(𝐗a𝐙a)(𝐗b𝐙b)𝐗c𝐗d𝐙e𝐙f\displaystyle=\left(\mathbf{X}_{a}\mathbf{Z}_{a}\right)\left(\mathbf{X}_{b}\mathbf{Z}_{b}\right)\mathbf{X}_{c}\mathbf{X}_{d}\mathbf{Z}_{e}\mathbf{Z}_{f} (28)
=(𝐙a𝐗a)(𝐙b𝐗b)𝐗c𝐗d𝐙e𝐙f\displaystyle=\left(\mathbf{Z}_{a}\mathbf{X}_{a}\right)\left(\mathbf{Z}_{b}\mathbf{X}_{b}\right)\mathbf{X}_{c}\mathbf{X}_{d}\mathbf{Z}_{e}\mathbf{Z}_{f}
=0.\displaystyle=0.

We can visualize the 2D surface code given in Figure 2 as a set of data qubits on every edge of an embedded square lattice on the planar surface, and measure qubits on every vertex (face) and face (vertex) of the lattice (dual lattice).

4.1 Single qubit error detection and correction

Let us suppose that a bit-flip error occurs on one of the data qubits. The two adjacent measure-Z qubits will detect this because the sign of these measure-Z qubits will change. This will also change the quiescent state

𝐙a𝐙b𝐙c𝐙d(𝐗a|ψ)\displaystyle\mathbf{Z}_{a}\mathbf{Z}_{b}\mathbf{Z}_{c}\mathbf{Z}_{d}(\mathbf{X}_{a}|\psi\rangle) =𝐗a(𝐙a𝐙b𝐙c𝐙d|ψ)\displaystyle=-\mathbf{X}_{a}(\mathbf{Z}_{a}\mathbf{Z}_{b}\mathbf{Z}_{c}\mathbf{Z}_{d}|\psi\rangle) (29)
=Zabcd(𝐗a|ψ).\displaystyle=-Z_{abcd}(\mathbf{X}_{a}|\psi\rangle). (30)

This shows that 𝐗a|ψ\mathbf{X}_{a}|\psi\rangle is an eigenstate of 𝐙\mathbf{Z} stabilizer but with an opposite sign. This will be more clear with the following example: Let us assume that a bit-flip error occurs on the 7th7^{\text{th}} data qubit. We select the quiescent state |ψ|\psi\rangle corresponding to the set {1,1,1,1,1,}\{1,-1,-1,1,1,\cdots\}, which has measurement outcomes of all the 12 measure qubits. Since, bit-flip error occurs on the 7th7^{\text{th}} data qubit, sign of the measurement outcome at 6th6^{\text{th}} and 8th8^{\text{th}} measure-Z qubits will change. Similarly, we can detect phase-flip errors. If instead of a bit-flip error on 7th{}^{\text{th}} data qubit a phase-flip error occurs then measurement outcome at 4th4^{\text{th}} and 9th9^{\text{th}} measure-X qubit will flip signs.

Now, to correct for the bit-flip we apply a second 𝐗a\mathbf{X}_{a} operator on the corrupted data qubit. The same can be done for the phase-flip errors where we apply 𝐙a\mathbf{Z}_{a} on the data qubit to correct for the error. An issue with applying an extra gate operation for practical purposes is that we cannot obtain 100%100\% fidelity. This could introduce more errors in the surface code. Instead, the errors are corrected using a classical control software which changes the sign of measurement qubits that get flipped due to errors.

4.2 Logical Operators

A planar 2D surface code with a single boundary cannot encode any qubit. This is because all the possible 1-chains are homologically equivalent. Therefore, the first homology group 1\mathbb{H}_{1} will be isomorphic to the trivial group 1\mathbb{Z}_{1}. Since it does not have any generators there will be no encoded qubit. It may seem that the surface code in Figure 2 can also not encode any qubit, but that is not the case. This is because it has two different kinds of boundaries. There is a boundary that terminates with measure-X qubits, which in literature is referred to as smooth boundary. The other boundary terminates with a measure-Z qubit, called rough boundary. Since there are two different types of boundaries the first homology group 1\mathbb{H}_{1} will be isomorphic to 2\mathbb{Z}_{2}. Since 2\mathbb{Z}_{2} has one generator, the surface code will encode 1 qubit. This can also be seen in Figure 3. It has 25 data qubits and 24 measure qubits, so there are 2×252\times 25 degrees of freedom in the data qubits and 2×242\times 24 constraints from the stabilizer measurements. The two unconstrained degrees of freedom act as a logical or encoded qubit [1][21].

Refer to caption
Figure 3: A square 2D array of data qubits, with X boundaries on the left and right, and Z boundaries on the top and bottom. The array has 25 data qubits, but only 24 𝐗\mathbf{X} and 𝐙\mathbf{Z} stabilizers. A product chain 𝐗L=𝐗1𝐗2𝐗3𝐗4\mathbf{X}_{L}=\mathbf{X}_{1}\mathbf{X}_{2}\mathbf{X}_{3}\mathbf{X}_{4} of 𝐗\mathbf{X} operators connects the two X boundaries, commutes with all the array stabilizers and changes the array state from the quiescent state |ψ|\psi\rangle to |ψX=𝐗L|ψ|\psi_{X}\rangle=\mathbf{X}_{L}|\psi\rangle with the same measurement outcomes as |ψ|\psi\rangle. A second product chain 𝐙L=𝐙5𝐙6𝐙3𝐙7\mathbf{Z}_{L}=\mathbf{Z}_{5}\mathbf{Z}_{6}\mathbf{Z}_{3}\mathbf{Z}_{7} connects the two Z boundaries and commutes with the array stabilizers; it changes the array state from |ψ|\psi\rangle to |ψZ=𝐙L|ψ|\psi_{Z}\rangle=\mathbf{Z}_{L}|\psi\rangle. The operator chains 𝐗L\mathbf{X}_{L} and 𝐙L\mathbf{Z}_{L} anti-commute.

We can now define logical operators that allow us to manipulate these additional degrees of freedom. Logical operators form closed 1-chain cycles. In Figure 3 operators 𝐗L\mathbf{X}_{L} (in blue) and 𝐙L\mathbf{Z}_{L} (in red) show the two possible logical operators acting on the data qubits. We note that the product chain 𝐗L\mathbf{X}_{L} and 𝐙L\mathbf{Z}_{L} is closed 1-cycles and homologically inequivalent (See Appendix 8.3 to read more on the homology of curves). They represent the two equivalence classes of 1\mathbb{H}_{1}. We can choose other chains of single qubit operator products to define different 𝐗L\mathbf{X}_{L} and 𝐙L\mathbf{Z}_{L}. Consider for example the chain 𝐗L=𝐗1𝐗8𝐗9𝐗10𝐗3𝐗4\mathbf{X}_{L}^{\prime}=\mathbf{X}_{1}\mathbf{X}_{8}\mathbf{X}_{9}\mathbf{X}_{10}\mathbf{X}_{3}\mathbf{X}_{4} also shown in Figure 3. It can be easily seen that it is homologically equivalent to 𝐗L\mathbf{X}_{L} and hence belong to the same equivalence class (See the Section 8.4). Notice that we can write 𝐗L=(𝐗2𝐗8𝐗9𝐗10)𝐗L\mathbf{X}_{L}^{\prime}=(\mathbf{X}_{2}\mathbf{X}_{8}\mathbf{X}_{9}\mathbf{X}_{10})\mathbf{X}_{L}. The term in the parentheses is the stabilizer operator. Therefore, if we operate on a quiescent state |ψ|\psi\rangle with 𝐗L\mathbf{X}_{L}^{\prime} we will get the same state obtained when 𝐗L\mathbf{X}_{L} is applied on |ψ|\psi\rangle up to an overall phase. Hence, there is only one linearly independent 𝐗L\mathbf{X}_{L} operator for this array.

At first glance this result may seem mysterious; after all, if we operate on the array with a loop of 𝐗\mathbf{X} operators corresponding to a stabilizer 𝐗loop=𝐗2𝐗8𝐗9𝐗10\mathbf{X}_{\text{loop}}=\mathbf{X}_{2}\mathbf{X}_{8}\mathbf{X}_{9}\mathbf{X}_{10} we are bit-flipping four data qubits so the state |ψ=𝐗loop|ψ|\psi\rangle^{\prime}=\mathbf{X}_{\text{loop}}|\psi\rangle should be different from |ψ|\psi\rangle. The only way |ψ|\psi\rangle and |ψ|\psi\rangle^{\prime} are the same is if |ψ|\psi\rangle already contains the superposition of un-bit-flipped and bit-flipped data qubits. This is precisely how we define surface code. A surface code state is the superposition of all homologically equivalent cycles. A stabilizer loop like 𝐗loop\mathbf{X}_{\text{loop}} will only lead to homologically equivalent configurations. Look at Appendix 8.3 to get a mathematical perspective and intuitive understanding of the homology of curves.

Notice that the 𝐙L\mathbf{Z}_{L} operator chain is in the dual lattice, which makes it a 1-cochain. Since in the dual lattice we have measure-X qubits (i.e., |+|+\rangle and ||-\rangle are the basis states); the face stabilizer will be a loop of 𝐙\mathbf{Z} operators. So, we see that the same argument applies to the 𝐙L\mathbf{Z}_{L} operator.

4.2.1 Creating logical qubits:

To increase the number of logical qubits we need to define more non-trivial homologically inequivalent cycles. An efficient way to do that is to create holes inside the boundaries of the array. This can be done in two ways: turn off measure-Z qubits or measure-X qubits.

When we create a hole inside the array by turning off a measure-Z qubit, we create additional two degrees of freedom or another logical qubit. This logical qubit is called a Z-cut qubit. The newly formed 𝐗L\mathbf{X}_{L} logical operator connects the array’s outer X-boundary with the internal X-boundary of the hole. The 𝐙L\mathbf{Z}_{L} logical operator forms a loop (joining measure-X qubits) around the Z-cut hole. Note that this loop is not the stabilizer because it is not simply connected. It is clear that this hole/defect is in the dual basis, we call the single Z-cut qubit a smooth defect or a dual defect.

Analogously, we can define an X-cut qubit by turning off the measure-X qubit. Then 𝐙L\mathbf{Z}_{L} operator is a chain of 𝐙\mathbf{Z} operators from the array Z boundary to the internal Z boundary created by turning off the measure-X qubit, and 𝐗L\mathbf{X}_{L} operator is a loop of 𝐗\mathbf{X} bit-flips surrounding the X-cut hole. A single X-cut qubit is called a rough defect or a primal defect. We can create more logical qubits by making more holes within the boundaries of the array. See [1] for a more detailed explanation.

4.3 Distance of surface code

In this subsection, we are going to demonstrate a way of finding the distance of a surface code in reference to finding the logical operators and then using that to create a set of operators that commutes with the stabilizer generator which in technical language is termed as the centralizers of stabilizers generator. As discussed in Section 2.3, the minimum weight of the elements of the centralizer of the stabilizer generator would provide the distance of the code. We defined the logical operator by creating a chain of operators commute with our stabilizer generator. As seen above in a simple 2D surface code there are 2 homologically inequivalent 1-cycles and hence two logical operators 𝐗L\mathbf{X}_{L} and 𝐙L\mathbf{Z}_{L}. Fowler et al. [1] defined the distance of a 2D surface code as the minimum weight of the logical operators. For simple geometries in which we can encode only one qubit.

5 Surface Code Implementation Using Cluster State

In the previous two sections, we discussed the concepts of surface codes and the measurement-based computation model utilizing cluster state generation separately. Now, in this section, we aim to explain whether we can study the stabilizer evolution and perform similar computations through a different initialization procedure that differs from the usual computational basis initialization of the qubit and CNOT entangling operation. To study a different initialization, we performed initialization of our qubits in the |+|+\rangle which was followed by the CZ entangling operator in order to prepare the initial surface code cluster state. Such a circuit is used to study the stabilizer evolution of the prepared state and a comparison is demonstrated with respect to the usual computation basis surface code circuit in this section. Regarding the initialization, compared to the CNOT entangling operation, the CZ entanglement being symmetric allows one the flexibility of not worrying about defining the control and target qubits involved in the process while entangling the qubits to form the cluster state on which the computation can be performed. In the study to provide a comparison along with other computations, we will discuss our work wherein we realized a surface code on 3×33\times 3 and 5×55\times 5 cluster states.

5.1 Realizing Stabilizer Evolution for a Surface Code

To investigate a surface code that captures our attention, we employ Algorithm 1, a modified version of the algorithm proposed by [22] for realizing stabilizer codes. This algorithm enables us to determine the ultimate stabilizer generator of the evolving cluster state. Subsequently, the cluster state undergoes a transformation using a suitable measurement pattern.

Algorithm 1 involves a meticulous selection process, wherein the stabilizer operator is carefully chosen to commute with every measurement operator during each

Algorithm 1 An algorithm to realize stabilizer generators for a surface code
Cluster State (𝒞\mathcal{C}), Measurement Array (\mathcal{M}), Non-Identity Measurement Index Array (nmn_{m}).
𝐊in(j)=Stabilizer(𝒞)=𝐗abN(a)𝐙b\mathbf{K}_{in}^{(j)}=Stabilizer(\mathcal{C})=\mathbf{X}_{a}\prod_{b\in N(a)}\mathbf{Z}_{b}\triangleright a := elements of 𝒞\mathcal{C}
for ii in range(0,|\mathcal{M}|) do
    𝐊c\mathbf{K}_{c} , 𝐊ac\mathbf{K}_{ac} = [[ ]]
    for kk in range(0,|𝐊in(j)\mathbf{K}_{in}^{(j)}|) do
         if [𝐊in(j)[k],[i]]=0[\mathbf{K}^{(j)}_{in}[k],\mathcal{M}[i]]=0 then
             𝐊c𝐊in(j)[k]\mathbf{K}_{c}\leftarrow\mathbf{K}_{in}^{(j)}[k]
         else
             𝐊ac𝐊in(j)[k]\mathbf{K}_{ac}\leftarrow\mathbf{K}_{in}^{(j)}[k]
         end if
    end for
    if |𝐊ac|>1|\mathbf{K}_{ac}|>1 then
         for ll in range(0,|KacK_{ac}|-1) do
             𝐊c𝐊ac[l]×𝐊ac[l+1]\mathbf{K}_{c}\leftarrow\mathbf{K}_{ac}[l]\times\mathbf{K}_{ac}[l+1]
         end for
    else
         𝐊ac\mathbf{K}_{ac} vanishes
    end if
    𝐊(j)=[\mathbf{K}^{(j)}=[ ]]
    for mm in range(0,|𝐊c\mathbf{K}_{c}|) do
         if [𝐊c[m],[i]]=0[\mathbf{K}_{c}[m],\mathcal{M}[i]]=0 then
             if 𝐊c[m][nm[i]]=[i][nm[i]]Pauli(I)\mathbf{K}_{c}[m][n_{m}[i]]=\mathcal{M}[i][n_{m}[i]]\neq Pauli(I) then
                 𝐊(j)𝐊c[m]×[i]\mathbf{K}^{(j)}\leftarrow\mathbf{K}_{c}[m]\times\mathcal{M}[i]
             else
                 𝐊(j)𝐊c[m]\mathbf{K}^{(j)}\leftarrow\mathbf{K}_{c}[m]
             end if
         end if
    end for
    𝐊in(j)𝐊(j)\mathbf{K}^{(j)}_{in}\leftarrow\mathbf{K}^{(j)}
end for
Post-measurement Stabilizer Generators: 𝐊out(j)𝐊in(j)\mathbf{K}^{(j)}_{out}\leftarrow\mathbf{K}^{(j)}_{in}

cycle specified by the measurement pattern. It depends on considering the cases of commutation relation between the evolving stabilizer generators (beginning from the initial cluster state generators) and the measurement pattern under consideration. At each cycle for an element of the measurement operator, we store the stabilizers in 𝐊c\mathbf{K}_{c} or 𝐊ac\mathbf{K}_{ac} depending on whether the element commute or anti commute with measurement operator respectively. If the anticommuting array (𝐊ac\mathbf{K}_{ac}) contains more than one element, we multiply the elements within themselves and append the new terms in the commuting array (i.e., in 𝐊c\mathbf{K}_{c}) to get the final stabilizer generators corresponding to a particular measurement operator. We repeat the process for each element of the measurement array to get the final stabilizer for our cluster state. This ensures that the desired stabilizer generators commute within themselves and with the prescribed measurement patterns.

The algorithm is implemented using the AWS Braket platforms and requires the Qiskit libraries. The resulting stabilizer generators obtained from this implementation will be utilized in the subsequent subsections, with an aim to demonstrate and study the observed changes compared to the established CNOT implementation for 3×3 and 5×5 circuits.

5.2 Surface Code Using 3×\times 3 Cluster State

In this section, we will conduct a comparable analysis on the stabilizer evolution of a 3×3 array of qubits, consisting of a cluster of 9 qubits, following a specific measurement pattern. This measurement pattern is an extension of the pattern utilized in the previous section. As illustrated in Figure 4, the measurement pattern involves Z-measurements on qubits 1,7{1,7} and X-measurements on qubits 3,5{3,5}. The resulting circuit, which will be used for subsequent computations, takes the following form:

Refer to caption
Figure 4: 3×\times3 cluster state. Qubits 1 and 7 are measured in Z-basis and qubits 3 and 5 are measured in X-basis.

5.2.1 Stabilizer Evolution of a 3×\times3 Surface Code:

On applying the algorithm to study the stabilizer evolution of the above-mentioned circuit with 5 data qubits and 4 measure qubits, as seen in Figure 4. We study the stabilizer evolution both for the CNOT entangled circuit and our CZ entangled circuit which can be seen in the following results:

Refer to caption
Figure 5: Stabilizer Generators for CNOT entangled 3x3 cluster.
Refer to caption
Figure 6: Stabilizer Generators for CZ entangled 3x3 cluster.

The above results demonstrate a deviation between the different surface code initialization mentioned using CNOT and CZ operations respectively. Opposite indexing for 𝐙\mathbf{Z} and 𝐗\mathbf{X} stabilizer is observed as a difference from the predecessor initialization which can be attributed to the fundamental Hadamard transformation incorporated in the theoretical framework as demonstrated in the next subsection demonstrating the theoretical calculation to support the results obtained.

5.2.2 Theoretical Background:

From Figure 4 we have (3,5)𝒞I(g)(3,5)\in\mathcal{C}_{I}(g), (1,7)𝒞B(g)(1,7)\in\mathcal{C}_{B}(g) and (0,2,4,6,8)𝒞O(g)(0,2,4,6,8)\in\mathcal{C}_{O}(g). Let the state of the cluster be |ϕ|\phi\rangle. Using Equation 13, we can write the following eigenvalue equations for |ϕ|\phi\rangle:

𝐗(0)𝐙(1)𝐙(3)|ϕ=|ϕ,\displaystyle\mathbf{X}^{(0)}\mathbf{Z}^{(1)}\mathbf{Z}^{(3)}|\phi\rangle=|\phi\rangle, (31)
𝐗(1)𝐙(0)𝐙(2)𝐙(4)|ϕ=|ϕ,\displaystyle\mathbf{X}^{(1)}\mathbf{Z}^{(0)}\mathbf{Z}^{(2)}\mathbf{Z}^{(4)}|\phi\rangle=|\phi\rangle, (32)
𝐗(2)𝐙(1)𝐙(5)|ϕ=|ϕ,\displaystyle\mathbf{X}^{(2)}\mathbf{Z}^{(1)}\mathbf{Z}^{(5)}|\phi\rangle=|\phi\rangle, (33)
𝐗(3)𝐙(0)𝐙(4)𝐙(6)|ϕ=|ϕ,\displaystyle\mathbf{X}^{(3)}\mathbf{Z}^{(0)}\mathbf{Z}^{(4)}\mathbf{Z}^{(6)}|\phi\rangle=|\phi\rangle, (34)
𝐗(4)𝐙(3)𝐙(1)𝐙(5)𝐙(7)|ϕ=|ϕ,\displaystyle\mathbf{X}^{(4)}\mathbf{Z}^{(3)}\mathbf{Z}^{(1)}\mathbf{Z}^{(5)}\mathbf{Z}^{(7)}|\phi\rangle=|\phi\rangle, (35)
𝐗(5)𝐙(2)𝐙(4)𝐙(8)|ϕ=|ϕ,\displaystyle\mathbf{X}^{(5)}\mathbf{Z}^{(2)}\mathbf{Z}^{(4)}\mathbf{Z}^{(8)}|\phi\rangle=|\phi\rangle, (36)
𝐗(6)𝐙(3)𝐙(7)|ϕ=|ϕ,\displaystyle\mathbf{X}^{(6)}\mathbf{Z}^{(3)}\mathbf{Z}^{(7)}|\phi\rangle=|\phi\rangle, (37)
𝐗(7)𝐙(4)𝐙(6)𝐙(8)|ϕ=|ϕ,\displaystyle\mathbf{X}^{(7)}\mathbf{Z}^{(4)}\mathbf{Z}^{(6)}\mathbf{Z}^{(8)}|\phi\rangle=|\phi\rangle, (38)
𝐗(8)𝐙(5)𝐙(7)|ϕ=|ϕ.\displaystyle\mathbf{X}^{(8)}\mathbf{Z}^{(5)}\mathbf{Z}^{(7)}|\phi\rangle=|\phi\rangle. (39)

Since qubits 1 and 7 are measured in 𝐙\mathbf{Z} basis we can remove these qubits from the state. This is because we saw in Section 3.2 that qubits measured in 𝐙\mathbf{Z} do not affect the final outcome and hence can be removed. The remaining qubits are shown in Figure 7. Let the state of the remaining qubits be |ψ|\psi\rangle. It will satisfy the following set of cluster state eigenvalue equations:

𝐗(0)𝐙(3)|ψ=|ψ,\displaystyle\mathbf{X}^{(0)}\mathbf{Z}^{(3)}|\psi\rangle=|\psi\rangle, (40)
𝐗(2)𝐙(5)|ψ=|ψ,\displaystyle\mathbf{X}^{(2)}\mathbf{Z}^{(5)}|\psi\rangle=|\psi\rangle, (41)
𝐗(3)𝐙(0)𝐙(4)𝐙(6)|ϕ=|ϕ,\displaystyle\mathbf{X}^{(3)}\mathbf{Z}^{(0)}\mathbf{Z}^{(4)}\mathbf{Z}^{(6)}|\phi\rangle=|\phi\rangle, (42)
𝐗(4)𝐙(3)𝐙(5)|ψ=|ψ,\displaystyle\mathbf{X}^{(4)}\mathbf{Z}^{(3)}\mathbf{Z}^{(5)}|\psi\rangle=|\psi\rangle, (43)
𝐗(5)𝐙(2)𝐙(4)𝐙(8)|ψ=|ψ,\displaystyle\mathbf{X}^{(5)}\mathbf{Z}^{(2)}\mathbf{Z}^{(4)}\mathbf{Z}^{(8)}|\psi\rangle=|\psi\rangle, (44)
𝐗(6)𝐙(3)|ψ=|ψ,\displaystyle\mathbf{X}^{(6)}\mathbf{Z}^{(3)}|\psi\rangle=|\psi\rangle, (45)
𝐗(8)𝐙(5)|ψ=|ψ.\displaystyle\mathbf{X}^{(8)}\mathbf{Z}^{(5)}|\psi\rangle=|\psi\rangle. (46)
Refer to caption
Figure 7: 3×\times3 cluster state after measurement of qubits 1 and 7 in 𝐙\mathbf{Z} basis. As seen in section 3.2 measuring in the Z-basis removes the qubits from the circuit.

Using the above equations we can write the following two equations:

𝐙(3)𝐙(5)𝐇(0)𝐇(4)𝐇(6)𝐙(0)𝐙(4)𝐙(6)𝐇(0)𝐇(4)𝐇(6)|ψ=|ψ,\displaystyle\mathbf{Z}^{(3)}\mathbf{Z}^{(5)}\mathbf{H}^{(0)}\mathbf{H}^{(4)}\mathbf{H}^{(6)}\mathbf{Z}^{(0)}\mathbf{Z}^{(4)}\mathbf{Z}^{(6)}\mathbf{H}^{\dagger(0)}\mathbf{H}^{\dagger(4)}\mathbf{H}^{\dagger(6)}|\psi\rangle=|\psi\rangle, (47)
𝐙(3)𝐙(5)𝐇(2)𝐇(4)𝐇(8)𝐙(2)𝐙(4)𝐙(8)𝐇(2)𝐇(4)𝐇(8)|ψ=|ψ.\displaystyle\mathbf{Z}^{(3)}\mathbf{Z}^{(5)}\mathbf{H}^{(2)}\mathbf{H}^{(4)}\mathbf{H}^{(8)}\mathbf{Z}^{(2)}\mathbf{Z}^{(4)}\mathbf{Z}^{(8)}\mathbf{H}^{\dagger(2)}\mathbf{H}^{\dagger(4)}\mathbf{H}^{\dagger(8)}|\psi\rangle=|\psi\rangle. (48)

Now, by incorporating Theorem 1, we can say that we have to apply an additional Hadamard gate (𝐇\mathbf{H}) on the output qubits (0,2,4,6,8) to get the correct surface code stabilizers.

5.3 Surface Code Using 5×\times5 Cluster State

In this section, we will perform a similar study of the stabilizer evolution of a cluster of 25 qubits stacked as a 5×\times5 array of qubits following a particular measurement pattern. As seen in Figure 8, the measurement pattern followed is an extension of the pattern with Z-measurement and X-measurement being performed on qubits {1,3,11,13,21,23}\{1,3,11,13,21,23\} and {5,7,9,15,17,19}\{5,7,9,15,17,19\} respectively, with the circuit to be considered taking the following form:

Refer to caption
Figure 8: 5×\times5 cluster state showing the measurement pattern implemented to obtain the surface code. The logical operators X^L\hat{\textbf{X}}_{L} (red) and Z^L\hat{\textbf{Z}}_{L} (blue) are also shown.

5.3.1 Stabilizer Evolution of a 5×\times5 Surface Code:

On applying the algorithm to study the stabilizer evolution of the above-mentioned circuit with 13 data qubits and 12 measure qubits, we obtain the following stabilizer evolution for our circuit:

Refer to caption
Figure 9: Stabilizer Generators for CZ entangled 5x5 cluster.

On studying the corresponding indexes in Figure 9 of our independent stabilizer generator, a similar stabilizer evolution of different indexing is observed in this case as well. The opposite indexing of the stabilizer as compared to its equivalent CNOT implementation counterpart can be similarly explained by extending the theoretical background mentioned in the study of a 3×\times3 surface code.

5.3.2 Distance of a 5×\times Surface Code:

In this subsection, we are going to demonstrate a way of finding the distance of a surface code in reference to finding the logical operators and then using that to create a set of operators that commutes with the stabilizer generator which in technical language is termed as the centralizers of stabilizers generator. As discussed in Section 2.3, the minimum weight of the elements of the centralizer of the stabilizer generator would provide the distance of the code. We defined the logical operator by creating a chain of operators commute with our stabilizer generator. In the process, we make an observation that the chain of Pauli Operators that constitutes the logical operators also follow similar opposite indexing of Z-logical and X-logical operators in a similar fashion as the stabilizer generators of our surface codes which can be attributed once again to the fundamental Hadamard transformation involved in the theoretical background of our cluster state formulation. Taking care of the opposite indexing, creating the logical operators (the first three elements in the centralizer array below corresponds to the X, Z, and Y logical operator respectively), and performing multiplications of logical operators and stabilizer generators gives us our required element of the centralizers of the stabilizer along with the corresponding weight which is helpful to find the distance of the code, as demonstrated below:

Refer to caption
Figure 10: Centralizers for a 5×\times5 Surface Code.

As seen from Figure 10, the distance of the code is 3, which implies that our 5x5 surface code can be denoted as [[13,1,3]][[13,1,3]]. With such a code of distance 3, we can hope to correct 1 error. Such a structure provides the smallest structure which can be used as an error-correcting code for future consideration of the study. The work demonstrates how one using such an initialization of a surface code structure can result in just the opposite indexing of the stabilizer generator which can be taken care of by using a suitable Hadamard transformation while providing easier initialization to our CNOT entangled cluster state.

6 Discussion

In this paper, we proposed a way to create surface codes using cluster state as the resource. We noted that the cluster state, formed using the CZ operation, gives an advantage over the entangled state formed using the CNOT operation. This is primarily because the CZ operation is symmetric and does not differentiate between the control and target qubits. Another benefit of using cluster states was that it is practically easy to create in the lab. The unitary interaction, in Equation 14, corresponds to an Ising-type interaction that can be realized via controlled collisions in optical lattices [15]. This means that the temporal resources required to create a cluster state are independent of the size of the cluster. Once the cluster states are obtained we applied MBQC to get the desired surface code.

We presented an algorithm to obtain the stabilizers of the surface codes. Stabilizer formalism plays a central role in all of quantum information specifically in fault-tolerant quantum computation. We only analyzed simple 2D square-shaped surface code structures mainly 3×\times3 and 5×\times5. With the help of stabilizers, we were able to obtain the distance. The geometry of our surface codes only allowed two homologically inequivalent logical operators; hence, we could only encode one logical qubit irrespective of the number of physical qubits. We noted that the distance of the surface code can be written as a function of nn as d=n+12d=\frac{n+1}{2}. We further saw that the 3×\times3 surface is of no practical use as it cannot correct any quantum error. But 5×\times5 can be used to correct one type of error in the encoded logical qubit. From our analysis, we can see that MBQC provides an efficient mechanism to create surface codes. These surface codes can then be used as an encoder circuit to encode one or more than one logical qubit depending on the topology and structure of the surface code.

7 Acknowledgement

We thank MeitY QCAL for their generous financial support, which made this research possible. Dr. A.R. thanks the IISER-B for the startup fund for the same. We would also like to acknowledge Mr. Mehul Chakraborty’s contributions to the discussions during the project’s initial phase.

8 Appendix

8.1 3 qubit code

Now, let’s see how we can devise a 3-qubit stabilizer code using the method discussed in Section 2.2. We know that in 3 qubit code three physical qubits are used to encode one logical qubit, hence n=3n=3 and k=1k=1. Qubit flip errors in one qubit are described by the following error operators

={𝐗𝐈𝐈,𝐈𝐗𝐈,𝐈𝐈𝐗}.\mathcal{E}=\left\{\mathbf{X}\otimes\mathbf{I}\otimes\mathbf{I},\mathbf{I}\otimes\mathbf{X}\otimes\mathbf{I},\mathbf{I}\otimes\mathbf{I}\otimes\mathbf{X}\right\}. (49)

We select from all the three-qubit Pauli operators elements that commute with themselves and anti-commute with elements of \mathcal{E} in Equation 49. We will obtain the following set of stabilizers

𝕊={𝐙𝐙𝐈,𝐈𝐙𝐙,𝐙𝐈𝐙}.\mathbb{S}=\left\{\mathbf{Z}\otimes\mathbf{Z}\otimes\mathbf{I},\mathbf{I}\otimes\mathbf{Z}\otimes\mathbf{Z},\mathbf{Z}\otimes\mathbf{I}\otimes\mathbf{Z}\right\}. (50)

Any 2 elements of 𝕊\mathbb{S} form the generator of the set. Therefore the code subspace has dimensions 2 and has the eigenstates

|0L=|000,\displaystyle|0\rangle_{L}=|000\rangle, (51)
|1L=|111.\displaystyle|1\rangle_{L}=|111\rangle.

8.2 5 qubit code

Table 1 shows the stabilizer group generators for a five-qubit code. Since no. of generators is 4, i.e., r=4r=4, we have k=nr=1k=n-r=1. Consider an error 𝐄=𝐘𝐙𝐘𝐈𝐈\mathbf{E}=\mathbf{Y}\otimes\mathbf{Z}\otimes\mathbf{Y}\otimes\mathbf{I}\otimes\mathbf{I}. This error commutes with all the generators. Therefore, 𝐄𝕊\𝕊\mathbf{E}\in\mathbb{N}_{\mathbb{S}}\backslash\mathbb{S}. We will see that this is the smallest error that is undetectable; hence this code has distance d=3d=3. One can also note that this is a perfect code; it means that all the possible single-qubit errors (16 in this case) exhaust all the possible error syndromes (also 16). In Table 1, X and Z define the encoded bit-flip and phase-flip operators respectively. Now, using the stabilizer group we can define the basis for the code subspace

|0¯\displaystyle|\bar{0}\rangle =M𝕊M|00000,\displaystyle=\sum_{\textbf{M}\in\mathbb{S}}\textbf{M}|00000\rangle, (52)
|1¯\displaystyle|\bar{1}\rangle =X|0¯.\displaystyle=\textbf{X}|\bar{0}\rangle.
M1\textbf{M}_{1} X Z Z Z I
M2\textbf{M}_{2} I X Z Z X
M3\textbf{M}_{3} X I X Z Z
M4\textbf{M}_{4} Z X I X Z
XL\textbf{X}_{L} X X X X X
ZL\textbf{Z}_{L} Z Z Z Z Z
Table 1: Stabilizer for five-qubit code [[5,1,3]][[5,1,3]].

8.3 Homology of curves

Homology is a branch of topology that is most relevant for topological codes. Topological codes can be formulated and understood almost entirely in homological terms. Homology is the mathematical field that abstracts and generalizes the notion of boundary. In this work, we will limit our study to homology on the group 2\mathbb{Z}_{2}. We will see that there is a topological invariant called the first homology group of the surface which is essential in making topological codes [20].

8.3.1 2\mathbb{Z}_{2} homology

Consider a particular lattice embedded in the surface. We write vertices as 0-cells, edges as 1-cells, and faces as 2-cells. We will associate an element from the 2\mathbb{Z}_{2} group with each nn-cell, with nn=0,1,2 for our case. The group 2\mathbb{Z}_{2} is the simplest non-trivial group. It has two elements and is isomorphic to the set of integers {0,1}\{0,1\} with group composition given by addition modulo 2. For example, if we label edges as {ei}1E\{e_{i}\}_{1}^{E} we can represent any set of edges EE^{\prime} as

c=icieici={0ifeiE1ifeiE.c=\sum_{i}c_{i}e_{i}\qquad c_{i}=\begin{cases}0&\text{if}\;e_{i}\notin E^{\prime}\\ 1&\text{if}\;e_{i}\in E^{\prime}\end{cases}. (53)

A sum of this form is called a 1-chain. Given any set of edges EE^{\prime} we can represent 1-chain by substituting each element in EE^{\prime} by 1 and the rest of the elements by 0. One such example is shown in Figure 11.

Refer to caption
Figure 11: 1-chain in 2\mathbb{Z}_{2} homology [20]. (Permission Granted by the author)

We can add two 1-chains via bit-wise modulo 2 addition to produce another 1-chain (See Figure 12). We can easily see that 1-chain forms an abelian group under component-wise addition modulo 2. We denote this group by 12E\mathbb{C}_{1}\simeq\mathbb{Z}_{2}^{E} where EE is the number of edges. This means that 1\mathbb{C}_{1} is the direct product of 2\mathbb{Z}_{2} done EE times. The order of the group is 2E2^{E}. Further, we identify EE independent generators of the group by associating a generator with each edge. We place 1 on the edge associated with a specific generator and 0 on every other edge. This procedure gives us EE generators, also called edge generators. Similarly, we can form the group of 0-chains 02V\mathbb{C}_{0}\simeq\mathbb{Z}_{2}^{V} and the group of 2-chains 22F\mathbb{C}_{2}\simeq\mathbb{Z}_{2}^{F}. One can also visualize i\mathbb{C}_{i} as vector spaces with group generators being one set of basis elements B(i)B(\mathbb{C}_{i}).

Refer to caption
Figure 12: Addition of 1-chains in 2\mathbb{Z}_{2} homology [20]. (Permission granted by the author)

8.3.2 Boundary operators

We introduce a family of group homomorphisms \partial called boundary operators or maps. As the name suggests, \partial takes objects to their boundaries. We define a homomorphism i:ii1\partial_{i}:\mathbb{C}_{i}\rightarrow\mathbb{C}_{i-1} such that:

i1i=0.\partial_{i-1}\cdot\partial_{i}=0. (54)

2\partial_{2} (2-boundary operator/map) maps a set of faces to a set of edges that forms its boundary. 1\partial_{1} (1-boundary operator/map) maps a set of edges to a set of vertices where an odd number of edges meet. We can define 0-boundary operator 0\partial_{0} as a map that takes every 0-chain to null chain, i.e., 0c=0\partial_{0}c=0. Null chain is sometimes referred to as 1-chain.

8.3.3 Cycles

We define a subgroup 11\mathbb{Z}_{1}\subset\mathbb{C}_{1} which is a group of 1-chains zz that have no boundary, that is 1z=0\partial_{1}z=0, the kernel of 1\partial_{1}. Elements of 1\mathbb{Z}_{1} are also called 1-cycle. Generally, an nn-cycle is an nn-chain with a null boundary. The group of nn-cycles is labeled as n\mathbb{Z}_{n}. Now, a crucial observation is that all boundaries are also cycles. We define a subgroup 𝔹11\mathbb{B}_{1}\subset\mathbb{C}_{1} which is a group of 1-chains bb that are a boundary of a 2-chain cc, i.e., 2c=b\partial_{2}c=b or bimg(2)b\in\operatorname{img}(\partial_{2}) for some c2c\in\mathbb{C}_{2}. This means that

2c:=12c=0c2.\partial^{2}c:=\partial_{1}\cdot\partial_{2}c=0\quad\forall c\in\mathbb{C}_{2}. (55)

8.4 Homological Equivalence

Two nn-chains are homologically equivalent if they are equal up to composition with an nn-boundary. This means if two chains cc and cc^{\prime} are homologically equivalent, then there exists a (i+1i+1)-chain ci+1c_{i+1} such that

ci=ci+ci+1.c_{i}=c_{i}^{\prime}+\partial c_{i+1}. (56)

Fig 13 shows two homologically equivalent 1-chains.

Refer to caption
Figure 13: Homologically equivalent 1-chains [20]. (Permission granted by the author)

8.5 Homology group

If two chains are homologically equivalent then they share the same boundary but the reverse is not always true, that is, not all chains with the same boundary are homologically equivalent. Homological equivalence partitions the subgroup of chains with a given boundary into equivalence classes. Since cycles are the chains with null boundary it can be partitioned under homological equivalence. We define a quotient group n\mathbb{H}_{n} by partitioning n\mathbb{Z}_{n} into equivalence classes under composition with elements of 𝔹n\mathbb{B}_{n} as

n=n/𝔹n.\mathbb{H}_{n}=\mathbb{Z}_{n}/\mathbb{B}_{n}. (57)

From algebraic topology, we know that the properties of the homology group depend only on the topology of the surface it is defined. The first homology group, up to isomorphisms, can be written as

1=1/𝔹122g.\mathbb{H}_{1}=\mathbb{Z}_{1}/\mathbb{B}_{1}\simeq\mathbb{Z}_{2}^{2g}. (58)

The elements of 1\mathbb{H}_{1} are cosets of the form z¯:={z+b|bB1}\bar{z}:=\{z+b|b\in B_{1}\} for some z1z\in\mathbb{Z}_{1}.

References

References

  • [1] Austin G. Fowler, Matteo Mariantoni, John M. Martinis, and Andrew N. Cleland. Surface codes: Towards practical large-scale quantum computation. Physical Review A, 86(3), sep 2012.
  • [2] Michael A Nielsen and Isaac L Chuang. Quantum computation and quantum information. Phys. Today, 54(2):60, 2001.
  • [3] Peter W Shor. Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer. SIAM review, 41(2):303–332, 1999.
  • [4] Lov K Grover. A fast quantum mechanical algorithm for database search. In Proceedings of the twenty-eighth annual ACM symposium on Theory of computing, pages 212–219, 1996.
  • [5] Nicolas Gisin and Rob Thew. Quantum communication. Nat. Photonics, 1:165–171, March 2007.
  • [6] Joschka Roffe. Quantum error correction: an introductory guide. Contemporary Physics, 60(3):226–245, 2019.
  • [7] Daniel Gottesman. Stabilizer codes and quantum error correction, 1997.
  • [8] H. J. Briegel, D. E. Browne, W. Dür, R. Raussendorf, and M. Van den Nest. Measurement-based quantum computation. Nat. Phys., 5:19–26, January 2009.
  • [9] R. Raussendorf, J. Harrington, and K. Goyal. A fault-tolerant one-way quantum computer. arXiv, October 2005.
  • [10] Robert Raussendorf and Jim Harrington. Fault-tolerant quantum computation with high threshold in two dimensions. Phys. Rev. Lett., 98:190504, May 2007.
  • [11] Frank Gaitan. Quantum error correction and fault tolerant quantum computing. CRC Press, 2008.
  • [12] Dieter Suter and Gonzalo A Álvarez. Colloquium: Protecting quantum information against environmental noise. Reviews of Modern Physics, 88(4):041001, 2016.
  • [13] Maximilian Schlosshauer. Decoherence and Quantum Computing, pages 293–328. Springer Berlin Heidelberg, Berlin, Heidelberg, 2007.
  • [14] Emanuel Knill and Raymond Laflamme. Theory of quantum error-correcting codes. Physical Review A, 55(2):900, 1997.
  • [15] Robert Raussendorf and Hans J Briegel. A one-way quantum computer. Physical Review Letters, 86(22):5188, 2001.
  • [16] Hans J Briegel and Robert Raussendorf. Persistent entanglement in arrays of interacting particles. Physical Review Letters, 86(5):910, 2001.
  • [17] Robert Raussendorf and Tzu-Chieh Wei. Quantum computation by local measurement. arXiv preprint arXiv:1208.0041, 2012.
  • [18] Robert Raussendorf, Daniel E Browne, and Hans J Briegel. Measurement-based quantum computation on cluster states. Physical review A, 68(2):022312, 2003.
  • [19] Héctor Bombín. An introduction to topological quantum codes. arXiv preprint arXiv:1311.0277, 2013.
  • [20] Dan Browne. Toplological codes and computation, 2014.
  • [21] Eric Dennis, Alexei Kitaev, Andrew Landahl, and John Preskill. Topological quantum memory. Journal of Mathematical Physics, 43(9):4452–4505, 2002.
  • [22] Swayangprabha Shaw, Harsh Gupta, Shahid Mehraj Shah, and Ankur Raina. Construction of non-css quantum codes using measurements on cluster states, 2023.