FlexiSCD: Flexible Surface Code Deformer for Dynamic Defects

Keyi Yin [email protected] University of California, San Diego, CA, USA Xiang Fang [email protected] University of California, Santa Barbara, CA, USA Travis Humble [email protected] Oak Ridge National Laboratory, Oak Ridge, TN, USA Ang Li [email protected] Pacific Northwest National Laboratory, Richland, WA, USA Yunong Shi [email protected] Amazon Braket, New York, NY, USA Yufei Ding [email protected] University of California, San Diego, CA, USA
Abstract

Quantum Error Correction (QEC) codes are vital for protecting quantum computers from noise by encoding quantum information redundantly in physical qubits. However, dynamic defects pose a significant challenge, potentially rendering physical qubits faulty during computation across various quantum platforms. Current defect mitigation strategies focus on surface codes, but often fail to fully restore QEC capability or disrupt logical operations.

In our paper, we introduce FlexiSCD, a code deformation framework that integrates adaptive defect mitigation into surface code workflows. It strategically crafts basic deformation instructions based on gauge transformations, enabling optimized processes tailored to specific defects, restoring QEC capability efficiently with fewer qubit resources. We also design an adaptive code layout for efficient logical operations.

Our evaluation demonstrates that FlexiSCD reduces failure rates by 35×70×35\times\sim 70\times35 × ∼ 70 × and requires only half the qubit resources compared to previous methods. It surpasses previous defect removal techniques, preserving QEC capability and improving surface code communication

I Introduction

Refer to caption
Figure 1: Comparison of FlexiSCD with existing dynamic defect mitigation methods. (a) Illustration of dynamic defects induced by cosmic rays or error drift. (b) Adaptive Surface Code (ASC) [1] employs fixed deformation operation that leads to bad code distance. (c) Q3DE [2] utilizes fixed-scale enlargement on a fixed layout, resulting in poor resource utilization and communication efficiency. (d) FlexiSCD enables adaptive defect removal, enlargement, and layout optimization, providing a more versatile and efficient response to dynamic defects.

Device errors significantly hinder the advancement of quantum computing [3], obstructing its capability to fulfill its vast potential [4, 5, 6]. Consequently, Quantum Error Correction (QEC), a technique that protects quantum information by using redundant qubits, is pivotal to achieve scalable fault-tolerant quantum computing (FTQC) [7].

Among current QEC code proposals [8, 9, 10, 11, 12, 13, 14], surface code [10, 14, 15, 16] is a leading candidate to achieve FTQC due to its simple 2D-lattice topology and high tolerance to physical qubit errors. Due to their practicality, small-scale surface codes have been successfully demonstrated on several quantum computing platforms [17, 18, 19, 20].

However, scaling surface codes still presents several challenges, especially dynamic defects that emerge on quantum hardware during computation. Events like cosmic-ray strikes on superconducting devices can induce multi-bit burst errors (MBBEs) during computation, leading to defects with localized error rate spikes as high as 50% in affected regions [21, 22, 23, 24]. Leakage errors in all platforms remove the qubit states from the computation space, rendering them inoperable and triggering high-weight correlated errors [25, 26]. Various factors [27, 28, 29] can cause error drift that increases the qubit error rate on different quantum platforms.

These defects can persist for thousands of QEC rounds before their effects go away [22], severely compromising the error correction capability of surface codes. Without mitigation, the logical error rate could potentially increase by a factor of 100100100100 on average [17, 2]. Hence, it is imperative to develop appropriate mitigation strategies for dynamic defects to maintain surface codes’ error correction ability.

Dynamic defects are an inherent aspect of quantum device physics, rendering them insurmountable through hardware mitigation alone [24, 30]. Thus, mitigation at the software level is crucial. Current hardware detectors [31, 32] can swiftly and accurately detect these defects using statistical methods. Using these defect data, software-level solutions can be developed to effectively manage dynamic defects. Currently, the two main software approaches for defect mitigation are defect removal and code enlargement, although each method comes with its own challenges.

A. Defect Removal excludes defective qubits from syndrome measurements during QEC cycles to ensure the accuracy of decoding and subsequent correction. One leading defect removal technique is ASC (Adaptive Surface Code) [1], which performs a simple transformation (known as super-stabilizer [33, 34, 35, 36, 37]) for defect removal. Defect removal methods such as ASC face two issues:

(1) Lack of Distance Recovery: Defect removal methods remove defective qubits without introducing new ones, leading to a permanent reduction in code distance (Section II-A) and increasing program failure rate. Preemptively selecting a larger code size could mitigate this issue to some extent, but accurately allocating the right qubit resources for all defect patterns is a challenge, often resulting in either insufficient resource allocation or wastage of qubits.

(2) Inability to Address Different Defect Types: Defects in surface codes appear as either defective syndrome or data qubits and they can be further categorized by their spatial location as boundary, corner, and interior qubits. Current methods apply a uniform transformation to all defects, hindering them from addressing specific defect types, which leads to suboptimal error correction capability in the resulting code.

B. Code enlargement preserves the code distance under defects by scaling up the code size. As an example, Q3DE [2], a leading enlargement method, initially spaces surface code patches by the code distance d𝑑ditalic_d (Fig. 1(c)). It then enlarges the code to a fixed size of 2d2𝑑2d2 italic_d after defect detection (Fig. 1(c)), borrowing the “growth” transformation designed for lattice-surgery based logical operations [38]. Despite its simplicity, the Q3DE approach suffers from several drawbacks:

(1) Increased Logical Error Rate: Q3DE’s fixed-size enlargement cannot accommodate defect removal, allowing defects to persist and their errors to spread through surface code syndrome measurements, which leads to a significant increase in logical error rates (as detailed in Section II-A).

(2) Qubit Resource Inefficiency: Due to the lack of guarantee of the logical error rate, Q3DE pessimistically doubles code size after defects are detected, irrespective of their specific patterns. This often results in excessive enlargement beyond what’s needed for code distance restoration, leading to poor qubit resource efficiency.

(3) Communication Impediment: Q3DE focuses on recovering single code patches but overlooks the fact that doubled-size codes occupy the space between surface codes. This space is crucial for logical qubit communication in logical operations. This limitation results in significantly limited end-to-end system efficiency.

At a high level, the challenges faced by current defect removal and enlargement approaches arise from their simple application of existing deformation methods, such as super-stabilizer and fixed-size enlarging. This rigid application limits their capacity to handle various defect types, enlarge incrementally, and integrate with each other effectively, resulting in high logical error rates.

Prompted by these challenges, we introduce FlexiSCD, a code deformation framework that extends the current surface code instruction set [39, 40, 41, 42] (detailed in Section II-C) to include adaptive defect mitigation capabilities. FlexiSCD meticulously crafts four deformation instructions (Section IV) that provides superior granularity and versatility compared to fixed operations in ASC and Q3DE.

FlexiSCD consists of two components: a compile-time layout generator and a runtime code deformation unit. The code deformation unit uses the extended instruction set to implement a highly optimized deformation strategy that unifies the defect removal and the enlargement approaches. This unified approach eliminates error sources from defects while restoring code distance, overcoming the limitations of ASC and Q3DE (Issue A.(1), B.(1)). Furthermore, due to FlexiSCD’s instruction design, the code deformation unit can effectively manage various defect types and facilitate adaptive enlargement, substantially improving error correction capabilities and resource efficiency (Issue A.(2), B.(2)). Additionally, the layout generator strategically adjusts the spacings between logical qubit patches to ensure unimpeded execution of two-qubit logical operations, thereby maintaining high end-to-end system efficiency (Issue B.(3)). As a result, FlexiSCD resolves all issues of previous methods.

We perform a comprehensive evaluation of FlexiSCD. The end-to-end performance on various quantum programs shows that FlexiSCD considerably suppresses the program’s failure rate by 35×70×35\times\sim 70\times35 × ∼ 70 × compared with ASC while maintaining nearly-optimal runtime, and requires only 50%similar-toabsentpercent50\sim 50\%∼ 50 % of Q3DE’s qubit resources. Ablation studies show that our framework significantly outperforms previous defect removal methods in preserving code distance and facilitates surface code communication by achieving nearly optimal throughput.

Our contributions can be summarized as follows:

  • We introduce FlexiSCD, a deformation framework designed for adaptive defect mitigation on surface codes.

  • We propose four meticulously crafted deformation instructions , offering highly flexible deformation strategies when combined.

  • We establish a novel code deformation strategy based on our instructions, which not only unifies previous defect removal and enlargement methods but also yields more optimized deformation processes.

  • We propose a novel surface code layout that achieves nearly optimal runtime while maintaining the target logical error rate, effectively resolving communication issues present in existing methods.

II Background and Motivation

II-A Surface Codes

Surface codes arrange physical qubits on a 2D grid to collectively encode logical qubits. We illustrate its key components below as well as in Fig. 2.

Pauli operators. Pauli X𝑋Xitalic_X and Z𝑍Zitalic_Z operators are fundamental qubit operations in QEC for describing both errors and error detection operations [43]. Importantly, X𝑋Xitalic_X and Z𝑍Zitalic_Z anti-commute, i.e., XZ=ZX𝑋𝑍𝑍𝑋XZ=-ZXitalic_X italic_Z = - italic_Z italic_X, allowing QEC codes to detect X𝑋Xitalic_X- or Z𝑍Zitalic_Z-errors using the Pauli Z𝑍Zitalic_Z or X𝑋Xitalic_X operator. Additionally, X𝑋Xitalic_X or Z𝑍Zitalic_Z errors can be corrected by applying the X𝑋Xitalic_X or Z𝑍Zitalic_Z operator because X2=Z2=Isuperscript𝑋2superscript𝑍2𝐼X^{2}=Z^{2}=Iitalic_X start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT = italic_Z start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT = italic_I.

Data and Syndrome qubits. Physical qubits in surface codes are either data qubits or syndrome qubits. Data qubits (black dots) store the logical quantum state, while syndrome qubits (white dots) are for error detection of adjacent data qubits through stabilizer measurements.

Stabilizers. Each syndrome qubit is associated with a stabilizer [44, 45], composed of Pauli operators on adjacent data qubits which identifies the type of error and the specific data qubits for which the syndrome qubit is accountable. Interior and boundary surface code stabilizers measure four and two adjacent data qubits, respectively, depicted as squares for interiors and half-circles for boundaries. Stabilizers are distinguished into X𝑋Xitalic_X-type (red boxes), which detect Z𝑍Zitalic_Z errors and Z𝑍Zitalic_Z-type (blue boxes), which detect X𝑋Xitalic_X errors. Stabilizers are designed to commute, ensuring consistent error detection.

Code distance is the minimal number of physical errors that induce a logical operation (error). The code distance of a surface code equals to the number of data qubits on its edge (Fig. 2(a)). A surface code with more physical qubits gives a larger code distance and has better error resilience [15, 46].

Impact of Defects. Dynamic defects manifest on either data or syndrome qubits, located within the code or along its boundaries (edges or corners), resulting in intricate defect patterns (Fig. 2(b)). Defective syndrome qubits with high error rates fail to provide accurate error information, which renders the stabilizer inoperable and may compromise the code distance by half or more. Defective data qubits consistently generate excessive errors that may surpass the code’s QEC capability, elevating the logical error rate by orders of magnitude [2].

Refer to caption
Figure 2: (a) A surface code logical qubit with code distance 5555. (b) A defective surface code logical qubit with code distance reduced to 2222, illustrated by the weight-2 Z𝑍Zitalic_Z logical operator.

II-B Gauge Transformation

Gauge transformation [47] is a fundamental technique that underpins FlexiSCD as well as facilitates logical operations on surface codes. In this section, we will introduce gauge operators and basic gauge transformations that can be viewed as atomic instructions on surface codes.

Gauge operators. Gauge refers to “degrees of freedom” in QEC. In surface codes, all Pauli operators that preserve logical qubit states are either stabilizers or logical operators, leaving no spare degrees of freedom. For purposes like defect mitigation, stabilizers can be converted to gauge operators, indicating that they are “set free”. This conversion can be simply done by ceasing the measurement of the selected stabilizers in QEC cycles. Gauge operators form anti-commutative pairs [48], meaning when a stabilizer is converted to a gauge operator, a corresponding Pauli operator that anti-commutes with it (but commutes with the rest of the stabilizers) is also introduced as a gauge operator (or more precisely, a generator of the gauge group [47]). One important utility of gauge operators is to provide freedom to measure stabilizers, i.e.formulae-sequence𝑖𝑒i.e.italic_i . italic_e ., sometimes we can measure two gauge operators of which the product equals a stabilizer for syndrome measurement.

Gauge Transformation explores the degrees of freedom introduced by gauge operators. Converting stabilizers to gauge operators, as mentioned above, is an example of gauge transformations. There are four basic types of gauge transformation and they can be viewed as atomic instructions for performing operations on surface codes:

Refer to caption
Figure 3: Examples of basic gauge transformations.

(1) Stabilizer to Gauge (S2G): S2G converts a stabilizer to a gauge operator. For example, in Fig. 3(c), the stabilizer s1,s2,g1,g2subscript𝑠1subscript𝑠2subscript𝑔1subscript𝑔2s_{1},s_{2},g_{1},g_{2}italic_s start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_s start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , italic_g start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_g start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT are converted to gauge operators. Meanwhile, X5subscript𝑋5X_{5}italic_X start_POSTSUBSCRIPT 5 end_POSTSUBSCRIPT and Z5subscript𝑍5Z_{5}italic_Z start_POSTSUBSCRIPT 5 end_POSTSUBSCRIPT, which anti-commute with g1,g2subscript𝑔1subscript𝑔2g_{1},g_{2}italic_g start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_g start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT and s1,s2subscript𝑠1subscript𝑠2s_{1},s_{2}italic_s start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_s start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT, are introduced. The updated stabilizer and gauge set become S={}𝑆S=\{\}italic_S = { } and G={X5,Z5,s1,s2,g1,g2}𝐺subscript𝑋5subscript𝑍5subscript𝑠1subscript𝑠2subscript𝑔1subscript𝑔2G=\{X_{5},Z_{5},s_{1},s_{2},g_{1},g_{2}\}italic_G = { italic_X start_POSTSUBSCRIPT 5 end_POSTSUBSCRIPT , italic_Z start_POSTSUBSCRIPT 5 end_POSTSUBSCRIPT , italic_s start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_s start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , italic_g start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_g start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT }. This instruction potentially reduces the code size. S2G instructions are commutative, as they only depend on the set of newly introduced gauges.

(2) Gauge to Stabilizer (G2S): G2S converts a gauge operator into a stabilizer and removes all gauge operators that anti-commute with it. G2S is the inverse process of S2G (Fig. 3(b)(c)). This instruction eliminates redundant degrees of freedom and expands the code.

(3) Stabilizer to Stabilizer (S2S): S2S multiplies two stabilizers to form a new stabilizer. For instance, in Fig. 3(a), the product of stabilizers s1,s2subscript𝑠1subscript𝑠2s_{1},s_{2}italic_s start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_s start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT and g1,g2subscript𝑔1subscript𝑔2g_{1},g_{2}italic_g start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_g start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT, yields the stabilizers s1s2subscript𝑠1subscript𝑠2s_{1}s_{2}italic_s start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_s start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT and g1g2subscript𝑔1subscript𝑔2g_{1}g_{2}italic_g start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_g start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT. This instruction is often used to build larger stabilizers.

(4) Gauge to Gauge (G2G): G2G multiplies two gauge operators to form a new gauge operator. For instance, in Fig. 3, the products of gauge operators s1X5subscript𝑠1subscript𝑋5s_{1}X_{5}italic_s start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_X start_POSTSUBSCRIPT 5 end_POSTSUBSCRIPT, s2X5subscript𝑠2subscript𝑋5s_{2}X_{5}italic_s start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT italic_X start_POSTSUBSCRIPT 5 end_POSTSUBSCRIPT, g1Z5subscript𝑔1subscript𝑍5g_{1}Z_{5}italic_g start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_Z start_POSTSUBSCRIPT 5 end_POSTSUBSCRIPT, and g2Z5subscript𝑔2subscript𝑍5g_{2}Z_{5}italic_g start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT italic_Z start_POSTSUBSCRIPT 5 end_POSTSUBSCRIPT also result in gauge operators. This instruction reorganizes gauge operators, potentially separating some qubit from the code. For example, the G2G transformation in Fig. 3(d) indicates that qubit q5subscript𝑞5q_{5}italic_q start_POSTSUBSCRIPT 5 end_POSTSUBSCRIPT can be separated from the code.

In summary, these four atomic instructions offer the building blocks for composing versatile and complex instructions to expand, contract, and deform the surface codes for purposes like performing logical operations and defect mitigation. Viewed as atomic instructions, they can be supported by any surface code implementation by simply altering the syndrome measurement patterns in QEC cycles.

II-C Quantum Program Execution on Surface Codes

To execute a high-level quantum program on surface codes [39, 40, 41, 42], a compile time algorithm compiler first maps algorithmic qubits to surface code patches and lowers the logical operations to a native instruction schedule. During runtime, an execution unit utilizes this instruction schedule along with real-time data (such as syndrome measurement results) to execute the program.

Refer to caption
Figure 4: (a) Example of merging two code patches. (2) Perform a logical CNOT gate on two distant logical qubits through an ancilla path connecting them. The control (resp. target) logical qubit interact with the ancilla logical qubit on the edge of Z𝑍Zitalic_Z- (resp. X𝑋Xitalic_X-) logical operators, with equal-length interacting edges.

Instruction set. Current implementations of surface code logical operations are predominantly based on the Lattice Surgery (LS) method [38], which provides an instruction set to expand and connect surface code patches to update and entangle logical states [47]. These instructions, such as grow, merge, and split, are composed of the atomic instructions introduced in Section II-B. For example, the merge instruction connects two arrays of physical qubit registers through a series of S2G and G2S transformations. In Fig. 4(b), applying merge to the blue and red lines activates syndrome measurements on the ancillary patches between the logical surface code patches, facilitating a logical 2-qubit CNOT operation.

Code layout. Current surface code compilers as well as Q3DE arrange logical qubits on a grid with an inter-space of d𝑑ditalic_d, as shown in Fig. 4(b). This layout ensures that activated ancillary patches for logical operations maintain the same code distance as logical qubits, providing same level of noise protection.

III The FlexiSCD framework

Refer to caption
Figure 5: FlexiSCD integrates a Qubit Layout Generator during compilation time and a Code Deformation Unit during runtime into the current surface code workflow. They are combined to extend adaptive defect mitigation functionality to the existing surface code implementation.

The FlexiSCD framework consists of two main components: a compilation time layout generator and a runtime code deformation unit. As illustrated in Fig. 5, FlexiSCD integrates seamlessly with the existing surface code components, including the algorithm compiler and the execution unit.

The layout generator analyzes the input program to estimate the required number of logical qubits and the necessary code distance d𝑑ditalic_d to achieve a target logical error rate. It also computes the additional inter-space ΔdΔ𝑑\Delta droman_Δ italic_d based on the defect error model. This extra space accommodates potential enlargements and ensures communication between logical qubits during the execution of operations. We discuss the adaptive layout generator in detail in Section VI.

The code deformation unit is the core component of FlexiSCD. It deforms logical qubits dynamically to optimize defect mitigation during runtime. Utilizing real-time defect information from defect detectors and the current surface code configuration, the code deformation unit applies our adaptive deformation strategy. This strategy employs instructions from our extended instruction set to effectively remove defects and execute adaptive enlargements. The unit then forwards these instruction schedules to the execution unit for actual updates. Notably, despite the adaptiveness of our deformation methodology, actual code deformation updates can be implemented within a single QEC cycle.

We detail the extended instruction set in Section IV and the code deformation unit in Section V.

IV The FlexiSCD Instruction Set

Previous methods ASC and Q3DE are limited by their simplistic and fixed deformation operations for diverse defect patterns. In response, FlexiSCD introduces four carefully crafted instructions (Table I) to extend the current surface code instruction set (Section II-C). DataQ_RM and SyndromeQ_RM target the removal of interior data and syndrome qubits, respectively, while PatchQ_RM and PatchQ_ADD modify the boundaries of code patches to achieve adaptive boundary defect removal and code enlargement. Akin to CISC in classical computing, each instruction is constructed from multiple atomic instructions (Section II-B) adapted for the surface code topology, as detailed in Fig. 6. Meanwhile, these instructions are granular enough to ensure seamless integration and versatile enough to support a broad spectrum of deformation operations.

TABLE I: Instruction sets of various surface code implementations
Method Extended Instructions over LS Supported Operations
Lattice Surgery N/A Logical operations
Q3DE N/A Logical operations, Fixed enlargement
ASC DataQ_RM Logical operations, Fixed qubit removal
FlexiSCD DataQ_RM,  SyndromeQ_RM, PatchQ_RM,  PatchQ_ADD Logical operations, Adaptive qubit removal, Adaptive enlargement

IV-A Code Deformation Instructions of FlexiSCD

Fig. 6 presents four deformation instructions introduced by FlexiSCD. Physical qubits are denoted by lattice coordinates, and boundaries by a list of qubit coordinates, both serving as input parameters of instructions.

(a) Data qubit removal (DataQ_RM): DataQ_RM removes a single data qubit. As shown in Fig. 6 (a), it first uses 4 S2G to convert stabilizers s1,s2,g1,g2subscript𝑠1subscript𝑠2subscript𝑔1subscript𝑔2s_{1},s_{2},g_{1},g_{2}italic_s start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_s start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , italic_g start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_g start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT into gauge operators, while introducing gauge operators Z0,X0subscript𝑍0subscript𝑋0Z_{0},X_{0}italic_Z start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT , italic_X start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT that anti-commute with s1,s2subscript𝑠1subscript𝑠2s_{1},s_{2}italic_s start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_s start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT and g1,g2subscript𝑔1subscript𝑔2g_{1},g_{2}italic_g start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_g start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT, respectively. It then uses 4 G2G to adjust gauge operators s1,s2,g1,g2subscript𝑠1subscript𝑠2subscript𝑔1subscript𝑔2s_{1},s_{2},g_{1},g_{2}italic_s start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_s start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , italic_g start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_g start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT (rectangles) into X0s1,X0s2,Z0g1,Z0g2subscript𝑋0subscript𝑠1subscript𝑋0subscript𝑠2subscript𝑍0subscript𝑔1subscript𝑍0subscript𝑔2X_{0}s_{1},X_{0}s_{2},Z_{0}g_{1},Z_{0}g_{2}italic_X start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT italic_s start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_X start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT italic_s start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , italic_Z start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT italic_g start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_Z start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT italic_g start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT (triangles), effectively separating q0subscript𝑞0q_{0}italic_q start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT from the code and enabling its removal. Notably, DataQ_RM coincides with ASC’s super-stabilizer method for single data qubit removal. However, within our framework, DataQ_RM is constructed explicitly and could be combined with other instructions to perform more versatile deformations, as will be shown in Section V.

(2) Syndrome qubit removal (SyndromeQ_RM): SyndromeQ_RM presents a novel method to remove a single syndrome qubit. It uses four S2G to form g1g4subscript𝑔1subscript𝑔4g_{1}-g_{4}italic_g start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT - italic_g start_POSTSUBSCRIPT 4 end_POSTSUBSCRIPT. Interestingly, these four gauge operators form a new stabilizer (blue octagon in Fig. 6(b)) that doesn’t rely on q0subscript𝑞0q_{0}italic_q start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT. Meanwhile, four gauge operators X1subscript𝑋1X_{1}italic_X start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPTX4subscript𝑋4X_{4}italic_X start_POSTSUBSCRIPT 4 end_POSTSUBSCRIPT are introduced (red dots), and their product forms a stabilizer X1,2,3,4subscript𝑋1234X_{1,2,3,4}italic_X start_POSTSUBSCRIPT 1 , 2 , 3 , 4 end_POSTSUBSCRIPT. Measurement of X1,2,3,4subscript𝑋1234X_{1,2,3,4}italic_X start_POSTSUBSCRIPT 1 , 2 , 3 , 4 end_POSTSUBSCRIPT can be achieved by using its constituent gauge operators without relying on the syndrome qubit q0subscript𝑞0q_{0}italic_q start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT, which allows the removal of q0subscript𝑞0q_{0}italic_q start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT from the code. This novel method maximizes the utility of adjacent intact data qubits and achieves optimal removal of a single interior syndrome qubit. Additionally, SyndromeQ_RM and DataQ_RM commute, as they both exclusively utilize S2G𝑆2𝐺S2Gitalic_S 2 italic_G, which commute with themselves. This commutativity enables SyndromeQ_RM to be optimal even for complex defect patterns, as will be discussed in Section V.

(3) Boundary qubit removal (PatchQ_RM): PatchQ_RM removes defects on the boundary–for example, the syndrome qubit q5subscript𝑞5q_{5}italic_q start_POSTSUBSCRIPT 5 end_POSTSUBSCRIPT or data qubits q1,q2subscript𝑞1subscript𝑞2q_{1},q_{2}italic_q start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_q start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT in Fig. 6(c). This is achieved by combining several atomic instructions in Section II-B to deform the boundary, thus excluding the defects from the code patch. Fig. 6(c) presents an example where the boundary defective data qubit q1subscript𝑞1q_{1}italic_q start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT is removed by deforming the boundary from XL2subscript𝑋𝐿2X_{L2}italic_X start_POSTSUBSCRIPT italic_L 2 end_POSTSUBSCRIPT to XL2superscriptsubscript𝑋𝐿2X_{L2}^{\prime}italic_X start_POSTSUBSCRIPT italic_L 2 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT (specifically, we add and fix Z1subscript𝑍1Z_{1}italic_Z start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT as a stabilizer and update the rest of stabilizers and gauge operators accordingly).

(4) New qubits incorporation (PatchQ_ADD): The instruction PatchQ_ADD introduces new qubits beyond the original code. A new data qubit q𝑞qitalic_q is initialized in either the |0ket0|0\rangle| 0 ⟩ or |+ket|+\rangle| + ⟩ state, equivalent to introducing a new stabilizer Zqsubscript𝑍𝑞Z_{q}italic_Z start_POSTSUBSCRIPT italic_q end_POSTSUBSCRIPT or Xqsubscript𝑋𝑞X_{q}italic_X start_POSTSUBSCRIPT italic_q end_POSTSUBSCRIPT. New syndrome qubits are then added along with their associated stabilizers, which update the stabilizers and gauge operators through a series of atomic instructions (Section II-B), resulting in a deformed code containing additional qubits. Fig. 6(d) presents an example of adding two data qubits and one syndrome qubit. This instruction can be iterated to facilitate code enlargement.

These four instructions can be combined to manage various defect types and facilitate adaptive code enlargement. The granularity and versatility provided by these instructions form the basis of our highly adaptive code deformation strategy, which will be detailed in Section V.

Refer to caption
Figure 6: Examples of the four deformation instructions of FlexiSCD. Qi is the coordinate of qubit qisubscript𝑞𝑖q_{i}italic_q start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT and XLj is the coordinate list that represents the boundary XLjsubscript𝑋𝐿𝑗X_{Lj}italic_X start_POSTSUBSCRIPT italic_L italic_j end_POSTSUBSCRIPT.

V The Code Deformation Unit

The code deformation unit is the core component of FlexiSCD for adaptive defect mitigation. Before every QEC cycle, the code deformation unit receives the current surface code configuration (including the shape and location of logical qubit patches) from the last round of deformation and current defect information from the dynamic defect detector. Leveraging this information, the code deformation unit executes two subroutines sequentially, as illustrated in Fig. 5. The first subroutine, Defect Removal, removes detected qubits from the current code. The second subroutine Adaptive Enlargement takes the resulting code, calculates the new code distance, and adaptively enlarges the code.

V-A Defect Removal Subroutine

The defect removal subroutine, outlined in Algorithm 1, is crafted to strategically handle various types of defects. Below, we detail the components of this algorithm:

Input: stabilizer set S𝑆Sitalic_S, gauge set G𝐺Gitalic_G,
   defective qubit set D𝐷Ditalic_D
Output: stabilizer set Ssuperscript𝑆S^{\prime}italic_S start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT, gauge set Gsuperscript𝐺G^{\prime}italic_G start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT
1 for diDsubscript𝑑𝑖𝐷d_{i}\in Ditalic_d start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ∈ italic_D do
2       if diInterior_Qsubscript𝑑𝑖𝐼𝑛𝑡𝑒𝑟𝑖𝑜𝑟_𝑄d_{i}\in Interior\_Qitalic_d start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ∈ italic_I italic_n italic_t italic_e italic_r italic_i italic_o italic_r _ italic_Q then
3             if diData_Qsubscript𝑑𝑖𝐷𝑎𝑡𝑎_𝑄d_{i}\in Data\_Qitalic_d start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ∈ italic_D italic_a italic_t italic_a _ italic_Q then
4                   DataQ_RM disubscript𝑑𝑖d_{i}italic_d start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT
5                  
6            else
7                   SyndromeQ_RM disubscript𝑑𝑖d_{i}italic_d start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT
8                  
9             end if
10            
11       else
12             if diEdgeX_Qsubscript𝑑𝑖𝐸𝑑𝑔𝑒𝑋_𝑄d_{i}\in EdgeX\_Qitalic_d start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ∈ italic_E italic_d italic_g italic_e italic_X _ italic_Q and diEdgeZ_Qsubscript𝑑𝑖𝐸𝑑𝑔𝑒𝑍_𝑄d_{i}\in EdgeZ\_Qitalic_d start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ∈ italic_E italic_d italic_g italic_e italic_Z _ italic_Q then
13                   pX,eXsubscript𝑝𝑋subscript𝑒𝑋p_{X},e_{X}italic_p start_POSTSUBSCRIPT italic_X end_POSTSUBSCRIPT , italic_e start_POSTSUBSCRIPT italic_X end_POSTSUBSCRIPT = find_patch(disubscript𝑑𝑖d_{i}italic_d start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT, X)
14                   pZ,eZsubscript𝑝𝑍subscript𝑒𝑍p_{Z},e_{Z}italic_p start_POSTSUBSCRIPT italic_Z end_POSTSUBSCRIPT , italic_e start_POSTSUBSCRIPT italic_Z end_POSTSUBSCRIPT = find_patch(disubscript𝑑𝑖d_{i}italic_d start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT, Z)
15                   p,e𝑝𝑒p,eitalic_p , italic_e = balancing(pXsubscript𝑝𝑋p_{X}italic_p start_POSTSUBSCRIPT italic_X end_POSTSUBSCRIPT, eXsubscript𝑒𝑋e_{X}italic_e start_POSTSUBSCRIPT italic_X end_POSTSUBSCRIPT, pZsubscript𝑝𝑍p_{Z}italic_p start_POSTSUBSCRIPT italic_Z end_POSTSUBSCRIPT, eZsubscript𝑒𝑍e_{Z}italic_e start_POSTSUBSCRIPT italic_Z end_POSTSUBSCRIPT)
16                  
17            else if diEdgeX_Qsubscript𝑑𝑖𝐸𝑑𝑔𝑒𝑋_𝑄d_{i}\in EdgeX\_Qitalic_d start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ∈ italic_E italic_d italic_g italic_e italic_X _ italic_Q then
18                   p,e𝑝𝑒p,eitalic_p , italic_e = find_patch(disubscript𝑑𝑖d_{i}italic_d start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT, X)
19                  
20            else
21                   p,e𝑝𝑒p,eitalic_p , italic_e = find_patch(disubscript𝑑𝑖d_{i}italic_d start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT, Z)
22                  
23             end if
24            PatchQ_RM p𝑝pitalic_p, e𝑒eitalic_e
25            
26       end if
27      
28 end for
return Distance(S𝑆Sitalic_S, G𝐺Gitalic_G) - Distance(Ssuperscript𝑆S^{\prime}italic_S start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT, Gsuperscript𝐺G^{\prime}italic_G start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT)
Algorithm 1 Defect Removal Subroutine

Interior defect removal. The first if branch handles interior defect removal. As shown in Section IV, the optimal removal of defective interior qubits can be achieved simply by applying either DataQ_RM or PatchQ_RM, depending on the qubit type. This simple strategy also achieves optimal removal even for complex defect patterns, since DataQ_RM and PatchQ_RM commute. This commutativity ensures that the removal of neighboring qubits does not interfere with each other, preserving the optimality of the strategy.

Comparison with ASC. ASC solely employs the DataQ_RM instruction even for defective syndrome qubits. For removing a defective syndrome qubit, ASC must apply DataQ_RM four times to remove adjacent data qubits, even if they are not defective. This can result in an unnecessary loss of code distance. For example, the deformed code produced by ASC in Fig. 7(a) has a Z𝑍Zitalic_Z-distance of only 3, while our strategy can preserve it to be 5.

Refer to caption
Figure 7: Illustration of ASC and Q3DE. (a) The resulting code of ASC has X𝑋Xitalic_X- and Z𝑍Zitalic_Z-distance both equal to 3333, while our instruction Fig. 6(b) leads to a code with Z𝑍Zitalic_Z-distance 5555 and X𝑋Xitalic_X-distance 3333. (b) Code enlargement of Q3DE equates to multiple PatchQ_ADD instructions.

Boundary defect removal. The removal of boundary defective qubits is achieved through PatchQ_RM (Fig. 6(c)). However, unlike the interior case where a larger stabilizer can be formed to provide additional error detection capabilities (Fig. 6(a)(b)), simply applying PatchQ_RM leads to suboptimal code distance. Thus, we have to strategically apply G2S to introduce new stabillizers for extra protection. Especially in the corner case, we have to carefully choose from which edge to choose the gauge operator for conversion, to balance the distances X𝑋Xitalic_X and Z𝑍Zitalic_Z. For example, for the defective data qubit q0subscript𝑞0q_{0}italic_q start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT in the top right corner of Fig. 8, we can convert either Zqsubscript𝑍𝑞Z_{q}italic_Z start_POSTSUBSCRIPT italic_q end_POSTSUBSCRIPT or Xqsubscript𝑋𝑞X_{q}italic_X start_POSTSUBSCRIPT italic_q end_POSTSUBSCRIPT to a stabilizer. In the balancing function, we select the one that balances the X𝑋Xitalic_X- and Z𝑍Zitalic_Z-code distances, reflected by the length of the boundaries (red and blue lines) to ensure that the deformed code remains resilient to both X𝑋Xitalic_X- and Z𝑍Zitalic_Z-errors.

Comparison with ASC. ASC  disables defective qubits on the boundary, disregarding their impact on the X𝑋Xitalic_X-, Z𝑍Zitalic_Z-distances. As Fig. 8 shows, ASC converts the gauge operator Z0subscript𝑍0Z_{0}italic_Z start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT into stabilizer to minimize the number of disabled qubits, leading to a smaller Z𝑍Zitalic_Z-code distance than FlexiSCD.

Refer to caption
Figure 8: Convert the right gauge operator into stabilizer to balance the X𝑋Xitalic_X-, Z𝑍Zitalic_Z-distance. (a) ASC converts the gauge operator Z0subscript𝑍0Z_{0}italic_Z start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT into stabilizer, leading to unbalanced X𝑋Xitalic_X-, Z𝑍Zitalic_Z-distance and a smaller code distance. (b) FlexiSCD converts the gauge operator X0subscript𝑋0X_{0}italic_X start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT into stabilizer, leading to balanced X𝑋Xitalic_X-, Z𝑍Zitalic_Z-distance and a larger code distance.
Refer to caption
Figure 9: (a) Our proposed layout with inter-placing width d+Δd𝑑Δ𝑑d+\Delta ditalic_d + roman_Δ italic_d can facilitate long range logical operation with lower qubit overheads while preserving code distance d𝑑ditalic_d of the communication channel. (b) The layout for Q3DE’s double-size strategy. (c) To effectively facilitate the qubit communication in Q3DE’s method, an inter-space of 2d2𝑑2d2 italic_d is necessary, introducing a significant qubit overhead.

V-B Adaptive Enlargement Subroutine

This subroutine receives the deformed code of the Defect Removal Subroutine and efficiently restores the lost code distance by introducing new qubits. As illustrated in Algorithm 2, this enlargement process addresses defects in the newly introduced qubits and ensure a restoration to the original code distance.

Input: stabilizer set S𝑆Sitalic_S, gauge set G𝐺Gitalic_G,
   defective qubit set D𝐷Ditalic_D,
   original code distance Dist𝐷𝑖𝑠𝑡Distitalic_D italic_i italic_s italic_t
   current code distance distX,distZ𝑑𝑖𝑠subscript𝑡𝑋𝑑𝑖𝑠subscript𝑡𝑍dist_{X},dist_{Z}italic_d italic_i italic_s italic_t start_POSTSUBSCRIPT italic_X end_POSTSUBSCRIPT , italic_d italic_i italic_s italic_t start_POSTSUBSCRIPT italic_Z end_POSTSUBSCRIPT
Output: stabilizer set Ssuperscript𝑆S^{\prime}italic_S start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT, gauge set Gsuperscript𝐺G^{\prime}italic_G start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT
1 Defects=𝐷𝑒𝑓𝑒𝑐𝑡𝑠Defects=\emptysetitalic_D italic_e italic_f italic_e italic_c italic_t italic_s = ∅
2 while distX<Dist𝑑𝑖𝑠subscript𝑡𝑋𝐷𝑖𝑠𝑡dist_{X}<Distitalic_d italic_i italic_s italic_t start_POSTSUBSCRIPT italic_X end_POSTSUBSCRIPT < italic_D italic_i italic_s italic_t or distZ<Dist𝑑𝑖𝑠subscript𝑡𝑍𝐷𝑖𝑠𝑡dist_{Z}<Distitalic_d italic_i italic_s italic_t start_POSTSUBSCRIPT italic_Z end_POSTSUBSCRIPT < italic_D italic_i italic_s italic_t do
3       if distX<Dist𝑑𝑖𝑠subscript𝑡𝑋𝐷𝑖𝑠𝑡dist_{X}<Distitalic_d italic_i italic_s italic_t start_POSTSUBSCRIPT italic_X end_POSTSUBSCRIPT < italic_D italic_i italic_s italic_t then
4             layer1𝑙𝑎𝑦𝑒subscript𝑟1layer_{1}italic_l italic_a italic_y italic_e italic_r start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT = find_layer(XL1subscript𝑋𝐿1X_{L1}italic_X start_POSTSUBSCRIPT italic_L 1 end_POSTSUBSCRIPT)
5             for patchlayer1𝑝𝑎𝑡𝑐𝑙𝑎𝑦𝑒subscript𝑟1patch\in layer_{1}italic_p italic_a italic_t italic_c italic_h ∈ italic_l italic_a italic_y italic_e italic_r start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT do
6                   if Exist dipatchDsubscript𝑑𝑖𝑝𝑎𝑡𝑐𝐷d_{i}\in patch\cap Ditalic_d start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ∈ italic_p italic_a italic_t italic_c italic_h ∩ italic_D then
7                         Find X𝑋Xitalic_X-type patch2𝑝𝑎𝑡𝑐subscript2patch_{2}italic_p italic_a italic_t italic_c italic_h start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT that dipatch2subscript𝑑𝑖𝑝𝑎𝑡𝑐subscript2d_{i}\in patch_{2}italic_d start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ∈ italic_p italic_a italic_t italic_c italic_h start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT
8                         layer1𝑙𝑎𝑦𝑒subscript𝑟1layer_{1}italic_l italic_a italic_y italic_e italic_r start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT = layer1patch2𝑙𝑎𝑦𝑒subscript𝑟1𝑝𝑎𝑡𝑐subscript2layer_{1}\cup patch_{2}italic_l italic_a italic_y italic_e italic_r start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ∪ italic_p italic_a italic_t italic_c italic_h start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT
9                         D=Ddi𝐷𝐷subscript𝑑𝑖D=D-d_{i}italic_D = italic_D - italic_d start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT
10                         Defects=Defects+di𝐷𝑒𝑓𝑒𝑐𝑡𝑠𝐷𝑒𝑓𝑒𝑐𝑡𝑠subscript𝑑𝑖Defects=Defects+d_{i}italic_D italic_e italic_f italic_e italic_c italic_t italic_s = italic_D italic_e italic_f italic_e italic_c italic_t italic_s + italic_d start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT
11                   end if
12                  
13             end for
14            layer2𝑙𝑎𝑦𝑒subscript𝑟2layer_{2}italic_l italic_a italic_y italic_e italic_r start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT = find_layer(XL2subscript𝑋𝐿2X_{L2}italic_X start_POSTSUBSCRIPT italic_L 2 end_POSTSUBSCRIPT)
15             …similar to layer1𝑙𝑎𝑦𝑒subscript𝑟1layer_{1}italic_l italic_a italic_y italic_e italic_r start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT
16             layer,XL𝑙𝑎𝑦𝑒𝑟subscript𝑋𝐿layer,X_{L}italic_l italic_a italic_y italic_e italic_r , italic_X start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT = min(layer1𝑙𝑎𝑦𝑒subscript𝑟1layer_{1}italic_l italic_a italic_y italic_e italic_r start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT, layer2𝑙𝑎𝑦𝑒subscript𝑟2layer_{2}italic_l italic_a italic_y italic_e italic_r start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT)
17             for patchlayer𝑝𝑎𝑡𝑐𝑙𝑎𝑦𝑒𝑟patch\in layeritalic_p italic_a italic_t italic_c italic_h ∈ italic_l italic_a italic_y italic_e italic_r do
18                   PatchQ_ADD patch𝑝𝑎𝑡𝑐patchitalic_p italic_a italic_t italic_c italic_h, XLsubscript𝑋𝐿X_{L}italic_X start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT
19             end for
20            distX=distX+1𝑑𝑖𝑠subscript𝑡𝑋𝑑𝑖𝑠subscript𝑡𝑋1dist_{X}=dist_{X}+1italic_d italic_i italic_s italic_t start_POSTSUBSCRIPT italic_X end_POSTSUBSCRIPT = italic_d italic_i italic_s italic_t start_POSTSUBSCRIPT italic_X end_POSTSUBSCRIPT + 1
21            
22      else
23             …similar to distZ𝑑𝑖𝑠subscript𝑡𝑍dist_{Z}italic_d italic_i italic_s italic_t start_POSTSUBSCRIPT italic_Z end_POSTSUBSCRIPT
24            
25       end if
26      for diDefectssubscript𝑑𝑖𝐷𝑒𝑓𝑒𝑐𝑡𝑠d_{i}\in Defectsitalic_d start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ∈ italic_D italic_e italic_f italic_e italic_c italic_t italic_s do
27             Apply Algorithm 1 to remove disubscript𝑑𝑖d_{i}italic_d start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT
28       end for
29      
30 end while
Algorithm 2 Adaptive Enlargement Subroutine

Code enlargement with defective patches. After defect removal, we evaluate the reduction in both X𝑋Xitalic_X- and Z𝑍Zitalic_Z-code distances compared to the ideal surface code. Calculating the code distance for every patch added to the surface code could be inefficient. In the find_layer function, we first identify a set of patches that can increase the code distance by at least one unit of the relevant type, assuming that the identified layer is defect-free.

However, new layers may contain defects, which invalidates our assumption. For example, in Fig. 10 (a), defective qubits q1subscript𝑞1q_{1}italic_q start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT and q2subscript𝑞2q_{2}italic_q start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT are removed, resulting in an irregular boundary that hinders regular enlargement. Similarly, in Fig. 10 (c), the defective qubit q0subscript𝑞0q_{0}italic_q start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT in the prospective scale layer also complicates the enlargement.

To solve this problem, FlexiSCD  combines the instruction PatchQ_ADD with the qubit removal subroutine DataQ_RM, SyndromeQ_RM, PatchQ_RM, as shown in line 24 in Algorithm 2. Initially, defective qubits are temporarily disregarded to facilitate the regular enlargement. Subsequently, these defective qubits are excluded using our qubit removal instructions, resulting in an enlarged code with defects removed as the output of the Code Deformation Unit (Fig. 10 (b) (d)). To execute the deformation process, qubits are introduced in the appropriate state all at once, and stabilizers in the new code are measured. Importantly, this seamless integration of qubit removal and enlargement is facilitated by the unified gauge transformation perspective underlying these deformation instructions.

Refer to caption
Figure 10: Enlargement while addressing defects. (a) Removed defects create an irregular boundary. (b) Enlarging on the irregular boundary in (a). (c) Defect can occur on prospective enlarging layers. (d) Enlarging by a qubit layer with a defect in (c).

VI The Layout Generator

FlexiSCD’s layout generator aims to facilitate communication between surface codes in the presence of potential code enlargement due to defect mitigation. The key idea is to introduce an additional ΔdΔ𝑑\Delta droman_Δ italic_d inter-space, as shown in Fig. 9(a), to accommodate enlargements of up to size ΔdΔ𝑑\Delta droman_Δ italic_d (or even 2Δd2Δ𝑑2\Delta d2 roman_Δ italic_d if enlarging in both directions). The parameter ΔdΔ𝑑\Delta droman_Δ italic_d is determined by the defect error model, chosen such that enlarging within size ΔdΔ𝑑\Delta droman_Δ italic_d can effectively restore the code distance of the deformed code with high probability. Therefore, the communication channel of width d𝑑ditalic_d will only be compromised by code enlargement with a negligible probability.

Comparison with Q3DE. As illustrated in Fig. 7 (b), Q3DE supports fixed enlargement only, whereas our FlexiSCD allows the introduction of only the necessary number of patches to restore the code distance, resulting in savings in qubit resources needed for incorporation into the code. Moreover, the basic process in Q3DE lacks the capability to address irregular boundaries caused by defects or defects occurring on newly introduced qubits. Consequently, Q3DE may inadvertently introduce additional defective qubits during the enlargement process, leading to an increase in error sources that counteract the intended function of the introduced redundant qubits. This failure to effectively mitigate defects can result in a logical error rate that exceeds expectations.

FlexiSCD’s layout generator. The output layout is determined by three parameters:

(1) Logical qubit number N𝑁Nitalic_N. The logical qubits in the layout should be the algorithmic qubits needed for the quantum program, plus the additional qubits essential for facilitating quantum computation, such as logical qubits prepared in magic states for implementing logical T𝑇Titalic_T gates [40]. These logical qubits are arranged in a lattice on a plane, with each one encoded within a surface code and equally spaced apart from one another.

(2) Code distance d𝑑ditalic_d. The code distance d𝑑ditalic_d should be chosen sufficiently large to maintain a sufficiently low logical error rate, ensuring that the failure rate αfailsubscript𝛼𝑓𝑎𝑖𝑙\alpha_{fail}italic_α start_POSTSUBSCRIPT italic_f italic_a italic_i italic_l end_POSTSUBSCRIPT of the program execution remains below a certain threshold, such as 0.1%percent0.10.1\%0.1 %. The failure rate can be estimated based on the logical error rate and features of the quantum program, such as the number of logical gates and the space-time cost of logical gates. For further details on this estimation, please refer to [41, 49].

TABLE II: Results of Q3DE , ASC and FlexiSCD for various programs with different scale
Benchmark Q3DE ASC FlexiSCD
Name # CX𝐶𝑋CXitalic_C italic_X # T # qubit d𝑑ditalic_d # physical qubit Retry risk # physical qubit Retry risk # physical qubit Retry risk
Simon -400-1000 3.02×1053.02superscript1053.02\times 10^{5}3.02 × 10 start_POSTSUPERSCRIPT 5 end_POSTSUPERSCRIPT 00 400400400400 19 1.46×1061.46superscript1061.46\times 10^{6}1.46 × 10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT OverRuntime 1.46×1061.46superscript1061.46\times 10^{6}1.46 × 10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT 53.1%percent53.153.1\%53.1 % 1.80×1061.80superscript1061.80\times 10^{6}1.80 × 10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT 1.51%percent1.511.51\%1.51 %
21 1.79×1061.79superscript1061.79\times 10^{6}1.79 × 10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT OverRuntime 1.79×1061.79superscript1061.79\times 10^{6}1.79 × 10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT 7.28%percent7.287.28\%7.28 % 2.15×1062.15superscript1062.15\times 10^{6}2.15 × 10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT 0.17%percent0.170.17\%0.17 %
Simon -900-1500 1.01×1061.01superscript1061.01\times 10^{6}1.01 × 10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT 00 900900900900 21 3.73×1063.73superscript1063.73\times 10^{6}3.73 × 10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT OverRuntime 3.73×1063.73superscript1063.73\times 10^{6}3.73 × 10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT 46.7%percent46.746.7\%46.7 % 4.49×1064.49superscript1064.49\times 10^{6}4.49 × 10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT 1.09%percent1.091.09\%1.09 %
23 4.47×1064.47superscript1064.47\times 10^{6}4.47 × 10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT OverRuntime 4.47×1064.47superscript1064.47\times 10^{6}4.47 × 10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT 6.14%percent6.146.14\%6.14 % 5.30×1065.30superscript1065.30\times 10^{6}5.30 × 10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT 0.12%percent0.120.12\%0.12 %
RCA -225-500 8.96×1058.96superscript1058.96\times 10^{5}8.96 × 10 start_POSTSUPERSCRIPT 5 end_POSTSUPERSCRIPT 7.84×1057.84superscript1057.84\times 10^{5}7.84 × 10 start_POSTSUPERSCRIPT 5 end_POSTSUPERSCRIPT 225225225225 21 1.08×1061.08superscript1061.08\times 10^{6}1.08 × 10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT OverRuntime 1.08×1061.08superscript1061.08\times 10^{6}1.08 × 10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT 41.9%percent41.941.9\%41.9 % 1.30×1061.30superscript1061.30\times 10^{6}1.30 × 10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT 0.98%percent0.980.98\%0.98 %
23 1.30×1061.30superscript1061.30\times 10^{6}1.30 × 10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT OverRuntime 1.30×1061.30superscript1061.30\times 10^{6}1.30 × 10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT 5.63%percent5.635.63\%5.63 % 1.54×1061.54superscript1061.54\times 10^{6}1.54 × 10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT 0.11%percent0.110.11\%0.11 %
RCA -729-100 5.82×1055.82superscript1055.82\times 10^{5}5.82 × 10 start_POSTSUPERSCRIPT 5 end_POSTSUPERSCRIPT 5.10×1055.10superscript1055.10\times 10^{5}5.10 × 10 start_POSTSUPERSCRIPT 5 end_POSTSUPERSCRIPT 729729729729 21 3.07×1063.07superscript1063.07\times 10^{6}3.07 × 10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT OverRuntime 3.07×1063.07superscript1063.07\times 10^{6}3.07 × 10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT 76.6%percent76.676.6\%76.6 % 3.70×1063.70superscript1063.70\times 10^{6}3.70 × 10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT 1.79%percent1.791.79\%1.79 %
23 3.69×1063.69superscript1063.69\times 10^{6}3.69 × 10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT OverRuntime 3.69×1063.69superscript1063.69\times 10^{6}3.69 × 10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT 10.2%percent10.210.2\%10.2 % 4.37×1064.37superscript1064.37\times 10^{6}4.37 × 10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT 0.20%percent0.200.20\%0.20 %
QFT -25-160 1.02×1051.02superscript1051.02\times 10^{5}1.02 × 10 start_POSTSUPERSCRIPT 5 end_POSTSUPERSCRIPT 1.87×1081.87superscript1081.87\times 10^{8}1.87 × 10 start_POSTSUPERSCRIPT 8 end_POSTSUPERSCRIPT 25252525 23 2.39×1052.39superscript1052.39\times 10^{5}2.39 × 10 start_POSTSUPERSCRIPT 5 end_POSTSUPERSCRIPT OverRuntime 2.39×1052.39superscript1052.39\times 10^{5}2.39 × 10 start_POSTSUPERSCRIPT 5 end_POSTSUPERSCRIPT 61.4%percent61.461.4\%61.4 % 2.85×1052.85superscript1052.85\times 10^{5}2.85 × 10 start_POSTSUPERSCRIPT 5 end_POSTSUPERSCRIPT 1.20%percent1.201.20\%1.20 %
25 2.82×1052.82superscript1052.82\times 10^{5}2.82 × 10 start_POSTSUPERSCRIPT 5 end_POSTSUPERSCRIPT OverRuntime 2.82×1052.82superscript1052.82\times 10^{5}2.82 × 10 start_POSTSUPERSCRIPT 5 end_POSTSUPERSCRIPT 7.83%percent7.837.83\%7.83 % 3.32×1053.32superscript1053.32\times 10^{5}3.32 × 10 start_POSTSUPERSCRIPT 5 end_POSTSUPERSCRIPT 0.13%percent0.130.13\%0.13 %
QFT -100-20 2.30×1052.30superscript1052.30\times 10^{5}2.30 × 10 start_POSTSUPERSCRIPT 5 end_POSTSUPERSCRIPT 1.58×1091.58superscript1091.58\times 10^{9}1.58 × 10 start_POSTSUPERSCRIPT 9 end_POSTSUPERSCRIPT 100100100100 25 0.78×1060.78superscript1060.78\times 10^{6}0.78 × 10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT OverRuntime 0.78×1060.78superscript1060.78\times 10^{6}0.78 × 10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT 100%similar-toabsentpercent100\sim 100\%∼ 100 % 0.92×1060.92superscript1060.92\times 10^{6}0.92 × 10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT 1.69%percent1.691.69\%1.69 %
27 0.91×1060.91superscript1060.91\times 10^{6}0.91 × 10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT OverRuntime 0.91×1060.91superscript1060.91\times 10^{6}0.91 × 10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT 12.6%percent12.612.6\%12.6 % 1.06×1061.06superscript1061.06\times 10^{6}1.06 × 10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT 0.18%percent0.180.18\%0.18 %
Grover -9-80 1.36×1051.36superscript1051.36\times 10^{5}1.36 × 10 start_POSTSUPERSCRIPT 5 end_POSTSUPERSCRIPT 1.99×1081.99superscript1081.99\times 10^{8}1.99 × 10 start_POSTSUPERSCRIPT 8 end_POSTSUPERSCRIPT 9999 23 1.29×1051.29superscript1051.29\times 10^{5}1.29 × 10 start_POSTSUPERSCRIPT 5 end_POSTSUPERSCRIPT OverRuntime 1.29×1051.29superscript1051.29\times 10^{5}1.29 × 10 start_POSTSUPERSCRIPT 5 end_POSTSUPERSCRIPT 57.3%percent57.357.3\%57.3 % 1.54×1051.54superscript1051.54\times 10^{5}1.54 × 10 start_POSTSUPERSCRIPT 5 end_POSTSUPERSCRIPT 1.12%percent1.121.12\%1.12 %
25 1.51×1051.51superscript1051.51\times 10^{5}1.51 × 10 start_POSTSUPERSCRIPT 5 end_POSTSUPERSCRIPT OverRuntime 1.51×1051.51superscript1051.51\times 10^{5}1.51 × 10 start_POSTSUPERSCRIPT 5 end_POSTSUPERSCRIPT 7.23%percent7.237.23\%7.23 % 1.79×1051.79superscript1051.79\times 10^{5}1.79 × 10 start_POSTSUPERSCRIPT 5 end_POSTSUPERSCRIPT 0.12%percent0.120.12\%0.12 %
Grover -16-2 4.29×1054.29superscript1054.29\times 10^{5}4.29 × 10 start_POSTSUPERSCRIPT 5 end_POSTSUPERSCRIPT 1.13×1091.13superscript1091.13\times 10^{9}1.13 × 10 start_POSTSUPERSCRIPT 9 end_POSTSUPERSCRIPT 16161616 25 2.12×1052.12superscript1052.12\times 10^{5}2.12 × 10 start_POSTSUPERSCRIPT 5 end_POSTSUPERSCRIPT OverRuntime 2.12×1052.12superscript1052.12\times 10^{5}2.12 × 10 start_POSTSUPERSCRIPT 5 end_POSTSUPERSCRIPT 56.0%percent56.056.0\%56.0 % 2.50×1052.50superscript1052.50\times 10^{5}2.50 × 10 start_POSTSUPERSCRIPT 5 end_POSTSUPERSCRIPT 0.93%percent0.930.93\%0.93 %
27 2.47×1052.47superscript1052.47\times 10^{5}2.47 × 10 start_POSTSUPERSCRIPT 5 end_POSTSUPERSCRIPT OverRuntime 2.47×1052.47superscript1052.47\times 10^{5}2.47 × 10 start_POSTSUPERSCRIPT 5 end_POSTSUPERSCRIPT 7.01%percent7.017.01\%7.01 % 2.88×1052.88superscript1052.88\times 10^{5}2.88 × 10 start_POSTSUPERSCRIPT 5 end_POSTSUPERSCRIPT 0.10%percent0.100.10\%0.10 %

(3) Additional inter-space ΔdΔ𝑑\Delta droman_Δ italic_d. We present an error model for defects that allows us to estimate the probability of the communication channel being blocked. We assume that defects occurring on each physical qubit follow a Poisson process with rate ρ𝜌\rhoitalic_ρ, lasting for a time T𝑇Titalic_T, and with a maximal size of D𝐷Ditalic_D. Thus, the number of defects on a patch follows a Poisson distribution with parameter λ=2d2ρT𝜆2superscript𝑑2𝜌𝑇\lambda=2d^{2}\rho Titalic_λ = 2 italic_d start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT italic_ρ italic_T, since a surface code of code distance d𝑑ditalic_d contains roughly 2d22superscript𝑑22d^{2}2 italic_d start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT physical qubits. Therefore, the probability of having k𝑘kitalic_k defects on a code is p(k)=λkk!eλ𝑝𝑘superscript𝜆𝑘𝑘superscript𝑒𝜆p(k)=\frac{\lambda^{k}}{k!}e^{-\lambda}italic_p ( italic_k ) = divide start_ARG italic_λ start_POSTSUPERSCRIPT italic_k end_POSTSUPERSCRIPT end_ARG start_ARG italic_k ! end_ARG italic_e start_POSTSUPERSCRIPT - italic_λ end_POSTSUPERSCRIPT. The additional inter-space ΔdΔ𝑑\Delta droman_Δ italic_d can accommodate the enlargement for mitigating Δd/DΔ𝑑𝐷\lfloor\Delta d/D\rfloor⌊ roman_Δ italic_d / italic_D ⌋ defects without compromising the communication channel. The probability of this protection failing and the channel becoming blocked is:

pblock=1k=0Δd/Dp(k)subscript𝑝𝑏𝑙𝑜𝑐𝑘1superscriptsubscript𝑘0Δ𝑑𝐷𝑝𝑘p_{block}=1-\sum_{k=0}^{\lfloor\Delta d/D\rfloor}p(k)italic_p start_POSTSUBSCRIPT italic_b italic_l italic_o italic_c italic_k end_POSTSUBSCRIPT = 1 - ∑ start_POSTSUBSCRIPT italic_k = 0 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ⌊ roman_Δ italic_d / italic_D ⌋ end_POSTSUPERSCRIPT italic_p ( italic_k ) (1)

A desired ΔdΔ𝑑\Delta droman_Δ italic_d should be chosen as the smallest value such that the block probability is below a certain threshold αblocksubscript𝛼𝑏𝑙𝑜𝑐𝑘\alpha_{block}italic_α start_POSTSUBSCRIPT italic_b italic_l italic_o italic_c italic_k end_POSTSUBSCRIPT, such as αblock=0.01subscript𝛼𝑏𝑙𝑜𝑐𝑘0.01\alpha_{block}=0.01italic_α start_POSTSUBSCRIPT italic_b italic_l italic_o italic_c italic_k end_POSTSUBSCRIPT = 0.01.

For example, in experiment [22], cosmic-rays attack a 26262626-qubit superconducting device roughly every 10s10𝑠10s10 italic_s, with each attack lasting for 25ms25𝑚𝑠25ms25 italic_m italic_s, and the number of affected qubits up to 24242424. In this case, ρ=0.1Hz/26𝜌0.1𝐻𝑧26\rho=0.1Hz/26italic_ρ = 0.1 italic_H italic_z / 26, T=25ms𝑇25𝑚𝑠T=25msitalic_T = 25 italic_m italic_s, and D4𝐷4D\approx 4italic_D ≈ 4. For a typical surface code of size d=27𝑑27d=27italic_d = 27 [49], its Poisson parameter is λ=0.14𝜆0.14\lambda=0.14italic_λ = 0.14. Here, we can choose Δd=4Δ𝑑4\Delta d=4roman_Δ italic_d = 4 because pblock=1p(0)p(1)0.0089<0.01=αblocksubscript𝑝𝑏𝑙𝑜𝑐𝑘1𝑝0𝑝10.00890.01subscript𝛼𝑏𝑙𝑜𝑐𝑘p_{block}=1-p(0)-p(1)\approx 0.0089<0.01=\alpha_{block}italic_p start_POSTSUBSCRIPT italic_b italic_l italic_o italic_c italic_k end_POSTSUBSCRIPT = 1 - italic_p ( 0 ) - italic_p ( 1 ) ≈ 0.0089 < 0.01 = italic_α start_POSTSUBSCRIPT italic_b italic_l italic_o italic_c italic_k end_POSTSUBSCRIPT.

Comparison with Q3DE layout. Q3DE’s layout poses challenges on logical qubit communication due to its double-size enlargement scheme, which entirely obstructs the space between codes used for executing logical operations Fig. 9(b). It has the following major limitations:

(1) Space-time overhead of logical operations. The blocked channel may lead to space overhead for long-distance logical operations. For example, in Fig. 9(b), the CNOT gate from qubit B𝐵Bitalic_B to C𝐶Citalic_C must traverse a longer path (solid line) instead of the shorter one (dotted lines) due to the enlarged qubit B𝐵Bitalic_B. Moreover, the blocked channel can result in severe time overhead. Logical operations may become unfeasible due to blocked paths, such as the CNOT gate from qubit A𝐴Aitalic_A to B𝐵Bitalic_B. In such cases, the program must be paused for a long time (thousands of QEC cycles) until the effects of defects subside, and the code shrinks back to its original size, making the ancilla path available again. In contrast, our layout with an extra inter-space ΔdΔ𝑑\Delta droman_Δ italic_d effectively suppresses the block probability, thus reducing the space-time cost of logical operations to a nearly optimal level.

(2) Qubit resource for facilitating communication. It’s possible for the size-doubling strategy in Q3DE to achieve nearly optimal space and time costs, but it requires a 2d2𝑑2d2 italic_d inter-space (Fig. 9(c)) to accommodate both code enlargement and ancilla paths of distance d𝑑ditalic_d. However, this results in a significant qubit resource overhead of (3d2d)2=2.25superscript3𝑑2𝑑22.25(\frac{3d}{2d})^{2}=2.25( divide start_ARG 3 italic_d end_ARG start_ARG 2 italic_d end_ARG ) start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT = 2.25 times. In contrast, our layout introduces a lower overhead since ΔdΔ𝑑\Delta droman_Δ italic_d must be smaller than d𝑑ditalic_d. This overhead remains mild, especially when ΔdΔ𝑑\Delta droman_Δ italic_d is relatively small compared to the code distance d𝑑ditalic_d.

VII Implementation and Evaluation

VII-A Experimental Setup

Evaluation setting. We use the Stim stabilizer circuit simulator [50] and the PyMatching [51] decoder for our numerical simulations. For program compilation, we employ the lattice surgery framework described in [52, 41], along with the T𝑇Titalic_T factory for implementing logical T𝑇Titalic_T gates using magic state distillation strategies [39].

Benchmark programs. We have selected several quantum programs designed to tackle real-world challenges. These programs include Simon’s algorithm [53], Ripple Carry Adder (RCA) [54], Quantum Fourier Transform (QFT) [55], and Grover’s algorithm [5]. The first suffix of the name indicates the number of logical qubits used, while the second suffix represents the number of repetitions. For instance, ”QFT-100-20” indicates the task of 20 QFT layers on 100 qubits, a common scenario used in more complex algorithms like Shor’s algorithm [4].

Refer to caption
Figure 11: (a) Logical error rate of with qubit removal by FlexiSCD and without any treatment. (b) Cost in distance recovery. (c) Throughput vs Defect.

Metric. For evaluation, we consider three key metrics. First, the physical qubit count encompasses all data and ancilla qubits used in the quantum program’s layout. It quantifies the qubit resources required for the task, with lower values being preferred. Second, the retry risk, as defined by [49], represents the probability of an uncorrectable logical error occurring in the program, which will lead to an incorrect task result that necessitates retry. This metric indicates the error rate of task results, with lower values being preferred. Third, the throughput of non-local operations represents the average number of operations executed in one cycle, with higher values being preferred. This metric indicates the layout’s ability to execute non-local operations (CNOT and T gates) in parallel, which can significantly impact task runtime, particularly when compared to local operations.

Error model. We adopt an error model similar to [2]. The physical error rate of each qubit is assumed to be p=103𝑝superscript103p=10^{-3}italic_p = 10 start_POSTSUPERSCRIPT - 3 end_POSTSUPERSCRIPT. For dynamic defects, each physical qubit experiences a dynamic defect event following an exponential distribution with an average event rate of λ=1/(26×10 s)𝜆12610 s\lambda=1/(26\times 10\text{ s})italic_λ = 1 / ( 26 × 10 s ) [22]. When a physical qubit is attacked, the adjacent 24 qubits are affected, resulting in a defective region of size 4. The physical error rate of qubits in the affected region increases to approximately 50% and lasts for T=25𝑇25T=25italic_T = 25 ms, equivalent to approximately 25000 QEC cycles.

VII-B Overall Performance

We compare our FlexiSCD with two previous frameworks, Q3DE method [2] and adaptive surface code (ASC) [1], on benchmark programs mentioned in Section VII-A. The results are presented in Table II. We evaluate these tasks on surface codes of appropriate distances chosen to meet the target retry risk levels of 1%percent11\%1 % and 0.1%percent0.10.1\%0.1 % in our framework. Overall, our FlexiSCD in Table II demonstrates a consistently better performance. In particular, we highlight the following three observations:

  1. 1.

    All tasks processed by Q3DE exhibit a retry risk of 100%similar-toabsentpercent100\sim 100\%∼ 100 %, indicating an inability to mitigate the impact of dynamic defects. This limitation stems from its enlargement operation with a fixed layout, which causes the ancilla space near the defective qubits to become blocked. Additionally, the large scale of tasks necessitates high-fidelity logical qubits, implying a large code distance d𝑑ditalic_d for the surface code. With more qubits used to encode a logical qubit, there is a higher probability of the qubit blocks being attacked by defect events. Consequently, most qubit blocks become enlarged in Q3DE , and a significant portion of the ancilla paths are blocked. Fewer or even no available ancilla paths for executing non-local operations result in the high retry risk.

  2. 2.

    Without the ability to recover the decreased distance caused by removing defective qubits, the retry risk of tasks executed by ASC is 35x-70x higher than those by our FlexiSCD. This disparity arises from the task’s retry risk being determined by the worst qubit blocks during runtime, since a single logical error on any logical qubit can lead to the failure of the entire task. Failure to restore a low-distance logical qubit to the original required distance d𝑑ditalic_d for the task significantly amplifies the retry risk.

  3. 3.

    With FlexiSCD’s layout, it requires only around 20%percent2020\%20 % more physical qubits to resolve the communication blocking issue and achieve a low retry risk. Moreover, even with the same number of physical qubits, FlexiSCD still outperforms ASC. For example, in the task ”QFT-100-20,” FlexiSCD with d=25𝑑25d=25italic_d = 25 and Δd=4Δ𝑑4\Delta d=4roman_Δ italic_d = 4 and ASC with d=27𝑑27d=27italic_d = 27 both use roughly 9×1059superscript1059\times 10^{5}9 × 10 start_POSTSUPERSCRIPT 5 end_POSTSUPERSCRIPT physical qubits. However, the retry risk of FlexiSCD is still 6.3x lower than that of ASC.

VII-C Analysis on Sub-components

In this section, we demonstrate the superior performance of our FlexiSCD due to its adaptive deformation framework and layout. Our approach excels in saving qubit resources, maintaining the QEC capability of the deformed code, and enhancing surface code communication compared to other methods. We have conducted a series of experiments to showcase these advantages.

Refer to caption
Figure 12: Physical qubit counts required to achieve a retry risk of approximately 1%percent11\%1 %. Q3DE* stands for the revised illustrated in Fig. 9(c).

Qubit resource saving. We demonstrate the substantial resource savings achieved by FlexiSCD by comparing the physical qubit count required for the layout to achieve a 1%percent11\%1 % retry risk with different methods. Our comparison includes Lattice Surgery, the revised version of Q3DE, and ASC. In the revised Q3DE, we adjust the inter-space to 2d2𝑑2d2 italic_d to prevent the enlargement from blocking surrounding communication paths, as illustrated in Fig. 9(c). As depicted in Fig. 12, FlexiSCD requires significantly fewer qubits compared to all previous methods, approximately 75% less than Lattice Surgery, 50% less than Q3DE, and 15% less than ASC.

Improved logical error rate by qubit removal. In Fig. 11(a), we compare the logical error rates of surface codes with and without defective qubits removed by FlexiSCD, across different numbers of defective qubits. We do not present the cases for d=21𝑑21d=21italic_d = 21 and d=27𝑑27d=27italic_d = 27 because the logical error rates are so low that numerical simulations cannot provide reasonable estimations.

The results show that FlexiSCDsignificantly enhances the logical error rate by removing defects. Codes with defects removed achieve comparable logical error rates to those without any treatment, despite having much smaller code distances. For instance, when there are 10 defective qubits, a distance-9 code with defects removed shows a similar logical error rate to a distance-15 code without any treatment. This also underscores that simply expanding the code size while retaining defective qubits, as in Q3DE, cannot effectively improve logical error rates as expected.

Enhanced code distance by adaptive defect removal. We compare the cost of distance recovery of FlexiSCD and previous methods such as ASC that use oversimplified deformation operations. Fig. 11(b) gives the code distance of defective codes of different original sizes, w.r.t. varying number of defective qubits. It indicates that our method can preserve the code distance better than the previous methods, leading to a lower cost when recovering the code distance through enlargement. Additionally, the advantage of our method becomes more significant on codes of larger size and when there are more defective qubits.

Parallelism improvement by FlexiSCD’s layout. In Fig. 11(c), we compare the efficiency of qubit communication using the layouts in three schemes: (1) FlexiSCD, (2) Q3DE with d𝑑ditalic_d inter-space, and (3) classical lattice surgery (LS), representing optimal runtime. We consider 100100100100 logical qubits and three sets of tasks, each comprising 5555 tasks with 25252525 CNOT gates on 50505050 distinct logical qubits. The tasks in each set can be completed in 16161616, 19191919, and 22222222 time-steps on the LS layout, respectively, indicating three levels of parallelism. We then sample defects 100100100100 times for each task and compute the average throughput of each task set using the layouts in FlexiSCD and Q3DE.

The results indicate that as the defect rate increases, the throughput significantly drops for the Q3DE layout, whereas it only experiences a slight decline with our layout. This is because expanding all the defective code to a 2d2𝑑2d2 italic_d size severely blocks the ancilla paths for long-range CNOT gates, resulting in a much longer execution time, while the additional ΔdΔ𝑑\Delta droman_Δ italic_d space in our layout significantly reducing the probability of ancilla paths being blocked. Therefore, the FlexiSCD layout effectively facilitates the computation among logical qubits.

VIII Related Work

In this section, we present a broader perspective on approaches for addressing dynamic defects in quantum hardware. Generally, there are three main directions to consider:

(1) Hardware-level solutions. Dynamic defects can be mitigated at the hardware level to reduce their incidence rate. Physical techniques such as shielding [24, 30], phonon downconversion [56, 57], and metallic covers [58] can help mitigate the burst of quasiparticles induced by radiation materials and cosmic rays, which is a main source of qubit decoherence. Various mitigation methods on chips [21, 59] are also proposed. However, these hardware-level solutions alone are often insufficient to reduce the logical error rate to a level where meaningful quantum computations, which can take several hours [49], can be effectively executed. Although preventing these defects at the hardware level is challenging, specialized hardware detectors [31, 32] can often locate them accurately at runtime with statistical methods.

(2) Software-level solution. To address dynamic defects that involve varying error rates, methods like [2, 60, 61, 62] estimate modified error rates based on historical syndrome data and then adjust the error rates in the decoders such as MWPM  [46, 63, 64, 65, 66, 67]. Various error mitigation approaches [68, 69, 70] based on statistical methods are also proposed. However, these methods becomes ineffective when the physical error rate is considerably high or the errors can possible propagate, but these are often the case with dynamic defects, where defected qubits can have error rates near 50% and affect the integrity of adjacent qubits [22, 25].

(3) QEC-level solution. Theoretical frameworks have been established for converting one stabilizer code to another [71, 72, 73, 74, 47, 75] by modifying the code through a series of measurements. However, these methods either potentially modify the encoded information [74, 47], or ignore the hardware constraints on qubit connectivity [75], limiting their code conversion procedure for practical use. On the other hand, approaches such as [2, 76, 1] design new codes based on the structure of the underlying hardware. However, these methods are inefficient in utilizing the remaining intact qubits, do not detail the specific deformation procedure, and overlook the feasibility of communication between logical qubits.

IX Conclusion

In this work, we introduce a novel deformation framework FlexiSCD, which expands the existing surface code instruction set by integrating adaptive defect mitigation functionalities. Based on four meticulously designed deformation instructions, FlexiSCD creates a larger design space than previous work, enabling optimized deformation processes tailored to specific defects. When combined with a new adaptive code layout, FlexiSCD significantly enhances qubit communication efficiency and reduces logical error rates with only mild additional qubit resource. Comprehensive evaluations show that FlexiSCD produces deformed codes with better QEC capabilities and more efficient qubit communication. FlexiSCD serves as a versatile tool for effectively addressing defects in surface codes across various quantum platforms.

References

  • [1] Adam Siegel, Armands Strikis, Thomas Flatters, and Simon Benjamin. Adaptive surface code for quantum error correction in the presence of temporary or permanent defects. Quantum, 7:1065, 2023.
  • [2] Yasunari Suzuki, Takanori Sugiyama, Tomochika Arai, Wang Liao, Koji Inoue, and Teruo Tanimoto. Q3de: A fault-tolerant quantum computer architecture for multi-bit burst errors by cosmic rays. In 2022 55th IEEE/ACM International Symposium on Microarchitecture (MICRO), pages 1110–1125. IEEE, 2022.
  • [3] John Preskill. Quantum computing in the nisq era and beyond. Quantum, 2:79, 2018.
  • [4] Peter W Shor. Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer. SIAM review, 41(2):303–332, 1999.
  • [5] 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.
  • [6] Alberto Peruzzo, Jarrod McClean, Peter Shadbolt, Man-Hong Yung, Xiao-Qi Zhou, Peter J Love, Alán Aspuru-Guzik, and Jeremy L O’brien. A variational eigenvalue solver on a photonic quantum processor. Nature communications, 5(1):4213, 2014.
  • [7] Peter W Shor. Fault-tolerant quantum computation. In Proceedings of 37th conference on foundations of computer science, pages 56–65. IEEE, 1996.
  • [8] A Robert Calderbank and Peter W Shor. Good quantum error-correcting codes exist. Physical Review A, 54(2):1098, 1996.
  • [9] Andrew Steane. Multiple-particle interference and quantum error correction. Proceedings of the Royal Society of London. Series A: Mathematical, Physical and Engineering Sciences, 452(1954):2551–2577, 1996.
  • [10] Sergey B Bravyi and A Yu Kitaev. Quantum codes on a lattice with boundary. arXiv preprint quant-ph/9811052, 1998.
  • [11] Héctor Bombín and Miguel A Martin-Delgado. Optimal resources for topological two-dimensional stabilizer codes: Comparative study. Physical Review A, 76(1):012305, 2007.
  • [12] Hector Bombin and Miguel Angel Martin-Delgado. Topological quantum distillation. Physical review letters, 97(18):180501, 2006.
  • [13] Peter W Shor. Scheme for reducing decoherence in quantum computer memory. Physical review A, 52(4):R2493, 1995.
  • [14] A Yu Kitaev. Fault-tolerant quantum computation by anyons. Annals of physics, 303(1):2–30, 2003.
  • [15] 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):032324, 2012.
  • [16] Simon J Devitt, William J Munro, and Kae Nemoto. Quantum error correction for beginners. Reports on Progress in Physics, 76(7):076001, 2013.
  • [17] Suppressing quantum errors by scaling a surface code logical qubit. Nature, 614(7949):676–681, 2023.
  • [18] Youwei Zhao, Yangsen Ye, He-Liang Huang, Yiming Zhang, Dachao Wu, Huijie Guan, Qingling Zhu, Zuolin Wei, Tan He, Sirui Cao, et al. Realization of an error-correcting surface code with superconducting qubits. Physical Review Letters, 129(3):030501, 2022.
  • [19] Dolev Bluvstein, Simon J Evered, Alexandra A Geim, Sophie H Li, Hengyun Zhou, Tom Manovitz, Sepehr Ebadi, Madelyn Cain, Marcin Kalinowski, Dominik Hangleiter, et al. Logical quantum processor based on reconfigurable atom arrays. Nature, 626(7997):58–65, 2024.
  • [20] Sebastian Krinner, Nathan Lacroix, Ants Remm, Agustin Di Paolo, Elie Genois, Catherine Leroux, Christoph Hellings, Stefania Lazar, Francois Swiadek, Johannes Herrmann, et al. Realizing repeated quantum error correction in a distance-three surface code. Nature, 605(7911):669–674, 2022.
  • [21] John M Martinis. Saving superconducting quantum processors from decay and correlated errors generated by gamma and cosmic rays. npj Quantum Information, 7(1):90, 2021.
  • [22] Matt McEwen, Lara Faoro, Kunal Arya, Andrew Dunsworth, Trent Huang, Seon Kim, Brian Burkett, Austin Fowler, Frank Arute, Joseph C Bardin, et al. Resolving catastrophic error bursts from cosmic rays in large arrays of superconducting qubits. Nature Physics, 18(1):107–111, 2022.
  • [23] Christopher D Wilen, S Abdullah, NA Kurinsky, C Stanford, L Cardani, G d’Imperio, C Tomei, L Faoro, LB Ioffe, CH Liu, et al. Correlated charge noise and relaxation errors in superconducting qubits. Nature, 594(7863):369–373, 2021.
  • [24] Antti P Vepsäläinen, Amir H Karamlou, John L Orrell, Akshunna S Dogra, Ben Loer, Francisca Vasconcelos, David K Kim, Alexander J Melville, Bethany M Niedzielski, Jonilyn L Yoder, et al. Impact of ionizing radiation on superconducting qubit coherence. Nature, 584(7822):551–556, 2020.
  • [25] Natalie C Brown, Michael Newman, and Kenneth R Brown. Handling leakage with subsystem codes. New Journal of Physics, 21(7):073055, 2019.
  • [26] Iris Cong, Harry Levine, Alexander Keesling, Dolev Bluvstein, Sheng-Tao Wang, and Mikhail D. Lukin. Hardware-efficient, fault-tolerant quantum computation with rydberg atoms, 2022.
  • [27] E Gümüş, Danial Majidi, Danilo Nikolić, Patrick Raif, Bayan Karimi, Joonas T Peltonen, Elke Scheer, Jukka P Pekola, Hervé Courtois, Wolfgang Belzig, et al. Calorimetry of a phase slip in a josephson junction. Nature Physics, 19(2):196–200, 2023.
  • [28] Matthew L Day, Pei Jiang Low, Brendan White, Rajibul Islam, and Crystal Senko. Limits on atomic qubit control from laser noise. npj Quantum Information, 8(1):72, 2022.
  • [29] JJ Burnett, A Bengtsson, M Scigliuzzo, D Niepce, M Kudra, P Delsing, and J Bylander. Decoherence benchmarking of superconducting qubits. npj quantum inf. 5. 2019.
  • [30] Laura Cardani, Francesco Valenti, Nicola Casali, Gianluigi Catelani, Thibault Charpentier, Massimiliano Clemenza, Ivan Colantoni, Angelo Cruciani, G D’Imperio, Luca Gironi, et al. Reducing the impact of radioactivity on quantum circuits in a deep-underground facility. Nature communications, 12(1):2733, 2021.
  • [31] James T Farmer, Azarin Zarassi, Darian M Hartsell, Evangelos Vlachos, Haimeng Zhang, and Eli M Levenson-Falk. Continuous real-time detection of quasiparticle trap** in aluminum nanobridge josephson junctions. Applied Physics Letters, 119(12), 2021.
  • [32] Willemijn Uilhoorn, James G Kroll, Arno Bargerbos, Syed D Nabi, Chung-Kai Yang, Peter Krogstrup, Leo P Kouwenhoven, Angela Kou, and Gijs de Lange. Quasiparticle trap** by orbital effect in a hybrid superconducting-semiconducting circuit. arXiv preprint arXiv:2105.11038, 2021.
  • [33] Kaitlin N Smith, Gokul Subramanian Ravi, Jonathan M Baker, and Frederic T Chong. Scaling superconducting quantum computers with chiplet architectures. In 2022 55th IEEE/ACM International Symposium on Microarchitecture (MICRO), pages 1092–1109. IEEE, 2022.
  • [34] Thomas M Stace, Sean D Barrett, and Andrew C Doherty. Thresholds for topological codes in the presence of loss. Physical review letters, 102(20):200501, 2009.
  • [35] Thomas M Stace and Sean D Barrett. Error correction and degeneracy in surface codes suffering loss. Physical Review A, 81(2):022317, 2010.
  • [36] James M Auger, Hussain Anwar, Mercedes Gimeno-Segovia, Thomas M Stace, and Dan E Browne. Fault-tolerance thresholds for the surface code with fabrication errors. Physical Review A, 96(4):042316, 2017.
  • [37] Shota Nagayama, Austin G Fowler, Dominic Horsman, Simon J Devitt, and Rodney Van Meter. Surface code error correction on a defective lattice. New Journal of Physics, 19(2):023050, 2017.
  • [38] Dominic Horsman, Austin G Fowler, Simon Devitt, and Rodney Van Meter. Surface code quantum computing by lattice surgery. New Journal of Physics, 14(12):123011, 2012.
  • [39] Austin G Fowler and Craig Gidney. Low overhead quantum computation using lattice surgery. arXiv preprint arXiv:1808.06709, 2018.
  • [40] Michael Beverland, Vadym Kliuchnikov, and Eddie Schoute. Surface code compilation via edge-disjoint paths. PRX Quantum, 3(2):020342, 2022.
  • [41] Daniel Litinski. A game of surface codes: Large-scale quantum computing with lattice surgery. Quantum, 3:128, 2019.
  • [42] Tyler LeBlond, Ryan S Bennink, Justin G Lietz, and Christopher M Seck. Tiscc: A surface code compiler and resource estimator for trapped-ion processors. In Proceedings of the SC’23 Workshops of The International Conference on High Performance Computing, Network, Storage, and Analysis, pages 1426–1435, 2023.
  • [43] Michael A Nielsen and Isaac L Chuang. Quantum computation and quantum information. Cambridge university press, 2010.
  • [44] Daniel Gottesman. Class of quantum error-correcting codes saturating the quantum hamming bound. Physical Review A, 54(3):1862, 1996.
  • [45] Daniel Gottesman. The heisenberg representation of quantum computers, 1998.
  • [46] Eric Dennis, Alexei Kitaev, Andrew Landahl, and John Preskill. Topological quantum memory. Journal of Mathematical Physics, 43(9):4452–4505, 2002.
  • [47] Christophe Vuillot, Lingling Lao, Ben Criger, Carmen García Almudéver, Koen Bertels, and Barbara M Terhal. Code deformation and lattice surgery are gauge fixing. New Journal of Physics, 21(3):033028, 2019.
  • [48] David Poulin. Stabilizer formalism for operator quantum error correction. Physical review letters, 95(23):230504, 2005.
  • [49] Craig Gidney and Martin Ekerå. How to factor 2048 bit rsa integers in 8 hours using 20 million noisy qubits. Quantum, 5:433, 2021.
  • [50] Craig Gidney. Stim: a fast stabilizer circuit simulator. Quantum, 5:497, 2021.
  • [51] Oscar Higgott. Pymatching: A python package for decoding quantum codes with minimum-weight perfect matching. ACM Transactions on Quantum Computing, 3(3):1–16, 2022.
  • [52] George Watkins, Hoang Minh Nguyen, Varun Seshadri, Keelan Watkins, Steven Pearce, Hoi-Kwan Lau, and Alexandru Paler. A high performance compiler for very large scale surface code computations. arXiv preprint arXiv:2302.02459, 2023.
  • [53] Daniel R Simon. On the power of quantum computation. SIAM journal on computing, 26(5):1474–1483, 1997.
  • [54] Yasuhiro Takahashi and Noboru Kunihiro. A linear-size quantum circuit for addition with no ancillary qubits. Quantum Information & Computation, 5(6):440–448, 2005.
  • [55] Don Coppersmith. An approximate fourier transform useful in quantum factoring. arXiv preprint quant-ph/0201067, 2002.
  • [56] K Karatsu, A Endo, J Bueno, PJ De Visser, R Barends, DJ Thoen, V Murugesan, N Tomita, and JJA Baselmans. Mitigation of cosmic ray effect on microwave kinetic inductance detector arrays. Applied Physics Letters, 114(3), 2019.
  • [57] V Iaia, J Ku, A Ballard, CP Larson, E Yelton, CH Liu, S Patel, R McDermott, and BLT Plourde. Phonon downconversion to suppress correlated errors in superconducting qubits. Nature Communications, 13(1):6425, 2022.
  • [58] Xianchuang Pan, Yuxuan Zhou, Haolan Yuan, Lifu Nie, Weiwei Wei, Libo Zhang, Jian Li, Song Liu, Zhi Hao Jiang, Gianluigi Catelani, et al. Engineering superconducting qubits to reduce quasiparticles and charge noise. Nature Communications, 13(1):7196, 2022.
  • [59] Matt McEwen, Dvir Kafri, Z Chen, Juan Atalaya, KJ Satzinger, Chris Quintana, Paul Victor Klimov, Daniel Sank, C Gidney, AG Fowler, et al. Removing leakage-induced correlated errors in superconducting quantum error correction. Nature communications, 12(1):1761, 2021.
  • [60] Josu Etxezarreta Martinez, Patricio Fuentes, Pedro Crespo, and Javier Garcia-Frias. Time-varying quantum channel models for superconducting qubits. npj Quantum Information, 7(1):115, 2021.
  • [61] Oscar Higgott, Thomas C Bohdanowicz, Aleksander Kubica, Steven T Flammia, and Earl T Campbell. Improved decoding of circuit noise and fragile boundaries of tailored surface codes. Physical Review X, 13(3):031007, 2023.
  • [62] Austin G Fowler, D Sank, J Kelly, R Barends, and John M Martinis. Scalable extraction of error models from the output of error detection circuits. arXiv preprint arXiv:1405.1454, 2014.
  • [63] Austin G Fowler, Adam C Whiteside, and Lloyd CL Hollenberg. Towards practical classical processing for the surface code. Physical review letters, 108(18):180501, 2012.
  • [64] Oscar Higgott and Craig Gidney. Sparse blossom: correcting a million errors per core second with minimum-weight matching, 2023.
  • [65] Austin G Fowler. Optimal complexity correction of correlated errors in the surface code. arXiv preprint arXiv:1310.0863, 2013.
  • [66] Nicolas Delfosse and Jean-Pierre Tillich. A decoding algorithm for css codes using the x/z correlations. In 2014 IEEE International Symposium on Information Theory, pages 1071–1075. IEEE, 2014.
  • [67] Hanrui Wang, Pengyu Liu, Yilian Liu, Jiaqi Gu, Jonathan Baker, Frederic T. Chong, and Song Han. Dgr: Tackling drifted and correlated noise in quantum error correction via decoding graph re-weighting, 2023.
  • [68] Christophe Piveteau, David Sutter, Sergey Bravyi, Jay M Gambetta, and Kristan Temme. Error mitigation for universal gates on encoded qubits. Physical review letters, 127(20):200505, 2021.
  • [69] Kristan Temme, Sergey Bravyi, and Jay M Gambetta. Error mitigation for short-depth quantum circuits. Physical review letters, 119(18):180509, 2017.
  • [70] Sergey Bravyi, Sarah Sheldon, Abhinav Kandala, David C Mckay, and Jay M Gambetta. Mitigating measurement errors in multiqubit experiments. Physical Review A, 103(4):042605, 2021.
  • [71] Ashley M Stephens, Zachary WE Evans, Simon J Devitt, and Lloyd CL Hollenberg. Asymmetric quantum error correction via code conversion. Physical Review A, 77(6):062335, 2008.
  • [72] Charles D Hill, Austin G Fowler, David S Wang, and Lloyd CL Hollenberg. Fault-tolerant quantum error correction code conversion. Quantum Information & Computation, 13(5-6):439–451, 2013.
  • [73] Yongsoo Hwang, Byung-Soo Choi, Young-chai Ko, and Jun Heo. Fault-tolerant conversion between stabilizer codes by clifford operations. arXiv preprint arXiv:1511.02596, 2015.
  • [74] Héctor Bombín and Miguel Angel Martin-Delgado. Quantum measurements and gates by code deformation. Journal of Physics A: Mathematical and Theoretical, 42(9):095302, 2009.
  • [75] Kristina R Colladay and Erich J Mueller. Rewiring stabilizer codes. New Journal of Physics, 20(8):083030, 2018.
  • [76] Armands Strikis, Simon C Benjamin, and Benjamin J Brown. Quantum computing is scalable on a planar array of qubits with fabrication defects. Physical Review Applied, 19(6):064081, 2023.