Optimizing Graph Codes for Measurement-Based Loss Tolerance

Graph codes play an important role in photonic quantum technologies as they provide signiﬁcant protection against qubit loss, a dominant noise mechanism. Here, we develop methods to analyze and optimize measurement-based tolerance to qubit loss and computational errors for arbitrary graph codes. Using these tools we identify optimized codes with up to 12 qubits and asymptotically large modular constructions. The developed methods enable signiﬁcant beneﬁts for various photonic quantum technologies, as we illustrate with novel all-photonic quantum repeater states for quantum communication and high-threshold fusion-based schemes for fault-tolerant quantum computing.

Quantum information is fragile and its control can be easily impaired by dissipation in the physical environment.Quantum error correction (QEC) and fault tolerance aim at reducing the impact of noise, provided the physical error rate is below a certain threshold, enabling the control of quantum information in spite of physical imperfections [1][2][3].Optimizing codes to the specific platform used and targeting the native noise mechanisms and operations to reduce the operational overheads is key to make QEC practical for near-term and future quantum hardware.In photonics, the dominant noise mechanism is photon loss, which irreversibly erases the state of the associated physical qubit.Although photon loss is an error that can be directly detected, unlike conventional gate errors, it nevertheless poses stringent hardware requirements for practical applications.For example, current architectures for fault-tolerant photonic quantum computing need losses to be below a threshold of approximately 2% [4], very challenging for photonic setups.A possible modular approach to improve these requirements is to encode each computational qubit in a loss-tolerant code, as pictured in Fig. 1.The encoding and decoding are typically measurement-based, i.e., obtained by sequential destructive measurements on part of an entangled resource state to protect the remaining unmeasured components from errors-an approach particularly suitable for photonics [4,[7][8][9].As we show in this work, codes with moderate size, less than a few tens of qubits, can already provide significant measurement-based suppression of logical errors due to photon loss on encoded qubits.Previous proposals have considered various types of loss-tolerant codes, e.g., tree graph codes [6] [see Fig. 1(a)] and Bacon-Shor codes [10], whose code structures allow the loss tolerance to be readily analyzed.The use of these codes was proposed and investigated, for example, in the context of photonic measurement-based quantum communication [11][12][13][14] and computation [4,15].Identifying resource-efficient codes with high loss tolerance could bring significant practical benefits to these technologies.Here, we address this goal by developing methods to analyze the loss and error tolerance in general graph codes and use them to design and implement optimization techniques.We fully characterize measurement-based fault-tolerant properties and optimize graph codes with up to 12 qubits, and investigate generalizations to larger graphs with modular structures.We find optimized codes that can provide significant advantages in various photonic applications, including improved repeater graph states for quantum communication and fusion-based schemes for fault-tolerant photonic quantum computing with loss thresholds up to 10.5% using standard linear optical fusions.[5] and tree graphs [6].In this work we develop tools to analyze the loss tolerance for arbitrary graph codes.(b) Graph codes with improved performance can enable designing better modules for modular photonic applications, including computation or communication schemes.

A. Encoding a logical qubit
Graph codes, introduced in Ref. [16,17], are quantum codes with graph states as codewords, a class of quantum states that can be conveniently described in terms of graphs and graph transformations [8,18].The quantum state associated to an undirected and unweighted graph G = (V, E) with vertices V and edges E is where CZ i,j represents a controlled-Z operation between qubits i and j , and is represented by edge between the associated vertices.Graph states are stabilizer states [2] with stabilizer generators K i = X i k∈N i Z k , where i runs over the graph nodes and N i is the neighborhood of qubit i.
Throughout this work, we use X , Y, Z to indicate Pauli operators.The generators generate the Abelian group of stabilizer operators S = K j n j =1 , meaning that each stabilizer S ∈ S is a product of generators S = n i=1 K b i i , with b i ∈ {0, 1}.
A possible method to encode an arbitrary qubit state |ψ = α|0 + β|1 in an n-qubit graph code is pictured in Fig. 2(a).We initially prepare the n physical code qubits in a graph state |G and an additional input qubit in the target state |ψ = α|0 + β|1 .The logical encoding is then performed by applying controlled-Z operations between the input qubit and a subset B of the code qubits, and then measuring the input qubit in the X basis.As these operations are all in the Clifford group, we can track the stabilizers and logical operations on the state according to the usual stabilizer transformation rules [2], obtaining the n-qubit code in the logical state |ψ = α|0 + β|1 if the measurement outcome is +1, and Z|ψ on outcome −1.The bar will be used throughout to denote logical elements.Here |0 = |G and the logical operators are given by X = b∈B Z b and Z = K b 0 for some choice of b 0 ∈ B [see Fig. 2(c)].The updated code stabilizers are S = K b 0 K b , K b b∈B\b 0 ,b / ∈B , with K i the stabilizer generators of |G [8].As products of a logical operator with stabilizers also form valid logical operators of the code, we can write the set of all logical operators as L = (X , Z, Y = iX Z) • S. Note that an equivalent approach to encoding can be obtained by initializing the input qubit in |+ before applying the controlled-Z operations to the code qubits in B, and then measuring it in the qubit basis {|ψ * , |ψ * ⊥ } (which in general can be non-Clifford), as pictured in Fig. 2(b).Here we define |ψ * = α * |0 + β * |1 to be the complex conjugate of |ψ .In this way, the encoding can be described as starting from a fixed progenitor graph G = (V + {input}, E + ({input}, B)) with n + 1 nodes, and then measuring the input node in the targeted basis.This can be simply observed by writing the initial graph state as 2 with codewords and logical operators defined as above, for which projective measurement of the input qubit into |ψ * prepares the logical code state in the conjugate state |ψ , as desired.The two pictures are equivalent but, depending on the protocol under study, analyzing the encoding in the progenitor picture may be more convenient as it permits description of the encoding and decoding of a logical qubit entirely through the stabilizers of the progenitor graph.In fact, the stabilizer generators of the progenitor graph that act as X in and Z in on the input qubit are transformed in the logical operators X and Z of the code, respectively, upon measurement of the input.That is, X ↔ K in and Z ↔ K b 0 , where K i are the stabilizer generators of the progenitor graph G and b 0 ∈ B. Note that the encoding methods discussed above rely on physical operations on the input qubit, and could thus be noisy, as loss or error in the input physical qubit may correspond to logical errors.Therefore, while convenient analysis tools and potentially noise tolerant in specific implementations, they are not general prescriptions for fault-tolerant state preparation.

B. Measurement-based decoding
Measurement-based approaches process logical quantum information by only performing destructive singlequbit measurements on the code qubits and classical feed forward.In the context of QEC, the constraints imposed by , where computational qubits are encoded in graph codes and computational qubit measurements correspond to logical measurements on the graph codes.(e) Physical modularization of resource states, obtained substituting each computational qubits with a virtual qubit, the input of the associated graph code, to be measured in X .
operating a single destructive measurement per qubit add significant limitations with respect to repeatedly performing parity checks in circuit-based approaches.Namely, given a single-qubit measurement pattern M on the physical qubits, the only stabilizers that will be accessible are those that commute qubitwise with M , i.e., the stabilizers in with S the initial code stabilizers.Note that S M ⊆ S forms a stabilizer subgroup of S (Appendix E).Therefore, the effect of these constraints is effectively to induce a reduced code S M compatible qubitwise with the measurement M .This can also be regarded, more abstractly, as a gaugefixing procedure [20,21].Measurement-based decoding of gate errors, i.e., the inference of qubit errors from the measured syndromes, can then be performed equivalently as one would do in standard QEC by considering the reduced code S M induced by M .

C. Effects of qubit loss
The effect of qubit loss detected during measurements can be described similarly to the enforcement of a measurement pattern M described above.If a qubit is lost, all stabilizers and logical operators that act nontrivially on that qubit are no longer measurable.This enforces a qubitwise constraint similar but stronger to Eq. ( 2) as compatibility now requires an identity on a lost qubit rather than just a commuting operator.To maintain a concise notation when describing the effects of loss, we write M i = to indicate that qubit i was lost, and use the convention that [A, ] = 0 iff A = 1.With this notation, we can write the set of stabilizers S M compatible with M , which now includes also lost qubits, again exactly as Eq. ( 2).Also in this case S M is a stabilizer subgroup of the initial stabilizer group S; the presence of losses has the effect of reducing it further (see Appendix E for more details).However, qubit losses also pose constraints on logical operators of the code as they cannot have support on a lost qubit.These constraints can be included in a very similar way as for the stabilizers by writing the induced set of logical operators as again using the convention M i = if qubit i is lost.In the progenitor graph picture, the conditions in Eq. ( 3) can be conveniently included by directly applying Eq. ( 2) to the stabilizers of the progenitor graph.The main idea behind loss-tolerant measurement-based QEC is that, if losses are not excessive, the set L M remains nontrivial and S M contains enough stabilizers to protect the encoded logical state from errors.In general, the code performance depends on the chosen single-qubit measurement pattern M , as well as on the initial graph code.If losses are heralded, i.e., which qubits are lost is known before their measurement, the measurement pattern M can be conveniently optimized beforehand to achieve the best available S M and L M [22].However, losses are often unheralded: loss of a qubit is detected only upon its measurement and not before.This loss model is relevant to most quantum platforms (e.g., photonics), and we focus on it in this work.Finding initial graph codes and measurement strategies that provide good tolerance to unheralded loss is in general a complex task and is investigated in the next sections.

II. LOSS-TOLERANT LOGICAL MEASUREMENTS WITH GRAPH CODES
In measurement-based approaches, computational operations are implemented via single-qubit measurements.We start describing general methods to perform these measurements loss tolerantly when encoding each computational qubit into an arbitrary graph code, as depicted in Figs.

A. Loss-tolerant logical Pauli measurements
As stabilizers are based on the Pauli group, logical measurements in the Pauli bases are the simplest to analyze within the framework we describe: it corresponds to measuring a logical operator L ∈ {X , Y, Z}.In the progenitor picture, this can be seen as a nondestructive Pauli measurement on the input qubit without having to directly measure it, often referred to as an indirect measurement [6].Let us consider, for example, an indirect measurement of the X logical operator.In the presence of qubit loss, a measurement pattern M on the physical qubits successfully measures it if the set L[X ] M , obtained applying the condition in Eq. ( 3) to the set L[X ] of all possible logical X operators of the code, is nonempty.Equivalently, it means there exists a logical operator X ∈ L[X ] M that can be obtained from the single-qubit measurements performed in M and with no support on lost qubits (i.e., X i = 1 if M i = ).Identical conditions apply for Y and Z indirect measurements.A simple example is the indirect logical X measurement on star-graph codes, i.e., graph codes with a star-graph progenitor [see Fig. 3(a)].From the definitions in Sec.I, it is evident that a single-qubit operator X i on any code qubit i provides a valid logical Z operator, i.e., L[Z] = {X i } n i=1 .Therefore, choosing the measurement pattern M = i X i , if at least one code qubit is not lost then L[Z] M is nonempty and the logical operator is successfully measured.The probability of failing to measure Z, which we call logical loss, is thus [Z] = n where n is the number of physical code qubits and the qubit loss probability.Such strong robustness for Z measurements for the star graphs comes at the expense of weak performance for X and Y measurements.In fact, both X and Y are weight-n operators, meaning that all physical qubits need to exist to obtain a successful logical measurement, so In arbitrary graph codes, the optimality of a measurement pattern M on the remaining undetected qubits may depend on the losses detected on already-measured qubits.Therefore, given a graph code, an important task is now finding a decoding strategy that optimizes the probability to achieve a measurement pattern M providing a successful logical measurement.Specifically, while decoding in Considering n code qubits, for any of these graph structures the success probability to measure the associated logical operator is  the logical success probability in terms of the qubit loss by summing the conditional probabilities of all paths in the tree that end in a successful logical measurement, as exemplified in Fig. 4(c) for the pentagon code.More details on the algorithm and decoding procedures are described in Appendix A.
When testing the graphs in Fig. 3 we retrieve the expected loss tolerance with scaling = n , optimal for a single logical Pauli measurement.A more interesting problem is instead to find codes with good loss tolerance for any logical Pauli A ∈ {X , Y, Z} measurement, and as such we consider as our metric the worst-case logical loss rate, [Pauli] = min{ [X ], [Y], [Z]}.The fact that loss tolerance is invariant in locally equivalent graphs [18,23] (see Appendix D) allows us to make the optimization procedure more efficient, as we have to only analyze one representative graph state per local-equivalence class for a comprehensive analysis.Detailed categorization of graphstate equivalence classes have been performed for graphs with up to 12 qubits [24,25], which we use to carry out an exhaustive search of small-scale (up to n = 11 code qubits, i.e., progenitor graphs with 12 qubits) graph codes.We find that 12-qubit progenitor graph states can be analyzed typically in a few seconds on a standard laptop, but due to the large number of equivalence classes (>10 6 ) we take advantage of the high-performance computing cluster BlueCrystal at the University of Bristol.We identify the pentagon code, shown in Fig. 4(a), as the smallest code (n = 4) showing loss tolerance simultaneously for more than one logical Pauli measurement.For this graph we obtain the same logical success probability η = 2η 2 − η 4 for logical measurements of any Pauli operator, plotted in Fig. 4(b), where η = 1 − is the physical transmittivity and η = 1 − .When the physical loss is below * 38% loss tolerance begins to appear as the logical loss is lower than the physical one.This value is denoted the breakeven point, where the graph encoding outperforms the bare physical qubit, and is often similar but not necessarily equal to the code's loss threshold under concatenation, see Sec.IV.At low-loss rates ∼ 4 2 [see Fig. 4

(b) inset],
indicating the code is able to protect against the loss of any single qubit.We show in Figs.5(a)-5(c) the results of the optimization for progenitor graphs with up to 12 qubits.In Fig. 5(a) we report some of the graph states (see Appendix F for a complete list) we identify with optimized loss tolerance at loss values much smaller than the break-even point, where we are well within the subthreshold regime (i.e., optimizing at a physical loss level = 1%).The associated performances are plotted in Fig. 5(b).Break-even points up to 50% can already be achieved for these graph codes of moderate size.In some cases, further improvements can also be obtained considering graphs optimized at loss levels close to the break-even point (i.e., 30%, depending on the code size), represented by the dashed lines in Fig. 5(c), with the associated graph states reported in Appendix F. These two parameter regimes are found to well represent code performance and any improvements from optimizing at different loss values are found to be small.The tools presented here allow identification of optimized graphs tailored to the noise rates of the physical system.

B. Logical measurements in an arbitrary basis
In the measurement-based framework, Pauli measurements correspond to Clifford operations.In order to perform universal quantum computations, we also require measurements in an arbitrary basis on the Blochsphere equator A(θ ) = X cos(θ ) + Y sin(θ ) providing non-Clifford operations [26].In order to perform this operation loss tolerantly on a graph code, the idea we consider can be regarded as adaptive teleportation of the encoded state into a single code qubit preemptively measured in A(θ ).If we know from the start that a physical qubit is not lost, which we call the output qubit, then a sufficient condition for measuring A(θ ) on |ψ is to measure the other code qubits such that the encoded state is teleported onto the output qubit [22].However, we can also think of inverting the order of these operations: first attempt to measure A(θ ) out and then do the teleportation only if the output photon is successfully detected, and otherwise try again with a different output qubit [6].The two orderings provide the same outcome up to a feed-forward operation on the output.Care is hence required to account for the Pauli frame update imposed by the outcome of intermediate measurements.This may be done with classical postprocessing of measurement outcomes in some cases, in other cases more sophisticated correction circuits may need to be employed, for example, those discussed in Refs.[6,27].Procedures to perform arbitrary logical measurements can thus be obtained by adapting techniques for loss-tolerant teleportation in graph states to the case where the output is not a fixed qubit.In particular, Ref. [22] provides a sufficient condition for a measurement pattern M to teleport the encoded state to a fixed output qubit, called the stabilizer pathfinding conditions (SPCs).In terms of the constraints in Eq. ( 3), SPCs can be stated as follows: a measurement pattern M of local Pauli operators on code qubits not including the output (M out = 1) teleports the encoded state to the output qubit, up to a random but known local unitary U out ∈ {1, X , Y, Z}, if L M contains two anticommuting logical operators.For logical measurements, to this condition we need to add the successful initial measurement of the output in A(θ ) out .The SPC can be included in the decoder very similarly as in the Pauli measurement decoder discussed in the previous section (Algorithm 1).The main differences are as follows: (1) we now need to consider the set of all logical operators L, instead of a single logical Pauli, and (2) we require it to contain at least two anticommuting operators at the end, instead of just being nonempty.The approach is thus modified to a decoder structure as described in Algorithm 2, with more details reported in Appendix A.

Algorithm 2. Arbitrary measurement decoder
The loss tolerance of graph codes under arbitrary basis measurements is again preserved between locally equivalent graphs (see Appendix D), allowing for a streamlined optimization procedure.The smallest code displaying loss tolerance we identify is again the pentagon progenitor graph in Fig. 4(a).The logical success probability for arbitrary A measurement with this graph is η = 4η 3 − 3η 4 [see Fig. 4(b)].Loss tolerance is observed below a physical loss breakeven point of * ≈ 23%, and we observe a subthreshold scaling of the logical loss as approximately 6 2 indicating tolerance against the loss of any single code qubit.It can be noted, also comparing the behaviors in Fig. 4(b), that the loss-tolerance performance is worse than logical measurements of Pauli operators, as expected.In Fig. 4(d) we report, for various code sizes, the graphs we identify, which optimize the loss tolerance for arbitrary logical measurements in the subthreshold regime.Their logical loss behavior is shown in Fig. 4(e).We again observe improved loss tolerance for larger codes, and break-even points that are higher by a few percent when optimizing in this regime, as shown in Fig. 4(f).For the largest size explored, n = 11 code qubits (12-qubit progenitor graphs), we obtain a break-even point of * 40%.

III. MEASUREMENT-BASED ERROR CORRECTION IN LOSS-TOLERANT GRAPHS
Qubit errors arising from imperfect gates and measurements can also be simultaneously corrected with graph codes.Unlike photon loss, they cannot be directly detected, so need to be inferred using the code stabilizers S M and operators L M induced by the measurement pattern M , as described in Sec.I.
For logical Pauli measurements, measurement-based error correction corresponds to updating the Pauli frame, meaning that the correction can be done by postprocessing the logical measurement outcome.Specifically, after inferring an error E from a decoder, the outcome of L is flipped if the supports of E and L share an odd number of qubits (if no L exists due to losses, we consider it a logical error as well).For arbitrary logical measurements, the situation is similar but considers both logical operators (L, K) in a pair satisfying the SPCs, as described in Sec.II.Note, however, that in this case we cannot identify and correct errors on the physical A out (θ ) measurement of the output qubit, as that operation is outside the stabilized space (unless A out (θ ) is a Pauli measurement).Therefore, the logical error rate for arbitrary measurements cannot be smaller than the physical rate on the output qubit.This is related to the fact that in the measurement-based framework logical arbitrary measurements A out (θ ) correspond to arbitrary non-Clifford single-qubit operations, and stabilizer codes possess only a limited set of natively fault-tolerant gates [28,29].
To maintain generality for arbitrary graph codes, we implement error decoding via maximum likelihood, which is computationally viable for the moderate-size codes considered here, and consider a phenomenological error model of independent identically distributed (IID) Pauli errors on each qubit, corresponding to the depolarizing channel ρ → (1 − 3λ) ρ + λ (X ρX + YρY + ZρZ).More details on the decoding procedure can be found in Appendix A. The error correction is again invariant for locally equivalent graphs, up to permutations of the Pauli bases, which arise from local complementations on the progenitor graph, which effectively act as Clifford operations on the logical operators (see Appendix D).We can thus analyze individual graphs from local-equivalence classes to characterize codes of increasing size, now using models where errors and loss are simultaneously present.Considering indirect Pauli measurements, the smallest progenitor graph found to exhibit fault tolerance against both errors and losses is the cube graph, shown in Fig. 6(a), which generates a code locally equivalent to the seven-qubit Steane code [30].As shown in Fig. 6(b), when noises are individually present, it outperforms the bare qubit for losses below 50%, saturating the bound of the measurement complementarity principle [31], and for physical errors λ ≤ 3.2%.In Fig. 6(c) we plot the overall fault probability in the presence of loss and Pauli errors, where the fault probability is the probability of at least one error type occurring during measurement.In Fig. 6(d) we show the ratio between the logical and physical fault probabilities, where now a break-even curve can be observed and shows a remarkable robustness for this code.
As mentioned above, it is not possible to reduce logical errors below the single-qubit level for arbitrary basis measurements.Still, we find examples of graphs that saturate this linear bound at low error rates.For example, we show in Fig. 6(e) the decorated pentagon graph, which is loss tolerant for arbitrary measurements with a break-even point of 32% [see Fig. 6(f)] while simultaneously having logical error rates / → 1 as → 0.

IV. EXTENDING TO LARGER GRAPHS BY MODULARIZATION
To analyze the performance of larger codes efficiently, we consider two modular approaches: cascading and concatenating small unit graphs, which can be fully characterized using the previously described techniques.

A. Cascaded graphs
We define cascaded graphs as layered graphs constructed by recursively appending unit graphs to code qubits.In particular, by embedding each code qubit in the kth layer with a unit graph to which it is the input qubit, then the code qubits of all the added unit graphs represent the qubits in the (k + 1)th layer.This step can then be repeated to recursively build larger graphs in a modular approach, where the unit graphs used can also vary at different layers.Examples of cascaded graphs are shown in Figs.7(b) and 7(g).The inspiration for the cascaded graphs' construction comes from tree-graph codes [6], which can be seen as cascades of star graphs [see Fig. 3(a)], locally equivalent to Greenberger-Horne-Zeilinger (GHZ) states.Cascaded graphs are a generalization of tree-graph structures using arbitrary graphs as modules.
The structure of cascaded graphs is such that the analysis of their loss and error tolerance properties can be efficiently obtained once the performance of the small-size unit graphs is known.The idea is to consider the measurement patterns suggested on the top-layer graph, and modify them recursively when going to deeper layers.In fact, the cascaded structure allows us to leverage indirect measurements of qubits in upper layers via the measurement of qubits in deeper layers.For example, if a top-layer qubit is to be measured in the Z basis, it can equally be measured indirectly using qubits restricted to the second layer of the graph, so loss of the qubit can be tolerated.In fact, for any lost qubit at depth k of a cascaded structure, one can attempt to recover an indirect Z measurement by measuring depth k + 1 qubits.Measurements in non-Z bases, however, necessarily require additional indirect measurements of deeper qubits, as logical non-Z operators in the progenitor graph have always support on the code qubits  [the set B in Fig. 2(c)].Such measurements are effectively disentangling deeper layers, analogously as in tree graphs [6].The asymmetry between Z and non-Z bases can thus be attributed to the geometry of the stabilizers in the full graph; X -and Y-type stabilizers penetrate between layers, whereas Z-type stabilizers do not.
Using the properties described above, we can perform the decoding process for cascaded graphs recursively using only the properties of unit graphs at different layers in the cascade.We report such recursive functions, for decoding both losses and errors, in Appendix B 1. In Figs.7(c) and 7(d) (insets) we report an example of improved logical losses and error rates obtained by cascaded graph structures.Here the unit graph is taken to be the smallest graph we identified in Sec.III with tolerance to both loss and errors for logical Pauli measurements-the cube progenitor graph.

B. Concatenated graphs
Modular extensions of graph codes can also be performed via graph-code concatenation, where each code qubit is itself encoded in another code-a standard approach in QEC.Concatenation of graph codes can be described by simple graph operations and be used for constructing concatenated quantum codes of increasing size [32].A concatenated graph code can be also easily described starting from the cascaded construction of the previous section: it corresponds to considering every qubit in intermediate layers as virtual qubits measured in the X basis and with +1 outcome obtained.The measurementbased decoding procedures can also be performed similarly in a recursive fashion, with the only difference that now all measurements performed on intermediate layers are indirect and direct measurements are only performed on the qubits in the deepest layer (see Appendix B 2 for details).Note in fact that virtual qubits do not have to exist in practice and are only useful in describing the concatenated graph; only the lowest depth qubits are physical.We show examples of concatenated codes in an encoding is shown in Figs.7(b) and 7(g) for self-concatenations of the cube (Steane) and decorated pentagon graph codes.
In Figs.7(c)-7(e) we report the performance for concatenated cube graph codes in the presence of losses and errors, for up to 4 layers of concatenation when performing Pauli-basis measurements.We observe a threshold appearing for losses at 50%, saturating the bound set by the measurement complementarity principle (see Appendix C), and an error threshold of λ = 3.2%.Figures 7(h)-7(j) show equivalent plots but for arbitrary logical measurements concatenating the decorated pentagon graph.As the decoding procedure described above can easily incorporate the concatenation of different unit graphs at different layers, we can optimise the combination of unit graphs to obtain higher noise tolerance at various number of code qubits.In Fig. 8 we plot the results of such optimization for concatenated graphs at different loss levels, for both logical Pauli and arbitrary measurements.The optimization was performed by directly testing all combinations for up to four layers of unit graphs from the set of all loss-tolerant graphs we identified from the analysis in Sec.II.For comparison, we also report the performance of optimized tree graphs from Ref. [6].Already in the regime with few tens of qubits, we see orders of magnitude improvement in the logical loss of the optimized concatenated graphs against tree graphs for the tested physical transmission rates in the 0.7-0.95range.

V. LOGICAL GRAPH-STATE FUSIONS
The techniques described in previous sections for singlequbit logical measurements can also be used to analyze another key operation for photonic measurement-based approaches: fusion gates [4,34,35].Introduced in Ref. [34], they are probabilistic two-qubit entangling gates that can be implemented using simple linear-optical circuits, and have the effect of joining two photonic graph states with a destructive measurement on two photons, one from each graph.Standard fusion operations, implementable with simple linear circuits and no ancillary resources, succeed with a probability of 50% [34], which can be boosted by using ancillary photons [36][37][38].In particular, Ref. [36] shows that using 2 m − 2 entangled ancillary photons it is FIG.8. Resource scaling for optimized concatenated graph codes for logical Pauli (blue) and arbitrary A(α) (red) measurements, compared with the performance of optimized tree graphs (dashed black) from Ref. [33].For tree graphs, the worst-case logical loss rate of a Pauli measurement (Y basis) is the same as for A(α).Semitransparent points correspond to logical losses for all the combinations of concatenated graphs tested in the optimization procedure, and solid lines correspond to the optimized scaling from the best concatenation configurations obtained.The numerical scaling data, which considers exclusively losses, is reported for different values of the per-photon transmission η.Note the scale for all plots is log versus loglog.
possible to achieve a success probability (1 − p fail )η 1/p fail , where p fail = 2 −m is the probability of gate failure and η is the transmission.In operator terms, a successful fusion measurement retrieves two parity measurements for the operators XX and ZZ.If the gate fails, only one of the two outcomes is available, and single-photon operations can be used to choose it to be ZZ or XX , while the other outcome is erased.If either of the qubits is lost, the gate fails completely and neither operator is recovered.The two mechanisms of qubit loss and gate failure are thus inequivalent and with different consequences for the growth of clusters.Graph codes can be used to make the fusion of the encoded logical qubits robust against both mechanisms [4,[39][40][41][42].A logical fusion of two encoded qubits is a measurement providing joint parity checks X X and ZZ.In contrast to logical single-qubit measurements, this operation requires physical fusion gates between qubits from the two codes, i.e., physical fusion gates.Nevertheless, as we show, these can be readily included with the techniques developed in previous sections.We consider two different strategies for it, as illustrated in Fig. 9(a) and described below.The probability of logical fusion p succ is plotted for the adaptive (solid lines) and transversal (dashed) approaches, for varying code sizes.Standard physical fusions with 50% success probability are considered between physical qubits.For comparison, we also report the optimal performance of boosted fusion measurements (black dotted line) using 2 m−1 ancilla qubits for m ≤ 8.

A. Transversal physical fusions
Considering two identical graphs encoding the logical qubits to be fused, we first consider a ballistic method where physical fusions are attempted transversally between all code qubits in one graph and the equivalent qubits in the other, as shown in Fig. 9(a).Each physical fusion can be successful, fail, or be erased due to loss of one of the photons with respective probabilities η 1/p fail (1 − p fail ), η 1/p fail p fail , and 1 − η 1/p fail .Once all transversal fusions are performed, the logical fusion is successful if the obtained operators can generate both X X and ZZ, fails if only one of them can be generated, or is completely lost if neither of them can.We numerically calculate the probability for each of these three logical outcomes by considering all possible combinations of the three outcomes from fusing all n pairs of code qubits in the graphs.The total logical fusion success probability is obtained by summing the probability associated to all combinations that lead to a successful fusion, and similarly for the logical failure and logical loss probability.We allow the measurement recovered on physical fusion failure to be chosen independently for each qubit, which is precompiled using maximum likelihood before runtime to maximize the probability of successful fusion.We report in Fig. 9(b) results for logical transversal fusion on the graphs optimized at subthreshold loss rates for arbitrary single-qubit measurements up to n = 9 [see Fig. 5(d)].Despite the approach being nonadaptive, these small codes present success probabilities that significantly outperform typical boosted fusion schemes, which we also report in the black dashed curve, in terms of loss tolerance.For example, using standard physical fusions with 50% success probability, we obtain logical fusion measurements with success probability p succ > 0.8 for physical loss = 5% and p succ > 0.95 at = 1%.

B. Adaptive physical fusions
A second approach we investigate for logical fusions is an adaptive strategy based on the ideas introduced for performing logical arbitrary basis measurements in Sec.II B. Recall that the SPC identifies pairs of logical operators that anticommute on a single qubit [22], which we denote as output qubit.Taking two copies of a graph code, a logical fusion can be achieved by fusing an identified output qubit with the corresponding qubit in the other graph, followed by single-qubit measurements on the remaining qubits.The decoder for adaptive fusion is similar to that presented in Algorithm 2: the idea, in the progenitor graph picture, is to teleport the virtual input qubits of the two codes into some output qubits, which have been prefused together.Explicitly, a physical fusion measurement is attempted between pairs of output qubits, and once a fusion is successful single-qubit Pauli measurements are attempted sequentially on the remaining qubits of each code, effectively implementing a separate decoder as in Algorithm 2 for each graph.This approach leads to improved loss tolerance compared to the transversal case as, when performing single-qubit measurements, the loss of either qubit in a pair does not erase the information obtainable from the other.The use of single-qubit measurements to increase the loss tolerance of logical fusions has been suggested for tree graphs [42], here we extend to general graphs.
In Fig. 9 we report the performance of the adaptive strategy using the graphs identified in Sec.II B, which are optimized for arbitrary single-qubit measurements up to n = 9 [see Fig. 5(d)].It can be observed that the adaptive strategy generally provides better performance compared to the transversal one and boosted fusions.For example, using standard physical fusions with 50% success probability, we can reach logical fusion success probabilities of p succ = 0.86 already at a physical loss of = 10%, and p succ > 0.99 at = 1%.

VI. APPLICATIONS
To benchmark the tools we develop for analyzing and optimizing general loss-tolerant graph codes, we investigate how they can be used in two exemplary applications.

A. Optimizing repeater graphs
Repeater graph states (RGSs) have been introduced in Ref. [11] as an approach to making all-optical two-way quantum repeaters in a quantum network.The graph structure originally proposed is shown in Fig. 10(a), and the repeater protocol works by transversely fusing the leftward leaf (i.e., single-edged) qubits from a repeater station with the right-ward leaf qubits from the previous station.The inner qubits are measured in X if the associated leaf is the first to be successfully fused, or otherwise in Z to remove unsuccessful or redundant fusions [11].
This protocol can also be interpreted as sequences of logical fusion operations described in Sec.V, and can be readily analyzed in the progenitor graph picture as depicted in Fig. 10(b).The left-ward and right-ward qubits each correspond to physical qubits in a graph code encoding a single logical qubit.Entanglement swapping between successive repeater stations simply corresponds to a logical fusion operation using the right-ward and left-ward codes.Within the repeater graph, the transmission of the logical information between the left-ward and right-ward codes can be simply described, again using the progenitor graph picture, as adding a link (i.e., a controlled-phase gate) between the input qubits of the left-ward and rightward codes and then measuring both of them in X to transmit the encoded logical qubit between left and right [6].In practice, the inputs are just treated as virtual qubits, and we directly consider the total repeater graph, i.e., the graph obtained after the controlled-phase and the X measurements are performed.The probability to successfully transmit between two consecutive stations thus simply corresponds to the logical fusion success probability of the underlying code as analyzed in Sec.V.
For the repeater graph considered in Ref. [11], it is easy to see that, up to local operations [43], it corresponds to using tree-graph codes with a branching ratio [N /2, 1] as both left-ward and right-ward codes [see Fig. 10(b)], with N the branching of the repeater graph [11].However, as discussed in the previous sections, tree codes are suboptimal for loss tolerance, and better performance can be obtained using codes optimized for logical fusion success probability.Using the construction presented above, we show in Fig. 10(c) the repeater graphs obtained from two optimized codes for logical fusion with n = 4 (the pentagon graph) and n = 8.The metric used in this optimization is the total success probability of the logical fusion, i.e., the probability to obtain both XX and ZZ.Their performance with adaptive fusion strategies is reported in Fig. 10(d), in which we also show for comparison the performance of standard RGSs.We see that comparable link generation probability can be achieved using general graph states with vastly fewer physical qubits, compared to traditional tree-based encodings, showing that our tools can bring significant improvements in the design of all-optical repeater schemes.

B. Fusion-based fault-tolerant schemes
Fusion-based quantum computation (FBQC) is a variant of measurement-based quantum computing where the computation is performed via probabilistic fusion gates between separate resource states rather than single-qubit measurements on large entangled cluster states [4].It has been recently introduced as a convenient picture to describe photonic quantum computation as it facilitates a direct description of probabilistic fault-tolerant architectures fusing small resource states, enabling a simple treatment of failed fusion operations and qubit loss.However, in the constructions from the original proposals [4], the per-photon loss thresholds are limited to <1%, also requiring highly boosted fusions.To improve them, concatenating qubits with a (2,2) Shor code was proposed, whereby a loss-tolerance threshold of 2.7% per photon is achieved for boosted physical fusions with 75% success probability.To obtain better performances, we can use the techniques developed in previous sections to consider concatenating resource states with more general graph codes, as shown in Figs.11(a) and 11(b).
In FBQC, the XX and ZZ parity measurement outcomes obtained from qubit fusions are used to construct the primal and dual syndrome graphs of a RHG lattice.The probability of logical error of the topological qubit depends on the probability that XX and ZZ measurement outcomes are erased.A difference with the logical fusion analyses performed in previous sections is that now we need to differentiate an unsuccessful fusion due to gate failure, where only one of XX and ZZ is erased, with the unsuccessful case due to the loss, where both outcomes are erased.In fact, randomizing the erased outcome in failed cases as in Ref. [4], which for general graph codes can be done via local Clifford operations, a failed fusion still has 50% chance to provide the outcome required for either the primal or dual syndrome graph.Therefore, in unsuccessful cases, we seek to enhance logical failure instead of logical loss, leading to a different optimization strategy.
To focus on a specific architecture, we consider the fault-tolerant fusion network constructed from fusing six-qubit hexagonal resource states from Ref. [4] [see Fig. 11(a)], which has the highest measurement erasure threshold amongst the reported FBQC schemes, i.e., 12%.The loss threshold per photon is then the threshold at which X X and ZZ erasure probabilities are simultaneously suppressed below 12%.Such thresholds in general also depend on the failure rate of the physical fusions employed, as boosting the success probability of the gate requires an increasing number of ancillary photons, none of which are permitted to be lost.It is therefore important to consider the trade-off between fusion failure rates and loss tolerance.These trade-offs result in concave curves for loss thresholds as a function of physical failure rates [4], as the ones shown in Fig. 11(c).In our analysis we optimize graphs considering only standard physical fusion gates, i.e., with 50% success probability, but for completeness we report the performance also for boosted cases.By parallelizing the optimization procedure using the Blue-Crystal high-performance computing cluster, we optimize for graph states with up to n = 10 (i.e., 11-qubit progenitor graphs), considering both transversal and adaptive fusions.The identified graphs, chosen to maximize the resultant loss-tolerance threshold, are shown in Appendix F, provide the loss thresholds reported in Fig. 11(c).For the adaptive approach, the thresholds reach 10.5% for qubit graph codes with n = 10, considering nonboosted physical fusions, and 4.9% for the transversal approach.

VII. DISCUSSION
We have shown how developing methods to analyze the measurement-based loss tolerance, as well as errorcorrection properties, for arbitrary graph states can provide logical qubits with significantly higher noise tolerance and fewer physical qubits.This is observed both for modules with 10 qubits and in the asymptotic regime where orders of magnitude improvements are observed with respect to tree graphs.An immediate implication of these results is to show that most of the graph modules currently considered in various photonic-based applications, such as tree-based encodings for one-way and two-way quantum repeater protocols [11][12][13]44] and Bacon-Shor codes for logical fusions in FBQC architectures [4], are suboptimal.Significant improvements can be obtained by using graphs optimized for the targeted functionality.We illustrate these advantages for a few applications in Sec.VI, but expect it to be relevant to improve a large part of photonic quantum applications based on graph states.To this scope, we make the Python code utilized for all the analysis in this work freely accessible [45].As an example, the per-photon-loss threshold of 10.5% for fault-tolerant FBQC, obtained considering only standard nonboosted fusion gates, is a significant improvement with respect to the previous 2.7% value with boosted fusions from Ref. [4], potentially bringing fault tolerance much closer to the capabilities of near-term photonic hardware.Moreover, this threshold is obtained considering the fusion network construction from Ref. [4] based on fusing six-qubit hexagons as resource states, and we expect it to improve further by developing fusion networks with higher tolerance to fusion erasure [46].
Technologies that are in principle well suited for the generation of graph codes include all-optical approaches, which when equipped with feed-forward and multiplexing could generate graph resource states deterministically [34,35,47], and approaches based on quantum emitters, where photonic entanglement can be directly generated via spin-photon interfaces [48][49][50].In particular, high-fidelity spin-photon systems have been recently developed in a variety of platforms, including quantum dots, superconducting circuits, atoms in optical cavities, and N-V centers [51][52][53][54][55][56][57], with demonstrations of deterministic generation of graph states with up to 14 photons [57].
The tools developed here allowed us to identify losstolerant graph codes with minimal requirement in terms of the number of qubits, and can be readily adapted to incorporate hardware-specific restrictions and error models.We expect such capabilities to be significantly valuable in developing near-term experiments targeting loss tolerance in the photonic platform.Such demonstrations will provide truly loss-tolerant photonic qubits, a milestone yet to be achieved that promise to unlock important opportunities for scaling photonic quantum technologies.

APPENDIX A: DECODERS 1. Loss-only decoding
The decoding strategy for arbitrary basis measurements on graph codes implemented in this work is outlined in Algorithm 2, with small modifications to that algorithm for Pauli basis or fusion measurements.The general strategy is as follows.Firstly, all possible measurement are initialized.For the case of Pauli measurements, this is simply the set of logical operators L, whereas for A(θ ) or fusion measurements, it is an operator satisfying the SPC [22] on the progenitor graph for any choice of output qubit, combined with physical A(θ ) or fusion measurements on that qubit.Inspired by Ref. [22] we construct measurements from only nontrivial stabilizers and logical operators, i.e., those which cannot be decomposed into a smaller weight operator multiplied by a stabilizer with nonoverlapping support, reducing the number of operators to consider.Then the optimal first measurement is determined according to a cost function-typically by choosing the measurement with the lowest weight, and selecting a random qubit from its support.On attempting the measurement, the outcome is recorded (±1 or null for a lost qubit), as well as the attempted basis.Now the set of available measurements is updated in response to the outcome, according to Eq. (2).These three steps are repeated until a measurement has succeeded or no possible strategies remain.Performing this search for every configuration of lost qubits constitutes building a decision tree for the decoder offline so that real-time decoding is simply a look-up table, which is queried up to n times during measurement of an n-qubit graph code.The tree is built using a depth-first search, and the termination conditions of the decoder mean that not all loss configurations need be examined.Every leaf of the tree is an outcome of the decoding procedure, with an associated set of measured qubits A, lost qubits B, and an outcome ∈ {success, fail}.If we call the set of successful leaves as Q, the probability of a successful measurement for the graph state G is This gives us analytic expressions for the effective transmission rates for various basis measurements on qubits encoded in graph codes.

Loss and unitary errors
At a qubit level, mitigation of unitary errors is done by measurement of code qubits remaining after the target measurement has been completed-these are additional resources that we leverage to gain more information about the target measurement outcome.The decoder is accordingly adapted such that we no longer terminate after the loss-only decoder is finished, but instead determine which additional stabilizer measurements can be implemented to check the obtained outcome.When the optimal check measurements have been identified, they are attempted in succession, and as before after each the strategy is updated according to its success or failure.This effectively extends the decision tree, reflecting the increased computational overhead of simultaneous error and loss correction.
Choosing optimal check measurements is a nontrivial task.From the set of remaining valid stabilizers, a set of valid check operators must commute qubitwise with one another, and with the set of measurements already performed.To choose a check set, we use heuristic methods, and pick the largest qubitwise commuting set with the greatest overlap with the target measurement.It should be noticed that this is not necessarily optimal.
The error-tolerant performance of this approach is determined numerically.For each successful leaf of the decision tree, there is an associated target measurement, and a (possibly empty) set of check measurements.As detailed in the main text, we consider the phenomenological noise model, in which Pauli operators are randomly applied to each code qubit with probability λ.This may result in flipped measurement outcomes, which is a logical error on the measurement.To find the probability of a logical error, we consider all configurations of measurement error on all code qubits, which are binary strings of length n, denoted e.Their probability is calculated, for the phenomenological model the probability of a flipped Pauli-basis measurement is Pauli = 2λ, as there are two anticommuting Pauli errors, and for an arbitrary basis measurement A = 3λ, so P e = n i=1 e i i (1 − i ) (1⊕e i ) .The syndrome is found from the outcomes of the check measurements, Synd(e) = {π(e C j )}, where j indexes the j th check operator, and π(x) denotes the parity of the string x.We also determine whether a logical error occurred on the target measurement, from the parity of e on the target measurement.From this, we can find the most probable error P max on the target given a particular syndrome, and so given a particular syndrome (which occurs with known probability) we correct for the most likely error pattern, succeeding with probability P max .Summing over all syndromes gives the total error rate.This process needs to be done for each successful leaf of the decision tree, as the target and check measurements will differ, with the overall performance of the graph being the logical error probability for each leaf weighted by the probability of obtaining that configuration [Eq.(A1)].Note that for logical arbitrary basis measurements we need to know the signs of two measurements to correctly decode the result, adding additional difficulty to the decoding process.Again, the computationally expensive parts of this decoding can be done offline, resulting in look-up table runtime costs.

Cascaded graphs
Suppose we want to implement a local Pauli measurement pattern M on a graph G, in order to implement either an indirect Pauli measurement or a SPF-based teleportation strategy.How do the required measurements change when another graph is appended to each qubit of G (except the input)?The strategies outlined in this work are constructed from stabilizers, so we can consider how stabilizers from G U are modified by moving to the cascaded graph.By decomposing the stabilizer into products of generators as outlined in Sec.I A, we see that if b t = 0, the modified measurement on the cascaded graph can have no weight on G L , as G L is only adjacent to qubit t. b t = 0 additionally implies M [t] = Z or 1, so Z measurements do not need to be modified when switching to the cascaded graph.This is intuitive from the graphical perspective as well, the Z t measurement deletes that vertex from the graph, and G L is disconnected from G U .For the same reasons, indirect Z t measurements, denoted Z (ind) t , can be performed by measuring qubits in G L only, leading to the improved loss tolerance of cascaded graphs.If instead b t = 1 and M [t] = X or Y, the corresponding stabilizer in the cascaded graph penetrates in to G L .The measurement pattern on the graph G L is j ∈N (t) Z j , an indirect X measurement on qubit t.Any X measurement on an intermediate layer code qubit therefore requires an additional indirect X basis measurement on deeper qubits, to disentangle them from the graph.This can be multiplied by any stabilizer of G L + t that does not include the generator K t (G L + t), the generator corresponding to qubit t in the graph (G L + t), to ensure the measurements in G U are unaffected.If we multiply by an odd number of stabilizer generators in the neighborhood of t, this alters the required measurement on qubit t.For an arbitrary basis measurement, we can derive the measurement update rules by inspecting the changes to the stabilizers involved in constructing the measurement pattern (as outlined in Sec.II B).At least one of these stabilizers will include the generator of the output qubit, so in cascading this generator is modified as for X or Y measurements outlined above.These updates are then given by Eq. (B1).
where Ã represents a modified basis.For the cases of X , Y, and A the two options are incompatible, so one must choose which to attempt in advance.It is clear to see that both the direct and indirect measurements must succeed for one of these measurements to be successfully performed.The probability of successfully measuring a qubit in basis where F(r (k+1) ; G k , M ) gives the probability of successfully performing a logical M basis measurement as a function r A } on graph G k at depth k in the cascade.η is the physical transmission probability.This function can be calculated analytically by considering the small unit graphs that make up the cascade.For a Z-basis measurement, the two options in Eq. (B1) are compatible, so we can try both.The logical transmission is then calculated via

Concatenated graphs
In concatenated graphs the picture is similar, except now every every "bottleneck" qubit is a virtual qubit-it has already been measured in the X basis, and the +1 outcomes obtained.The only measurement patterns than can be kept are then those compatible with X t measurements (using the same naming conventions as in Fig. 12).For Pauli-basis measurements, these are simply read off from Eq. (B1).For the arbitrary basis measurement the situation is slightly different, as now we choose an output qubit in the deepest layer of the concatenation.As described in the main text, we can think of this as teleporting to a depth k qubit, and then instead of measuring it in the arbitrary basis, teleporting it deeper into the concatenation via the already performed X measurement of the virtual bottleneck qubits.Hence one can think of measuring the virtual qubit in an arbitrary basis by performing a teleportation measurement pattern on the qubits in the k + 1th layer.
It can be seen directly from these expressions that the effective transmission parameters for virtual qubits at depth k is simply the probability of performing indirect measurements on qubits in the layer below, so can be recursively calculated according to the expression This form enables us to recover true loss-tolerance thresholds for MBQEC under code concatenation if the F are the same for all measurements in the target pattern.This is seen in the Steane code thresholds for MBQEC Paulibasis measurements discussed in the main text, where In Fig. 13 we compare cascaded and concatenated performance for an exemplary graph, here chosen to be the smallest progenitor graph with loss tolerance for arbitrary basis measurements-the pentagon graph.Both methods suppress logical error rates, but we see that the concatenated graphs have lower loss rates and fewer code qubits.In this work we have not considered how to physically realize these modular code constructions-it may be that the concatenated approach suffers from greater overhead during the preparation stage.This would be an interesting and useful avenue for further investigations.

APPENDIX C: MEASUREMENT COMPLEMENTARITY PRINCIPLE
By the uncertainty principle, one cannot perform measurements in different bases on a single qubit simultaneously, which has implications for the losstolerance thresholds of quantum codes, in particular that the thresholds may not exceed 50%.Consider an [[n, 1, d]] stabilizer code, with stabilizer group S and logical operators X , Z.If there exists a bipartition of the physical qubits into sets A 1 , A 2 such that there exist logical operators whose support is restricted to each set (X ) ⊆ A 1 and (Z) ⊆ A 2 , the two logical operators would be simultaneously measurable, violating the uncertainty principle.This shows that every pair of logical operators shares support on at least one qubit, (X ) ∩ (Z) = ∅.One could imagine losing the set A 2 of physical qubits to a third party.If either party is able to perform a measurement using only their qubits, the above argument necessitates that the other party can only recover the same measurement on their set.To relate this to loss thresholds, we need to distinguish between the break-even point and the threshold.The break-even point refers to the point at which ( b ) = b for a given code, whereas the threshold l * denotes the loss below which code concatenation increases the probability of measurement success.Given a deep concatenation, the success probability in the subthreshold regime approaches 1.The above argument places no restriction on the break-even point of the codes, but requires that for any two different measurements P and Q, the loss-tolerance thresholds must satisfy * [P] + * [Q] ≤ 1-referred to as the measurement complementarity principle.Hence, the threshold for arbitrary basis measurements cannot exceed 50%.This is an analogous restriction to the gate complementarity principle [31], which applies to the probability of successfully performing logical gates.

APPENDIX D: LOCAL CLIFFORD EQUIVALENCE
In this work we consider codes up to local Clifford operations, such that if two codes can be transformed in to each other by local Clifford operations they are deemed equivalent.When searching for optimal loss-tolerant codes we utilize the fact that the loss tolerance of a graph code using the decoders implemented here is invariant under these operations.This is seen by examining how graph codes are modified under local complementation, a graph transformation, which inverts the neighborhood of a particular node.Local complementation on a node α of a graph is equivalent to application of the following local unitary [18,23] to the graph state.
where N α denotes the neighborhood of qubit α.Consider two graph states related via local complementation |G (2) = U LC α |G (1) .These are the progenitor graphs of two locally equivalent graph codes.We show here that the loss tolerance of these graph codes is identical.Upon conjugation with U LC α the Pauli operators of a qubit q in the graph transform as This transformation can be used to readily verify the stabilizer generators of G (1) transform in to the generators of G (2) .The loss tolerance of G (1) under logical measurements in an arbitrary basis is determined by the set of valid measurement patterns M = {M }, where M = S (1)  1 ∪ S (1)  2 , such that the two stabilizers anticommute on the input and output, and commute on all other qubits.Each stabilizer transforms under local complementation according to the above table, such that the qubit support is invariant, and any pair of operators, which are (anti)commuting on a particular qubit remain (anti)commuting on that qubit.This means S (2)  1 ∪ S (2)  2 is a valid measurement pattern on G (2) , where S (2)  j = U LC α S (1)  j (U LC α ) † , and there is a bijective relation between measurements that perform measurementbased teleportation on graph states.Furthermore, two measurement patterns that were initially compatible remain so, and the success probability is thus conserved.
In general, a local Clifford operation preserves the bitwise commutativity of two Pauli operators, and the compatibility of two measurement patterns is determined by their bitwise commutation properties, so this argument applies similarly to measurements in Pauli bases, and to logical Fusion measurements.For Pauli basis measurements, a local complementation of the progenitor graph may transform a logical Pauli operator in to a different logical Pauli, indeed the locally equivalent graphs depicted in Fig. 3 perform differently to one another in each basis.However, the success probability will be conserved when averaging over Pauli bases, as all logical Paulis that are the same type in one graph will also be the same type in the locally equivalent sibling.The caveat to this invariance is in the decoder implementation.The decoder may make arbitrary choices between equally "good" measurement strategies, biasing the probability of performing measurements in particular bases.A decoder based on heuristic methods may therefore not choose corresponding strategies in locally equivalent graphs, so while their optimal loss tolerance is the same, their performance could vary in practice.

APPENDIX E: STABILIZED SPACES UNDER MEASUREMENT AND LOSS
Consider a stabilizer code with stabilizer S and logical operators X and Z. Suppose we perform a measurement M ∈ P n on the qubits in the code.The reduced stabilizer group is given by S M = {S ∈ S | [S [i] , M [i] ] = 0}.For any two stabilizers S 1 , S 2 in the reduced group, their product S 3 = S 1 S 2 is also in the group.From the requirement that [S [i] , M [i] ] = 0, we obtain that S [i] = M [i] or 1.The product S [i] 1 S [i] 2 = M [i] or 1 from the properties of Pauli operators, and we obtain the commutation relations of S 3 , [S 2 , M [i] ] = 0 The product element S 3 is therefore in the group, and it is closed.The identity element trivially remains in the group, and −1 cannot be added to the group by discarding elements, so the reduced set S M forms a stabilizer group.The effect of loss is similar, except for now we retain only stabilizers that act trivially on the lost set, i.e., if M [i] = , [S [i] , M [i] ] ⇐⇒ S [i] = 1.From this it is straightforward to see, by using the same argument as above, that the restricted set of stabilizers satisfying this condition form a stabilizer group.
FIG. 1. (a)Graph codes can encode quantum information with inherent robustness to qubit loss.Example of loss-tolerant graphs include the Raussendorf lattice[5] and tree graphs[6].In this work we develop tools to analyze the loss tolerance for arbitrary graph codes.(b) Graph codes with improved performance can enable designing better modules for modular photonic applications, including computation or communication schemes.

FIG. 2 .
FIG. 2. Encoding in graph states.(a) State injection picture, where the logical state is encoded by preparing it on an ancilla qubit, followed by entangling operations and an X measurement on the ancilla.(b) Progenitor picture, where the same encoding is performed measuring the input qubit of the progenitor graph in the targeted state.(c) The prepared graph code in the logical state |ψ , and associated codewords.Loop edges represent Z Pauli operations on the associated qubits [19].(d) Modular schemes for measurementbased operations, where computational qubits are encoded in graph codes and computational qubit measurements correspond to logical measurements on the graph codes.(e) Physical modularization of resource states, obtained substituting each computational qubits with a virtual qubit, the input of the associated graph code, to be measured in X .

FIG. 3 .
FIG. 3. Optimal graphs for individual logical Pauli measurements.(a) Star graph providing optimal loss tolerance for measuring Z, (b) branched star graph for X , and (c) star graph for Y. Considering n code qubits, for any of these graph structures the success probability to measure the associated logical operator is 1 − n , although for the remaining two logical Pauli operators it decreases exponentially as (1 − ) n , with the physical loss rate.

FIG. 4 .
FIG.4.Loss-tolerant logical measurements with the pentagon graph.(a) Progenitor graph for the pentagon code, with its two logical operators and the list of stabilizer generators.(b) Performance of the pentagon code for all logical Pauli measurements (red) and logical measurements in an arbitrary basis (blue).Physical loss is shown as a dotted black line, with break-even points obtained at 38% and 23% for Pauli and arbitrary measurements, respectively.(c) Exemplary decision tree for decoding an arbitrary measurement on the pentagon graph tolerating the loss of any single qubit.Green arrows represent successful qubit measurements, red arrows represent loss of the measured qubits.At each measurement, the number of valid measurement strategies remaining is reduced.

FIG. 5 .
FIG. 5. Optimized graph codes for loss-tolerant measurements.(a) Progenitor graphs of the graph codes optimized for Pauli-basis measurements in the subthreshold regime for different code sizes, with the associated performance shown in (b).Each graph is a representative with minimum edge number in its local-equivalence class.(c) Comparison of near-break-even performance for graphs optimized for their loss break-even point (dashed lines) and the subthreshold-optimized graphs (solid lines).(d)-(f) Analogous plots for arbitrary basis measurements.

FIG. 6 .
FIG. 6. Simultaneous correction of loss and errors on graph codes.(a) The cube graph is the smallest progenitor graph able to perform logical measurements in all Pauli bases correcting simultaneously losses and errors.(b) Logical error probability for each noise type in isolation, and (c) when both are simultaneously present.(d) Ratio of encoded to bare error rates, highlighting the region (in red) where error suppression occurs.(e)-(h) Analogous plots for arbitrary basis measurements.The smallest graph able to correct losses and to saturate the scaling / → 1 at low error rates is the decorated pentagon graph.

FIG. 7 .
FIG. 7. Performance of cascaded and concatenated codes.(a) Modular construction using the cube graph code, and (b) the resulting progenitor graph state with two layers.The qubits in layer 1, shown in purple, are physical for the cascaded construction, and virtual X -measured qubits for the concatenated one.(c) Loss-tolerance performance, considering a loss-only noise model, for logical Pauli measurements self-concatenating the cube graph code at different layers, showing a threshold at 50% loss.The performance for equivalent cascaded constructions is shown in the inset.(d) Performance for error tolerance, with an IID error-only model, showing a threshold at λ 3.2% (e) Overall fault probability in the presence of both noise types for concatenations of up to depth 4, showing the emergence of a threshold curve.(e)-(j) Equivalent plots for the decorated pentagon code for arbitrary basis measurements.

FIG. 9 .
FIG.9.Logical fusion measurements.(a) Two approaches to perform logical fusion operations are to perform physical fusion transversally in a ballistic manner (top), or using an adaptive strategy requiring only a single successful physical fusion and with single-qubit measurements on the remaining qubits (bottom).(b) The probability of logical fusion p succ is plotted for the adaptive (solid lines) and transversal (dashed) approaches, for varying code sizes.Standard physical fusions with 50% success probability are considered between physical qubits.For comparison, we also report the optimal performance of boosted fusion measurements (black dotted line) using 2 m−1 ancilla qubits for m ≤ 8.

FIG. 10 .
FIG. 10.Generalized repeater graph states.(a) Operation of the N = 3 repeater graph state (RGS, in the yellow box) introduced in Ref. [11].Single-qubit Pauli and fusion measurements are performed on qubits to fuse each RGS with its neighbors at consecutive repeater stations (red boxes).(b) The progenitor graph construction of RGSs, where logical fusions are performed at each repeater station between progenitor graphs whose input qubits have been joined via a controlled-phase gate.(c) Generalization of RGS states constructed from loss-tolerant graph codes with n = 4 and n = 8 code qubits.(d) Link success probability as a function of the physical loss rate for graph codes with adaptive nonboosted physical fusions (solid lines), with varying numbers of code qubits, against an instance of the RGS construction with 90 physical qubits (n = 45), shown inset.The yellow qubits are logically encoded in a tree graph with branching ratios [4, 1].

FIG. 11 .
FIG. 11.Fusion-based fault tolerance.(a) Construction of a fault-tolerant fusion network for FBQC via fusing six-qubit hexagonal resource state, from Ref. [4].(b) Concatenation of the fusion network with graph codes to enable logical fusions tolerant to loss and failure.(c)Per-photon loss-tolerance thresholds for concatenations with optimized graph codes of varying sizes, using the adaptive decoding strategy (solid lines) and the transversal strategy (dashed).The performance of the (2,2) Shor encoding presented in Ref.[4] is also shown as the black dotted line.
FIG.12.A Pauli measurement on an intermediate-layer qubit t has additional requirements when we move to a cascaded graph.t is a "bottleneck" qubit between the upper and lower graphs G U , G L .We can find the properties of the casaded graph by considering the performance of the graphs G U , G L + t for SPF and indirect Pauli measurements.

FIG. 13 .
FIG. 13.Cascaded and concatenated graphs.(a) Logical against physical loss rates for arbitrary measurements on cascaded pentagon graphs.Inset is a depth-2 cascade with 20 physical qubits (purple qubits are physical).(b) shows the analogous performance for concatenated pentagons, for which the depth-2 concatenation has 16 physical qubits (purple qubits virtual).

FIG. 14 .
FIG.14.The optimised graphs for loss-tolerant logical qubit measurements (top), for break-even and subthreshold regimes, and optimized graphs for logical fusion measurements (bottom).
1 − n , although for the remaining two logical Pauli operators it decreases exponentially as (1 − ) n , with the physical loss rate.