# Q-Pandora Unboxed: Characterizing Resilience of Quantum Error Correction Codes Under Biased Noise
## 2 Overview of Quantum Error Correction
### Surface Codes  
The surface code [33] is a two-dimensional QECC and is currently one of the most popular codes due to its high threshold for errors. It succeeded in the proposal of toric codes, marking it as one of the earliest instances of topological codes. The operation of the surface code involves encoding physical qubits within a logical space that spans two dimensions. This unique layout plays a crucial role in its ability to detect and correct errors efficiently, thus contributing to its high error threshold. A considerable number of experiments have been conducted to realize surface codes in practical applications [17; 34]. The distinguishing attribute of the surface code emerges from its unique approach to error detection and correction. Ancilla qubits, crucial to this process, are employed to conduct measurements that identify both bit-flip and phase-flip errors: the two primary categories of quantum errors. This methodology aligns with the strategies used by most QECCs, where measurements are performed in the form of X and Z stabilizer checks. An n-distance surface code is expressed in the form of an \(n\times n\) lattice, where each blob signifies a qubit integral to the logical state. The lattice is structured in a manner that ensures every qubit is subject to both X and Z stabilizers, tasked with detecting phase- and bit-flip errors, respectively. Each stabilizer check is a product of several Pauli operators (X or Z) acting on a subset of the qubits. If an error occurs, it will change the outcome of the stabilizer checks associated with that qubit. By performing these checks, it is possible to identify when and where an error has occurred after using a decoding algorithm [35; 36]. After errors have been detected, they can be corrected using quantum gates to flip the affected qubits back to their correct states. Unrotated [37] and rotated [26] surface codes are two different layouts for implementing surface code QEC. The difference lies primarily in their lattice structures and the arrangement of qubits, which influence their error-correction capabilities. 1. Unrotated surface codes: These utilize a square lattice arrangement of qubits. Here, the data qubits form the edges of squares with each surface or plaquette corresponding to a Z-stabilizer influencing all four qubits of the edges. X-stabilizers, represented by the vertices, act on the qubits that lie on the edges connected to the vertex. Figure 1 (left) depicts an unrotated surface code, with gray blobs denoting qubits acted upon by pink squares represented Z-stabilizers and green lines depicted X-stabilizers. 2. Rotated Surface Codes: These deploy a tilted lattice pattern where X-stabilizers and Z-stabilizers occupy alternating boxes of a lattice, akin to a chessboard layout. These stabilizers operate on the qubits positioned on the vertices of the specific box. Figure 1 (right) exemplifies distance-3 rotated surface codes. Here, pink surfaces symbolize Z-stabilizers, while green surfaces denote X-stabilizers. Collectively, these stabilizers act on all the gray blobs illustrating qubits that constitute the logical state. Generally, rotated surface codes are favored for achieving robust long-distance QEC due to their slightly higher threshold and less complex implementation. Nevertheless, both these configurations necessitate a substantial number of physical qubits and sophisticated control, making the realization of a comprehensive, fault-tolerant quantum computer using surface codes a formidable challenge for quantum engineering. When a stabilizer operates on a set of four qubits (\(q_{0},q_{1},q_{2},q_{3}\)), there are typically two methods to represent this interaction in the form of a quantum circuit. Figure 2 demonstrates two distinct approaches to constructing X- and Z-stabilizers, either with or without Hadamard gates. (a) depicts the formation of a Z-stabilizer utilizing solely CNOT gates.