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

Relating Measurement Patterns to Circuits via Pauli Flow

Will Simmons Cambridge Quantum Computing Ltd
9a Bridge Street, Cambridge, UKDepartment of Computer Science, University of Oxford
Wolfson Building, Parks Road, Oxford, UK [email protected]
Abstract

The one-way model of Measurement-Based Quantum Computing and the gate-based circuit model give two different presentations of how quantum computation can be performed. There are known methods for converting any gate-based quantum circuit into a one-way computation, whereas the reverse is only efficient given some constraints on the structure of the measurement pattern. Causal flow and generalised flow have already been shown as sufficient, with efficient algorithms for identifying these properties and performing the circuit extraction. Pauli flow is a weaker set of conditions that extends generalised flow to use the knowledge that some vertices are measured in a Pauli basis. In this paper, we show that Pauli flow can similarly be identified efficiently and that any measurement pattern whose underlying graph admits a Pauli flow can be efficiently transformed into a gate-based circuit without using ancilla qubits. We then use this relationship to derive simulation results for the effects of graph-theoretic rewrites in the ZX-calculus using a more circuit-like data structure we call the Pauli Dependency DAG.

1 Introduction

There are numerous approaches to quantum computation that differ in how problems are encoded and how the system evolves over time. The one-way model [32] is a variant of Measurement-Based Quantum Computing (MBQC) where the inputs are embedded into a general graph state, and the chosen computation is specified by a sequence of single-qubit measurements to apply, consuming the state and inducing a desired output state on the remaining qubits. In contrast, the gate-based model[30] applies unitary gates from some universal gateset to the input qubits directly. Gate-based circuits may use ancilla qubits and measurements, though they are only necessary for expanding to a larger state space for outputs and reading out final data.

There is a wide literature on rewriting both measurement patterns [17, 33, 18] and circuits [26, 19, 22, 35, 3, 12] to reduce the resource cost. Of particular interest here is the use of graph-theoretic rewrites of ZX-diagrams (in close correspondence with measurement patterns [17]) by Kissinger and van de Wetering [22], and of representations focussed on sequences of rotations about Pauli tensors such as by Zhang and Chen [35] herein referred to as Pauli Dependency DAGs (PDDAGs) as they capture the temporal dependencies between these rotations. Both works presented these as techniques for TT gate reduction with identical performance. The extraction method in this paper maps a measurement pattern/ZX-diagram directly into the form of a PDDAG, allowing us to formally demonstrate that each of the graph-theoretic rewrites can be simulated by moving Clifford-angled rotations through the PDDAG. This complements existing work on deriving equivalences between the PathSum formalism and the ZH calculus [5, 4, 24] and between different graphical calculi [29, 23] which have shown to provide useful insight on the semantics of operations for the more abstract calculi.

Previous work in this area has given algorithms for extracting circuits from measurement patterns that satisfy flow properties which describe how the errors from unwanted measurement outcomes can be corrected using the stabilizers of the graph state [8, 6]. The weakest such property that allows for interesting (i.e. non-Pauli) measurements is generalised flow (gflow) for which the single-plane form exactly describes the set of patterns that are uniformly, strongly, and stepwise deterministic [10]. Pauli flow [10] weakens the uniformity condition by labelling some of the measurements as being in a Pauli basis rather than at some arbitrary angle in a plane of the Bloch sphere. This allows for more interesting corrections that make use of Pauli projections to absorb some terms of the graph state stabilizers. This paper directly extends the works of Mhalla and Perdrix [28] and Backens et al. [6] for gflow to handle this wider class of measurement patterns.

This paper starts by laying out the key definitions and concepts behind measurement patterns and existing results on causal flow and gflow in Section 2. Section 3 will give a short overview of the Pauli Dependency DAG structure and how it can be used to rewrite circuits. We will then introduce the notion of Pauli flow and decompose the circuit extraction problem to generate a procedure that works for any measurement pattern with Pauli flow in Section 4. Then Section 5 will cover a number of methods of rewriting measurement patterns in turn and investigate their effects on the PDDAG extracted to show how they can be simulated.

2 Measurement-Based Quantum Computing

The one-way model follows the typical structure of MBQC of building some resource state which is then consumed by single-qubit measurements. The particular resource considered is a graph state, constructed by matching qubits (inputs and ancillas prepared in the |+=12(|0+|1)\ket{+}=\tfrac{1}{\sqrt{2}}\left(\ket{0}+\ket{1}\right) state) with vertices in a graph, and entangling them (with a CZCZ gate) according to the edges. Measurements are generally non-deterministic so, in order to have a deterministic effect overall, local gates can be applied to the remaining qubits to counteract the difference between the projectors for each outcome, giving the net effect of post-selecting the desired outcome. The introduction of such correction gates can be viewed as adapting the choice of basis for the future measurements.

Single qubit measurements are characterised by the bases they project into, which themselves can be described by a vector in the Bloch sphere. For MBQC, we conventionally restrict measurements into a plane of the Bloch sphere spanned by two of the Pauli bases. Such planar measurement bases are described by the following for α[0,2π)\alpha\in\left[0,2\pi\right):

|+XY,α\displaystyle\ket{+_{XY,\alpha}} =12(|0+eiα|1)\displaystyle=\tfrac{1}{\sqrt{2}}\left(\ket{0}+e^{i\alpha}\ket{1}\right) |XY,α\displaystyle\ket{-_{XY,\alpha}} =12(|0eiα|1)\displaystyle=\tfrac{1}{\sqrt{2}}\left(\ket{0}-e^{i\alpha}\ket{1}\right)
|+XZ,α\displaystyle\ket{+_{XZ,\alpha}} =cos(α2)|0+sin(α2)|1\displaystyle=\cos\left(\tfrac{\alpha}{2}\right)\ket{0}+\sin\left(\tfrac{\alpha}{2}\right)\ket{1} |XZ,α\displaystyle\ket{-_{XZ,\alpha}} =sin(α2)|0cos(α2)|1\displaystyle=\sin\left(\tfrac{\alpha}{2}\right)\ket{0}-\cos\left(\tfrac{\alpha}{2}\right)\ket{1} (1)
|+YZ,α\displaystyle\ket{+_{YZ,\alpha}} =cos(α2)|0+isin(α2)|1\displaystyle=\cos\left(\tfrac{\alpha}{2}\right)\ket{0}+i\sin\left(\tfrac{\alpha}{2}\right)\ket{1} |YZ,α\displaystyle\ket{-_{YZ,\alpha}} =sin(α2)|0icos(α2)|1\displaystyle=\sin\left(\tfrac{\alpha}{2}\right)\ket{0}-i\cos\left(\tfrac{\alpha}{2}\right)\ket{1}

with the following special cases for Pauli measurements for α=aπ\alpha=a\pi (a{0,1}a\in\{0,1\}):

|+X,aπ\displaystyle\ket{+_{X,a\pi}} =12(|0+(1)a|1)\displaystyle=\tfrac{1}{\sqrt{2}}\left(\ket{0}+(-1)^{a}\ket{1}\right) |X,aπ\displaystyle\ket{-_{X,a\pi}} =12(|0(1)a|1)\displaystyle=\tfrac{1}{\sqrt{2}}\left(\ket{0}-(-1)^{a}\ket{1}\right)
|+Y,aπ\displaystyle\ket{+_{Y,a\pi}} =12(|0+i(1)a|1)\displaystyle=\tfrac{1}{\sqrt{2}}\left(\ket{0}+i(-1)^{a}\ket{1}\right) |Y,aπ\displaystyle\ket{-_{Y,a\pi}} =12(|0i(1)a|1)\displaystyle=\tfrac{1}{\sqrt{2}}\left(\ket{0}-i(-1)^{a}\ket{1}\right) (2)
|+Z,aπ\displaystyle\ket{+_{Z,a\pi}} =(1a)|0+a|1\displaystyle=\left(1-a\right)\ket{0}+a\ket{1} |Z,aπ\displaystyle\ket{-_{Z,a\pi}} =a|0+(1a)|1\displaystyle=a\ket{0}+\left(1-a\right)\ket{1}

For any measurement basis, the negative outcome at angle α\alpha is equivalent to the positive outcome at angle α+π\alpha+\pi. We usually treat the positive measurement outcome as the desired branch, i.e. the projector we want to apply to achieve our desired end state.

Formally, measurement patterns (i.e. MBQC programs) are defined as follows:

Definition 2.1 (Measurement pattern).

A measurement pattern consists of a collection VV of qubits with distinguished subsets I,OVI,O\subseteq V of inputs and outputs, and a sequence of commands from:

  • Preparations NuN_{u}, initialising qubit uIu\notin I to |+\ket{+};

  • Entangling operators EuvE_{uv}, applying a CZCZ gate between distinct qubits u,vVu,v\in V;

  • Destructive measurements Muλ,αM_{u}^{\lambda,\alpha}, projecting qubit uOu\notin O onto either |+λ,α\ket{+_{\lambda,\alpha}} with outcome 0 or |λ,α\ket{-_{\lambda,\alpha}} with outcome 11;

  • Corrections [Xu]v[X_{u}]^{v} or [Zu]v[Z_{u}]^{v}, conditionally applying an XX gate or a ZZ gate to qubit uVu\in V if the outcome of the measurement for qubit vv was 11.

A measurement pattern is runnable if additionally:

  • All non-input qubits are prepared exactly once;

  • A non-input qubit is not acted on by any other command before its preparation;

  • All non-output qubits are measured exactly once;

  • A non-output qubit is not acted on by any other command after its measurement;

  • No correction depends on an outcome not yet measured.

The intended branch of a measurement pattern (where all measurement outcomes are 0 and hence no corrections are required) can be summarised by a tuple (Γ,α)(\Gamma,\alpha) of a labelled open graph Γ\Gamma describing the entanglement and measurement planes, and an assignment of measurement angles α:O¯[0,2π)\alpha:\overline{O}\to\left[0,2\pi\right).

Definition 2.2 (Labelled open graph).

A labelled open graph is a tuple Γ=(G,I,O,λ)\Gamma=\left(G,I,O,\lambda\right) where G=(V,E)G=(V,E) is an undirected graph, I,OVI,O\subseteq V are (possibly overlapping) subsets of vertices for inputs and outputs respectively, and λ:O¯{XY,XZ,YZ,X,Y,Z}\lambda:\overline{O}\to\{XY,XZ,YZ,X,Y,Z\} is a labelling function assigning a measurement plane or Pauli to each non-output vertex.

Remark 2.3.

To fix notation, we will use I¯=VI\overline{I}=V\setminus I for non-input (prepared) vertices and O¯=VO\overline{O}=V\setminus O for non-output (measured) vertices. uvu\sim v denotes vertices u,vVu,v\in V being adjacent in GG. Neighbour sets are NG(u):={wV|wu}N_{G}(u):=\{w\in V|w\sim u\} and odd neighbourhoods are OddG(A):={wV|NG(w)A| is odd}\mathrm{Odd}_{G}(A):=\left\{w\in V\mid\left|N_{G}(w)\cap A\right|\text{ is odd}\right\}, writing Odd(A)\mathrm{Odd}(A) when the choice of graph is obvious. The symmetric difference of sets is written as AΔB:=(AB)(BA)A\Delta B:=(A\setminus B)\cup(B\setminus A). When drawing diagrams for measurement patterns, we will distinguish between measured and output vertices as filled and unfilled points respectively, and inputs are specified by boxes around the vertices. For linear maps, subscripts may be used to specify that a map acts on some given qubit(s) and is the identity on all others, such as +λ(v),α(v)|v\bra{+_{\lambda(v),\alpha(v)}}_{v} or PvP_{v} for some Pauli PP.

Each branch (combination of measurement outcomes) gives rise to a linear map from the inputs to the outputs based on the commands run and the projections observed. The overall channel from considering all branches is a completely-positive trace-preserving map whose Kraus maps are exactly the branch maps. When we have a strongly deterministic pattern (all branches are equal up to global phase), we just associate it with the linear map of the intended branch. Since runnable patterns can be standardised to perform all initialisations first, then all entangling gates, and finally alternate measurements and corrections, this linear map also has a standard representation.

Definition 2.4 (Linear map of a pattern).

The linear map associated with a measurement pattern (Γ,α)(\Gamma,\alpha) is given by

MΓ,α:=(uO¯+λ(u),α(u)|u)EGNI¯M_{\Gamma,\alpha}:=\left(\prod_{u\in\overline{O}}\bra{+_{\lambda(u),\alpha(u)}}_{u}\right)E_{G}N_{\overline{I}} (3)

where EG:=uvEuvE_{G}:=\prod_{u\sim v}E_{uv} entangles pairs of adjacent qubits in the graph with CZCZ gates and NI¯:=uI¯NuN_{\overline{I}}:=\prod_{u\in\overline{I}}N_{u} initialises every non-input in the |+\ket{+} state.

Interpreting the graph state as EGNI¯E_{G}N_{\overline{I}} gives rise to a stabilizer per initialised vertex uI¯u\in\overline{I}:

EGNI¯=EGXuNI¯=(vNG(u)Zv)XuEGNI¯E_{G}N_{\overline{I}}=E_{G}X_{u}N_{\overline{I}}=\left(\prod_{v\in N_{G}(u)}Z_{v}\right)X_{u}E_{G}N_{\overline{I}} (4)

Since the linear map of a pattern is not just a simple graph state but a projected graph state, it is possible for some Pauli terms introduced by graph state stabilizers to be absorbed by the Pauli projections:

+X,aπ|u=(1)a+X,aπ|uXu+Y,aπ|u=(1)a+Y,aπ|uYu+Z,aπ|u=(1)a+Z,aπ|uZu\begin{split}\bra{+_{X,a\pi}}_{u}&=(-1)^{a}\bra{+_{X,a\pi}}_{u}X_{u}\\ \bra{+_{Y,a\pi}}_{u}&=(-1)^{a}\bra{+_{Y,a\pi}}_{u}Y_{u}\\ \bra{+_{Z,a\pi}}_{u}&=(-1)^{a}\bra{+_{Z,a\pi}}_{u}Z_{u}\\ \end{split} (5)

These stabilizers and Pauli absorptions are practical for deriving possible means of correcting for unwanted measurement outcomes.

The intention behind different types of flow conditions is to capture the ability to propagate errors from unwanted measurement outcomes forward to the rest of the circuit in order to correct them, aiming for stepwise determinism (each measurement can be corrected independently). Causal flow is the simplest case where we suppose all vertices are measured in the XYXY basis and each error can be corrected by considering a single stabilizer of the graph state.

Definition 2.5 (Causal flow [14]).

Given a labelled open graph Γ=(G,I,O,λ)\Gamma=(G,I,O,\lambda) such that uO¯.λ(u)=XY\forall u\in\overline{O}.\lambda(u)=XY, a causal flow for Γ\Gamma is a tuple (f,)(f,\prec) of a map f:O¯I¯f:\overline{O}\to\overline{I} and a strict partial order \prec over VV such that for all vO¯v\in\overline{O}:

  • vf(v)v\sim f(v)

  • vf(v)v\prec f(v)

  • wNG(f(v)).w=vvw\forall w\in N_{G}(f(v)).w=v\vee v\prec w

The idea here is that ZvZ_{v} from the graph stabilizer (wNG(f(v))Zw)Xf(v)\left(\prod_{w\in N_{G}(f(v))}Z_{w}\right)X_{f(v)} will eliminate the effect of the measurement error on qubit vv, meaning we can correct the error by applying (wNG(f(v)){v}Zw)Xf(v)\left(\prod_{w\in N_{G}(f(v))\setminus\{v\}}Z_{w}\right)X_{f(v)} and implicitly invoking the stabilizer. The partial order \prec indicates a required order of the measurements, ensuring that none of the vertices required for correcting vv have been measured yet.

Generalised flow takes a similar approach, but allows us to take combinations of the basic stabilizers. If the stabilizer of a candidate f(v)f(v) would require a ZZ correction on some uNG(f(v))u\in N_{G}(f(v)) that has already been measured, there may exist some other stabilizer we can apply that cancels out the ZZ for us. Now, instead of the stabilizer being determined by a single vertex f(v)I¯f(v)\in\overline{I}, we have a set g(v)I¯g(v)\subseteq\overline{I} giving (wOdd(g(v))Zw)(wg(v)Xw)\left(\prod_{w\in\mathrm{Odd}(g(v))}Z_{w}\right)\left(\prod_{w\in g(v)}X_{w}\right) up to phase. By relaxing these restrictions on the stabilizers used, we can also generate YY or XX on the measured vertex, allowing the correction of measurements in the XZXZ and YZYZ planes respectively.

Definition 2.6 (Generalised flow [10]).

Given a labelled open graph Γ=(G,I,O,λ)\Gamma=(G,I,O,\lambda) such that uO¯.λ(u){XY,XZ,YZ}\forall u\in\overline{O}.\lambda(u)\in\{XY,XZ,YZ\}, a generalised flow (or gflow) for Γ\Gamma is a tuple (g,)(g,\prec) of a map g:O¯𝒫[I¯]g:\overline{O}\to\mathcal{P}[\overline{I}] and a strict partial order \prec over VV such that for all vO¯v\in\overline{O}:

  • wg(v).vwvw\forall w\in g(v).v\neq w\Rightarrow v\prec w

  • wOdd(g(v)).vwvw\forall w\in\mathrm{Odd}(g(v)).v\neq w\Rightarrow v\prec w

  • λ(v)=XYvg(v)vOdd(g(v))\lambda(v)=XY\Rightarrow v\notin g(v)\wedge v\in\mathrm{Odd}(g(v))

  • λ(v)=XZvg(v)vOdd(g(v))\lambda(v)=XZ\Rightarrow v\in g(v)\wedge v\in\mathrm{Odd}(g(v))

  • λ(v)=YZvg(v)vOdd(g(v))\lambda(v)=YZ\Rightarrow v\in g(v)\wedge v\notin\mathrm{Odd}(g(v))

There exist polynomial-time algorithms for identifying whether or not a labelled open graph admits causal flow or gflow [15, 28, 6], and for extracting an equivalent unitary circuit for the measurement pattern given either type of flow [8, 6].

3 Pauli Dependency DAGs

The Pauli Dependency DAG is a data structure for representing the action of a pure quantum circuit that abstracts away gate set, Clifford gates, and gate commutations. This was notably covered in the work of Zhang and Chen [35] where it was used to identify possible pairs of TT gates which could be merged through some sequence of gate commutations and Clifford gate relations in order to reduce the number of TT gates in the circuit. Similar structures are also covered by Litinski [25] for compiling circuits for lattice surgery and by Gosset et al. [20] as an intermediate for synthesis of Clifford+TT circuits.

The Clifford group is the group of linear maps that can be formed from CXCX, Hadamard, and RZ(π2)RZ(\tfrac{\pi}{2}) with qubit initialisation in the |0\ket{0} state. These hold a special place in quantum theory as the maximal group of actions under which the Pauli group is closed. Their behaviour is conveniently captured by the stabilizer framework, allowing for canonical representations like the stabilizer tableau [34, 2]. They are often viewed as the “easy” gates in a circuit because of their simple algebra, efficient simulation [21, 2], and low resource cost in many error correction schemes [11].

Most common gate types can be expressed as (combinations of) Pauli exponentials (eiθPe^{i\theta P} for some P{I,X,Y,Z}nP\in\{I,X,Y,Z\}^{\otimes n}), which also benefit from elegant relations with stabilizers.

Lemma 3.1 (Product Rotation Lemma).

Let AA and BB be commuting operators such that B𝒞=𝒞B\mathcal{C}=\mathcal{C} for some linear map 𝒞\mathcal{C}. Then eiθA𝒞=eiθAB𝒞e^{i\theta A}\mathcal{C}=e^{i\theta AB}\mathcal{C}.

Proof.

For any analytic function F(A)F(A), we can expand its Taylor series in F(A)𝒞F(A)\mathcal{C}, then introduce and commute BB in each term to form the Taylor series for F(AB)𝒞F(AB)\mathcal{C}. ∎

Gate Equivalent Pauli exponentials
CXctCX_{ct} eiπ4ZcXteiπ4Zceiπ4Xte^{-i\tfrac{\pi}{4}Z_{c}X_{t}}e^{i\tfrac{\pi}{4}Z_{c}}e^{i\tfrac{\pi}{4}X_{t}}
CZctCZ_{ct} eiπ4ZcZteiπ4Zceiπ4Zte^{-i\tfrac{\pi}{4}Z_{c}Z_{t}}e^{i\tfrac{\pi}{4}Z_{c}}e^{i\tfrac{\pi}{4}Z_{t}}
RZ(α)RZ(\alpha) eiα2Ze^{-i\tfrac{\alpha}{2}Z}
RX(α)RX(\alpha) eiα2Xe^{-i\tfrac{\alpha}{2}X}
HH eiπ4Zeiπ4Xeiπ4Ze^{-i\tfrac{\pi}{4}Z}e^{-i\tfrac{\pi}{4}X}e^{-i\tfrac{\pi}{4}Z}
CCXabtCCX_{abt} eiπ8ZaZbXteiπ8ZaZbeiπ8ZaXteiπ8ZbXteiπ8Zaeiπ8Zbeiπ8Xte^{-i\tfrac{\pi}{8}Z_{a}Z_{b}X_{t}}e^{i\tfrac{\pi}{8}Z_{a}Z_{b}}e^{i\tfrac{\pi}{8}Z_{a}X_{t}}e^{i\tfrac{\pi}{8}Z_{b}X_{t}}e^{-i\tfrac{\pi}{8}Z_{a}}e^{-i\tfrac{\pi}{8}Z_{b}}e^{-i\tfrac{\pi}{8}X_{t}}
Table 1: Summary of conversions from common gates into Pauli exponentials (up to global phase). Subscripts are used to indicate specific qubits for multi-qubit gates. Other gates can similarly be represented by first decomposing into a universal gate set such as {CX,RZ,RX}\{CX,RZ,RX\} and optionally tidying up using the 3.2.

Pauli exponentials where the coefficient is an integral multiple of π4\tfrac{\pi}{4} correspond to Clifford gates. The action of Clifford gates on both Paulis and arbitrary Pauli exponentials can be summarised in a few equations.

Lemma 3.2 (Reorder Rules).

For any Pauli strings A,B{I,X,Y,Z}nA,B\in\{I,X,Y,Z\}^{\otimes n} and angles θ,ϕ\theta,\phi, if AA and BB commute, then

eiθAB\displaystyle e^{i\theta A}B =BeiθA\displaystyle=Be^{i\theta A} (6)
eiθAeiϕB\displaystyle e^{i\theta A}e^{i\phi B} =eiϕBeiθA\displaystyle=e^{i\phi B}e^{i\theta A} (7)

and otherwise (i.e. they anticommute)

eiπ4AB\displaystyle e^{i\tfrac{\pi}{4}A}B =(iAB)eiπ4A\displaystyle=(iAB)e^{i\tfrac{\pi}{4}A} (8)
eiπ4AeiϕB\displaystyle e^{i\tfrac{\pi}{4}A}e^{i\phi B} =eiϕ(iAB)eiπ4A\displaystyle=e^{i\phi(iAB)}e^{i\tfrac{\pi}{4}A} (9)
Proof.

Any operator satisfying A2=IA^{2}=I and real θ\theta permit the decomposition eiθA=cosθI+isinθAe^{i\theta A}=\cos\theta I+i\sin\theta A by grouping terms in the Taylor expansion. Each equation follows from decomposing one of the exponentials in this way. Whilst the right-hand side of Equation 9 appears to contain a real exponent, remember that iABiAB is a real Pauli string when AA and BB anticommute. ∎

We can represent any circuit as a set of qubit initialisations followed by a sequence of Pauli exponentials by decomposing each gate in turn. The above rules can then be used to move any Clifford-angled exponentials to the start of the circuit, resulting in the product form (keiϕkAk)𝒞\left(\prod_{k}e^{i\phi_{k}A_{k}}\right)\mathcal{C} where 𝒞\mathcal{C} is a stabilizer process and each ϕk\phi_{k} is not an integral multiple of π4\tfrac{\pi}{4}. Previous presentations [25, 35] collected the Clifford gates at the end of the circuit rather than at the start. When considering unitary circuits, the choice of direction is arbitrary, but in the general case we may not always be able to transport qubit initialisations through the Pauli exponentials to the end.

𝒞\mathcal{C} can be expressed canonically by its stabilizer tableau. Specifically, since we could have an arbitrary number of inputs we need a variant mixing the extremes of the unitary case [2] and the usual state case [34] to capture both how Paulis over the inputs are transformed to Pauli strings over the outputs and additional generators for free stabilizers over the outputs. In examples, we will describe this by the stabilizers of the Choi operator of 𝒞\mathcal{C} (which we shall refer to as an isometry tableau for clarity), from which it is simple to convert it to any binary matrix format of choice. Such tableaux can be identified and synthesised by embedding them into unitary tableaux by breaking down the isometry into an initialisation of |O||I||O|-|I| qubits in the |0\ket{0} state followed by a unitary circuit which maps ZZ on the initialised qubits to each of the free output stabilizers and XX to any choice of operators that extend our generators to span the full Pauli group. Since the rows are just generators for the stabilizer group, we still have the notion of “free actions” given by reordering rows or multiplying two rows together.

For the rotation list, there is still some obvious redundancy in the product form resulting from commutations. Because anticommuting Pauli strings prevent commutation of their exponentials, any valid ordering of the rotations will preserve the relative order of rotations with anticommuting strings, inducing a temporal dependency between them. Taking the transitive closure of these dependencies gives a partial order between the exponentials which represents keiϕkAk\prod_{k}e^{i\phi_{k}A_{k}} up to any number of commutations.

Definition 3.3 (Pauli Dependency DAG).

A Pauli Dependency DAG (PDDAG) for a circuit is a pair of an isometry tableau for a Clifford map 𝒞\mathcal{C} and a directed acyclic graph for a partial order \prec over terms {(Ak,αk)}k\{(A_{k},\alpha_{k})\}_{k} (Ak{I,X,Y,Z}nA_{k}\in\{I,X,Y,Z\}^{n}, αk[0,2π)\alpha_{k}\in\left[0,2\pi\right)) such that the linear map of the circuit is given by (keiαk2Ak)𝒞\left(\prod_{k}^{\succ}e^{i\tfrac{\alpha_{k}}{2}A_{k}}\right)\mathcal{C}111The convention of using eiαk2Ake^{i\tfrac{\alpha_{k}}{2}A_{k}} rather than eiαkAke^{i\alpha_{k}A_{k}} is to give a closer semblance to the definitions of usual rotation gates like RZRZ and their multi-qubit counterparts from literature on Pauli gadgets [12, 13] and to make the notation easier when we come to discuss extraction but is just a notational choice. up to global phase.

Since the full \prec relation is rather large, we use the minimal representation/Hasse diagram which includes edges in the DAG for immediate successors (those pairs of exponentials whose strings anticommute and could appear adjacent to one another in some valid topological ordering).

SSRY(α3)RY(\alpha_{3})RX(α4)RX(\alpha_{4})RY(α5)RY(\alpha_{5})RZ(α6)RZ(\alpha_{6})RZ(α0)RZ(\alpha_{0})RY(α2)RY(\alpha_{2})RZ(α1)RZ(\alpha_{1})RY(α7)RY(\alpha_{7})
Ins Outs Sign
XX YY ++
XX XX ++
ZZ ZZ ++
ZZ ZZ ++
SSRY(α3)RY(\alpha_{3})RX(α4)RX(\alpha_{4})RY(α5)RY(\alpha_{5})RZ(α6)RZ(\alpha_{6})RZ(α0)RZ(\alpha_{0})RY(α2)RY(\alpha_{2})RZ(α1)RZ(\alpha_{1})RY(α7)RY(\alpha_{7})(Z1I2,α0){(Z_{1}I_{2},-\alpha_{0})}(X1I2,α2){(X_{1}I_{2},\alpha_{2})}(Y1X2,α3){(Y_{1}X_{2},-\alpha_{3})}(Z1I2,α6){(Z_{1}I_{2},-\alpha_{6})}(Y1X2,α5){(Y_{1}X_{2},-\alpha_{5})}(I1Z2,α1){(I_{1}Z_{2},-\alpha_{1})}(I1X2,α4){(I_{1}X_{2},\alpha_{4})}(I1Y2,α7){(I_{1}Y_{2},-\alpha_{7})}
Figure 1: An example quantum circuit and the corresponding isometry tableau and rotation DAG which form the PDDAG. Since the nodes of angles α3\alpha_{3} and α5\alpha_{5} have no relative dependencies and share the same Pauli string, it is possible to commute them to be adjacent and merge them to a single rotation. The α4\alpha_{4} rotation can commute through the CXCXgates so is only blocked by α1\alpha_{1} in the past and α7\alpha_{7} in the future.

Rewrite rules for PDDAGs change the structure but preserve the linear map. The most useful rewrite for circuit reduction is rotation merging: two nodes in the graph j,kj,k can be merged to give a single node with (Aj,αj+αk)(A_{j},\alpha_{j}+\alpha_{k}) if Aj=AkA_{j}=A_{k} and both jkj\not\prec k and kjk\not\prec j (i.e. there is some valid topological ordering of the graph which puts these rotations together).

The PDDAG definition permits Clifford-angled rotations, allowing the movement of Clifford rotations through the circuit via the 3.2 to be an explicit rewrite. Combining this with merging/splitting of phases and eliminating rotations with angle 0 permits a more rigid canonical form where the range of angles for each rotation is reduced from [0,2π)\left[0,2\pi\right) to (0,π2)\left(0,\tfrac{\pi}{2}\right).

When the initial Clifford process includes some qubit initialisations, it will have some free stabilizers over its outputs that can be used to change the Pauli strings of rotations in the DAG using the 3.1. We can use the 3.2 to propagate the stabilizers beyond the initial rotations to find more places to perform this rewrite. Changing the Pauli strings of rotations in this way can affect how they commute/anticommute with their neighbours, modifying the dependency relation \prec.

Extracting a circuit back out of an arbitrary PDDAG can be naively done by synthesising the stabilizer tableau [2, 27] and each of the Pauli exponentials in turn according to some topological ordering using some standard decompositions [7, 12] although this will typically add an extremely high amount of redundant Clifford gates. More efficient synthesis can be performed using techniques for synthesising pairs of rotations simultaneously [12] or by diagonalising sets of mutually commuting rotations [9, 13]. It is also possible that future architectures may find efficient ways to perform each Pauli rotation natively or employ lattice surgery where it is practical to just perform them directly [25].

Alternatively, similar to the action of phase teleportation in ZX-diagram rewriting [22], one can also retain the structure of a circuit and just use the PDDAG structure to spot where non-adjacent gates can be merged via the rotation merging rewrites. This is typically good when the original circuit already has a relatively low density of Clifford gates when it is unlikely that resynthesis will give as efficient a circuit structure.

4 Circuit Extraction

The goal of circuit extraction is to identify a sequence of gates that implements the same linear map as a given measurement pattern. Simply calculating the linear map and using standard matrix decomposition techniques is not sufficient since it will scale exponentially with the size of the pattern, making it impractical in the long-run. The method presented here will make use of a Pauli flow to determine the effect that each measurement angle has on the outputs. Doing so will yield the PDDAG representation directly, giving a rotation per planar measurement and a stabilizer process.

To motivate our method, recall the possible measurement bases from Section 2. Each planar basis projection can be constructed as a basic rotation of some Pauli basis:

±XY,α|±X,0|eiα2Z±XZ,α|±Z,0|eiα2Y±YZ,α|±Z,0|eiα2X\begin{split}\bra{\pm_{XY,\alpha}}&\approx\bra{\pm_{X,0}}e^{i\tfrac{\alpha}{2}Z}\\ \bra{\pm_{XZ,\alpha}}&\approx\bra{\pm_{Z,0}}e^{i\tfrac{\alpha}{2}Y}\\ \bra{\pm_{YZ,\alpha}}&\approx\bra{\pm_{Z,0}}e^{-i\tfrac{\alpha}{2}X}\end{split} (10)

The key idea driving this method of circuit extraction is to apply the 3.1 to alter these rotations and move them to onto the output qubits, but this requires identifying an appropriate stabilizer of the graph state to use. In a similar way, flow conditions already describe stabilizers for propagating errors onto other qubits. Pauli flow is one such example which can handle both planar measurements λ(v){XY,XZ,YZ}\lambda(v)\in\{XY,XZ,YZ\} and special cases for Pauli measurements λ(v){X,Y,Z}\lambda(v)\in\{X,Y,Z\}. Similar to gflow, it gives a stabilizer that applies a Pauli XX to vertices in p(v)p(v) and a Pauli ZZ to vertices in Odd(p(v))\mathrm{Odd}(p(v)). However, because Equation 5 means Pauli corrections have no observable effect if the qubit is measured in the same basis, it doesn’t matter if, for example, a vertex up(v)u\in p(v) with λ(u)=X\lambda(u)=X has already been measured before vv.

+X,α(u)|uEGNI¯+X,α(u)|u(wp(v)wuXw)(wOdd(p(v))Zw)EGNI¯\bra{+_{X,\alpha(u)}}_{u}E_{G}N_{\overline{I}}\approx\bra{+_{X,\alpha(u)}}_{u}\left(\prod_{\begin{subarray}{c}w\in p(v)\\ w\neq u\end{subarray}}X_{w}\right)\left(\prod_{\begin{subarray}{c}w\in\mathrm{Odd}(p(v))\end{subarray}}Z_{w}\right)E_{G}N_{\overline{I}} (11)
Definition 4.1 (Pauli flow [10, 31]).

Given a labelled open graph Γ=(G,I,O,λ)\Gamma=(G,I,O,\lambda), a Pauli flow for Γ\Gamma is a tuple (p,)(p,\prec) of a map p:O¯𝒫[I¯]p:\overline{O}\to\mathcal{P}[\overline{I}] and a strict partial order \prec over VV such that for all uO¯u\in\overline{O}:

  1. [.X][\prec.X]

    vp(u).uvλ(v){X,Y}uv\forall v\in p(u).u\neq v\wedge\lambda(v)\notin\{X,Y\}\Rightarrow u\prec v

  2. [.Z][\prec.Z]

    vOdd(p(u)).uvλ(v){Y,Z}uv\forall v\in\mathrm{Odd}(p(u)).u\neq v\wedge\lambda(v)\notin\{Y,Z\}\Rightarrow u\prec v

  3. [.Y][\prec.Y]

    vu.uvλ(v)=Y(vp(u)vOdd(p(u)))\forall v\preceq u.u\neq v\wedge\lambda(v)=Y\Rightarrow\left(v\in p(u)\Leftrightarrow v\in\mathrm{Odd}(p(u))\right)

  4. [λ.XY][\lambda.XY]

    λ(u)=(X,Y)up(u)uOdd(p(u))\lambda(u)=(X,Y)\Rightarrow u\notin p(u)\wedge u\in\mathrm{Odd}(p(u))

  5. [λ.XZ][\lambda.XZ]

    λ(u)=(X,Z)up(u)uOdd(p(u))\lambda(u)=(X,Z)\Rightarrow u\in p(u)\wedge u\in\mathrm{Odd}(p(u))

  6. [λ.YZ][\lambda.YZ]

    λ(u)=(Y,Z)up(u)uOdd(p(u))\lambda(u)=(Y,Z)\Rightarrow u\in p(u)\wedge u\notin\mathrm{Odd}(p(u))

  7. [λ.X][\lambda.X]

    λ(u)=XuOdd(p(u))\lambda(u)=X\Rightarrow u\in\mathrm{Odd}(p(u))

  8. [λ.Z][\lambda.Z]

    λ(u)=Zup(u)\lambda(u)=Z\Rightarrow u\in p(u)

  9. [λ.Y][\lambda.Y]

    λ(u)=Y(up(u)uOdd(p(u)))(up(u)uOdd(p(u)))\lambda(u)=Y\Rightarrow(u\notin p(u)\wedge u\in\mathrm{Odd}(p(u)))\vee(u\in p(u)\wedge u\notin\mathrm{Odd}(p(u)))

where uv:=¬(vu)u\preceq v:=\neg(v\prec u).

Definition 4.2 (Extraction string).

Let (Γ,α)(\Gamma,\alpha) describe a measurement pattern with Pauli flow (p,)(p,\prec) and some chosen measured vertex vO¯v\in\overline{O}. A Pauli string 𝐏\mathbf{P} over the outputs is a PP-extraction string (P{X,Y,Z}P\in\{X,Y,Z\}) for vv if Pv𝐏P_{v}\mathbf{P} is a stabilizer of the linear map 𝒞\mathcal{C}:

𝒞:=(wO¯wvλ(w){XY,XZ,YZ}+λ(w),0|w)(wO¯{v}λ(w){X,Y,Z}+λ(w),α(w)|w)EGNI¯\mathcal{C}:=\left(\prod_{\begin{subarray}{c}w\in\overline{O}\\ w\succ v\\ \lambda(w)\in\{XY,XZ,YZ\}\end{subarray}}\bra{+_{\lambda(w),0}}_{w}\right)\left(\prod_{\begin{subarray}{c}w\in\overline{O}\setminus\{v\}\\ \lambda(w)\in\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda(w),\alpha(w)}}_{w}\right)E_{G}N_{\overline{I}}\\ (12)

A primary extraction string 𝐏v\mathbf{P}^{\bot v} for vv is a PvP^{\bot v}-extraction string where

Pv:={Xif vp(v)vOdd(p(v))Yif vp(v)vOdd(p(v))Zif vp(v)vOdd(p(v))P^{\bot v}:=\begin{cases}X&\text{if }v\in p(v)\wedge v\notin\mathrm{Odd}(p(v))\\ Y&\text{if }v\in p(v)\wedge v\in\mathrm{Odd}(p(v))\\ Z&\text{if }v\notin p(v)\wedge v\in\mathrm{Odd}(p(v))\\ \end{cases} (13)

Relating this definition to the goal of using the 3.1, the cases for PvP^{\bot v} match the rotations in Equation 10. The fact that the rest of the stabilizer is over the outputs means we are successfully removing it from the scope of the pattern. For the purposes of extraction, we can assume all measurement angles of future vertices have already been extracted, making them Pauli projections. The notion of a focussed flow [28, 6] then guarantees that all Pauli terms are absorbed, leaving something in the form of an extraction string.

Definition 4.3 (Focussed).

Given a labelled open graph Γ\Gamma, a set p^I¯\hat{p}\subset\overline{I} is focussed over SO¯S\subseteq\overline{O} if:

  1. [FX][FX]

    wSp^.λ(w){XY,X,Y}\forall w\in S\cap\hat{p}.\lambda(w)\in\{XY,X,Y\}

  2. [FZ][FZ]

    wSOdd(p^).λ(w){XZ,YZ,Y,Z}\forall w\in S\cap\mathrm{Odd}(\hat{p}).\lambda(w)\in\{XZ,YZ,Y,Z\}

  3. [FY][FY]

    wS.λ(w)=Y(wp^wOdd(p^))\forall w\in S.\lambda(w)=Y\Rightarrow\left(w\in\hat{p}\Leftrightarrow w\in\mathrm{Odd}(\hat{p})\right)

A focussed set p^\hat{p} for Γ\Gamma is focussed over O¯\overline{O}. A Pauli flow (p,)(p,\prec) is focussed if p(v)p(v) is focussed over O¯{v}\overline{O}\setminus\{v\} for all vO¯v\in\overline{O}.

Lemma 4.4.

Let Γ=(G,I,O,λ)\Gamma=(G,I,O,\lambda) be a labelled open graph with some measurement angles α:O¯[0,2π)\alpha:\overline{O}\to\left[0,2\pi\right) and a focussed Pauli flow (p,)(p,\prec). Then for any vertex vO¯v\in\overline{O}, p(v)p(v) determines a PvP^{\bot v}-extraction string.

Proof.

Proof in Appendix (Lemma C.2). ∎

To make this extraction technique practical, we need to be able to find a focussed Pauli flow when one exists. This follows similarly to the corresponding results for causal flow and gflow.

Theorem 4.5.

(Generalisation of [28, Theorem 2], [6, Theorem 3.11]) There exists an algorithm that decides whether a given labelled open graph has a Pauli flow, and that outputs such a Pauli flow if it exists. Moreover, this output is maximally delayed, and the algorithm completes deterministically in time that grows polynomially with the number of vertices in the graph.

Proof.

Proof in Appendix (Theorem A.6). ∎

Lemma 4.6.

(Generalisation of [6, Proposition 3.14]) If a labelled open graph has a Pauli flow, then it has a maximally delayed, focussed Pauli flow.

Proof.

Proof in Appendix (Lemma B.5). ∎

We are now in the position where we can take any Pauli flow and extract all of the planar measurement angles from a measurement pattern. This just leaves a Clifford process which can be characterised completely by stabilizer theory. The rows of the isometry tableau describing how inputs are mapped are given by extraction strings of the inputs (taking input extensions of the measurement pattern as appropriate), and the remaining generators over the outputs are obtained from extraction strings.

Theorem 4.7.

(Generalisation of [6, Theorem 5.5]) Let (Γ,α)(\Gamma,\alpha) describe a measurement pattern where Γ\Gamma has a Pauli flow. Then there is an algorithm that identifies an equivalent circuit requiring no ancillae which completes in time polynomial in the number of vertices in Γ\Gamma.

Proof.

Proof in Appendix (Theorem C.12). ∎

5 Relating Rewrites

The most common rewrites in PDDAGs are merging terms and moving Clifford rotations, most notably moving a Clifford phase between a node in the DAG and the initial Clifford process. The structure or redundancy being exploiting for optimisation is very clear and easy to understand. On the other hand, graph-theoretic rewrites used for measurement patterns or ZX-diagrams have less obvious interpretations in how they relate to optimisations in the gate-based model. To compare the two, we consider extracting a PDDAG from a measurement pattern before and after a rewrite to observe the changes in the order, Pauli strings, and phases of the rotations from each measurement or tableau row, and then find a sequence of simple PDDAG rewrites that produces the same effect. Detailed proofs and examples can be found in Appendix D.

Given the special treatment of Pauli measurements in our representation of measurement patterns, the simplest rewrite we can do is to relabel a vertex measured in a Pauli basis between a planar label and a Pauli label, without changing the graph or other vertices.

Theorem 5.1.

Let (Γ,α)(\Gamma,\alpha) describe a measurement pattern with some vertex uO¯u\in\overline{O} such that λ(u){XY,XZ,YZ}\lambda(u)\in\{XY,XZ,YZ\} and α(u){0,π2,π,3π2}\alpha(u)\in\{0,\tfrac{\pi}{2},\pi,\tfrac{3\pi}{2}\}. Relabelling uu to the equivalent Pauli label corresponds to pushing the rotation from uu to the start of the PDDAG and absorbing it into the initial stabilizer process.

Proof.

Proof in Appendix (Theorem D.4). ∎

Removing vertices from the measurement pattern typically involves reducing a vertex’s measurement to the ZZ basis, at which point it no longer needs to be entangled with the other qubits. We can consider doing this both when the vertex is labelled as a Pauli ZZ measurement and as a planar measurement in the XZXZ or YZYZ planes.

Theorem 5.2.

Let (Γ,α)(\Gamma,\alpha) describe a measurement pattern with some vertex uO¯u\in\overline{O} such that λ(u){XZ,YZ,Z}\lambda(u)\in\{XZ,YZ,Z\} and α(u){0,π}\alpha(u)\in\{0,\pi\}. Eliminating uu from the graph corresponds to the following sequence of actions on the PDDAG:

  1. 1.

    If uu has a planar (XZXZ or YZYZ) label, then its rotation is pulled from the rotation DAG into the stabilizer block;

  2. 2.

    For each neighbour nn of uu that is an output, a ZnZ_{n} rotation of α(u)\alpha(u) is pulled from the stabilizer block through the entire rotation DAG to the end of the circuit;

  3. 3.

    For each neighbour nn of uu with λ(n)=XY\lambda(n)=XY, a 𝐏n\mathbf{P}^{\bot n} rotation of α(u)\alpha(u) is pulled from the stabilizer block and merged with the existing rotation for nn.

Proof.

Proof in Appendix (Theorem D.9). ∎

Here, we have a slightly different effect for planar labels compared to the Pauli ZZ label, though this can be thought of as a combination of the previous rewriting rule and the basic case for Pauli ZZ elimination. The additional rotations generated are exactly the ZZ gates introduced on neighbouring qubits to preserve the semantics (Lemma D.6).

One of the more interesting rewrites on measurement patterns is performing local complementation about some vertex uu. This inverts the connectivity between each pair of vertices neighbouring uu. To preserve the semantics, we also update the labels and measurement angles of uu and its neighbours. Combining this with ZZ vertex elimination allows the elimination of vertices measured in the YY basis.

Theorem 5.3.

Performing local complementation about a vertex uu corresponds to the following sequence of actions on the PDDAG:

  1. 1.

    For each output ww neighbouring uu, a (Zw,π2)(Z_{w},\tfrac{\pi}{2}) rotation is pulled from the initial stabilizer block all the way to the end of the rotation DAG;

  2. 2.

    If uu is an output, a (Xu,π2)(X_{u},-\tfrac{\pi}{2}) rotation is pulled from the initial stabilizer block all the way to the end of the rotation DAG;

  3. 3.

    For each vertex ww neighbouring uu with λ(w)=XY\lambda(w)=XY, and for uu itself if λ(u)\lambda(u) is planar, we pull a (𝐏w,(1)Dwπ2)\left(\mathbf{P^{\prime}}^{\bot w},(-1)^{D_{w}}\tfrac{\pi}{2}\right) rotation from the initial stabilizer block to merge it into the existing rotation for ww or uu. We do this in \succ-order over such ww vertices.

Proof.

Proof in Appendix (Theorem D.17). ∎

Another similar operation to local complementation is the act of pivoting a diagram about an edge, which can be used to prepare a Pauli XX measurement for elimination. This action can be decomposed into a sequence of local complementations about each end of the edge, so this can also be simulated by some sequence of Clifford transformations in the PDDAG.

In each of the above, we assume that a particular transformation is made to the focussed Pauli flow and focussed sets for the measurement pattern based on the rewrite chosen, as detailed in Appendix D. In truth, focussed Pauli flows need not be unique for a measurement pattern. We can view the map between focussed Pauli flows as a rewrite on the measurement pattern that changes the corrections applied after each measurement, keeping the labelled open graph and measurement angles the same. We can compare the differences to the focussed sets for the pattern to obtain our final correspondence theorem:

Theorem 5.4.

Let (Γ,α)(\Gamma,\alpha) describe a measurement pattern with some focussed Pauli flow (p,)(p,\prec), a focussed set p^\hat{p}, and some vertex uO¯u\in\overline{O} such that wp^Odd(p^).λ(w){XY,XZ,YZ}wuuw\forall w\in\hat{p}\cup\mathrm{Odd}(\hat{p}).\lambda(w)\in\{XY,XZ,YZ\}\Rightarrow w\neq u\wedge u\prec w. Updating p(u)p(u) to p(u)Δp^p(u)\Delta\hat{p} corresponds to a free action on the isometry tableau if uu is an input, and applying the 3.1 to the rotation from uu with the stabilizer of p^\hat{p} if uu has a planar label.

Therefore, any two focussed Pauli flows for the same labelled open graph yield PDDAGs that are related by a sequence of applications of the 3.1 and free actions on the isometry tableau.

Proof.

Proof in Appendix (Theorem D.23). ∎

An interesting consequence of this result is the uniqueness of focussed Pauli flow for unitary patterns (up to weakening of the partial order), since there are no free stabilizers with which to apply the 3.1.

6 Conclusion

We have investigated the significance of Pauli flow in the extraction of gate-based reversible circuits from measurement patterns, demonstrating that it is sufficient. This weakens the requirements for circuit extraction from universal measurement patterns compared to previous results. The principal contributions are a polynomial-time algorithm for identifying a Pauli flow for a measurement pattern (if one exists) and using this to construct an equivalent circuit without using ancillas or measurements.

The subsequent investigation using this map formally demonstrated that the effects of common graph-theoretic rewrites on measurement patterns/ZX-diagrams can be simulated via movement of Clifford rotations in a Pauli Dependency DAG. We know that the reverse simulation must be possible from the completeness of the ZX-calculus.

There are a number of possible avenues for future development regarding the topics of this paper:

  • The simulation of rewrites demonstrates that ZX-calculus and PDDAGs can perform equivalent effects, but analysis of the computational complexities is needed to determine preferences for practical usage such as the actual data structure of choice for quantum circuit compilation. This will be heavily dependent on the choice of the graph structure used in each case and how this can capture the dependency relation in the PDDAG.

  • Given a PDDAG (or generic gate-based circuit), the work here provides some practical constraints on Pauli flows that any equivalent measurement pattern should admit. This could give rise to a reverse construction to find a minimal measurement pattern for a given PDDAG, allowing for explicit simulations for any PDDAG rewrite in measurement patterns.

  • The flexibility of the PDDAG structure could be extended by incorporating measurements, discards or decoherence, conditional gates, and more elaborate rewrites aiming for completeness for deciding circuit equivalence.

References

  • [1]
  • [2] Scott Aaronson & Daniel Gottesman (2004): Improved Simulation of Stabilizer Circuits. Physical Review A 70(5), p. 052328, 10.1103/PhysRevA.70.052328.
  • [3] Matthew Amy (2019): Formal Methods in Quantum Circuit Design. Ph.D. thesis. Available at http://hdl.handle.net/10012/14480.
  • [4] Matthew Amy (2019): Towards Large-scale Functional Verification of Universal Quantum Circuits. Electronic Proceedings in Theoretical Computer Science 287, pp. 1–21, 10.4204/EPTCS.287.1.
  • [5] Miriam Backens & Aleks Kissinger (2019): ZH: A Complete Graphical Calculus for Quantum Computations Involving Classical Non-linearity. Electronic Proceedings in Theoretical Computer Science 287, pp. 23–42, 10.4204/EPTCS.287.2.
  • [6] Miriam Backens, Hector Miller-Bakewell, Giovanni de Felice, Leo Lobski & John van de Wetering (2021): There and back again: A circuit extraction tale. Quantum 5, p. 421, 10.22331/q-2021-03-25-421.
  • [7] Panagiotis Kl Barkoutsos, Jerome F. Gonthier, Igor Sokolov, Nikolaj Moll, Gian Salis, Andreas Fuhrer, Marc Ganzhorn, Daniel J. Egger, Matthias Troyer, Antonio Mezzacapo, Stefan Filipp & Ivano Tavernelli (2018): Quantum algorithms for electronic structure calculations: Particle-hole Hamiltonian and optimized wave-function expansions. Physical Review A, 10.1103/PhysRevA.98.022322.
  • [8] Niel De Beaudrap (2010): Unitary-circuit semantics for measurement-based computations. International Journal of Quantum Information, 10.1142/S0219749910006113.
  • [9] Ewout van den Berg & Kristan Temme (2020): Circuit optimization of Hamiltonian simulation by simultaneous diagonalization of Pauli clusters. Quantum 4, p. 322, 10.22331/q-2020-09-12-322.
  • [10] Daniel E Browne, Elham Kashefi, Mehdi Mhalla & Simon Perdrix (2007): Generalized flow and determinism in measurement-based quantum computation. New Journal of Physics 9(8), pp. 250–250, 10.1088/1367-2630/9/8/250.
  • [11] A. R. Calderbank, E. M. Rains, P. W. Shor & N. J.A. Sloane (1997): Quantum error correction and orthogonal geometry. Physical Review Letters, 10.1103/PhysRevLett.78.405.
  • [12] Alexander Cowtan, Silas Dilkes, Ross Duncan, Will Simmons & Seyon Sivarajah (2020): Phase gadget synthesis for shallow circuits. In: Electronic Proceedings in Theoretical Computer Science, EPTCS, 10.4204/EPTCS.318.13.
  • [13] Alexander Cowtan, Will Simmons & Ross Duncan (2020): A Generic Compilation Strategy for the Unitary Coupled Cluster Ansatz. Available at http://arxiv.org/abs/2007.10515.
  • [14] Vincent Danos & Elham Kashefi (2006): Determinism in the one-way model. Physical Review A 74(5), 10.1103/PhysRevA.74.052310.
  • [15] Niel De Beaudrap (2008): Finding flows in the one-way measurement model. Physical Review A - Atomic, Molecular, and Optical Physics 77(2), p. 022328, 10.1103/PhysRevA.77.022328.
  • [16] Ross Duncan, Aleks Kissinger, Simon Perdrix & John Van De Wetering (2020): Graph-theoretic Simplification of Quantum Circuits with the ZX-calculus. Quantum 4, p. 279, 10.22331/q-2020-06-04-279.
  • [17] Ross Duncan & Simon Perdrix (2010): Rewriting Measurement-Based Quantum Computations with Generalised Flow. In: Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), pp. 285–296, 10.1007/978-3-642-14162-1_24.
  • [18] Maryam Eslamy, Mahboobeh Houshmand, Morteza Saheb Zamani & Mehdi Sedighi (2018): Optimization of One-Way Quantum Computation Measurement Patterns. International Journal of Theoretical Physics, 10.1007/s10773-018-3844-x.
  • [19] Andrew Fagan & Ross Duncan (2019): Optimising Clifford Circuits with Quantomatic. Electronic Proceedings in Theoretical Computer Science 287, pp. 85–105, 10.4204/EPTCS.287.5.
  • [20] David Gosset, Vadym Kliuchnikov, Michele Mosca & Vincent Russo (2014): An algorithm for the T-count. Quantum Information and Computation 14(15&16), pp. 1261–1276, 10.26421/QIC14.15-16-1.
  • [21] Daniel Gottesman (1998): The Heisenberg Representation of Quantum Computers. Available at http://arxiv.org/abs/quant-ph/9807006.
  • [22] Aleks Kissinger & John van de Wetering (2020): Reducing the number of non-Clifford gates in quantum circuits. Physical Review A 102(2), p. 022406, 10.1103/PhysRevA.102.022406.
  • [23] Stach Kuijpers, John van de Wetering & Aleks Kissinger (2019): Graphical Fourier Theory and the Cost of Quantum Addition. Available at http://arxiv.org/abs/1904.07551.
  • [24] Louis Lemonnier, John van de Wetering & Aleks Kissinger (2020): Hypergraph simplification: Linking the path-sum approach to the ZH-calculus. Available at http://arxiv.org/abs/2003.13564.
  • [25] Daniel Litinski (2019): A Game of Surface Codes: Large-Scale Quantum Computing with Lattice Surgery. Technical Report, 10.22331/q-2019-03-05-128.
  • [26] Dmitri Maslov (2017): Basic circuit compilation techniques for an ion-trap quantum machine. Technical Report, 10.1088/1367-2630/aa5e47.
  • [27] Dmitri Maslov & Martin Roetteler: Shorter stabilizer circuits via Bruhat decomposition and quantum circuit transformations. Technical Report, 10.1109/TIT.2018.2825602.
  • [28] Mehdi Mhalla & Simon Perdrix (2008): Finding Optimal Flows Efficiently. In: Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), 5125 LNCS, Springer, Berlin, Heidelberg, pp. 857–868, 10.1007/978-3-540-70575-8_70.
  • [29] Kang Feng Ng & Quanlong Wang (2017): A universal completion of the ZX-calculus. Available at http://arxiv.org/abs/1706.09877.
  • [30] Michael A. Nielsen & Isaac L. Chuang (2010): Quantum Computation and Quantum Information. 10.1017/cbo9780511976667.
  • [31] Simon Perdrix & Luc Sanselme (2017): Determinism and Computational Power of Real Measurement-Based Quantum Computation. In: Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), 10472 LNCS, Springer Verlag, pp. 395–408, 10.1007/978-3-662-55751-8_31.
  • [32] Robert Raussendorf & Hans J. Briegel (2001): A one-way quantum computer. Physical Review Letters, 10.1103/PhysRevLett.86.5188.
  • [33] Raphael Dias da Silva, Einar Pius & Elham Kashefi (2013): Global Quantum Circuit Optimization. Available at http://arxiv.org/abs/1301.0351.
  • [34] Maarten Van den Nest, Jeroen Dehaene & Bart De Moor (2004): Graphical description of the action of local Clifford transformations on graph states. Physical Review A - Atomic, Molecular, and Optical Physics, 10.1103/PhysRevA.69.022316.
  • [35] Fang Zhang & Jianxin Chen (2019): Optimizing T gates in Clifford+T circuit as π/4\pi/4 rotations around Paulis. Available at http://arxiv.org/abs/1903.12456.

Appendix A An Algorithm for Identifying Pauli Flow

Here we will build up to an algorithm for identifying a Pauli flow from a graph, which follows the key principle of previous algorithms for causal flow and gflow [28, 6] of delaying measurements as long as possible in order to have as many vertices available for corrections as possible at each step. This is achieved by working backwards from the outputs and calculating the sets of vertices of a given “correction depth”.

Definition A.1.

For a given labelled open graph (G,I,O,λ)(G,I,O,\lambda) and a given Pauli flow (p,)(p,\prec), for each k1k\geq-1 we define the vertices at depth kk under \prec by

Vk:={if k=1max(Vi<kVi)if k0V_{k}^{\prec}:=\begin{cases}\emptyset&\text{if }k=-1\\ \max_{\prec}(V\setminus\bigcup_{i<k}V_{i}^{\prec})&\text{if }k\geq 0\end{cases} (14)

the cumulative vertices up to depth kk by

Vk:=ikViV_{\cup k}^{\prec}:=\bigcup_{i\leq k}V_{i}^{\prec} (15)

and the vertices in each plane correctable at depth k+1k+1 by

Vk+1,XY\displaystyle V_{k+1}^{\prec,XY} :={uO¯|λ(u){XY,X,Y}K(VkΛuXΛuY)I¯.KΛuYVk=Odd(K)ΛuYVkOdd(K)(VkΛuYΛuZ)={u}}\displaystyle:=\left\{u\in\overline{O}\middle|\begin{array}[]{l}\lambda(u)\in\{XY,X,Y\}\wedge\exists K\subseteq(V_{\cup k}^{\prec}\cup\Lambda_{u}^{X}\cup\Lambda_{u}^{Y})\cap\overline{I}.\\ K\cap\Lambda_{u}^{Y}\setminus V_{\cup k}^{\prec}=\mathrm{Odd}(K)\cap\Lambda_{u}^{Y}\setminus V_{\cup k}^{\prec}\\ \wedge\mathrm{Odd}(K)\setminus(V_{\cup k}^{\prec}\cup\Lambda_{u}^{Y}\cup\Lambda_{u}^{Z})=\{u\}\end{array}\right\} (19)
Vk+1,XZ\displaystyle V_{k+1}^{\prec,XZ} :={uO¯|λ(u){XZ,X,Z}K(VkΛuXΛuY)I¯.KΛuYVk=Odd(K{u})ΛuYVkOdd(K{u})(VkΛuYΛuZ)={u}}\displaystyle:=\left\{u\in\overline{O}\middle|\begin{array}[]{l}\lambda(u)\in\{XZ,X,Z\}\wedge\exists K\subseteq(V_{\cup k}^{\prec}\cup\Lambda_{u}^{X}\cup\Lambda_{u}^{Y})\cap\overline{I}.\\ K\cap\Lambda_{u}^{Y}\setminus V_{\cup k}^{\prec}=\mathrm{Odd}(K\cup\{u\})\cap\Lambda_{u}^{Y}\setminus V_{\cup k}^{\prec}\\ \wedge\mathrm{Odd}(K\cup\{u\})\setminus(V_{\cup k}^{\prec}\cup\Lambda_{u}^{Y}\cup\Lambda_{u}^{Z})=\{u\}\end{array}\right\} (23)
Vk+1,YZ\displaystyle V_{k+1}^{\prec,YZ} :={uO¯|λ(u){YZ,Y,Z}K(VkΛuXΛuY)I¯.KΛuYVk=Odd(K{u})ΛuYVkOdd(K{u})(VkΛuYΛuZ)=}\displaystyle:=\left\{u\in\overline{O}\middle|\begin{array}[]{l}\lambda(u)\in\{YZ,Y,Z\}\wedge\exists K\subseteq(V_{\cup k}^{\prec}\cup\Lambda_{u}^{X}\cup\Lambda_{u}^{Y})\cap\overline{I}.\\ K\cap\Lambda_{u}^{Y}\setminus V_{\cup k}^{\prec}=\mathrm{Odd}(K\cup\{u\})\cap\Lambda_{u}^{Y}\setminus V_{\cup k}^{\prec}\\ \wedge\mathrm{Odd}(K\cup\{u\})\setminus(V_{\cup k}^{\prec}\cup\Lambda_{u}^{Y}\cup\Lambda_{u}^{Z})=\emptyset\end{array}\right\} (27)

where ΛuP:={vO¯|vuλ(v)=P}\Lambda_{u}^{P}:=\{v\in\overline{O}|v\neq u\wedge\lambda(v)=P\}.

The sets Vk,XYV_{k}^{\prec,XY}, Vk,XZV_{k}^{\prec,XZ}, Vk,YZV_{k}^{\prec,YZ} capture the vertices vv at correction depth kk for which the vv component of the correcting stabilizer is ZZ, YY, or XX respectively. These definitions are intended to mirror the Pauli flow conditions, with the restrictions on λ(v)\lambda(v) matching [λ.XY][\lambda.XY]-[λ.Y][\lambda.Y] and the other conditions capturing [.X][\prec.X]-[.Y][\prec.Y] using KK for p(v){v}p(v)\setminus\{v\} and VkV_{\cup k}^{\prec} to represent the future vertices under \prec.

Definition A.2 (Delayed).

Given two Pauli flows (p,)(p,\prec) and (p,)(p^{\prime},\prec^{\prime}) for the same labelled open graph, (p,)(p,\prec) is more delayed than (p,)(p^{\prime},\prec^{\prime}) if for all kk,

|Vk||Vk|\left|V_{\cup k}^{\prec}\right|\geq\left|V_{\cup k}^{\prec^{\prime}}\right| (28)

and there exists a kk for which this inequality is strict. A Pauli flow (p,)(p,\prec) is maximally delayed if there exists no Pauli flow over the same labelled open graph that is more delayed.

Remark A.3.

If a labelled open graph admits a Pauli flow, then there must be a maximally delayed Pauli flow since the delayed relation is a strict partial order and there are only finitely many possible Pauli flows (the graph is finite, so there are only finite possible choices of maps pp and orders \prec). Any sequence of increasingly delayed flows must be finite, so we can always reach a maximal point. We will freely assume this without statement in subsequent proofs.

For causal flow and gflow, the set V0V_{0}^{\prec} for a maximally delayed flow is exactly the set of outputs [28, 6] since every measured vertex needs corrections. However, since Pauli flow allows some corrections to be effectively applied in the past of a vertex, we may now have some measured vertices in V0V_{0}^{\prec}. An example is given in Figure 2.

SSRY(α3)RY(\alpha_{3})RX(α4)RX(\alpha_{4})RY(α5)RY(\alpha_{5})RZ(α6)RZ(\alpha_{6})RZ(α0)RZ(\alpha_{0})RY(α2)RY(\alpha_{2})RZ(α1)RZ(\alpha_{1})RY(α7)RY(\alpha_{7})iiaabbccoo
vv λ(v)\lambda(v) p(v)p(v) Odd(p(v))\mathrm{Odd}(p(v)) {u|vu}\{u|v\prec u\}
ii XYXY aa i,b,oi,b,o b,ob,o
aa XX oo aa oo
bb XYXY cc bb -
cc XX b,ob,o cc b,ob,o
Figure 2: A labelled open graph and a maximally delayed Pauli flow with a measured vertex (bb) in V0V_{0}^{\prec}. If (p,)(p,\prec) is focussed, then the primary extraction string for such a vertex is the identity, meaning the measurement angle/outcome has no effect on the overall process.
Lemma A.4.

(Generalisation of [28, Lemma 1], [6, Lemma C.2]) If (p,)(p,\prec) is a maximally delayed Pauli flow of (G,I,O,λ)(G,I,O,\lambda), then V0=OV0,XYV0,XZV0,YZV_{0}^{\prec}=O\cup V_{0}^{\prec,XY}\cup V_{0}^{\prec,XZ}\cup V_{0}^{\prec,YZ}.

Proof.

V0OV0,XYV0,XZV0,YZV_{0}^{\prec}\subseteq O\cup V_{0}^{\prec,XY}\cup V_{0}^{\prec,XZ}\cup V_{0}^{\prec,YZ}: Since the output case is trivial, suppose uV0u\in V_{0}^{\prec} is a non-output. We start by showing that p(u)(V1ΛuXΛuY{u})I¯p(u)\subseteq(V_{-1}^{\prec}\cup\Lambda_{u}^{X}\cup\Lambda_{u}^{Y}\cup\{u\})\cap\overline{I}. p(u)I¯p(u)\subseteq\overline{I} from the definition of Pauli flow, since p:O¯𝒫[I¯]p:\overline{O}\to\mathcal{P}[\overline{I}]. By definition V1=V_{-1}^{\prec}=\emptyset, so we just require p(u)ΛuXΛuY{u}p(u)\subseteq\Lambda_{u}^{X}\cup\Lambda_{u}^{Y}\cup\{u\} which is given by condition [.X][\prec.X]. It remains to show that p(u){u}p(u)\setminus\{u\} is a suitable choice for KK for at least one of the three V0,PQV_{0}^{\prec,PQ} sets.

Every vertex vv satisfies vuv\preceq u (uV0u\in V_{0}^{\prec}), so condition [.Z][\prec.Z] becomes Odd(p(u))(ΛuYΛuZ){u}\mathrm{Odd}(p(u))\setminus(\Lambda_{u}^{Y}\cup\Lambda_{u}^{Z})\subseteq\{u\}. Condition [.Y][\prec.Y] gives p(u)ΛuY=Odd(p(u))ΛuYp(u)\cap\Lambda_{u}^{Y}=\mathrm{Odd}(p(u))\cap\Lambda_{u}^{Y}. We can rewrite these to the appropriate form from the definition of the V0,PQV_{0}^{\prec,PQ} sets based on whether or not uu is in p(u)p(u) and Odd(p(u))\mathrm{Odd}(p(u)). As the cases are mutually exclusive, we only place uu into a single set with conditions [λ.XY][\lambda.XY]-[λ.Y][\lambda.Y] restricting λ(u)\lambda(u) as needed.

V0OV0,XYV0,XZV0,YZV_{0}^{\prec}\supseteq O\cup V_{0}^{\prec,XY}\cup V_{0}^{\prec,XZ}\cup V_{0}^{\prec,YZ}: We will assume that there is some wOV0,XYV0,XZV0,YZw\in O\cup V_{0}^{\prec,XY}\cup V_{0}^{\prec,XZ}\cup V_{0}^{\prec,YZ} but wV0w\notin V_{0}^{\prec} and aim for a contradiction by generating a new Pauli flow that is more delayed than (p,)(p,\prec). If wOw\in O, then we can simply construct the new Pauli flow (p,({w}×V))(p,\prec\setminus(\{w\}\times V)). This is still a Pauli flow since the conditions only concern the measured vertices O¯\overline{O}. This is also more delayed since wV0({w}×V)w\in V_{0}^{\prec\setminus(\{w\}\times V)} and no vertex is made deeper.

For the remaining case, we shall suppose that wV0,XYV0,XZV0,YZw\in V_{0}^{\prec,XY}\cup V_{0}^{\prec,XZ}\cup V_{0}^{\prec,YZ} instead. Let K(ΛwXΛwy)I¯K\subseteq(\Lambda_{w}^{X}\cup\Lambda_{w}^{y})\cap\overline{I} be a witness for wV0,XYV0,XZV0,YZw\in V_{0}^{\prec,XY}\cup V_{0}^{\prec,XZ}\cup V_{0}^{\prec,YZ}. We define p:O¯𝒫[I¯]p^{\prime}:\overline{O}\to\mathcal{P}[\overline{I}] and \prec^{\prime} be the map and partial order:

p(u):={Kif u=w and wV0,XYK{w}if u=w and wV0,XYp(u)if uwp^{\prime}(u):=\begin{cases}K&\text{if }u=w\text{ and }w\in V_{0}^{\prec,XY}\\ K\cup\{w\}&\text{if }u=w\text{ and }w\notin V_{0}^{\prec,XY}\\ p(u)&\text{if }u\neq w\end{cases} (29)
:=({w}×V)\prec^{\prime}:=\prec\setminus(\{w\}\times V) (30)

For uwu\neq w, each of the Pauli flow conditions is trivially preserved, but we need to show they hold for p(w)p^{\prime}(w).

This satisfies condition [.X][\prec.X] from K(ΛwXΛwY)I¯K\subseteq(\Lambda_{w}^{X}\cup\Lambda_{w}^{Y})\cap\overline{I}. For each of the V0,PQV_{0}^{\prec,PQ} options, we get Odd(p(w))(ΛwYΛwZ){w}\mathrm{Odd}(p^{\prime}(w))\setminus\left(\Lambda_{w}^{Y}\cup\Lambda_{w}^{Z}\right)\subseteq\{w\}, so we can show [.Z][\prec.Z]. Similarly, we get p(w)ΛwY=Odd(p(w))ΛwYp^{\prime}(w)\cap\Lambda_{w}^{Y}=\mathrm{Odd}(p^{\prime}(w))\cap\Lambda_{w}^{Y} in each of the V0,PQV_{0}^{\prec,PQ} options, so condition [.Y][\prec.Y] also follows.

The membership of ww in p(w)p^{\prime}(w) and Odd(p(w))\mathrm{Odd}(p^{\prime}(w)) is decided by which of the V0,PQV_{0}^{\prec,PQ} it belongs to, which also restricts λ(w)\lambda(w) to the compatible planes according to conditions [λ.XY][\lambda.XY]-[λ.Y][\lambda.Y].

By assumption, wVkw\in V_{k}^{\prec} for some k>0k>0. By construction, the depth of every vertex under \prec^{\prime} is no larger than its depth under \prec and wV0w\in V_{0}^{\prec^{\prime}}. This means k0.|Vk||Vk|\forall k\geq 0.\left|V_{\cup k}^{\prec}\right|\leq\left|V_{\cup k}^{\prec^{\prime}}\right| and |V0|<|V0|\left|V_{0}^{\prec}\right|<\left|V_{0}^{\prec^{\prime}}\right|, so (p,)(p^{\prime},\prec^{\prime}) is a more delayed Pauli flow than (p,)(p,\prec). ∎

Lemma A.5.

(Generalisation of [28, Lemma 3], [6, Lemma C.4]) If (p,)(p,\prec) is a maximally delayed Pauli flow of (G,I,O,λ)(G,I,O,\lambda), then k>0.Vk=Vk,XYVk,XZVk,YZ\forall k>0.V_{k}^{\prec}=V_{k}^{\prec,XY}\cup V_{k}^{\prec,XZ}\cup V_{k}^{\prec,YZ}.

Proof.

For any given kk, the proof of this follows the same strategy as Lemma A.4. When constructing the more delayed flow given a counterexample ww, we need to adapt the definition of \prec^{\prime} to :=(({w}×V))({w}×Vk1)\prec^{\prime}:=\left(\prec\setminus(\{w\}\times V)\right)\cup(\{w\}\times V_{\cup k-1}^{\prec}). Vertices in Vk1V_{\cup k-1}^{\prec} are not covered by the constraints in the definitions of Vk,PQV_{k}^{\prec,PQ}, so we add them all to the future of ww to make sure we satisfy conditions [.X][\prec.X]-[.Y][\prec.Y]. ∎

These characterisations of the sets VkV_{k}^{\prec} give us an iterative method of identifying them since we can simply search for possible witness sets KK for each vertex.

PauliFlow(V,Γ,I,O,λ)\texttt{PauliFlow}(V,\Gamma,I,O,\lambda) = begin
       LX:=L_{X}:=\emptyset; LY:=L_{Y}:=\emptyset; LZ:=L_{Z}:=\emptyset;
       forall vVv\in V do
             if vOv\in O then d(v):=0d(v):=0;
             if λ(v)=X\lambda(v)=X then LX:=LX{v}L_{X}:=L_{X}\cup\{v\};
             if λ(v)=Y\lambda(v)=Y then LY:=LY{v}L_{Y}:=L_{Y}\cup\{v\};
             if λ(v)=Z\lambda(v)=Z then LY:=LZ{v}L_{Y}:=L_{Z}\cup\{v\};
            
       end forall
      return PauliFlowAux(V,Γ,I,λ,,O,0)\texttt{PauliFlowAux}(V,\Gamma,I,\lambda,\emptyset,O,0);
      
end
PauliFlowAux(V,Γ,I,λ,A,B,k)\texttt{PauliFlowAux}(V,\Gamma,I,\lambda,A,B,k) = begin
       C:=C:=\emptyset;
       forall uBCu\in B^{C} do
             if λ(u){XY,X,Y}\lambda(u)\in\{XY,X,Y\} then
                   KXY:=K_{XY}:= Solution for K(ALXLY)IC{u}K\subseteq(A\cup L_{X}\cup L_{Y})\cap I^{C}\setminus\{u\} where KLY({u}A)=Odd(K)LY({u}A)K\cap L_{Y}\setminus(\{u\}\cup A)=\mathrm{Odd}(K)\cap L_{Y}\setminus(\{u\}\cup A) and Odd(K)((ALYLZ)C{u})={u}\mathrm{Odd}(K)\cap((A\cup L_{Y}\cup L_{Z})^{C}\cup\{u\})=\{u\};
             end if
            if λ(u){XZ,X,Z}\lambda(u)\in\{XZ,X,Z\} then
                   KXZ:={u}K_{XZ}:=\{u\}\cup (Solution for K(ALXLY)IC{u}K\subseteq(A\cup L_{X}\cup L_{Y})\cap I^{C}\setminus\{u\} where KLY({u}A)=Odd(K{u})LY({u}A)K\cap L_{Y}\setminus(\{u\}\cup A)=\mathrm{Odd}(K\cup\{u\})\cap L_{Y}\setminus(\{u\}\cup A) and Odd(K{u})((ALYLZ)C{u})={u}\mathrm{Odd}(K\cup\{u\})\cap((A\cup L_{Y}\cup L_{Z})^{C}\cup\{u\})=\{u\});
             end if
            if λ(u){YZ,Y,Z}\lambda(u)\in\{YZ,Y,Z\} then
                   KYZ:={u}K_{YZ}:=\{u\}\cup (Solution for K(ALXLY)IC{u}K\subseteq(A\cup L_{X}\cup L_{Y})\cap I^{C}\setminus\{u\} where KLY({u}A)=Odd(K{u})LY({u}A)K\cap L_{Y}\setminus(\{u\}\cup A)=\mathrm{Odd}(K\cup\{u\})\cap L_{Y}\setminus(\{u\}\cup A) and Odd(K{u})((ALYLZ)C{u})=\mathrm{Odd}(K\cup\{u\})\cap((A\cup L_{Y}\cup L_{Z})^{C}\cup\{u\})=\emptyset);
             end if
            if a solution K0K_{0} is found for any of KXY,KXZ,KYZK_{XY},K_{XZ},K_{YZ} then
                   C:=C{u}C:=C\cup\{u\};
                   p(u):=K0p(u):=K_{0};
                   d(u):=kd(u):=k;
             end if
            
       end forall
      if C=C=\emptyset and k>0k>0 then
             if B=VB=V then return (true,p,d)(\mathrm{true},p,d);
             else return (false,,)(\mathrm{false},\emptyset,\emptyset);
            
       end if
      else
             B:=BCB^{\prime}:=B\cup C;
             return PauliFlowAux(V,Γ,I,λ,B,B,k+1)\texttt{PauliFlowAux}(V,\Gamma,I,\lambda,B^{\prime},B^{\prime},k+1);
       end if
      
end
Algorithm 1 An algorithm for identifying whether a labelled open graph has a Pauli flow.
Theorem A.6.

(Restatement of Theorem 4.5) There exists an algorithm that decides whether a given labelled open graph has a Pauli flow, and that outputs such a Pauli flow if it exists. Moreover, this output is maximally delayed, and the algorithm completes deterministically in time that grows polynomially with the number of vertices in the graph.

Proof.

The function PauliFlow(V,Γ,I,O,λ)\texttt{PauliFlow}(V,\Gamma,I,O,\lambda) in Algorithm 1 takes sets VV and I,OVI,O\subseteq V of vertices, an adjacency matrix Γ\Gamma over VV and a basis labelling function λ\lambda and returns “true\mathrm{true}” with a Pauli flow if one exists and “false\mathrm{false}” otherwise.

To see this, we consider the auxilliary method PauliFlowAux(V,Γ,I,λ,A,B,k)\texttt{PauliFlowAux}(V,\Gamma,I,\lambda,A,B,k) which aims to identify VkV_{k}^{\prec}, given sets A=Vk1A=V_{\cup k-1}^{\prec} of possible correctors and BVkB\subseteq V_{\cup k}^{\prec} (BAB\supseteq A) of solved vertices, and then proceed recursively over the remainder of the graph for higher depths. For the case of k=0k=0, OV0O\subseteq V_{0}^{\prec} has already been handled by the setup in PauliFlow(V,Γ,I,O,λ)\texttt{PauliFlow}(V,\Gamma,I,O,\lambda) so it is sufficient to just find Vk,XYVk,XZVk,YZV_{k}^{\prec,XY}\cup V_{k}^{\prec,XZ}\cup V_{k}^{\prec,YZ} due to Lemma A.4. For k>0k>0, A=BA=B so we are just finding Vk,XYVk,XZVk,YZV_{k}^{\prec,XY}\cup V_{k}^{\prec,XZ}\cup V_{k}^{\prec,YZ} in accordance with Lemma A.5. In each recursive call, it examines each candidate vertex in turn and looks for a witness set KK for membership into either Vk,XYV_{k}^{\prec,XY}, Vk,XZV_{k}^{\prec,XZ}, or Vk,YZV_{k}^{\prec,YZ}, from which we can identify a valid correction set. The global variables pp and dd map vertices to their correction sets and depths from the output (this defines the order \prec over vertices with vwd(v)>d(w)v\prec w\Leftrightarrow d(v)>d(w)).

This algorithm is guaranteed to terminate because VV is finite and BVB\subseteq V strictly grows with each call for k1k\geq 1, so CC will eventually be an empty set.

The resulting Pauli flow must be maximally delayed because we are constructing the largest set possible at each value of kk. If there were a more delayed Pauli flow (p,)(p^{\prime},\prec^{\prime}), there must be some minimal kk for which VkVkV_{k}^{\prec^{\prime}}\setminus V_{k}^{\prec} is non-empty. However, if a vertex vv belonged in this set then a suitable correction set for vv must exist. Algorithm 1 would find this when testing vv and place it in VkV_{k}^{\prec}.

For a given vertex uu, finding the witness set KK in each of the three possible search cases can be achieved by solving the linear equation system MA,uXK=Sλ~M_{A,u}X_{K}=S_{\tilde{\lambda}} in 𝔽2\mathbb{F}_{2} defined by:

MA,u\displaystyle M_{A,u} :=[Γ𝕂A,u×A,u(Γ+Id)𝕂A,u×𝕐A,u]\displaystyle:=\left[\begin{array}[]{c}\Gamma\cap\mathbb{K}_{A,u}\times\mathbb{P}_{A,u}\\ \hline\cr(\Gamma+\mathrm{Id})\cap\mathbb{K}_{A,u}\times\mathbb{Y}_{A,u}\end{array}\right] (33)
Sλ~\displaystyle S_{\tilde{\lambda}} :={[{u}0]if λ~=XY[(NΓ(u)A,u){u}NΓ(u)𝕐A,u]if λ~=XZ[NΓ(u)A,uNΓ(u)𝕐A,u]if λ~=YZ\displaystyle:=\begin{cases}\left[\begin{array}[]{c}\{u\}\\ \hline\cr 0\end{array}\right]&\text{if }\tilde{\lambda}=XY\\ \left[\begin{array}[]{c}(N_{\Gamma}(u)\cap\mathbb{P}_{A,u})\cup\{u\}\\ \hline\cr N_{\Gamma}(u)\cap\mathbb{Y}_{A,u}\end{array}\right]&\text{if }\tilde{\lambda}=XZ\\ \left[\begin{array}[]{c}N_{\Gamma}(u)\cap\mathbb{P}_{A,u}\\ \hline\cr N_{\Gamma}(u)\cap\mathbb{Y}_{A,u}\end{array}\right]&\text{if }\tilde{\lambda}=YZ\\ \end{cases} (34)

where 𝕂A,u:=(AΛuXΛuY)IC\mathbb{K}_{A,u}:=(A\cup\Lambda_{u}^{X}\cup\Lambda_{u}^{Y})\cap I^{C} is the set of possible elements of the witness set KK, A,u:=(AΛuYΛuZ)C\mathbb{P}_{A,u}:=(A\cup\Lambda_{u}^{Y}\cup\Lambda_{u}^{Z})^{C} is the set of vertices in the past/present which should remain corrected afer measuring and correcting uu, 𝕐A,u:=ΛuYA\mathbb{Y}_{A,u}:=\Lambda_{u}^{Y}\setminus A is the set of vertices we have to consider for condition [.Y][\prec.Y], λ~{XY,XZ,YZ}\tilde{\lambda}\in\{XY,XZ,YZ\} denotes which of the three cases we are considering, and XKX_{K} is the column vector with 11 in the position of vv if vKv\in K and a 0 otherwise.

Taking λ~=XY\tilde{\lambda}=XY as an example, the top block of equations encodes Odd(K)A,u={u}\mathrm{Odd}(K)\cap\mathbb{P}_{A,u}=\{u\} and the lower block encodes KΛuYA=Odd(K)ΛuYAK\cap\Lambda_{u}^{Y}\setminus A=\mathrm{Odd}(K)\cap\Lambda_{u}^{Y}\setminus A, so the solutions to these equations are exactly the possible witness sets KK. Such solutions can be identified by Gaussian elimination and back substitution in O(|V|3)O(|V|^{3}) time.

This part of the algorithm is hit at most |V||V| times per call to PauliFlowAux, which may be called at most |V||V| times, hence the overall complexity of this algorithm is O(|V|5)O(|V|^{5}). ∎

The complexity of this algorithm is higher than the O(|V|4)O(|V|^{4}) for the equivalent method for identifying gflow [6] 222It should be noted that Eslamy et al. provide an even more efficient algorithm for finding gflow in O(|V|3)O(|V|^{3}) time [18]. It may be possible to generalise this to Pauli flow in search of a more efficient routine.. This is because we can no longer do a single gaussian elimination per depth round because the matrix MA,uM_{A,u} and the range of the witness set KK are both dependent on the particular vertex uu under consideration.

Appendix B Focussed Sets and Pauli Flows

Even though the Pauli flow generated by Algorithm 1 is guaranteed to be maximally delayed, the correction sets may not be unique as the back substitution step may not have a single solution. In this section, we will investigate some transformations on Pauli flows resulting from this freedom to show that we can always reach a focussed Pauli flow.

Lemma B.1.

Given a Pauli flow (p,)(p,\prec) for a labelled open graph (G,I,O,λ)(G,I,O,\lambda) with two vertices u,vO¯u,v\in\overline{O} such that uvu\prec v, then (p,)(p^{\prime},\prec) is a Pauli flow where p(u):=p(u)Δp(v)p^{\prime}(u):=p(u)\Delta p(v) and wO¯{u}.p(w):=p(w)\forall w\in\overline{O}\setminus\{u\}.p^{\prime}(w):=p(w). Moreover, if (p,)(p,\prec) is maximally delayed, then so is (p,)(p^{\prime},\prec).

Proof.

The Pauli flow conditions hold trivially for any vertex in O¯{u}\overline{O}\setminus\{u\} since the correction sets have not changed, so it is sufficient to show they are preserved for uu. We should first observe that Odd(p(u))=Odd(p(u)Δp(v))=Odd(p(u))ΔOdd(p(v))\mathrm{Odd}(p^{\prime}(u))=\mathrm{Odd}(p(u)\Delta p(v))=\mathrm{Odd}(p(u))\Delta\mathrm{Odd}(p(v)).

[.X][\prec.X]: For any wp(u)w\in p^{\prime}(u) with wuw\neq u and λ(w){X,Y}\lambda(w)\notin\{X,Y\}, we must have either wp(u)w\in p(u), w=vw=v, or wp(v)wvw\in p(v)\wedge w\neq v. In any of these cases, we have uwu\prec w from [.X][\prec.X] for (p,)(p,\prec) and uvu\prec v.

[.Z][\prec.Z]: This follows similarly from uvu\prec v and [.Z][\prec.Z] on Odd(p(u))\mathrm{Odd}(p(u)) and Odd(p(v))\mathrm{Odd}(p(v)).

[.Y][\prec.Y]: For any wuw\preceq u with λ(w)=Y\lambda(w)=Y, we also must have wvw\preceq v since uvu\prec v. Hence by [.Y][\prec.Y], wp(u)wOdd(p(u))w\in p(u)\Leftrightarrow w\in\mathrm{Odd}(p(u)) and the same for p(v)p(v). Therefore, we find that wp(u)=p(u)Δp(v)wOdd(p(u))ΔOdd(p(v))=Odd(p(u))w\in p^{\prime}(u)=p(u)\Delta p(v)\Leftrightarrow w\in\mathrm{Odd}(p(u))\Delta\mathrm{Odd}(p(v))=\mathrm{Odd}(p^{\prime}(u)) as required.

[λ.XY][\lambda.XY]-[λ.YZ][\lambda.YZ]: up(v)u\notin p(v) and uOdd(p(v))u\notin\mathrm{Odd}(p(v)) by [.X][\prec.X] and [.Z][\prec.Z] since uvu\prec v, so the requirements are given by the corresponding conditions for (p,)(p,\prec).

[λ.X][\lambda.X]: uOdd(p(v))u\notin\mathrm{Odd}(p(v)) by [.Z][\prec.Z] and uOdd(p(u))u\in\mathrm{Odd}(p(u)) by [λ.X][\lambda.X], so uOdd(p(u))u\in\mathrm{Odd}(p^{\prime}(u)).

[λ.Z][\lambda.Z]: up(v)u\notin p(v) by [.X][\prec.X] and up(u)u\in p(u) by [λ.Z][\lambda.Z], so up(u)u\in p^{\prime}(u).

[λ.Y][\lambda.Y]: up(v)uOdd(p(v))u\in p(v)\Leftrightarrow u\in\mathrm{Odd}(p(v)) by [.Y][\prec.Y] and up(u)uOdd(p(u))u\in p(u)\Leftrightarrow u\notin\mathrm{Odd}(p(u)) by [λ.Y][\lambda.Y], then it is straightforward to show up(u)uOdd(p(u))u\in p^{\prime}(u)\Leftrightarrow u\notin\mathrm{Odd}(p^{\prime}(u)) by cases.

The maximally delayed property of a Pauli flow only concerns the partial order between the vertices, so since (p,)(p,\prec) and (p,)(p^{\prime},\prec) both use \prec the property is trivially preserved. ∎

This gives us a mechanism to generate new Pauli flows by adding correction sets together. We now show that this can help us to make progress towards satisfying the focussed property.

Lemma B.2.

For any labelled open graph Γ\Gamma, if sets p^,q^I¯\hat{p},\hat{q}\subseteq\overline{I} are focussed over SO¯S\subseteq\overline{O}, then so is p^Δq^\hat{p}\Delta\hat{q}.

Proof.

[FX][FX]: For any vertex v(p^Δq^)Sv\in(\hat{p}\Delta\hat{q})\cap S, we have either vp^v\in\hat{p} or vq^v\in\hat{q}. Since p^\hat{p} and q^\hat{q} are focussed over SS, the corresponding [FX][FX] condition gives λ(v){XY,X,Y}\lambda(v)\in\{XY,X,Y\}.

[FZ][FZ]: Similarly, for any vertex vOdd(p^Δq^)S=(Odd(p^)ΔOdd(q^))Sv\in\mathrm{Odd}(\hat{p}\Delta\hat{q})\cap S=(\mathrm{Odd}(\hat{p})\Delta\mathrm{Odd}(\hat{q}))\cap S, λ(v){XZ,YZ,Y,Z}\lambda(v)\in\{XZ,YZ,Y,Z\} follows from either vOdd(p^)v\in\mathrm{Odd}(\hat{p}) or vOdd(q^)v\in\mathrm{Odd}(\hat{q}) and [FZ][FZ].

[FY][FY]: For any vSv\in S with λ(v)=Y\lambda(v)=Y, we have vp^vOdd(p^)v\in\hat{p}\Leftrightarrow v\in\mathrm{Odd}(\hat{p}) and vq^vOdd(q^)v\in\hat{q}\Leftrightarrow v\in\mathrm{Odd}(\hat{q}) from [FY][FY] for p^\hat{p} and q^\hat{q}. Hence vp^Δq^vOdd(p^)ΔOdd(q^)v\in\hat{p}\Delta\hat{q}\Leftrightarrow v\in\mathrm{Odd}(\hat{p})\Delta\mathrm{Odd}(\hat{q}). ∎

Lemma B.3.

For any labelled open graph Γ\Gamma, if sets p^,q^I¯\hat{p},\hat{q}\subseteq\overline{I} are not focussed over {v}\{v\} (vO¯v\in\overline{O}), then p^Δq^\hat{p}\Delta\hat{q} is focussed over {v}\{v\}.

Proof.

We consider each case for λ(v)\lambda(v) and how the focussed conditions could fail for p^\hat{p} and q^\hat{q}:

λ(v){XY,X}\lambda(v)\in\{XY,X\}: [FX][FX] and [FY][FY] are trivially satisfied, so we must have vOdd(p^)v\in\mathrm{Odd}(\hat{p}) and vOdd(q^)v\in\mathrm{Odd}(\hat{q}) to fail [FZ][FZ]. This means vOdd(p^)ΔOdd(q^)=Odd(p^Δq^)v\notin\mathrm{Odd}(\hat{p})\Delta\mathrm{Odd}(\hat{q})=\mathrm{Odd}(\hat{p}\Delta\hat{q}), satisfying [FZ][FZ] for p^Δq^\hat{p}\Delta\hat{q}.

λ(v){XZ,YZ,Z}\lambda(v)\in\{XZ,YZ,Z\}: Similarly, [FZ][FZ] and [FY][FY] hold trivially, so we must have vp^v\in\hat{p} and vq^v\in\hat{q} to fail [FX][FX]. We hence have vp^Δq^v\notin\hat{p}\Delta\hat{q}, satisfying [FZ][FZ] for p^Δq^\hat{p}\Delta\hat{q}.

λ(v)=Y\lambda(v)=Y: Now [FX][FX] and [FZ][FZ] are trivial and we have vp^ΔOdd(p^)v\in\hat{p}\Delta\mathrm{Odd}(\hat{p}) and vq^ΔOdd(q^)v\in\hat{q}\Delta\mathrm{Odd}(\hat{q}) to fail [FY][FY]. This now satisfies [FY][FY] since v(p^ΔOdd(p^))Δ(q^ΔOdd(q^))=(p^Δq^)ΔOdd(p^Δq^)v\notin\left(\hat{p}\Delta\mathrm{Odd}(\hat{p})\right)\Delta\left(\hat{q}\Delta\mathrm{Odd}(\hat{q})\right)=(\hat{p}\Delta\hat{q})\Delta\mathrm{Odd}(\hat{p}\Delta\hat{q}). ∎

Combining these two lemmas, we can find combinations of correction sets that fix unfocussed vertices whilst preserving those we have already focussed.

Lemma B.4.

(Generalisation of [6, Lemma 3.13]) Let (G,I,O,λ)(G,I,O,\lambda) be a labelled open graph with a Pauli flow (p,)(p,\prec) and some vertex vO¯v\in\overline{O}. Then there exists p:O¯𝒫[I¯]p^{\prime}:\overline{O}\to\mathcal{P}[\overline{I}] such that:

  1. 1.

    wO¯.v=wp(w)=p(w)\forall w\in\overline{O}.v=w\vee p^{\prime}(w)=p(w);

  2. 2.

    p(v)p^{\prime}(v) is focussed over O¯{v}\overline{O}\setminus\{v\};

  3. 3.

    (p,)(p^{\prime},\prec) is a Pauli flow for (G,I,O,λ)(G,I,O,\lambda).

Proof.

Let J:|O¯|O¯J:\mathbb{Z}_{|\overline{O}|}\to\overline{O} be some indexing of the vertices that respects the order \prec (i,j<|O¯|.J(i)J(j)i<j\forall i,j<|\overline{O}|.J(i)\prec J(j)\Rightarrow i<j). We define a sequence of functions pkp_{k} as:

p0(u)\displaystyle p_{0}(u) :=p(u)\displaystyle:=p(u) (35)
pk+1(u)\displaystyle p_{k+1}(u) :={pk(u)Δpk(J(k))if (u=v,J(k)v,pk(v) is not focussed over {J(k)})pk(u)otherwise\displaystyle:=\begin{cases}p_{k}(u)\Delta p_{k}(J(k))&\text{if }\left(\begin{array}[]{l}u=v,\\ J(k)\neq v,\\ p_{k}(v)\text{ is not focussed over }\{J(k)\}\end{array}\right)\\ p_{k}(u)&\text{otherwise}\\ \end{cases} (36)

1 is satisfied for all (pk,)(p_{k},\prec) by construction, and 3 is also satisfied for all by Lemma B.1. To work towards 2, we proceed inductively with hypothesis Φ(k):=pk(v) is focussed over {J(i)}i<k{v}\Phi(k):=\text{``}p_{k}(v)\text{ is focussed over }\{J(i)\}_{i<k}\setminus\{v\}\text{''}. The k=0k=0 case holds vacuously.

Suppose we have Φ(k)\Phi(k). If J(k)=vJ(k)=v, then pk+1(v)=pk(v)p_{k+1}(v)=p_{k}(v) and Φ(k+1)\Phi(k+1) is an immediate consequence of Φ(k)\Phi(k). If pk(v)p_{k}(v) is focussed over {J(k)}\{J(k)\}, then pk+1(v)=pk(v)p_{k+1}(v)=p_{k}(v), so Φ(k+1)\Phi(k+1) follows from this assumption and Φ(k)\Phi(k). If, on the other hand, pk(v)p_{k}(v) is not focussed over {J(k)}\{J(k)\}, we have pk+1(v)=pk(v)Δpk(J(k))p_{k+1}(v)=p_{k}(v)\Delta p_{k}(J(k)). From conditions [λ.XY][\lambda.XY]-[λ.Y][\lambda.Y], pk(J(k))p_{k}(J(k)) is also not focussed over {J(k)}\{J(k)\}, so by Lemma B.3 we have pk+1(v)p_{k+1}(v) is focussed over {J(k)}\{J(k)\}. For any of the remaining i<ki<k (where J(i)vJ(i)\neq v), Φ(k)\Phi(k) says that pk(v)p_{k}(v) is focussed over {J(i)}\{J(i)\}. Since JJ respects the order \prec, we also have J(i)J(k)J(i)\preceq J(k), and hence conditions [.X][\prec.X]-[.Y][\prec.Y] imply that pk(J(k))p_{k}(J(k)) is focussed over {J(i)}\{J(i)\}. We combine these with Lemma B.2 to deduce that pk+1(v)p_{k+1}(v) is also focussed over {J(i)}\{J(i)\}.

At the end of this chain, we have (p|O¯|,)(p_{|\overline{O}|},\prec) where p|O¯|p_{|\overline{O}|} is focussed over O¯{v}\overline{O}\setminus\{v\}. ∎

Lemma B.5.

(Restatement of Lemma 4.6) If a labelled open graph has a Pauli flow, then it has a maximally delayed, focussed Pauli flow.

Proof.

Let (p,)(p,\prec) be such a maximally delayed Pauli flow according to Remark A.3. Applying Lemma B.4 for each vO¯v\in\overline{O} in turn, we reach some (p,)(p^{\prime},\prec) where, for every vO¯v\in\overline{O}, p(v)p^{\prime}(v) is focussed over O¯{v}\overline{O}\setminus\{v\}, i.e. (p,)(p^{\prime},\prec) is a focussed Pauli flow. Since the partial order \prec remains the same, this is also still maximally delayed. ∎

For general measurement patterns, even focussed Pauli flows may not be unique. However, given multiple focussed Pauli flows, the differences between their correction sets are given by the focussed sets of the graph.

Lemma B.6.

Let Γ=(G,I,O,λ)\Gamma=(G,I,O,\lambda) be a labelled open graph with a focussed Pauli flow (p,)(p,\prec) and a focussed set p^I¯\hat{p}\subseteq\overline{I}. Let vO¯v\in\overline{O} be a vertex such that wp^Odd(p^).λ(w){XY,XZ,YZ}wvvw\forall w\in\hat{p}\cup\mathrm{Odd}(\hat{p}).\lambda(w)\in\{XY,XZ,YZ\}\Rightarrow w\neq v\wedge v\preceq w. Then (p,)(p^{\prime},\prec^{\prime}) is a focussed Pauli flow, where:

p(w):={p(w)Δp^if w=vp(w)if wvp^{\prime}(w):=\begin{cases}p(w)\Delta\hat{p}&\text{if }w=v\\ p(w)&\text{if }w\neq v\end{cases} (37)

and \prec^{\prime} is the transitive closure of {(v,w)|wp^Odd(p^)λ(w){XY,XZ,YZ}}\prec\cup\{(v,w)|w\in\hat{p}\cup\mathrm{Odd}(\hat{p})\wedge\lambda(w)\in\{XY,XZ,YZ\}\}.

Proof.

Firstly, \prec^{\prime} is still a strict partial order. Transitivity is immediate from the definition as a transitive closure. For antisymmetry (and similarly for strictness), suppose on the contrary that we have some aba\prec^{\prime}b and bab\prec^{\prime}a (or directly aaa\prec^{\prime}a). This gives a transitive loop [a,,b,,a][a,\ldots,b,\ldots,a] where each step is either in \prec or {(v,w)|wp^Odd(p^)λ(w){XY,XZ,YZ}}\{(v,w)|w\in\hat{p}\cup\mathrm{Odd}(\hat{p})\wedge\lambda(w)\in\{XY,XZ,YZ\}\}. Since \prec is a strict partial order, we cannot have such a loop where every step is in \prec, so at least one step must be some such (v,w)(v,w). We can freely eliminate inner loops around vv, so we can assume wlog that vv only appears once in the loop. This means the rest of the loop is only from \prec, so wvw\prec v by transitivity. However, we assumed that vwv\preceq w since wp^Odd(p^)w\in\hat{p}\cup\mathrm{Odd}(\hat{p}) and λ(w){XY,XZ,YZ}\lambda(w)\in\{XY,XZ,YZ\}, giving us the contradiction we need.

Conditions [.X][\prec.X]-[.Y][\prec.Y] are preserved from the extension to \prec^{\prime} covering planar labels and the focussed property covering Pauli labels.

Conditions [λ.XY][\lambda.XY]-[λ.YZ][\lambda.YZ] are preserved since vp^Odd(p^)v\notin\hat{p}\cup\mathrm{Odd}(\hat{p}) gives vp(v)vp(v)v\in p^{\prime}(v)\Leftrightarrow v\in p(v) and vOdd(p(v))vOdd(p(v))v\in\mathrm{Odd}(p^{\prime}(v))\Leftrightarrow v\in\mathrm{Odd}(p(v)).

For conditions [λ.X][\lambda.X]-[λ.Y][\lambda.Y], the correction amounts to saying that p(v)p^{\prime}(v) is not focussed over {v}\{v\}. If this were not the case, then p(v)Δp^=p(v)p^{\prime}(v)\Delta\hat{p}=p(v) would be focussed over {v}\{v\} by Lemma B.2, contradicting the corresponding Pauli flow condition for p(v)p(v).

Finally, p(v)p^{\prime}(v) is focussed over O¯{v}\overline{O}\setminus\{v\} using Lemma B.2, so (p,)(p^{\prime},\prec^{\prime}) is focussed. ∎

Lemma B.7.

Let Γ\Gamma be a labelled open graph with two focussed Pauli flows (p,)(p,\prec) and (p,)(p^{\prime},\prec^{\prime}). Then for any vertex vO¯v\in\overline{O}, p(v)Δp(v)p(v)\Delta p^{\prime}(v) is a focussed set.

Proof.

Each of p(v)p(v) and p(v)p^{\prime}(v) are focussed over O¯{v}\overline{O}\setminus\{v\}, so their combination must also be by Lemma B.2. For each case of λ(v)\lambda(v), the corresponding condition from [λ.XY][\lambda.XY]-[λ.Y][\lambda.Y] is then enough to show that p(v)Δp(v)p(v)\Delta p^{\prime}(v) is also focussed over {v}\{v\}. ∎

An important consequence of this result is that in order to fully identify the space of all focussed Pauli flows for a given labelled open graph, it is sufficient to find one using Algorithm 1 that we focus with Lemma 4.6, and find all of the focussed sets. The following proofs show that the focussed sets form a group, allowing us to only need some generating set, and giving an algorithm for finding such generators.

Lemma B.8.

The focussed sets of a labelled open graph form a group under Δ\Delta.

Proof.

Closure is a direct consequence of Lemma B.2 with S=O¯S=\overline{O}. We then extend this to a group with identity \emptyset and each focussed set is self-inverse. ∎

Lemma B.9.

Any labelled open graph Γ=(G,I,O,λ)\Gamma=(G,I,O,\lambda) with a focussed Pauli flow has 2|O||I|2^{|O|-|I|} distinct focussed sets.

Proof.

We can find the number of subsets of I¯\overline{I} that are focussed over some SO¯S\subseteq\overline{O} inductively over the size of SS using the following induction hypothesis:

Φ(k):=SO¯.|S|=k|{p^I¯|p^ is focussed over S}|=2|I¯||S|\Phi(k):=\forall S\subseteq\overline{O}.|S|=k\Rightarrow\left|\left\{\hat{p}\subseteq\overline{I}\middle|\hat{p}\text{ is focussed over }S\right\}\right|=2^{|\overline{I}|-|S|} (38)

For k=0k=0, we only have to consider S=S=\emptyset. Any subset of |I¯||\overline{I}| satisfies the required properties, so there are 2|I¯|2^{|\overline{I}|} many such sets, so Φ(0)\Phi(0) holds.

Suppose Φ(k)\Phi(k) holds for some k0k\geq 0. Suppose SO¯S\subseteq\overline{O} is of size k+1k+1 and choose any vertex vSv\in S. Let Sv:=SvS_{v}:=S\setminus v, so |Sv|=k|S_{v}|=k. Φ(k)\Phi(k) implies there are 2|I¯|k2^{|\overline{I}|-k} subsets of I¯\overline{I} that are focussed over SvS_{v}. The subsets focussed over SS are those that are focussed over both SvS_{v} and {v}\{v\}.

Let (p,)(p,\prec) be some focussed Pauli flow for Γ\Gamma, so p(v)p(v) is focussed over O¯v\overline{O}\setminus v, and hence for SvS_{v}. Lemma B.2 implies the sets focussed over SvS_{v} are closed under symmetric difference with p(v)p(v). However, Lemma B.3 implies p^\hat{p} is focussed over {p}\{p\} if and only if p^Δp(v)\hat{p}\Delta p(v) is not because p(v)p(v) corrects the measurement at vv. This means taking the symmetric difference with p(v)p(v) defines a bijection between the sets that are focussed for SS and those that are focussed for SvS_{v} but not for {v}\{v\}. Since these are disjoint and partition the 2|I¯|k2^{|\overline{I}|-k} that are focussed over SvS_{v}, we must have 2|I¯|(k+1)2^{|\overline{I}|-(k+1)} that are focussed over SS, giving Φ(k+1)\Phi(k+1).

Focussed sets are those that are focussed over the entirety of O¯\overline{O}, so Φ(|O¯|)\Phi(|\overline{O}|) tells us that there are 2|I¯||O¯|=2|O||I|2^{|\overline{I}|-|\overline{O}|}=2^{|O|-|I|} focussed sets. ∎

Lemma B.10.

Given a labelled open graph Γ\Gamma with focussed Pauli flow, there exists an algorithm that identifies |O||I||O|-|I| independent generators for the group of focussed sets of Γ\Gamma. Furthermore, this algorithm completes in time polynomial in the number of vertices in Γ\Gamma.

Proof.

Similar to Theorem 4.5, we can encode the conditions for focussed sets into a linear equation system MX=SMX=S in 𝔽2\mathbb{F}_{2} which can be solved by Gaussian elimination and back substitution to obtain a single focussed set.

M\displaystyle M :=[Γ×𝕆C(Γ+Id)×𝕐]\displaystyle:=\left[\begin{array}[]{c}\Gamma\cap\mathbb{P}\times\mathbb{O}^{C}\\ \hline\cr(\Gamma+\mathrm{Id})\cap\mathbb{P}\times\mathbb{Y}\end{array}\right] (41)
S\displaystyle S :=[00]\displaystyle:=\left[\begin{array}[]{c}0\\ \hline\cr 0\end{array}\right] (44)
\displaystyle\mathbb{P} :=(O{wO¯|λ(w){XY,X,Y}})I¯\displaystyle:=(O\cup\{w\in\overline{O}|\lambda(w)\in\{XY,X,Y\}\})\cap\overline{I} (45)
𝕆\displaystyle\mathbb{O} :=O{wO¯|λ(w){XZ,YZ,Y,Z}}\displaystyle:=O\cup\{w\in\overline{O}|\lambda(w)\in\{XZ,YZ,Y,Z\}\} (46)
𝕐\displaystyle\mathbb{Y} :={wO¯|λ(w)=Y}\displaystyle:=\{w\in\overline{O}|\lambda(w)=Y\} (47)

In the above, we let Γ\Gamma stand for the adjacency matrix of its graph. We define \mathbb{P} to be the set of vertices that could be included in a focussed set and 𝕆\mathbb{O} the set of vertices that could be in the odd neighbourhood. Solutions satisfy [FX][FX] since XX only ranges over \mathbb{P}. The top block of the system encodes [FZ][FZ] since multiplying by Γ\Gamma in 𝔽2\mathbb{F}_{2} gives the odd neighbourhood, and similarly the bottom block encodes [FY][FY].

We need to add additional conventions to make sure that the focussed sets we obtain are non-empty and independent. Since this system is underconstrained (when there exist non-empty focussed sets), there will always be some freedom of choice during the back substitution step. Since every focussed set must be a solution, these free substitutions must generate the full set. Hence we can obtain independent, non-empty focussed sets by taking a single free substitution for each focussed set, iterating through each free substitution in turn.

Since both |||\mathbb{P}| and |𝕆C|+|𝕐||\mathbb{O}^{C}|+|\mathbb{Y}| are at most |V||V|, the Gaussian elimination takes O(|V|3)O(|V|^{3}) time. Each back substitution takes O(|V|2)O(|V|^{2}) time, which we must repeat |O||I||O|-|I| times giving O(|V|3)O(|V|^{3}) again. ∎

It should be noted that similar conditions can be incorporated into Algorithm 1 to directly obtain focussed Pauli flows by imposing further restrictions on the vertices that can be included in the correction sets and adding extra equations to restrict the odd neighbourhood.

A final comment we will make about the focussed conditions is that it removes the need for any ordering relation between Pauli vertices. When the measurement pattern uses only Pauli measurements, all of them can be measured simultaneously, giving a single round of corrections on the outputs. When there are additional planar measurements, we can do all Pauli measurements in a single layer before considering any of the planar measurements.

Lemma B.11.

If a labelled open graph has a Pauli flow, then there exists a Pauli flow (p,)(p,\prec) which satisfies vO¯.λ(v){X,Y,Z}uV.vu\forall v\in\overline{O}.\lambda(v)\in\{X,Y,Z\}\Rightarrow\forall u\in V.v\preceq u.

Proof.

Given a Pauli flow (p,)(p,\prec), we can assume wlog that it is focussed from Lemma 4.6. Let :={(u,v)V×O¯|λ(v){X,Y,Z}}\prec^{\prime}:=\prec\setminus\{(u,v)\in V\times\overline{O}|\lambda(v)\in\{X,Y,Z\}\}. By construction, this satisfies vO¯.λ(v){X,Y,Z}uV.vu\forall v\in\overline{O}.\lambda(v)\in\{X,Y,Z\}\Rightarrow\forall u\in V.v\preceq^{\prime}u. To show that (p,)(p,\prec^{\prime}) is a valid Pauli flow, we just need to show that [.X][\prec.X]-[.Y][\prec.Y] are unaffected which all follow from the focussed conditions. ∎

Appendix C Proofs for Circuit Extraction

This section will explore how to identify extraction strings and their properties, building up to a proof of Theorem 4.7 for circuit extraction. As dicussed in Section 4, the key principle is to extract planar measurement angles as rotations over the outputs, to leave behind a stabilizer process. We start by building up an explicit construction for extraction strings from a focussed Pauli flow.

Lemma C.1.

Given a Pauli flow (p,)(p,\prec) for a labelled open graph (G,I,O,λ)(G,I,O,\lambda), for any vertex vO¯v\in\overline{O} the size of p(v)Odd(p(v))p(v)\cap\mathrm{Odd}(p(v)) is even.

Proof.

Let G=(V,E)G=(V,E) and define the subgraph G=(p(v),E(p(v)×p(v)))G^{\prime}=(p(v),E\cap(p(v)\times p(v))). For any vertex wVw\in V, wp(v)Odd(p(v))w\in p(v)\cap\mathrm{Odd}(p(v)) if and only if ww has odd degree in GG^{\prime}. Since the sum of the vertex degrees must equal 22 times the number of edges in GG^{\prime}, there must be an even number of vertices with odd degree. ∎

Lemma C.2.

(Restatement of Lemma 4.4) Let Γ=(G,I,O,λ)\Gamma=(G,I,O,\lambda) be a labelled open graph with some measurement angles α:O¯[0,2π)\alpha:\overline{O}\to\left[0,2\pi\right) and a focussed Pauli flow (p,)(p,\prec). Then for any vertex vO¯v\in\overline{O}, p(v)p(v) determines a PvP^{\bot v}-extraction string.

Proof.

Consider an arbitrary measured vertex vO¯v\in\overline{O}.

Since each correction set p(v)p(v) is a subset of the non-input vertices, we can combine the graph state stabilizers. We may reorder the ZZ and XX terms with the possible introduction of a (1)(-1).

EGNI¯=(1)a(up(v)Xu)(uOdd(p(v))Zu)EGNI¯E_{G}N_{\overline{I}}=(-1)^{a}\left(\prod_{u\in p(v)}X_{u}\right)\left(\prod_{u\in\mathrm{Odd}(p(v))}Z_{u}\right)E_{G}N_{\overline{I}} (48)

where a=|E(p(v)×p(v))|a=|E\cap(p(v)\times p(v))| is the number of edges in the subgraph of p(v)p(v), since for each edge here we have to reorder the ZZ and XX terms on exactly one of the two vertices.

There are an even number of vertices with both an XX and a ZZ (see Lemma C.1), so we can apply Y=iXZY=iXZ on all such instances, again introducing a possible (1)(-1) term.

EGNI¯=(1)b(up(v)Odd(p(v))Xu)(uOdd(p(v))p(v)Zu)(up(v)Odd(p(v))Yu)EGNI¯\begin{split}E_{G}N_{\overline{I}}=(-1)^{b}&\left(\prod_{u\in p(v)\setminus\mathrm{Odd}(p(v))}X_{u}\right)\left(\prod_{u\in\mathrm{Odd}(p(v))\setminus p(v)}Z_{u}\right)\\ &\left(\prod_{u\in p(v)\cap\mathrm{Odd}(p(v))}Y_{u}\right)E_{G}N_{\overline{I}}\end{split} (49)

where b=a+|p(v)Odd(p(v))|/2b=a+|p(v)\cap\mathrm{Odd}(p(v))|/2.

Since (p,)(p,\prec) is a Pauli flow, every vertex in p(v)p(v) or Odd(p(v))\mathrm{Odd}(p(v)) is either a Pauli measurement or greater than vv in \prec (from conditions [.X][\prec.X] and [.Z][\prec.Z]). To fit the form from Equation 12, we consider adding the corresponding projections. Since (p,)(p,\prec) is focussed, each vertex (besides outputs and vv) in p(v)Odd(p(v))p(v)\setminus\mathrm{Odd}(p(v)) is projected into an XX basis eigenvector, and similarly Odd(p(v))p(v)\mathrm{Odd}(p(v))\setminus p(v) into ZZ and p(v)Odd(p(v))p(v)\cap\mathrm{Odd}(p(v)) into YY. This means we can absorb these Pauli operators into the projections, again with the possible introduction of a (1)(-1).

(uvλ(u){X,Y,Z}+λ(u),0|u)(uO¯{v}λ(u){X,Y,Z}+λ(u),α(u)|u)EGNI¯=(1)c(uvλ(u){X,Y,Z}+λ(u),0|u)(uO¯{v}λ(u){X,Y,Z}+λ(u),α(u)|u)(u(p(v)Odd(p(v)))(O{v})Xu)(u(Odd(p(v))p(v))(O{v})Zu)(up(v)Odd(p(v))(O{v})Yu)EGNI¯\begin{split}\left(\prod_{\begin{subarray}{c}u\succ v\\ \lambda(u)\notin\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda(u),0}}_{u}\right)\left(\prod_{\begin{subarray}{c}u\in\overline{O}\setminus\{v\}\\ \lambda(u)\in\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda(u),\alpha(u)}}_{u}\right)E_{G}N_{\overline{I}}\\ =(-1)^{c}\left(\prod_{\begin{subarray}{c}u\succ v\\ \lambda(u)\notin\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda(u),0}}_{u}\right)\left(\prod_{\begin{subarray}{c}u\in\overline{O}\setminus\{v\}\\ \lambda(u)\in\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda(u),\alpha(u)}}_{u}\right)\\ \left(\prod_{u\in(p(v)\setminus\mathrm{Odd}(p(v)))\cap(O\cup\{v\})}X_{u}\right)\left(\prod_{u\in(\mathrm{Odd}(p(v))\setminus p(v))\cap(O\cup\{v\})}Z_{u}\right)\\ \left(\prod_{u\in p(v)\cap\mathrm{Odd}(p(v))\cap(O\cup\{v\})}Y_{u}\right)E_{G}N_{\overline{I}}\end{split} (50)

where c=b+|(p(v)Odd(p(v))){uO¯|λ(u){X,Y,Z}α(u)=π}|c=b+\left|\left(p(v)\cup\mathrm{Odd}(p(v))\right)\cap\{u\in\overline{O}|\lambda(u)\in\{X,Y,Z\}\wedge\alpha(u)=\pi\}\right|.

This is now a Pauli operator with PvP^{\bot v} on vv and remainder over only the outputs, making it a valid primary extraction string. ∎

Recall that the 3.1 can use these extraction strings to remove the measurement angles. We can summarise Equation 10 by

+λ(v),α(v)|\displaystyle\bra{+_{\lambda(v),\alpha(v)}} +λ(v),0|e(1)Dviα(v)2Pv\displaystyle\approx\bra{+_{\lambda(v),0}}e^{(-1)^{D_{v}}i\tfrac{\alpha(v)}{2}P^{\bot v}} (51)
Dv\displaystyle D_{v} :={1if λ(v)=YZ0otherwise\displaystyle:=\begin{cases}1&\text{if }\lambda(v)=YZ\\ 0&\text{otherwise}\end{cases} (52)

where DvD_{v} dictates the direction of rotation about the Bloch sphere. This means the rotation we extract over the outputs is e(1)Dviα(v)2𝐏ve^{(-1)^{D_{v}}i\tfrac{\alpha(v)}{2}\mathbf{P}^{\bot v}}.

After extracting all planar measurement angles, we are left with the following stabilizer process:

𝒞=(uO¯λ(u){X,Y,Z}+λ(u),0|u)(uO¯λ(u){X,Y,Z}+λ(u),α(u)|u)EGNI¯\mathcal{C}=\left(\prod_{\begin{subarray}{c}u\in\overline{O}\\ \lambda(u)\notin\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda(u),0}}_{u}\right)\left(\prod_{\begin{subarray}{c}u\in\overline{O}\\ \lambda(u)\in\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda(u),\alpha(u)}}_{u}\right)E_{G}N_{\overline{I}} (53)

We can characterise this by finding its isometry tableau. Recall from Section 3 that the isometry tableau generalises variants of the stabilizer tableau representation from previous literature for both stabilizer states [34], where the rows represent generators for the stabilizer group, and unitaries [2], where the rows represent the actions of the unitary on ZuZ_{u} and XuX_{u} for each input uu - that is, the operator 𝐏\mathbf{P} such that 𝐏𝒞Zu=𝒞\mathbf{P}\mathcal{C}Z_{u}=\mathcal{C}. It is enough for us to find such ZuZ_{u} and XuX_{u} actions for each input along with |O||I||O|-|I| generators for the free stabilizers over the outputs.

Since ZZ on an input will commute through the CZCZ gates, we can get the corresponding stablizer row from the primary extraction string assuming Pu=ZP^{\bot u}=Z for this input. This is guaranteed since the correction set cannot contain any inputs, including itself.

We can use the same trick to obtain the XX rows from primary extraction strings. In this case, we find an altered pattern (Γ,α)(\Gamma^{\prime},\alpha^{\prime}) such that 𝒞𝒞Hu\mathcal{C}\approx\mathcal{C}^{\prime}H_{u}. The Hadamard maps XX to a ZZ, meaning we can use the extraction string with respect to (Γ,α)(\Gamma^{\prime},\alpha^{\prime}). One way to achieve this is by input extension.

Definition C.3 (Input Extension).

Given an open graph (G,I,O)(G,I,O), input extension about uIu\in I adds a new vertex uu^{\prime} that is only connected to uu and replaces uu in the input set. Formally, V=V{u}V^{\prime}=V\cup\{u^{\prime}\}, E=E{uu}E^{\prime}=E\cup\{u^{\prime}\sim u\}, I=(I{u}){u}I^{\prime}=(I\cup\{u^{\prime}\})\setminus\{u\}.

Lemma C.4.

Let (Γ,α)(\Gamma,\alpha) describe a measurement pattern with some chosen input uIu\in I. Taking an input extension about uu gives an equivalent measurement pattern (Γ,α)(\Gamma^{\prime},\alpha^{\prime}) assuming λ=λ{uXY}\lambda^{\prime}=\lambda\cup\{u^{\prime}\mapsto XY\}, α=α{u0}\alpha^{\prime}=\alpha\cup\{u^{\prime}\mapsto 0\}, and a Hamadard gate is applied to input uu^{\prime} before the start of the pattern.

Proof.

It is enough to verify the following equation:

H=2(+XY,0|𝕀)CZ(𝕀|+X,0)H=\sqrt{2}\left(\bra{+_{XY,0}}\otimes\mathbb{I}\right)CZ\left(\mathbb{I}\otimes\ket{+_{X,0}}\right) (54)

In order to actually use this, we need to show that Pauli flows are preserved by input extensions.

Lemma C.5.

(Generalisation of [6, Lemma 3.8]) Let Γ\Gamma and Γ\Gamma^{\prime} be labelled open graphs related by an input extension on vertex uIu\in I (generating uIu^{\prime}\in I^{\prime}). If Γ\Gamma has a Pauli flow, then so does Γ\Gamma^{\prime}.

Proof.

Suppose Γ\Gamma has a Pauli flow (p,)(p,\prec). Let p=p{u{u}}p^{\prime}=p\cup\{u^{\prime}\mapsto\{u\}\} and \prec^{\prime} be the transitive closure of {(u,w)|wNG(u){u}}\prec\cup\{(u^{\prime},w)|w\in N_{G}(u)\cup\{u\}\}.

For any vVOv\in V\setminus O, up(v)=p(v)u^{\prime}\notin p^{\prime}(v)=p(v) and uOddG(p(v))=OddG(p(v))u^{\prime}\notin\mathrm{Odd}_{G^{\prime}}(p^{\prime}(v))=\mathrm{Odd}_{G}(p(v)) since its only neighbour uu is an input in Γ\Gamma which could not appear in any correction sets from pp. This allows us to inherit all of the Pauli flow properties from (p,)(p,\prec) for vv as they have remained unchanged.

For uu^{\prime}, the definition of \prec^{\prime} guarantees conditions [.X][\prec.X]-[.Y][\prec.Y] since uwu^{\prime}\prec^{\prime}w for every wNG(u){u}=(OddG(p(u)){u})p(u)w\in N_{G}(u)\cup\{u\}=(\mathrm{Odd}_{G^{\prime}}(p^{\prime}(u^{\prime}))\setminus\{u^{\prime}\})\cup p^{\prime}(u^{\prime}). From the construction of p(u)p^{\prime}(u^{\prime}), we satisfy condition [λ.XY][\lambda.XY], and the remainder hold trivially. ∎

The remaining stabilizer generators can be obtained from the focussed sets of the measurement pattern.

Lemma C.6.

Given a measurement pattern (Γ,α)(\Gamma,\alpha) where the labelled open graph Γ=(G,I,O,λ)\Gamma=(G,I,O,\lambda) has a focussed set p^\hat{p}, then p^\hat{p} determines a stabilizer 𝐏^\mathbf{\hat{P}} of the linear map:

(wO¯λ(w){X,Y,Z}+λ(w),0|w)(wO¯λ(w){X,Y,Z}+λ(w),α(w)|w)EGNI¯\left(\prod_{\begin{subarray}{c}w\in\overline{O}\\ \lambda(w)\notin\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda(w),0}}_{w}\right)\left(\prod_{\begin{subarray}{c}w\in\overline{O}\\ \lambda(w)\in\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda(w),\alpha(w)}}_{w}\right)E_{G}N_{\overline{I}} (55)
Proof.

This follows similarly to Lemma 4.4. After applying the measurement projections, the only Pauli terms that are not absorbed into the projections are over the output qubits. ∎

Lemma B.9 implies that we can get |O||I||O|-|I| generators for the group of focussed sets, and we are looking for |O||I||O|-|I| generators for the free stabilizers. For this to work, we need the map from Lemma C.6 to be a bijection (i.e. the generators for the focussed sets don’t degenerate when mapped into stabilizers). We go one step further by showing that it also preserves the group action as a result of Lemmas C.7 and C.8.

Lemma C.7.

Let Γ\Gamma be a labelled open graph. For any set of vertices SI¯S\subseteq\overline{I}, denote the output substring of the stabilizer as 𝐏S=(wOSXw)(wOOdd(S)Zw)\mathbf{P}^{S}=\left(\prod_{w\in O\cap S}X_{w}\right)\left(\prod_{w\in O\cap\mathrm{Odd}(S)}Z_{w}\right). Then for any S,TI¯S,T\subseteq\overline{I} we have 𝐏S𝐏T𝐏SΔT\mathbf{P}^{S}\mathbf{P}^{T}\approx\mathbf{P}^{S\Delta T}.

Proof.

This follows from the anticommutativity of XX and ZZ and Odd(SΔT)=Odd(S)ΔOdd(T)\mathrm{Odd}(S\Delta T)=\mathrm{Odd}(S)\Delta\mathrm{Odd}(T).

𝐏S𝐏T=(wOSXw)(wOOdd(S)Zw)(wOTXw)(wOOdd(T)Zw)(wOSXw)(wOTXw)(wOOdd(S)Zw)(wOOdd(T)Zw)=(wO(SΔT)Xw)(wOOdd(SΔT)Zw)=𝐏SΔT\begin{split}\mathbf{P}^{S}\mathbf{P}^{T}&=\left(\prod_{w\in O\cap S}X_{w}\right)\left(\prod_{w\in O\cap\mathrm{Odd}(S)}Z_{w}\right)\left(\prod_{w\in O\cap T}X_{w}\right)\left(\prod_{w\in O\cap\mathrm{Odd}(T)}Z_{w}\right)\\ &\approx\left(\prod_{w\in O\cap S}X_{w}\right)\left(\prod_{w\in O\cap T}X_{w}\right)\left(\prod_{w\in O\cap\mathrm{Odd}(S)}Z_{w}\right)\left(\prod_{w\in O\cap\mathrm{Odd}(T)}Z_{w}\right)\\ &=\left(\prod_{w\in O\cap(S\Delta T)}X_{w}\right)\left(\prod_{w\in O\cap\mathrm{Odd}(S\Delta T)}Z_{w}\right)\\ &=\mathbf{P}^{S\Delta T}\end{split} (56)

Lemma C.8.

For any non-zero linear map 𝒞\mathcal{C} with stabilizers AA and BB, if AA and BB share the same Pauli string then A=BA=B.

Proof.

If AA and BB share the same Pauli string, they can only differ by phase, so B=eiθAB=e^{i\theta}A. Since stabilizers form a group, AB=A(eiθA)=eiθIAB=A(e^{i\theta}A)=e^{i\theta}I is also a stabilizer, i.e. 𝒞=eiθ𝒞\mathcal{C}=e^{i\theta}\mathcal{C}. eiθ1e^{i\theta}\neq 1 implies 𝒞\mathcal{C} is a zero map, so we must have A=BA=B. ∎

Because the groups of focussed sets and free stabilizers have the same finite cardinality, injectivity is enough to show that we have an isomorphism. We can prove this by showing that only the empty set gets mapped to the identity.

Lemma C.9.

Let (Γ,α)(\Gamma,\alpha) describe a measurement pattern with a focussed Pauli flow (p,)(p,\prec). Then for any vertices u,vO¯u,v\in\overline{O} the primary extraction strings satisfy

𝐏u𝐏v=(1)Fuvp+Fvup𝐏v𝐏u\mathbf{P}^{\bot u}\mathbf{P}^{\bot v}=(-1)^{F_{u\to v}^{p}+F_{v\to u}^{p}}\mathbf{P}^{\bot v}\mathbf{P}^{\bot u} (57)

where Fxyp:=|{y}(p(x)Odd(p(x)))|F_{x\to y}^{p}:=|\{y\}\cap(p(x)\cup\mathrm{Odd}(p(x)))| indicates whether yy is used in the correction of xx. Similarly, given a focussed set p^\hat{p}, its stabilizer satisfies

𝐏u𝐏^=(1)Gp^u𝐏^𝐏u\mathbf{P}^{\bot u}\mathbf{\hat{P}}=(-1)^{G_{\hat{p}\to u}}\mathbf{\hat{P}}\mathbf{P}^{\bot u} (58)

where Gp^u=|{u}(p^Odd(p^))|G_{\hat{p}\to u}=|\{u\}\cap(\hat{p}\cup\mathrm{Odd}(\hat{p}))| indicates whether uu is used in the generation of the stabilizer.

Proof.

Since 𝐏u\mathbf{P}^{\bot u} and 𝐏v\mathbf{P}^{\bot v} are tensor products of Pauli matrices, they must either commute or anticommute. Consider the linear map 𝒞\mathcal{C} given by:

𝒞:=(wO¯{u,v}λ(w){X,Y,Z}uwvw+λ(w),0|w)(wO¯{u,v}λ(w){X,Y,Z}+λ(w),α(w)|w)EGNI¯\mathcal{C}:=\left(\prod_{\begin{subarray}{c}w\in\overline{O}\setminus\{u,v\}\\ \lambda(w)\notin\{X,Y,Z\}\\ u\prec w\vee v\prec w\end{subarray}}\bra{+_{\lambda(w),0}}_{w}\right)\left(\prod_{\begin{subarray}{c}w\in\overline{O}\setminus\{u,v\}\\ \lambda(w)\in\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda(w),\alpha(w)}}_{w}\right)E_{G}N_{\overline{I}} (59)

This may not be in the exact form needed to introduce extraction strings for uu and vv if they use each other for corrections. Let PxyP^{x\to y} be the Pauli induced on yy when correcting xx.

Pxy:={Iif yp(x)Odd(p(x))Xif yp(x)Odd(p(x))Yif yp(x)Odd(p(x))Zif yOdd(p(x))p(x)P^{x\to y}:=\begin{cases}I&\text{if }y\notin p(x)\cup\mathrm{Odd}(p(x))\\ X&\text{if }y\in p(x)\setminus\mathrm{Odd}(p(x))\\ Y&\text{if }y\in p(x)\cap\mathrm{Odd}(p(x))\\ Z&\text{if }y\in\mathrm{Odd}(p(x))\setminus p(x)\end{cases} (60)

We can still follow the construction in the proof of Lemma 4.4 to deduce that (1)AuvpPuuPuvv𝐏u(-1)^{A_{u\to v}^{p}}P^{\bot u}_{u}P^{u\to v}_{v}\mathbf{P}^{\bot u} and (1)AvupPvuuPvv𝐏v(-1)^{A_{v\to u}^{p}}P^{v\to u}_{u}P^{\bot v}_{v}\mathbf{P}^{\bot v} are stabilizers of 𝒞\mathcal{C} where

Axyp:={Fxypif λ(y){X,Y,Z}α(y)=π0otherwiseA_{x\to y}^{p}:=\begin{cases}F_{x\to y}^{p}&\text{if }\lambda(y)\in\{X,Y,Z\}\wedge\alpha(y)=\pi\\ 0&\text{otherwise}\end{cases} (61)

Comparing conditions [λ.XY][\lambda.XY]-[λ.Y][\lambda.Y] and the focussed conditions, we see that, for any vertex xO¯x\in\overline{O}, PxP^{\bot x} is orthogonal to the measurement plane/Pauli of xx and hence anticommutes with any PyxIP^{y\to x}\neq I. Equationally, PxPyx=(1)FyxpPyxPxP^{\bot x}P^{y\to x}=(-1)^{F_{y\to x}^{p}}P^{y\to x}P^{\bot x}.

The stabilizer group of 𝒞\mathcal{C} is abelian, so we have

(1)AuvpPuuPuvv𝐏u(1)AvupPvuuPvv𝐏v=(1)AvupPvuuPvv𝐏v(1)AuvpPuuPuvv𝐏u=(1)Fuvp+Fvup(1)AuvpPuuPuvv𝐏v(1)AvupPvuuPvv𝐏u\begin{split}&(-1)^{A_{u\to v}^{p}}P^{\bot u}_{u}P^{u\to v}_{v}\mathbf{P}^{\bot u}(-1)^{A_{v\to u}^{p}}P^{v\to u}_{u}P^{\bot v}_{v}\mathbf{P}^{\bot v}\\ =&(-1)^{A_{v\to u}^{p}}P^{v\to u}_{u}P^{\bot v}_{v}\mathbf{P}^{\bot v}(-1)^{A_{u\to v}^{p}}P^{\bot u}_{u}P^{u\to v}_{v}\mathbf{P}^{\bot u}\\ =&(-1)^{F_{u\to v}^{p}+F_{v\to u}^{p}}(-1)^{A_{u\to v}^{p}}P^{\bot u}_{u}P^{u\to v}_{v}\mathbf{P}^{\bot v}(-1)^{A_{v\to u}^{p}}P^{v\to u}_{u}P^{\bot v}_{v}\mathbf{P}^{\bot u}\end{split} (62)

i.e. 𝐏u𝐏v=(1)Fuvp+Fvup𝐏v𝐏u\mathbf{P}^{\bot u}\mathbf{P}^{\bot v}=(-1)^{F_{u\to v}^{p}+F_{v\to u}^{p}}\mathbf{P}^{\bot v}\mathbf{P}^{\bot u}.

The proof for focussed sets is virtually the same, though we only need care about anticommuting Paulis on uu. ∎

Lemma C.10.

Given a labelled open graph Γ=(G,I,O,λ)\Gamma=(G,I,O,\lambda) with a focussed Pauli flow and any focussed set p^\hat{p}, then (p^Odd(p^))O=p^=(\hat{p}\cup\mathrm{Odd}(\hat{p}))\cap O=\emptyset\Leftrightarrow\hat{p}=\emptyset.

Proof.

p^=(p^Odd(p^))O=\hat{p}=\emptyset\Rightarrow(\hat{p}\cup\mathrm{Odd}(\hat{p}))\cap O=\emptyset is trivial. For the other direction, suppose for a contradiction that we have a non-empty p^\hat{p} for which (p^Odd(p^))O=(\hat{p}\cup\mathrm{Odd}(\hat{p}))\cap O=\emptyset, so we have some vp^O¯v\in\hat{p}\cap\overline{O} and the corresponding stabilizer is the identity. However, Lemma C.9 implies that the stabilizer must anticommute with the primary extraction string 𝐏v\mathbf{P}^{\bot v}, contradicting the identity assumption. ∎

Theorem C.11.

Let (Γ,α)(\Gamma,\alpha) describe a measurement pattern with a focussed Pauli flow. Then the construction from Lemma C.6 gives an isomorphism between the groups of focussed sets and the stabilizers of the linear map for (Γ,α)(\Gamma,\alpha) after removing all planar measurement angles.

Proof.

The group action is preserved due to Lemmas C.7 and C.8. By Lemma C.10, the map is injective (if we had two distinct focussed sets with the same stabilizer, combining them with Δ\Delta would give a non-empty focussed set that maps to the identity stabilizer) and subsequently bijective by cardinality from Lemma B.9. ∎

This isomorphism guarantees that the focussed sets identified by Lemma B.10 actually give a generating set for the stabilizer group, giving a valid isometry tableau. All that remains is to put everything together into a formal procedure.

Theorem C.12.

(Restatement of Theorem 4.7) Let (Γ,α)(\Gamma,\alpha) describe a measurement pattern where Γ\Gamma has a Pauli flow. Then there is an algorithm that identifies an equivalent circuit requiring no ancillae which completes in time polynomial in the number of vertices in Γ\Gamma.

Proof.

Using Theorem 4.5 and Lemma 4.6, we can identify a maximally delayed, focussed Pauli flow (p,)(p,\prec). Let J:|O¯|O¯J:\mathbb{Z}_{|\overline{O}|}\to\overline{O} be an indexing over the measured qubits such that J(i)J(j)j<iJ(i)\prec J(j)\Rightarrow j<i, i.e. JJ iterates from outputs to inputs respecting \prec. We will define a sequence of patterns (Γ,αk)(\Gamma,\alpha_{k}) and circuits CkC_{k} such that CkΓ;αkΓ;α\llbracket C_{k}\rrbracket\cdot\llbracket\Gamma;\alpha_{k}\rrbracket\approx\llbracket\Gamma;\alpha\rrbracket (where \llbracket-\rrbracket denotes the interpretation as a linear function). We start with α0=α\alpha_{0}=\alpha and C0C_{0} is the empty (identity) circuit.

For any k0k\geq 0, the update from αk\alpha_{k} to αk+1\alpha_{k+1} is just setting the angle of J(k)J(k) to 0 if it is planar.

αk(J(j)):={0if j<kλ(J(i)){XY,XZ,YZ}α(J(j))otherwise\alpha_{k}(J(j)):=\begin{cases}0&\text{if }j<k\wedge\lambda(J(i))\in\{XY,XZ,YZ\}\\ \alpha(J(j))&\text{otherwise}\end{cases} (63)

Defining the update from CkC_{k} to Ck+1C_{k+1} requires us to find a Pauli string 𝐏\mathbf{P} over the outputs such that:

(j<kλ(J(j)){X,Y,Z}+λ(J(j)),0|J(j))(jkλ(J(j)){X,Y,Z}+λ(J(j)),α(J(j))|J(j))EGNI¯eiα(J(k))2𝐏(jkλ(J(j)){X,Y,Z}+λ(J(j)),0|J(j))(j>kλ(J(j)){X,Y,Z}+λ(J(j)),α(J(j))|J(j))EGNI¯\begin{split}\left(\prod_{j<k\wedge\lambda(J(j))\notin\{X,Y,Z\}}\bra{+_{\lambda(J(j)),0}}_{J(j)}\right)&\\ \left(\prod_{j\geq k\vee\lambda(J(j))\in\{X,Y,Z\}}\bra{+_{\lambda(J(j)),\alpha(J(j))}}_{J(j)}\right)&E_{G}N_{\overline{I}}\\ \approx e^{i\tfrac{\alpha(J(k))}{2}\mathbf{P}}\left(\prod_{j\leq k\wedge\lambda(J(j))\notin\{X,Y,Z\}}\bra{+_{\lambda(J(j)),0}}_{J(j)}\right)&\\ \left(\prod_{j>k\vee\lambda(J(j))\in\{X,Y,Z\}}\bra{+_{\lambda(J(j)),\alpha(J(j))}}_{J(j)}\right)&E_{G}N_{\overline{I}}\end{split} (64)

When λ(J(k)){X,Y,Z}\lambda(J(k))\in\{X,Y,Z\} the projections on each side of Equation 64 are identical, meaning it suffices to let 𝐏\mathbf{P} be the identity and set Ck+1=CkC_{k+1}=C_{k}.

When λ(J(k)){XY,XZ,YZ}\lambda(J(k))\in\{XY,XZ,YZ\}, the projectors differ by a e(1)DJ(k)iα(J(k))2PJ(k)J(k)e^{(-1)^{D_{J(k)}}i\tfrac{\alpha(J(k))}{2}P^{\bot J(k)}_{J(k)}} according to Equation 10. Equation 64 then holds by using the 3.1 with a primary extraction string for J(k)J(k), which we can obtain by Lemma 4.4. We decompose this rotation into basic gates (for example, by CXCX ladder constructions [7, 12]) and add them to the start of CkC_{k} so that Ck+1=Cke(1)DJ(k)iα(J(k))2𝐏J(k)\llbracket C_{k+1}\rrbracket=\llbracket C_{k}\rrbracket\cdot e^{(-1)^{D_{J(k)}}i\tfrac{\alpha(J(k))}{2}\mathbf{P}^{\bot J(k)}}.

At the end of this sequence, we have the pattern (Γ,α|O¯|)(\Gamma,\alpha_{|\overline{O}|}) where every measurement is in a Pauli basis and the associated circuit C|O¯|C_{|\overline{O}|}. This means the corresponding isometry for this pattern is a stabilizer process.

To characterise this process, it is sufficient to identify its isometry tableau. For each input, we can find the ZZ row from the primary extraction string of the input vertex, and by taking an input extension with Lemma C.5 we can similarly get the XX row. Each of our |O||I||O|-|I| generators for the free stabilizers is given by Lemma B.10.

We can efficiently synthesise the isometry tableau and qubit preparations into a circuit CstabC_{\mathrm{stab}}. The final circuit is the combination of CstabC_{\mathrm{stab}} followed by C|O¯|C_{|\overline{O}|} which implements the same operator as (Γ,α)(\Gamma,\alpha).

To examine the complexity, we suppose an explicit Pauli flow is not given up front. Theorem 4.5 says that we can identify it in O(|V|5)O(|V|^{5}) time. We can extend the flow to consider all of the input extensions simultaneously using Lemma C.5 in O(|I|)O(|I|) time (ignoring the update to \prec since it won’t affect the outcome of the extraction procedure). The construction of Lemma 4.6 focusses this Pauli flow in O(|V|3)O(|V|^{3}) time (we apply at most O(|V|2)O(|V|^{2}) updates, each of which takes O(|V|)O(|V|) time to identify and apply). Adding the extra focussed sets also takes O(|V|3)O(|V|^{3}) time by Lemma B.10. Synthesising this into a circuit using the naive CXCX ladder construction takes O(|V||O|)O(|V|\cdot|O|) time for the rotations from non-Pauli measurements, and O(|O|3)O(|O|^{3}) to synthesise a stabilizer tableau using Aaronson and Gottesman’s method [2] (mapping an isometry tableau into that form just requires identifying the additional generators to fill the Pauli group, which can be done by Gaussian elimination in O(|O|3)O(|O|^{3}) time). The overall complexity is therefore dominated by the O(|V|5)O(|V|^{5}) Pauli flow identification. ∎

Example C.13.

Suppose we start with the following measurement pattern and focussed Pauli flow.

SSRY(α3)RY(\alpha_{3})RX(α4)RX(\alpha_{4})RY(α5)RY(\alpha_{5})RZ(α6)RZ(\alpha_{6})RZ(α0)RZ(\alpha_{0})RY(α2)RY(\alpha_{2})RZ(α1)RZ(\alpha_{1})RY(α7)RY(\alpha_{7})iiaabbccooiiddaao2o_{2}cco1o_{1}bb
vv λ(v)\lambda(v) p(v)p(v) Odd(p(v))\mathrm{Odd}(p(v)) {u|vu}\{u|v\prec u\}
ii XYXY b,o2b,o_{2} i,ai,a a,b,c,o1,o2a,b,c,o_{1},o_{2}
aa YZYZ a,c,d,o2a,c,d,o_{2} d,o1,o2d,o_{1},o_{2} c,o1,o2c,o_{1},o_{2}
bb XYXY c,d,o1c,d,o_{1} b,d,o1,o2b,d,o_{1},o_{2} c,o1,o2c,o_{1},o_{2}
cc XYXY o1o_{1} cc o1o_{1}
dd YY o2o_{2} dd o2o_{2}

Because we have two outputs and only one input, there is also an extra focussed set p^={c,o2}\hat{p}=\{c,o_{2}\}. We start by constructing the primary extraction strings for each vertex from Lemma 4.4. Let ad{0,1}a_{d}\in\{0,1\} be such that α(d)=adπ\alpha(d)=a_{d}\pi. Recall that we get one phase flip per edge between adjacent vertices in the correction/focussed set (|E(p(v)×p(v))||E\cap(p(v)\times p(v))|), one phase flip for every two YYs that appear in the graph state stabilizer (|p(v)Odd(p(v))|/2|p(v)\cap\mathrm{Odd}(p(v))|/2), and one for each term in the graph state stabilizer that is absorbed from a Pauli measurement with angle π\pi (|(p(v)Odd(p(v))){w|λ(w){X,Y,Z}α(w)=π}||(p(v)\cup\mathrm{Odd}(p(v)))\cap\{w|\lambda(w)\in\{X,Y,Z\}\wedge\alpha(w)=\pi\}|).

SS SOS\cap O Odd(S)O\mathrm{Odd}(S)\cap O Edges YYs Paulis 𝐏S\mathbf{P}^{S}
p(i)p(i) o2o_{2} 0 0 I1X2I_{1}X_{2}
p(a)p(a) o2o_{2} o1,o2o_{1},o_{2} 44 22 dd (1)ad+1Z1Y2(-1)^{a_{d}+1}Z_{1}Y_{2}
p(b)p(b) o1o_{1} o1,o2o_{1},o_{2} 22 22 dd (1)ad+1Y1Z2(-1)^{a_{d}+1}Y_{1}Z_{2}
p(c)p(c) o1o_{1} 0 0 X1I2X_{1}I_{2}
p(d)p(d) o2o_{2} 0 0 I1X2I_{1}X_{2}
p^\hat{p} o2o_{2} o1o_{1} 0 0 Z1X2Z_{1}X_{2}

We start by extracting the planar angles as rotations in \succ-order. We must start with cc, extracing it as eiα(c)2X1I2e^{i\tfrac{\alpha(c)}{2}X_{1}I_{2}} over the outputs.

Having extracted this, the projection on cc becomes the positive XX basis vector so it can absorb the corresponding Paulis on the graph state stabilizer from p(a)p(a) and p(b)p(b). Either aa or bb can be extracted next, giving e(1)adα(a)2Z1Y2e^{(-1)^{a_{d}}\tfrac{\alpha(a)}{2}Z_{1}Y_{2}} and e(1)ad+1α(b)2Y1Z2e^{(-1)^{a_{d}+1}\tfrac{\alpha(b)}{2}Y_{1}Z_{2}} respectively. Note that the phase of the rotation from aa got an extra 1-1 since Da=1D_{a}=1 (λ(a)=YZ\lambda(a)=YZ).

The final rotation to be extracted is eiα(i)2I1X2e^{i\tfrac{\alpha(i)}{2}I_{1}X_{2}} from ii. We don’t extract any rotation from dd since the measurement is already in a Pauli basis, and hence we can treat it as part of the leftover stabilizer process.

We can get the isometry tableau for this from the primary extraction strings. Having both the input and its only neighbour labelled with XYXY means we don’t necessarily have to perform input extensions to obtain the rows of the tableau during extraction, since they will function identically to ii and bb here because Γ\Gamma can already be viewed as an input extension of Γ{i}\Gamma\setminus\{i\} with input bb. This process maps ZZ on the input to I1X2I_{1}X_{2} (𝐏i\mathbf{P}^{\bot i}) over the outputs and XX on the input to (1)ad+1Y1Z2(-1)^{a_{d}+1}Y_{1}Z_{2} (𝐏b\mathbf{P}^{\bot b}). We have an extra row from the free stabilizer Z1X2Z_{1}X_{2} obtained from p^\hat{p}.

The structure we now have exactly maps to the following PDDAG:

Ins Outs Sign
XX YY ZZ ()ad+1(-)^{a_{d}+1}
ZZ XX ++
ZZ XX ++
SSRY(α3)RY(\alpha_{3})RX(α4)RX(\alpha_{4})RY(α5)RY(\alpha_{5})RZ(α6)RZ(\alpha_{6})RZ(α0)RZ(\alpha_{0})RY(α2)RY(\alpha_{2})RZ(α1)RZ(\alpha_{1})RY(α7)RY(\alpha_{7})iiaabbccooiiddaao2o_{2}cco1o_{1}bb(I1X2,α(i)){(I_{1}X_{2},\alpha(i))}((1)adZ1Y2,α(a)){((-1)^{a_{d}}Z_{1}Y_{2},\alpha(a))}(X1I2,α(c)){(X_{1}I_{2},\alpha(c))}((1)ad+1Y1Z2,α(b)){((-1)^{a_{d}+1}Y_{1}Z_{2},\alpha(b))}

Note that producing this PDDAG just amounted to reading off the focussed Pauli flow, using the correction sets to produce the strings and the order \prec for the dependency relation between the rotations.

For the rotations from aa and bb, we put the (1)(-1) phase with the strings rather than the angle. Whilst nodes (𝐏,θ)(-\mathbf{P},\theta) and (𝐏,θ)(\mathbf{P},-\theta) represent the same rotations, it is useful to keep the convention of writing the extracted rotation as ((1)Dv𝐏v,α(v))((-1)^{D_{v}}\mathbf{P}^{\bot v},\alpha(v)) to simplify the simulations in Section 5.

We can then synthesise a circuit from the PDDAG component-wise. We start with the isometry tableau, for which an example circuit is given below.

SSRY(α3)RY(\alpha_{3})RX(α4)RX(\alpha_{4})RY(α5)RY(\alpha_{5})RZ(α6)RZ(\alpha_{6})RZ(α0)RZ(\alpha_{0})RY(α2)RY(\alpha_{2})RZ(α1)RZ(\alpha_{1})RY(α7)RY(\alpha_{7})iiaabbccooiiddaao2o_{2}cco1o_{1}bbRX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})Zad+1Z^{a_{d}+1}HH|0\ket{0}

For the rotations, the (I1X2,α(i))(I_{1}X_{2},\alpha(i)) and (X1I2,α(c))(X_{1}I_{2},\alpha(c)) are simply RXRX gates. The other two rotations commute, and so can be efficiently diagonalised simultaneously.

SSRY(α3)RY(\alpha_{3})RX(α4)RX(\alpha_{4})RY(α5)RY(\alpha_{5})RZ(α6)RZ(\alpha_{6})RZ(α0)RZ(\alpha_{0})RY(α2)RY(\alpha_{2})RZ(α1)RZ(\alpha_{1})RY(α7)RY(\alpha_{7})iiaabbccooiiddaao2o_{2}cco1o_{1}bbRX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})Zad+1Z^{a_{d}+1}HH|0\ket{0}RY((1)adα(b))RY((-1)^{a_{d}}\alpha(b))RZ((1)ad+1α(a))RZ((-1)^{a_{d}+1}\alpha(a))RZ(π2)RZ(\tfrac{\pi}{2})RZ(π2)RZ(-\tfrac{\pi}{2})RX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})

Note that the angles of rotations acquire an extra 1-1 phase flip, since we defined (𝐏,θ)(\mathbf{P},\theta) to map to eiθ2𝐏e^{i\tfrac{\theta}{2}\mathbf{P}}, but basic rotation gates are defined as RP(θ)=eiθ2PRP(\theta)=e^{-i\tfrac{\theta}{2}P}.

Putting it all together, we obtain the following circuit:

SSRY(α3)RY(\alpha_{3})RX(α4)RX(\alpha_{4})RY(α5)RY(\alpha_{5})RZ(α6)RZ(\alpha_{6})RZ(α0)RZ(\alpha_{0})RY(α2)RY(\alpha_{2})RZ(α1)RZ(\alpha_{1})RY(α7)RY(\alpha_{7})iiaabbccooiiddaao2o_{2}cco1o_{1}bbRX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})Zad+1Z^{a_{d}+1}HH|0\ket{0}RY((1)adα(b))RY((-1)^{a_{d}}\alpha(b))RZ((1)ad+1α(a))RZ((-1)^{a_{d}+1}\alpha(a))RZ(π2)RZ(\tfrac{\pi}{2})RZ(π2)RZ(-\tfrac{\pi}{2})RX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})RX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})Zad+1Z^{a_{d}+1}HH|0\ket{0}RY((1)adα(b))RY((-1)^{a_{d}}\alpha(b))RZ((1)ad+1α(a))RZ((-1)^{a_{d}+1}\alpha(a))RZ(π2)RZ(\tfrac{\pi}{2})RZ(π2)RZ(-\tfrac{\pi}{2})RX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})RX(α(i))RX(-\alpha(i))RX(α(c))RX(-\alpha(c))

Appendix D Proofs for Rewrite Correspondences

Throughout this section, we will follow a general pattern when deriving the correspondences between rewrites of measurement patterns and PDDAGs:

  1. 1.

    Prove that the existence of Pauli flows is preserved by giving explicit updates to the focussed Pauli flows (and focussed sets);

  2. 2.

    Give the explicit updates to the primary extraction strings (and free stabilizers) for each rewrite;

  3. 3.

    Justify that the same updates are performed by the PDDAG rewrite.

We will also add additional proofs that semantics are preserved by rewriting the measurement pattern as required. When deriving equalities in the following proofs, we will freely use \approx to ignore global constants that are later removed symmetrically using the same substitution.

D.1 Relabelling Pauli Measurements

Lemma D.1.

Let (Γ,α)(\Gamma,\alpha) describe a measurement pattern and uO¯u\in\overline{O} be a vertex with λ(u){XY,XZ,YZ}\lambda(u)\in\{XY,XZ,YZ\} and α(u){0,π2,π,3π2}\alpha(u)\in\{0,\tfrac{\pi}{2},\pi,\tfrac{3\pi}{2}\}. Then there exists an equivalent pattern (Γ,α)(\Gamma^{\prime},\alpha^{\prime}) from relabelling uu as a Pauli measurement, where the new labels and angles are given by

(λ(u),α(u))={(X,α(u))if λ(u)=XYα(u){0,π}(Y,α(u)π2)if λ(u)=XYα(u){π2,3π2}(Z,α(u))if λ(u)=XZα(u){0,π}(X,α(u)π2)if λ(u)=XZα(u){π2,3π2}(Z,α(u))if λ(u)=YZα(u){0,π}(Y,α(u)π2)if λ(u)=YZα(u){π2,3π2}(\lambda^{\prime}(u),\alpha^{\prime}(u))=\begin{cases}(X,\alpha(u))&\text{if }\lambda(u)=XY\wedge\alpha(u)\in\{0,\pi\}\\ (Y,\alpha(u)-\tfrac{\pi}{2})&\text{if }\lambda(u)=XY\wedge\alpha(u)\in\{\tfrac{\pi}{2},\tfrac{3\pi}{2}\}\\ (Z,\alpha(u))&\text{if }\lambda(u)=XZ\wedge\alpha(u)\in\{0,\pi\}\\ (X,\alpha(u)-\tfrac{\pi}{2})&\text{if }\lambda(u)=XZ\wedge\alpha(u)\in\{\tfrac{\pi}{2},\tfrac{3\pi}{2}\}\\ (Z,\alpha(u))&\text{if }\lambda(u)=YZ\wedge\alpha(u)\in\{0,\pi\}\\ (Y,\alpha(u)-\tfrac{\pi}{2})&\text{if }\lambda(u)=YZ\wedge\alpha(u)\in\{\tfrac{\pi}{2},\tfrac{3\pi}{2}\}\\ \end{cases} (65)

and (λ(v),α(v))=(λ(v),α(v))(\lambda^{\prime}(v),\alpha^{\prime}(v))=(\lambda(v),\alpha(v)) for any vO¯{u}v\in\overline{O}\setminus\{u\}.

Proof.

The following equations describe how the Pauli measurements are embedded into the planes:

+X,α|+XY,α|+XZ,α+π2|+Y,α|+XY,α+π2|+YZ,α+π2|+Z,α|+XZ,α|+YZ,α|\begin{split}\bra{+_{X,\alpha}}&\approx\bra{+_{XY,\alpha}}\approx\bra{+_{XZ,\alpha+\tfrac{\pi}{2}}}\\ \bra{+_{Y,\alpha}}&\approx\bra{+_{XY,\alpha+\tfrac{\pi}{2}}}\approx\bra{+_{YZ,\alpha+\tfrac{\pi}{2}}}\\ \bra{+_{Z,\alpha}}&\approx\bra{+_{XZ,\alpha}}\approx\bra{+_{YZ,\alpha}}\\ \end{split} (66)

The equivalent Pauli measurement label and angle are determined uniquely by these embeddings. ∎

Lemma D.2.

Let (Γ,α)(\Gamma,\alpha) and (Γ,α)(\Gamma^{\prime},\alpha^{\prime}) describe measurement patterns related by relabelling some planar uO¯u\in\overline{O} as a Pauli according to Lemma D.1. If Γ\Gamma has a focussed Pauli flow (p,)(p,\prec), then (p,)(p^{\prime},\prec) is a focussed Pauli flow for Γ\Gamma^{\prime} where for any vO¯v\in\overline{O}

p(v):={p(v)Δp(u)if vuup(v)Odd(p(v))α(u){π2,3π2}p(v)otherwisep^{\prime}(v):=\begin{cases}p(v)\Delta p(u)&\text{if }v\neq u\wedge u\in p(v)\cup\mathrm{Odd}(p(v))\wedge\alpha(u)\in\{\tfrac{\pi}{2},\tfrac{3\pi}{2}\}\\ p(v)&\text{otherwise}\end{cases} (67)

Furthermore, focussed sets p^\hat{p} can be updated as

p^:={p^Δp(u)if up^Odd(p^)α(u){π2,3π2}p^otherwise\hat{p^{\prime}}:=\begin{cases}\hat{p}\Delta p(u)&\text{if }u\in\hat{p}\cup\mathrm{Odd}(\hat{p})\wedge\alpha(u)\in\{\tfrac{\pi}{2},\tfrac{3\pi}{2}\}\\ \hat{p}&\text{otherwise}\end{cases} (68)
Proof.

Suppose that (p,)(p,\prec) is a focussed Pauli flow for Γ\Gamma. Since λ(u){XY,XZ,YZ}\lambda(u)\in\{XY,XZ,YZ\}, any vO¯{u}v\in\overline{O}\setminus\{u\} such that up(v)Odd(p(v))u\in p(v)\cup\mathrm{Odd}(p(v)) must satisfy vuv\prec u by conditions [.X][\prec.X] and [.Z][\prec.Z]. (p,)(p^{\prime},\prec) is then also a Pauli flow for Γ\Gamma using Lemma B.1. Any Pauli flow for Γ\Gamma is also a Pauli flow for Γ\Gamma^{\prime}, since [.X][\prec.X]-[.Y][\prec.Y] are strictly weakened and [λ.X][\lambda.X]-[λ.Y][\lambda.Y] for Γ\Gamma^{\prime} follow from [λ.XY][\lambda.XY]-[λ.YZ][\lambda.YZ] for Γ\Gamma.

To show that (p,)(p^{\prime},\prec) is focussed for Γ\Gamma^{\prime}, consider and vertex vO¯v\in\overline{O}. As λ\lambda and λ\lambda^{\prime} only differ on uu, when p(v)=p(v)p^{\prime}(v)=p(v) it remains focussed over O¯{u,v}\overline{O}\setminus\{u,v\} in Γ\Gamma^{\prime}. This is enough when v=uv=u. If up(v)Odd(p(v))u\notin p(v)\cup\mathrm{Odd}(p(v)), then it is trivially focussed over {u}\{u\} in Γ\Gamma^{\prime}. Finally, in each of the cases of Equation 65 where α(u){0,π}\alpha(u)\in\{0,\pi\}, the compatible corrections in the focussed conditions do not change, so it remains focussed over {u}\{u\} in Γ\Gamma^{\prime}.

Suppose instead that vuv\neq u, up(v)Odd(p(v))u\in p(v)\cup\mathrm{Odd}(p(v)), and α(u){π2,3π2}\alpha(u)\in\{\tfrac{\pi}{2},\tfrac{3\pi}{2}\}, so p(v)=p(v)Δp(u)p^{\prime}(v)=p(v)\Delta p(u). Both p(v)p(v) and p(u)p(u) remain focussed over O¯{u,v}\overline{O}\setminus\{u,v\} in Γ\Gamma^{\prime}, and Lemma B.2 gives the same for p(v)p^{\prime}(v). For each case of λ(u){XY,XZ,YZ}\lambda(u)\in\{XY,XZ,YZ\}, what was a compatible correction for λ(u)\lambda(u) is now incompatible with λ(u)\lambda^{\prime}(u), so p(v)p(v) is not focussed over {u}\{u\} in Γ\Gamma^{\prime}. Additionally, conditions [λ.X][\lambda.X] and [λ.Y][\lambda.Y] mean that p(u)p(u) is also not focussed over {u}\{u\}. However, we can then use Lemma B.3 to conclude that their combination (p(v)p^{\prime}(v)) is focussed.

The proof of updating a focussed set p^\hat{p} to p^\hat{p^{\prime}} follows similarly. ∎

Lemma D.3.

Let (Γ,α)(\Gamma,\alpha) and (Γ,α)(\Gamma^{\prime},\alpha^{\prime}) be the measurement patterns and respective focussed Pauli flows (p,)(p,\prec) and (p,)(p^{\prime},\prec) from Lemma D.2 formed by changing the label of some uO¯u\in\overline{O} from a planar measurement to a Pauli measurement. Then the new primary extraction string for each vertex vO¯{u}v\in\overline{O}\setminus\{u\} is given by

𝐏v=PvvPvv𝐏v(cosα(u)Iisin(1)Du+Auvpα(u)Puvv𝐏u)Fvup\mathbf{P^{\prime}}^{\bot v}=P^{\prime\bot v}_{v}P^{\bot v}_{v}\mathbf{P}^{\bot v}\left(\cos\alpha(u)I-i\sin(-1)^{D_{u}+A_{u\to v}^{p}}\alpha(u)P^{u\to v}_{v}\mathbf{P}^{\bot u}\right)^{F_{v\to u}^{p}} (69)

and 𝐏u=𝐏u\mathbf{P^{\prime}}^{\bot u}=\mathbf{P}^{\bot u}. Furthermore, a stabilizer from a focussed set p^\hat{p} is updated to

𝐏^=𝐏^(cosα(u)Iisin(1)Duα(u)𝐏u)Gp^u\mathbf{\hat{P^{\prime}}}=\mathbf{\hat{P}}\left(\cos\alpha(u)I-i\sin(-1)^{D_{u}}\alpha(u)\mathbf{P}^{\bot u}\right)^{G_{\hat{p}\to u}} (70)
Proof.

The case for uu is simple because p(u)=p(u)p^{\prime}(u)=p(u) and the linear map 𝒞\mathcal{C} in the definition of extraction strings is unchanged. For the remainder, we consider some vO¯{u}v\in\overline{O}\setminus\{u\}.

Firstly, we show that PvPvIP^{\prime\bot v}P^{\bot v}\approx I if α(u){0,π}\alpha(u)\in\{0,\pi\} or (Puv)Fvup(P^{u\to v})^{F_{v\to u}^{p}} if α(u){π2,3π2}\alpha(u)\in\{\tfrac{\pi}{2},\tfrac{3\pi}{2}\} to deduce that 𝐏v\mathbf{P^{\prime}}^{\bot v} only acts on the outputs. If either up(v)Odd(p(v))u\notin p(v)\cup\mathrm{Odd}(p(v)) (i.e. Fvup=0F_{v\to u}^{p}=0) or α(u){0,π}\alpha(u)\in\{0,\pi\}, then p(v)=p(v)p^{\prime}(v)=p(v) and hence Pv=PvP^{\prime\bot v}=P^{\bot v}. Otherwise, we have p(v)=p(v)Δp(u)p^{\prime}(v)=p(v)\Delta p(u). By following a similar logic to the proof of Lemma C.7 considering {v}\{v\} instead of OO, we end up with PvPvPuvP^{\prime\bot v}\approx P^{\bot v}P^{u\to v}.

Now we show that 𝐏v\mathbf{P^{\prime}}^{\bot v} is a primary extraction string in (Γ,α)(\Gamma^{\prime},\alpha^{\prime}). Let 𝒞\mathcal{C^{\prime}} be the linear map from Definition 4.2 for (Γ,α)(\Gamma^{\prime},\alpha^{\prime}) and let 𝒞\mathcal{C} be the corresponding for (Γ,α)(\Gamma,\alpha) (plus an extra projection on uu if uvu\preceq v).

𝒞\displaystyle\mathcal{C^{\prime}} :=(wvλ(w){X,Y,Z}+λ(w),0|w)(wO¯{v}λ(w){X,Y,Z}+λ(w),α(w)|w)EGNI¯\displaystyle:=\left(\prod_{\begin{subarray}{c}w\succ v\\ \lambda^{\prime}(w)\notin\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda^{\prime}(w),0}}_{w}\right)\left(\prod_{\begin{subarray}{c}w\in\overline{O}\setminus\{v\}\\ \lambda^{\prime}(w)\in\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda^{\prime}(w),\alpha^{\prime}(w)}}_{w}\right)E_{G}N_{\overline{I}}
+λ(u),α(u)|u(wvwuλ(w){X,Y,Z}+λ(w),0|w)(wO¯{v}λ(w){X,Y,Z}+λ(w),α(w)|w)EGNI¯\displaystyle\approx\bra{+_{\lambda(u),\alpha(u)}}_{u}\left(\prod_{\begin{subarray}{c}w\succ v\\ w\neq u\\ \lambda(w)\notin\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda(w),0}}_{w}\right)\left(\prod_{\begin{subarray}{c}w\in\overline{O}\setminus\{v\}\\ \lambda(w)\in\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda(w),\alpha(w)}}_{w}\right)E_{G}N_{\overline{I}}
(wvw=uλ(w){X,Y,Z}+λ(w),0|w)(wO¯{v}λ(w){X,Y,Z}+λ(w),α(w)|w)e(1)Duiα(u)2PuuEGNI¯\displaystyle\approx\left(\prod_{\begin{subarray}{c}w\succ v\vee w=u\\ \lambda(w)\notin\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda(w),0}}_{w}\right)\left(\prod_{\begin{subarray}{c}w\in\overline{O}\setminus\{v\}\\ \lambda(w)\in\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda(w),\alpha(w)}}_{w}\right)e^{(-1)^{D_{u}}i\tfrac{\alpha(u)}{2}P^{\bot u}_{u}}E_{G}N_{\overline{I}}
=e(1)Du+Auvpiα(u)2Puvv𝐏u𝒞\displaystyle=e^{(-1)^{D_{u}+A_{u\to v}^{p}}i\tfrac{\alpha(u)}{2}P^{u\to v}_{v}\mathbf{P}^{\bot u}}\mathcal{C} (71)
=e(1)Du+Auvpiα(u)2Puvv𝐏uPvv𝐏v𝒞\displaystyle=e^{(-1)^{D_{u}+A_{u\to v}^{p}}i\tfrac{\alpha(u)}{2}P^{u\to v}_{v}\mathbf{P}^{\bot u}}P^{\bot v}_{v}\mathbf{P}^{\bot v}\mathcal{C}
=Pvve(1)Du+Auvp+Fuvpiα(u)2Puvv𝐏u𝐏v𝒞\displaystyle=P^{\bot v}_{v}e^{(-1)^{D_{u}+A_{u\to v}^{p}+F_{u\to v}^{p}}i\tfrac{\alpha(u)}{2}P^{u\to v}_{v}\mathbf{P}^{\bot u}}\mathbf{P}^{\bot v}\mathcal{C}
=Pvv𝐏ve(1)Du+Auvp+Fvupiα(u)2Puvv𝐏u𝒞\displaystyle=P^{\bot v}_{v}\mathbf{P}^{\bot v}e^{(-1)^{D_{u}+A_{u\to v}^{p}+F_{v\to u}^{p}}i\tfrac{\alpha(u)}{2}P^{u\to v}_{v}\mathbf{P}^{\bot u}}\mathcal{C}
=Pvv𝐏ve(1)Du+AuvpFvupiα(u)Puvv𝐏ue(1)Du+Auvpiα(u)2Puvv𝐏u𝒞\displaystyle=P^{\bot v}_{v}\mathbf{P}^{\bot v}e^{-(-1)^{D_{u}+A_{u\to v}^{p}}F_{v\to u}^{p}i\alpha(u)P^{u\to v}_{v}\mathbf{P}^{\bot u}}e^{(-1)^{D_{u}+A_{u\to v}^{p}}i\tfrac{\alpha(u)}{2}P^{u\to v}_{v}\mathbf{P}^{\bot u}}\mathcal{C}
Pvv𝐏ve(1)Du+AuvpFvupiα(u)Puvv𝐏u𝒞\displaystyle\approx P^{\bot v}_{v}\mathbf{P}^{\bot v}e^{-(-1)^{D_{u}+A_{u\to v}^{p}}F_{v\to u}^{p}i\alpha(u)P^{u\to v}_{v}\mathbf{P}^{\bot u}}\mathcal{C^{\prime}}
=Pvv𝐏v(cosα(u)Iisin(1)Du+Auvpα(u)Puvv𝐏u)Fvup𝒞\displaystyle=P^{\bot v}_{v}\mathbf{P}^{\bot v}\left(\cos\alpha(u)I-i\sin(-1)^{D_{u}+A_{u\to v}^{p}}\alpha(u)P^{u\to v}_{v}\mathbf{P}^{\bot u}\right)^{F_{v\to u}^{p}}\mathcal{C^{\prime}}
=Pvv𝐏v𝒞\displaystyle=P^{\prime\bot v}_{v}\mathbf{P^{\prime}}^{\bot v}\mathcal{C^{\prime}}

In the above derivation, moving Pvv𝐏vP^{\bot v}_{v}\mathbf{P}^{\bot v} through the rotation requires Lemma C.9 and PvPuv=(1)FuvpPuvPvP^{\bot v}P^{u\to v}=(-1)^{F_{u\to v}^{p}}P^{u\to v}P^{\bot v}.

Finally, by doing a case distinction on FvupF_{v\to u}^{p} and Lemma C.7, the extraction string from (p,)(p^{\prime},\prec) matches 𝐏v\mathbf{P^{\prime}}^{\bot v} up to phase, with Lemma C.8 making them equal.

The proof for focussed sets and stabilizers follows similarly. ∎

Theorem D.4.

(Restatement of Theorem 5.1) Let (Γ,α)(\Gamma,\alpha) describe a measurement pattern with some vertex uO¯u\in\overline{O} such that λ(u){XY,XZ,YZ}\lambda(u)\in\{XY,XZ,YZ\} and α(u){0,π2,π,3π2}\alpha(u)\in\{0,\tfrac{\pi}{2},\pi,\tfrac{3\pi}{2}\}. Relabelling uu to the equivalent Pauli label corresponds to pushing the rotation from uu to the start of the PDDAG and absorbing it into the initial stabilizer process.

Proof.

The corresponding PDDAG initially has a rotation node ((1)Du𝐏u,α(u))((-1)^{D_{u}}\mathbf{P}^{\bot u},\alpha(u)) (representing the operator e(1)Duiα(u)2𝐏ue^{(-1)^{D_{u}}i\tfrac{\alpha(u)}{2}\mathbf{P}^{\bot u}}) since uu originally has a planar label. Moving this to the front of the circuit updates the Pauli strings of other vertices according to the 3.2, so we need to check that the same update is made to planar vertices and the isometry tableau is updated appropriately.

For any planar vertex vuv\preceq u, vp(u)Odd(p(u))v\notin p(u)\cup\mathrm{Odd}(p(u)) and hence Puv=IP^{u\to v}=I and Auvp=0A_{u\to v}^{p}=0. If up(v)Odd(p(v))u\notin p(v)\cup\mathrm{Odd}(p(v)) then 𝐏v\mathbf{P}^{\bot v} and 𝐏u\mathbf{P}^{\bot u} commute, so no update is needed which matches the formula for 𝐏v\mathbf{P^{\prime}}^{\bot v} with Fvup=0F_{v\to u}^{p}=0. Otherwise, they anticommute. If α(u)=0\alpha(u)=0, the rotation is an identity so 𝐏v\mathbf{P}^{\bot v} is unchanged. If α(u)=π\alpha(u)=\pi, the rotation is a Pauli operator and hence flips the phase of vv’s rotation, matching the cosα(u)\cos\alpha(u) update. For α(u){π2,3π2}\alpha(u)\in\{\tfrac{\pi}{2},\tfrac{3\pi}{2}\}, the extraction string is updated by multiplication with the correct phase.

For the tableau, we need to handle rows from both the inputs and free stabilizers. For an input ii gained by input extension with λ(i)=XY\lambda(i)=XY, the same reductions can be made as for planar vertices and the updates for free stabilizers are essentially identical. In each case of α(u)\alpha(u), these updates match the effect on the isometry tableau since the 3.2 show the same effect for Paulis and generic rotations. ∎

Example D.5.

Let’s start with the same measurement pattern from Example C.13. Suppose α(c)=π2\alpha(c)=\tfrac{\pi}{2}, so we can obtain a semantically equivalent pattern by relabelling (λ(c),α(c)):=(Y,0)(\lambda^{\prime}(c),\alpha^{\prime}(c)):=(Y,0). This would make p(a)p(a), p(b)p(b) and p^\hat{p} no longer focussed. Refocussing gives:

vv λ(v)\lambda^{\prime}(v) p(v)p^{\prime}(v) Odd(p(v))\mathrm{Odd}(p^{\prime}(v)) {u|vu}\{u|v\prec^{\prime}u\}
ii XYXY b,o2b,o_{2} i,ai,a a,b,o1,o2a,b,o_{1},o_{2}
aa YZYZ a,c,d,o1,o2a,c,d,o_{1},o_{2} c,d,o1,o2c,d,o_{1},o_{2} o1,o2o_{1},o_{2}
bb XYXY c,dc,d b,c,d,o1,o2b,c,d,o_{1},o_{2} o1,o2o_{1},o_{2}
cc YY o1o_{1} cc o1o_{1}
dd YY o2o_{2} dd o2o_{2}

and p^={c,o1,o2}\hat{p^{\prime}}=\{c,o_{1},o_{2}\}. The restriction of \prec to \prec^{\prime} is not necessary, but will help to see the resemblance to the PDDAG later.

Now let’s look at applying the corresponding rewrite on the PDDAG from C.13. That is, we use the 3.2 to move (X1I2,π2)(X_{1}I_{2},\tfrac{\pi}{2}) (i.e. eiπ4X1I2e^{i\tfrac{\pi}{4}X_{1}I_{2}}) into the tableau. X1I2X_{1}I_{2} anticommutes with the rotations from aa and bb, the tableau row from bb, and the free stabilizer from p^\hat{p}. Each of these strings will then be updated by multiplication by X1I2X_{1}I_{2}. These are exactly the correction/focussed sets that were updated in the measurement pattern by combining with p(c)p(c). The result of this rewrite on the PDDAG is:

Ins Outs Sign
XX ZZ ZZ ()ad(-)^{a_{d}}
ZZ XX ++
YY XX ++
SSRY(α3)RY(\alpha_{3})RX(α4)RX(\alpha_{4})RY(α5)RY(\alpha_{5})RZ(α6)RZ(\alpha_{6})RZ(α0)RZ(\alpha_{0})RY(α2)RY(\alpha_{2})RZ(α1)RZ(\alpha_{1})RY(α7)RY(\alpha_{7})iiaabbccooiiddaao2o_{2}cco1o_{1}bbRX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})Zad+1Z^{a_{d}+1}HH|0\ket{0}RY((1)adα(b))RY((-1)^{a_{d}}\alpha(b))RZ((1)ad+1α(a))RZ((-1)^{a_{d}+1}\alpha(a))RZ(π2)RZ(\tfrac{\pi}{2})RZ(π2)RZ(-\tfrac{\pi}{2})RX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})RX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})Zad+1Z^{a_{d}+1}HH|0\ket{0}RY((1)adα(b))RY((-1)^{a_{d}}\alpha(b))RZ((1)ad+1α(a))RZ((-1)^{a_{d}+1}\alpha(a))RZ(π2)RZ(\tfrac{\pi}{2})RZ(π2)RZ(-\tfrac{\pi}{2})RX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})RX(α(i))RX(-\alpha(i))RX(α(c))RX(-\alpha(c))(I1X2,α(i)){(I_{1}X_{2},\alpha(i))}((1)ad+1Y1Y2,α(a)){((-1)^{a_{d}+1}Y_{1}Y_{2},\alpha(a))}((1)adZ1Z2,α(b)){((-1)^{a_{d}}Z_{1}Z_{2},\alpha(b))}

One can check that this is identical to the PDDAG extracted using (p,)(p^{\prime},\prec).

D.2 ZZ Measurement Elimination

Lemma D.6.

Let (Γ,α)(\Gamma,\alpha) describe a measurement pattern with some vertex uO¯u\in\overline{O} such that λ(u){XZ,YZ,Z}\lambda(u)\in\{XZ,YZ,Z\} and α(u)=aπ\alpha(u)=a\pi (a{0,1}a\in\{0,1\}). Then eliminating vertex uu gives an equivalent measurement pattern (Γ,α)(\Gamma^{\prime},\alpha^{\prime}) where Γ=(G{u},I,O,λ)\Gamma^{\prime}=(G\setminus\{u\},I,O,\lambda), for all wO¯{u}w\in\overline{O}\setminus\{u\}

α(w):={α(w)+aπif wNG(u)λ(w){XY,X,Y}(1)aα(w)if wNG(u)λ(w){XZ,YZ}α(w)otherwise\alpha^{\prime}(w):=\begin{cases}\alpha(w)+a\pi&\text{if }w\in N_{G}(u)\wedge\lambda(w)\in\{XY,X,Y\}\\ (-1)^{a}\alpha(w)&\text{if }w\in N_{G}(u)\wedge\lambda(w)\in\{XZ,YZ\}\\ \alpha(w)&\text{otherwise}\end{cases} (72)

and each output neighbouring uu is followed by a ZaZ^{a} gate.

Proof.

This is just an extension of the planar case given in the proof of [6, Lemma 4.7] to cover Pauli labels by considering the embeddings from Equation 66. The idea is that the ZZ-basis projections 0|\bra{0} and 1|\bra{1} reduce each of the CZCZ gates on that qubit to either an identity or a ZZ gate (modelled as a ZZ conditioned on the measurement angle), in the same way that they reduce when applied to a |0\ket{0} or |1\ket{1}. This ZZ commutes with other CZCZ gates to the neighbouring outputs or to change the effective measurement on the neighbour. The qubit uu can then be removed since the only operations on it are the preparation and measurement. ∎

Lemma D.7.

(Generalisation of [6, Lemma 3.4]) Let (Γ,α)(\Gamma,\alpha) and (Γ,α)(\Gamma^{\prime},\alpha^{\prime}) be measurement patterns related by elimination of a vertex uu as in Lemma D.6. If (p,)(p,\prec) is a Pauli flow for Γ\Gamma, then (p,)(p^{\prime},\prec) is a Pauli flow for Γ\Gamma^{\prime} where for any vO¯{u}v\in\overline{O}\setminus\{u\}

p(v):={p(v)Δp(u)if up(v)p(v)if up(v)p^{\prime}(v):=\begin{cases}p(v)\Delta p(u)&\text{if }u\in p(v)\\ p(v)&\text{if }u\notin p(v)\end{cases} (73)

If (p,)(p,\prec) is focussed, then so is (p,)(p^{\prime},\prec). Furthermore, if p^\hat{p} is a focussed set for Γ\Gamma, then it is also a focussed set for Γ\Gamma^{\prime}.

Proof.

We first need to show that pp^{\prime} is a function from O¯{u}\overline{O}\setminus\{u\} to 𝒫[I¯{u}]\mathcal{P}[\overline{I}\setminus\{u\}]. This follows since λ(u){XZ,YZ,Z}\lambda(u)\in\{XZ,YZ,Z\} implies up(u)u\in p(u) (by conditions [λ.XZ][\lambda.XZ], [λ.YZ][\lambda.YZ], and [λ.Z][\lambda.Z]), so both cases of the definition of p(v)p^{\prime}(v) give up(v)u\notin p^{\prime}(v).

Because λ(u){XZ,YZ,Z}\lambda(u)\in\{XZ,YZ,Z\}, if up(v)u\in p(v) then vuv\prec u from [.X][\prec.X]. This means (p,)(p^{\prime},\prec) is a valid Pauli flow for (G,I,O,λ)(G,I,O,\lambda) by repeated applications of Lemma B.1. In particular, this means it satisfies all of the Pauli flow conditions for any vO¯{u}v\in\overline{O}\setminus\{u\}. These aren’t invalidated when restricting to G{u}G\setminus\{u\} since OddG{u}(A)=OddG(A){u}\mathrm{Odd}_{G\setminus\{u\}}(A)=\mathrm{Odd}_{G}(A)\setminus\{u\} for any AV{u}A\subseteq V\setminus\{u\} and vO¯{u}.p(v)V{u}\forall v\in\overline{O}\setminus\{u\}.p^{\prime}(v)\subseteq V\setminus\{u\}.

If (p,)(p,\prec) is a focussed Pauli flow, then up(v)u\notin p(v) for any vuv\neq u since λ(u){XZ,YZ,Z}\lambda(u)\in\{XZ,YZ,Z\}. This means p(v)=p(v)p^{\prime}(v)=p(v) for every vv, so the focussed property is trivially preserved. Similarly, the same holds for focussed sets. ∎

Lemma D.8.

Let (Γ,α)(\Gamma,\alpha) and (Γ,α)(\Gamma^{\prime},\alpha^{\prime}) be the measurement patterns and respective Pauli flows (p,)(p,\prec) and (p,)(p^{\prime},\prec) from Lemma D.7 formed by the elimination of a vertex uu. Then the new primary extraction string for each vertex vO¯{u}v\in\overline{O}\setminus\{u\} is given by

𝐏v=(1)a|p(v)NG(u)(O{v})|(n(NG(u){u})O¯nvn=uλ(n){XZ,YZ}nuλ(n)=XY(1)Fvnp)a𝐏v\mathbf{P^{\prime}}^{\bot v}=(-1)^{a|p(v)\cap N_{G}(u)\cap(O\cup\{v\})|}\left(\prod_{\begin{subarray}{c}n\in(N_{G}(u)\cup\{u\})\cap\overline{O}\\ n\succ v\\ n=u\Rightarrow\lambda(n)\in\{XZ,YZ\}\\ n\neq u\Rightarrow\lambda(n)=XY\end{subarray}}(-1)^{F_{v\to n}^{p}}\right)^{a}\mathbf{P}^{\bot v} (74)

where α(u)=aπ\alpha(u)=a\pi. Furthermore, the stabilizer from a focussed set p^\hat{p} is updated similarly.

Proof.

The focussed property implies up(v)u\notin p(v) (resp. up^u\notin\hat{p}), so p(v)=p(v)p^{\prime}(v)=p(v) (resp. p^\hat{p} is still a focussed set). Then p(v)OddGu(p(v))=(p(v)OddG(p(v))){u}p^{\prime}(v)\cup\mathrm{Odd}_{G\setminus u}(p^{\prime}(v))=(p(v)\cup\mathrm{Odd}_{G}(p(v)))\setminus\{u\} (resp. p^OddGu(p^)=(p^OddG(p^)){u}\hat{p}\cup\mathrm{Odd}_{G\setminus u}(\hat{p})=(\hat{p}\cup\mathrm{Odd}_{G}(\hat{p}))\setminus\{u\}). This is enough to show that the strings are preserved up to phase.

We find a primary extraction string for vv in (Γ,α)(\Gamma^{\prime},\alpha^{\prime}) by considering the linear map 𝒞\mathcal{C^{\prime}} from Definition 4.2, using the respective linear map 𝒞\mathcal{C} for (Γ,α)(\Gamma,\alpha).

𝒞=(wvwuλ(w){X,Y,Z}+λ(w),0|w)(wO¯{u}λ(w){X,Y,Z}+λ(w),α(w)|w)EGuNI¯{u}\mathcal{C^{\prime}}=\left(\prod_{\begin{subarray}{c}w\succ v\\ w\neq u\\ \lambda(w)\notin\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda(w),0}}_{w}\right)\left(\prod_{\begin{subarray}{c}w\in\overline{O}\setminus\{u\}\\ \lambda(w)\in\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda(w),\alpha^{\prime}(w)}}_{w}\right)E_{G\setminus u}N_{\overline{I}\setminus\{u\}} (75)

We can reintroduce qubit uu with measurement angle 0. We can then map the angles for the Pauli projections from α\alpha^{\prime} to α\alpha using orthogonal Paulis, letting zu:=1z_{u}:=1 if λ(u)=Z\lambda(u)=Z and 0 if λ(u){XZ,YZ}\lambda(u)\in\{XZ,YZ\}.

𝒞2(wvwuλ(w){X,Y,Z}+λ(w),0|w)(wO¯{u}λ(w){X,Y,Z}+λ(w),α(w)|w)+λ(u),0|uEGNI¯2(wvw=uλ(w){X,Y,Z}+λ(w),0|w)(wO¯λ(w){X,Y,Z}+λ(w),α(w)|w)(Puu)zua(nNG(u)λ(n){X,Y}Pnn)aEGNI¯\begin{split}\mathcal{C^{\prime}}\approx&\sqrt{2}\left(\prod_{\begin{subarray}{c}w\succ v\\ w\neq u\\ \lambda(w)\notin\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda(w),0}}_{w}\right)\left(\prod_{\begin{subarray}{c}w\in\overline{O}\setminus\{u\}\\ \lambda(w)\in\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda(w),\alpha^{\prime}(w)}}_{w}\right)\bra{+_{\lambda(u),0}}_{u}E_{G}N_{\overline{I}}\\ \approx&\sqrt{2}\left(\prod_{\begin{subarray}{c}w\succ v\vee w=u\\ \lambda(w)\notin\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda(w),0}}_{w}\right)\left(\prod_{\begin{subarray}{c}w\in\overline{O}\\ \lambda(w)\in\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda(w),\alpha(w)}}_{w}\right)\\ &(P^{\bot u}_{u})^{z_{u}a}\left(\prod_{\begin{subarray}{c}n\in N_{G}(u)\\ \lambda(n)\in\{X,Y\}\end{subarray}}P^{\bot n}_{n}\right)^{a}E_{G}N_{\overline{I}}\end{split} (76)

We can then apply the stabilizer of the graph state centred around uu to move these Paulis to other qubits, some of which can be absorbed into projections again.

𝒞2(wvλ(w){X,Y,Z}+λ(w),0|w)(wO¯λ(w){X,Y,Z}+λ(w),α(w)|w)(Puu)(1zu)a(nNG(u)(O{v})Zn)a(nNG(u)O¯nvλ(n)=XYPnn)a(nNG(u)O¯nvλ(n){X,Y,Z}Zn)aEGNI¯\begin{split}\mathcal{C^{\prime}}\approx&\sqrt{2}\left(\prod_{\begin{subarray}{c}w\succ v\\ \lambda(w)\notin\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda(w),0}}_{w}\right)\left(\prod_{\begin{subarray}{c}w\in\overline{O}\\ \lambda(w)\in\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda(w),\alpha(w)}}_{w}\right)\\ &(P^{\bot u}_{u})^{(1-z_{u})a}\left(\prod_{n\in N_{G}(u)\cap(O\cup\{v\})}Z_{n}\right)^{a}\left(\prod_{\begin{subarray}{c}n\in N_{G}(u)\cap\overline{O}\\ n\succ v\\ \lambda(n)=XY\end{subarray}}P^{\bot n}_{n}\right)^{a}\left(\prod_{\begin{subarray}{c}n\in N_{G}(u)\cap\overline{O}\\ n\preceq v\\ \lambda(n)\notin\{X,Y,Z\}\end{subarray}}Z_{n}\right)^{a}E_{G}N_{\overline{I}}\end{split} (77)

Each of the Paulis trapped under projections can be replaced by the primary extraction strings of those qubits. We leave the extraction strings without any order since reordering only introduces phases at this point which will be later removed.

𝒞2(w=uwvPuvv𝐏uw=uwvPuu)(1zu)a(nNG(u)(O{v})Zn)a(nNG(u)O¯nvλ(n)=XYPnvv𝐏n)a(nNG(u)O¯nvλ(n){X,Y,Z}Zn)a𝒞\begin{split}\mathcal{C^{\prime}}\approx&\sqrt{2}\left(\prod_{\begin{subarray}{c}w=u\\ w\succ v\end{subarray}}P^{u\to v}_{v}\mathbf{P}^{\bot u}\prod_{\begin{subarray}{c}w=u\\ w\preceq v\end{subarray}}P^{\bot u}_{u}\right)^{(1-z_{u})a}\left(\prod_{n\in N_{G}(u)\cap(O\cup\{v\})}Z_{n}\right)^{a}\\ &\left(\prod_{\begin{subarray}{c}n\in N_{G}(u)\cap\overline{O}\\ n\succ v\\ \lambda(n)=XY\end{subarray}}P^{n\to v}_{v}\mathbf{P}^{\bot n}\right)^{a}\left(\prod_{\begin{subarray}{c}n\in N_{G}(u)\cap\overline{O}\\ n\preceq v\\ \lambda(n)\notin\{X,Y,Z\}\end{subarray}}Z_{n}\right)^{a}\mathcal{C}\\ \end{split} (78)

We can now introduce Pvv𝐏vP^{\bot v}_{v}\mathbf{P}^{\bot v}. Commuting this to the front induces phase changes according to Lemma C.9 and PvPuv=(1)FuvpPuvPvP^{\bot v}P^{u\to v}=(-1)^{F_{u\to v}^{p}}P^{u\to v}P^{\bot v}. We then undo the previous steps to get back to 𝒞\mathcal{C^{\prime}}.

𝒞\displaystyle\mathcal{C^{\prime}}\approx 2(w=uwvPuvv𝐏uw=uwvPuu)(1zu)a(nNG(u)(O{v})Zn)a\displaystyle\sqrt{2}\left(\prod_{\begin{subarray}{c}w=u\\ w\succ v\end{subarray}}P^{u\to v}_{v}\mathbf{P}^{\bot u}\prod_{\begin{subarray}{c}w=u\\ w\preceq v\end{subarray}}P^{\bot u}_{u}\right)^{(1-z_{u})a}\left(\prod_{n\in N_{G}(u)\cap(O\cup\{v\})}Z_{n}\right)^{a}
(nNG(u)O¯nvλ(n)=XYPnvv𝐏n)a(nNG(u)O¯nvλ(n){X,Y,Z}Zn)aPvv𝐏v𝒞\displaystyle\left(\prod_{\begin{subarray}{c}n\in N_{G}(u)\cap\overline{O}\\ n\succ v\\ \lambda(n)=XY\end{subarray}}P^{n\to v}_{v}\mathbf{P}^{\bot n}\right)^{a}\left(\prod_{\begin{subarray}{c}n\in N_{G}(u)\cap\overline{O}\\ n\preceq v\\ \lambda(n)\notin\{X,Y,Z\}\end{subarray}}Z_{n}\right)^{a}P^{\bot v}_{v}\mathbf{P}^{\bot v}\mathcal{C}
=\displaystyle= 2Pvv(w=uwv(1)FuvpPuvv𝐏uw=uwvPuu)(1zu)a\displaystyle\sqrt{2}P^{\bot v}_{v}\left(\prod_{\begin{subarray}{c}w=u\\ w\succ v\end{subarray}}(-1)^{F_{u\to v}^{p}}P^{u\to v}_{v}\mathbf{P}^{\bot u}\prod_{\begin{subarray}{c}w=u\\ w\preceq v\end{subarray}}P^{\bot u}_{u}\right)^{(1-z_{u})a} (79)
(1)a|p(v)NG(u){v}|(nNG(u)(O{v})Zn)a\displaystyle(-1)^{a|p(v)\cap N_{G}(u)\cap\{v\}|}\left(\prod_{n\in N_{G}(u)\cap(O\cup\{v\})}Z_{n}\right)^{a}
(nNG(u)O¯nvλ(n)=XY(1)FnvpPnvv𝐏n)a(nNG(u)O¯nvλ(n){X,Y,Z}Zn)a𝐏v𝒞\displaystyle\left(\prod_{\begin{subarray}{c}n\in N_{G}(u)\cap\overline{O}\\ n\succ v\\ \lambda(n)=XY\end{subarray}}(-1)^{F_{n\to v}^{p}}P^{n\to v}_{v}\mathbf{P}^{\bot n}\right)^{a}\left(\prod_{\begin{subarray}{c}n\in N_{G}(u)\cap\overline{O}\\ n\preceq v\\ \lambda(n)\notin\{X,Y,Z\}\end{subarray}}Z_{n}\right)^{a}\mathbf{P}^{\bot v}\mathcal{C}
=\displaystyle= 2Pvv𝐏v(w=uwv(1)FvupPuvv𝐏uw=uwvPuu)(1zu)a\displaystyle\sqrt{2}P^{\bot v}_{v}\mathbf{P}^{\bot v}\left(\prod_{\begin{subarray}{c}w=u\\ w\succ v\end{subarray}}(-1)^{F_{v\to u}^{p}}P^{u\to v}_{v}\mathbf{P}^{\bot u}\prod_{\begin{subarray}{c}w=u\\ w\preceq v\end{subarray}}P^{\bot u}_{u}\right)^{(1-z_{u})a}
(1)a|p(v)NG(u)(O{v})|(nNG(u)(O{v})Zn)a\displaystyle(-1)^{a|p(v)\cap N_{G}(u)\cap(O\cup\{v\})|}\left(\prod_{n\in N_{G}(u)\cap(O\cup\{v\})}Z_{n}\right)^{a}
(nNG(u)O¯nvλ(n)=XY(1)FvnpPnvv𝐏n)a(nNG(u)O¯nvλ(n){X,Y,Z}Zn)a𝒞\displaystyle\left(\prod_{\begin{subarray}{c}n\in N_{G}(u)\cap\overline{O}\\ n\succ v\\ \lambda(n)=XY\end{subarray}}(-1)^{F_{v\to n}^{p}}P^{n\to v}_{v}\mathbf{P}^{\bot n}\right)^{a}\left(\prod_{\begin{subarray}{c}n\in N_{G}(u)\cap\overline{O}\\ n\preceq v\\ \lambda(n)\notin\{X,Y,Z\}\end{subarray}}Z_{n}\right)^{a}\mathcal{C}
\displaystyle\approx Pvv𝐏v(1)a|p(v)NG(u)(O{v})|(n(NG(u){u})O¯nvn=uλ(n){XZ,YZ}nuλ(n)=XY(1)Fvnp)a𝒞\displaystyle P^{\bot v}_{v}\mathbf{P}^{\bot v}(-1)^{a|p(v)\cap N_{G}(u)\cap(O\cup\{v\})|}\left(\prod_{\begin{subarray}{c}n\in(N_{G}(u)\cup\{u\})\cap\overline{O}\\ n\succ v\\ n=u\Rightarrow\lambda(n)\in\{XZ,YZ\}\\ n\neq u\Rightarrow\lambda(n)=XY\end{subarray}}(-1)^{F_{v\to n}^{p}}\right)^{a}\mathcal{C^{\prime}}

The calculations for focussed sets follow similarly. We can finish by using Lemma C.8 to conclude that these primary extraction strings (resp. stabilizers) are the ones generated by the new Pauli flow (resp. focussed sets). ∎

Theorem D.9.

(Restatement of Theorem 5.2) Let (Γ,α)(\Gamma,\alpha) describe a measurement pattern with some vertex uO¯u\in\overline{O} such that λ(u){XZ,YZ,Z}\lambda(u)\in\{XZ,YZ,Z\} and α(u){0,π}\alpha(u)\in\{0,\pi\}. Eliminating uu from the graph corresponds to the following sequence of actions on the PDDAG:

  1. 1.

    If uu has a planar (XZXZ or YZYZ) label, then its rotation is pulled from the rotation DAG into the stabilizer block;

  2. 2.

    For each neighbour nn of uu that is an output, a ZnZ_{n} rotation of α(u)\alpha(u) is pulled from the stabilizer block through the entire rotation DAG to the end of the circuit;

  3. 3.

    For each neighbour nn of uu with λ(n)=XY\lambda(n)=XY, a 𝐏n\mathbf{P}^{\bot n} rotation of α(u)\alpha(u) is pulled from the stabilizer block and merged with the existing rotation for nn.

Proof.

Each action is moving Pauli operators through rotations. The 3.2 simplify to inducing phase flips. In the PDDAG, we can flip either the operator or angle of the rotation. The α(u)=0\alpha(u)=0 case is trivial, so we suppose that α(u)=π\alpha(u)=\pi (a=1a=1).

For both the rotations and tableau rows, we need only consider extraction strings of planar vertices. Each of the rotations moved through the PDDAG to/from location ww (either w=uw=u or wNG(u)w\in N_{G}(u)) would induce a phase shift in the rotation or tableau row for vv if the corresponding Pauli string 𝐏w\mathbf{P}^{\bot w} anticommutes with 𝐏v\mathbf{P}^{\bot v} and originated beyond vv (either ww is an output or vwv\preceq w), i.e. wp(v)Ow\in p(v)\cap O or Fvwp=1F_{v\to w}^{p}=1. Equation 74 also negates the angle on vv if vNG(u)v\in N_{G}(u) and λ(v){XZ,YZ}\lambda(v)\in\{XZ,YZ\} (i.e. vp(v)v\in p(v)), as covered in Lemma D.6. ∎

Example D.10.

We will use the same example measurement pattern as Example C.13. aa is the only vertex with a label ready for vertex elimination, so to see something actually interesting we suppose α(a)=π\alpha(a)=\pi. Eliminating aa gives the following residual pattern.

SSRY(α3)RY(\alpha_{3})RX(α4)RX(\alpha_{4})RY(α5)RY(\alpha_{5})RZ(α6)RZ(\alpha_{6})RZ(α0)RZ(\alpha_{0})RY(α2)RY(\alpha_{2})RZ(α1)RZ(\alpha_{1})RY(α7)RY(\alpha_{7})iiaabbccooiiddaao2o_{2}cco1o_{1}bbRX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})Zad+1Z^{a_{d}+1}HH|0\ket{0}RY((1)adα(b))RY((-1)^{a_{d}}\alpha(b))RZ((1)ad+1α(a))RZ((-1)^{a_{d}+1}\alpha(a))RZ(π2)RZ(\tfrac{\pi}{2})RZ(π2)RZ(-\tfrac{\pi}{2})RX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})RX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})Zad+1Z^{a_{d}+1}HH|0\ket{0}RY((1)adα(b))RY((-1)^{a_{d}}\alpha(b))RZ((1)ad+1α(a))RZ((-1)^{a_{d}+1}\alpha(a))RZ(π2)RZ(\tfrac{\pi}{2})RZ(π2)RZ(-\tfrac{\pi}{2})RX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})RX(α(i))RX(-\alpha(i))RX(α(c))RX(-\alpha(c))iiddo2o_{2}cco1o_{1}bb
vv λ(v)\lambda^{\prime}(v) α(v)\alpha^{\prime}(v) p(v)p^{\prime}(v) Odd(p(v))\mathrm{Odd}(p^{\prime}(v)) {u|vu}\{u|v\prec u\}
ii XYXY α(i)\alpha(i) b,o2b,o_{2} ii b,c,o1,o2b,c,o_{1},o_{2}
bb XYXY α(b)+π\alpha(b)+\pi c,d,o1c,d,o_{1} b,d,o1,o2b,d,o_{1},o_{2} c,o1,o2c,o_{1},o_{2}
cc XYXY α(c)+π\alpha(c)+\pi o1o_{1} cc o1o_{1}
dd YY α(d)+π\alpha(d)+\pi o2o_{2} dd o2o_{2}

The focussed set p^={c,o2}\hat{p}=\{c,o_{2}\} remains valid. Following the rewrite sequence in the PDDAG, step 1 sees the rotation from aa pulled into the tableau. The Z1Y2Z_{1}Y_{2} term anticommutes with the rotation and tableau row from ii, as well as the free stabilizer from p^\hat{p}.

Ins Outs Sign
XX YY ZZ ()ad+1(-)^{a_{d}+1}
ZZ XX -
ZZ XX -
SSRY(α3)RY(\alpha_{3})RX(α4)RX(\alpha_{4})RY(α5)RY(\alpha_{5})RZ(α6)RZ(\alpha_{6})RZ(α0)RZ(\alpha_{0})RY(α2)RY(\alpha_{2})RZ(α1)RZ(\alpha_{1})RY(α7)RY(\alpha_{7})iiaabbccooiiddaao2o_{2}cco1o_{1}bbRX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})Zad+1Z^{a_{d}+1}HH|0\ket{0}RY((1)adα(b))RY((-1)^{a_{d}}\alpha(b))RZ((1)ad+1α(a))RZ((-1)^{a_{d}+1}\alpha(a))RZ(π2)RZ(\tfrac{\pi}{2})RZ(π2)RZ(-\tfrac{\pi}{2})RX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})RX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})Zad+1Z^{a_{d}+1}HH|0\ket{0}RY((1)adα(b))RY((-1)^{a_{d}}\alpha(b))RZ((1)ad+1α(a))RZ((-1)^{a_{d}+1}\alpha(a))RZ(π2)RZ(\tfrac{\pi}{2})RZ(π2)RZ(-\tfrac{\pi}{2})RX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})RX(α(i))RX(-\alpha(i))RX(α(c))RX(-\alpha(c))iiddo2o_{2}cco1o_{1}bb(I1X2,α(i)){(-I_{1}X_{2},\alpha(i))}((1)ad+1Y1Z2,α(b)){((-1)^{a_{d}+1}Y_{1}Z_{2},\alpha(b))}(X1I2,α(c)){(X_{1}I_{2},\alpha(c))}

For step 2, none of the neighbours of aa are outputs, so there is no change. For step 3, only bb and cc are labelled XYXY, so we move Y1Z2Y_{1}Z_{2} and X1I2X_{1}I_{2} from the tableau and merge into their corresponding rotations.

Ins Outs Sign
XX YY ZZ ()ad(-)^{a_{d}}
ZZ XX ++
ZZ XX ++
SSRY(α3)RY(\alpha_{3})RX(α4)RX(\alpha_{4})RY(α5)RY(\alpha_{5})RZ(α6)RZ(\alpha_{6})RZ(α0)RZ(\alpha_{0})RY(α2)RY(\alpha_{2})RZ(α1)RZ(\alpha_{1})RY(α7)RY(\alpha_{7})iiaabbccooiiddaao2o_{2}cco1o_{1}bbRX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})Zad+1Z^{a_{d}+1}HH|0\ket{0}RY((1)adα(b))RY((-1)^{a_{d}}\alpha(b))RZ((1)ad+1α(a))RZ((-1)^{a_{d}+1}\alpha(a))RZ(π2)RZ(\tfrac{\pi}{2})RZ(π2)RZ(-\tfrac{\pi}{2})RX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})RX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})Zad+1Z^{a_{d}+1}HH|0\ket{0}RY((1)adα(b))RY((-1)^{a_{d}}\alpha(b))RZ((1)ad+1α(a))RZ((-1)^{a_{d}+1}\alpha(a))RZ(π2)RZ(\tfrac{\pi}{2})RZ(π2)RZ(-\tfrac{\pi}{2})RX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})RX(α(i))RX(-\alpha(i))RX(α(c))RX(-\alpha(c))iiddo2o_{2}cco1o_{1}bb(I1X2,α(i)){(I_{1}X_{2},\alpha^{\prime}(i))}((1)adY1Z2,α(b)){((-1)^{a_{d}}Y_{1}Z_{2},\alpha^{\prime}(b))}(X1I2,α(c)){(X_{1}I_{2},\alpha^{\prime}(c))}

This same PDDAG is obtained by extracting from the reduced measurement pattern above. Since extraction will give everything in terms of α\alpha^{\prime}, we note that the phase on the primary extraction string from bb is now (1)1+α(d)/π=(1)ad(-1)^{1+\alpha^{\prime}(d)/\pi}=(-1)^{a_{d}}.

D.3 Local Complementation of Graphs

Definition D.11.

Given a graph G=(V,E)G=(V,E) with some designated vertex uVu\in V, the local complementation of GG about uu is the operation resulting in the graph:

Gu:=(V,EΔ{(v,w)|(v,u),(w,u)Evw})G\star u:=(V,E\Delta\{(v,w)|(v,u),(w,u)\in E\wedge v\neq w\}) (80)
Lemma D.12.

Let (Γ,α)(\Gamma,\alpha) describe a measurement pattern with Γ=(G,I,O,λ)\Gamma=(G,I,O,\lambda) and some vertex uI¯u\in\overline{I}. Then performing a local complementation about uu gives an equivalent measurement pattern (Γ,α)(\Gamma^{\prime},\alpha^{\prime}) where Γ=(Gu,I,O,λ)\Gamma^{\prime}=(G\star u,I,O,\lambda^{\prime}), for all vO¯{u}v\in\overline{O}\setminus\{u\}

(λ(u),α(u))\displaystyle(\lambda^{\prime}(u),\alpha^{\prime}(u)) :={(XZ,α(u)+π2)if λ(u)=XY(XY,π2α(u))if λ(u)=XZ(YZ,α(u)+π2)if λ(u)=YZ(X,α(u))if λ(u)=X(Z,α(u)+π)if λ(u)=Y(Y,α(u))if λ(u)=Z\displaystyle:=\begin{cases}(XZ,\alpha(u)+\tfrac{\pi}{2})&\text{if }\lambda(u)=XY\\ (XY,\tfrac{\pi}{2}-\alpha(u))&\text{if }\lambda(u)=XZ\\ (YZ,\alpha(u)+\tfrac{\pi}{2})&\text{if }\lambda(u)=YZ\\ (X,\alpha(u))&\text{if }\lambda(u)=X\\ (Z,\alpha(u)+\pi)&\text{if }\lambda(u)=Y\\ (Y,\alpha(u))&\text{if }\lambda(u)=Z\\ \end{cases} (81)
(λ(v),α(v))\displaystyle(\lambda^{\prime}(v),\alpha^{\prime}(v)) :={(XY,α(v)+π2)if vNG(u)λ(v)=XY(YZ,α(v))if vNG(u)λ(v)=XZ(XZ,α(v))if vNG(u)λ(v)=YZ(Y,α(v))if vNG(u)λ(v)=X(X,α(v)+π)if vNG(u)λ(v)=Y(λ(v),α(v))otherwise\displaystyle:=\begin{cases}(XY,\alpha(v)+\tfrac{\pi}{2})&\text{if }v\in N_{G}(u)\wedge\lambda(v)=XY\\ (YZ,\alpha(v))&\text{if }v\in N_{G}(u)\wedge\lambda(v)=XZ\\ (XZ,-\alpha(v))&\text{if }v\in N_{G}(u)\wedge\lambda(v)=YZ\\ (Y,\alpha(v))&\text{if }v\in N_{G}(u)\wedge\lambda(v)=X\\ (X,\alpha(v)+\pi)&\text{if }v\in N_{G}(u)\wedge\lambda(v)=Y\\ (\lambda(v),\alpha(v))&\text{otherwise}\end{cases} (82)

plus each output neighbouring uu is followed by an RZ(π2)RZ(-\tfrac{\pi}{2}) gate and if uu is an output then it is followed by an RX(π2)RX(\tfrac{\pi}{2}) gate.

Proof.

The case for planar measurements is given in the proof of [6, Lemma 4.3]. We can extend this to the Pauli measurements using the embeddings in Equation 66. For completeness, the rough idea is as follows:

In our notation, Van den Nest’s Theorem for local complementation [34] (specifically, the version allowing for inputs as in [6, Lemma 4.3]) becomes:

EGuNI¯eiπ4Xu(wNG(u)eiπ4Zw)EGNI¯eiπ4Xu(wNG(u)eiπ4Zw)EGNI¯E_{G\star u}N_{\overline{I}}\approx e^{-i\tfrac{\pi}{4}X_{u}}\left(\prod_{w\in N_{G}(u)}e^{i\tfrac{\pi}{4}Z_{w}}\right)E_{G}N_{\overline{I}}\approx e^{i\tfrac{\pi}{4}X_{u}}\left(\prod_{w\in N_{G}(u)}e^{-i\tfrac{\pi}{4}Z_{w}}\right)E_{G}N_{\overline{I}} (83)

Each of these rotations then modifies any subsequent measurement on that qubit. By considering each case for λ(v)\lambda(v), we find the updates for λ\lambda^{\prime} and α\alpha^{\prime} are suitable to capture this rotation. ∎

We quote the following Lemma from Duncan et al. [16] as it is useful in showing the preservation of Pauli flow here.

Lemma D.13.

([16, Lemma B.4]) Given a graph G=(V,E)G=(V,E), a subset AVA\subseteq V and a vertex uVu\in V, we have

OddGu(A)={OddG(A)Δ(NG(u)A)if uOddG(A)OddG(A)Δ(NG(u)A)if uOddG(A)\mathrm{Odd}_{G\star u}(A)=\begin{cases}\mathrm{Odd}_{G}(A)\Delta(N_{G}(u)\cap A)&\text{if }u\notin\mathrm{Odd}_{G}(A)\\ \mathrm{Odd}_{G}(A)\Delta(N_{G}(u)\setminus A)&\text{if }u\in\mathrm{Odd}_{G}(A)\\ \end{cases} (84)
Lemma D.14.

Let (Γ,α)(\Gamma,\alpha) and (Γ,α)(\Gamma^{\prime},\alpha^{\prime}) be measurement patterns related by local complementation about a vertex uI¯u\in\overline{I} as in Lemma D.12. If (p,)(p,\prec) is a Pauli flow for Γ\Gamma, then (p,)(p^{\prime},\prec) is a Pauli flow for Γ\Gamma^{\prime} where for any vO¯v\in\overline{O}

p(v):={p(v)Δ{u}if uOddG(p(v))p(v)if uOddG(p(v))p^{\prime}(v):=\begin{cases}p(v)\Delta\{u\}&\text{if }u\in\mathrm{Odd}_{G}(p(v))\\ p(v)&\text{if }u\notin\mathrm{Odd}_{G}(p(v))\end{cases} (85)
Proof.

For this proof, we will suppose uO¯u\in\overline{O}. The case where uu is an output has strictly weaker requirements from the flow conditions and hence will be covered by the cases examined here.

Firstly, we prove a useful decomposition of the odd neighbourhoods of correction sets. If uOddG(p(v))u\in\mathrm{Odd}_{G}(p(v)), then using Lemma D.13 we have

OddGu(p(v))=OddGu(p(v))ΔOddGu({u})=OddG(p(v))Δ(NG(u)p(v))ΔNG(u)=OddG(p(v))Δ(NG(u)p(v))\begin{split}\mathrm{Odd}_{G\star u}(p^{\prime}(v))&=\mathrm{Odd}_{G\star u}(p(v))\Delta\mathrm{Odd}_{G\star u}(\{u\})\\ &=\mathrm{Odd}_{G}(p(v))\Delta\left(N_{G}(u)\setminus p(v)\right)\Delta N_{G}(u)\\ &=\mathrm{Odd}_{G}(p(v))\Delta\left(N_{G}(u)\cap p(v)\right)\end{split} (86)

and similarly if uOddG(p(v))u\notin\mathrm{Odd}_{G}(p(v)) we have

OddGu(p(v))=OddGu(p(v))=OddG(p(v))Δ(NG(u)p(v))\begin{split}\mathrm{Odd}_{G\star u}(p^{\prime}(v))&=\mathrm{Odd}_{G\star u}(p(v))\\ &=\mathrm{Odd}_{G}(p(v))\Delta\left(N_{G}(u)\cap p(v)\right)\end{split} (87)

In either case, we can now use the following equation for the remainder of the proof:

OddGu(p(v))=OddG(p(v))Δ(NG(u)p(v))\mathrm{Odd}_{G\star u}(p^{\prime}(v))=\mathrm{Odd}_{G}(p(v))\Delta\left(N_{G}(u)\cap p(v)\right) (88)

We will first prove the Pauli flow conditions for v=uv=u and then separately show that they all hold for any vO¯{u}v\in\overline{O}\setminus\{u\}. For uu, [.X][\prec.X] is preserved since p(u)p^{\prime}(u) and p(u)p(u) are either identical or differ by uu, and wO¯{u}.λ(w){X,Y}λ(w){X,Y}\forall w\in\overline{O}\setminus\{u\}.\lambda^{\prime}(w)\in\{X,Y\}\Leftrightarrow\lambda(w)\in\{X,Y\}.

For condition [.Z][\prec.Z], consider any wOddGu(p(u))w\in\mathrm{Odd}_{G\star u}(p^{\prime}(u)) such that wuw\neq u and wuw\preceq u. By using Equation 88, we can consider the following cases:

  • Suppose wOddG(p(u))w\in\mathrm{Odd}_{G}(p(u)) and wNG(u)p(u)w\notin N_{G}(u)\cap p(u). From condition [.Z][\prec.Z] for (p,)(p,\prec), we have that λ(w){Y,Z}\lambda(w)\in\{Y,Z\}. If λ(w)=Z\lambda(w)=Z then λ(w)=Z\lambda^{\prime}(w)=Z which is sufficient, so suppose that λ(w)=Y\lambda(w)=Y. Conditon [.Y][\prec.Y] for (p,)(p,\prec) gives wp(u)w\in p(u), and hence wNG(u)w\notin N_{G}(u) which implies λ(w)=Y\lambda^{\prime}(w)=Y.

  • Suppose wOddG(p(u))w\notin\mathrm{Odd}_{G}(p(u)) and wNG(u)p(u)w\in N_{G}(u)\cap p(u). It must be the case that λ(w)Y\lambda(w)\neq Y by condition [.Y][\prec.Y] for (p,)(p,\prec), and condition [.X][\prec.X] gives λ(w){X,Y}\lambda(w)\in\{X,Y\}. So λ(w)=X\lambda(w)=X and λ(w)=Y\lambda^{\prime}(w)=Y which is sufficient.

For condition [.Y][\prec.Y], consider any wuw\preceq u such that uwu\neq w and λ(w)=Y\lambda^{\prime}(w)=Y. wp(u)w\in p^{\prime}(u) if and only if wp(u)w\in p(u) from the definition of pp^{\prime}.

  • Suppose wNG(u)w\in N_{G}(u). The definition of λ\lambda^{\prime} gives that λ(w)=X\lambda(w)=X, therefore wOddG(p(u))w\notin\mathrm{Odd}_{G}(p(u)) by condition [.Z][\prec.Z] for (p,)(p,\prec). Equation 88 now reduces to give wOddGu(p(u))wp(u)w\in\mathrm{Odd}_{G\star u}(p^{\prime}(u))\Leftrightarrow w\in p(u) (wp(u)w\in p^{\prime}(u)).

  • Suppose wNG(u)w\notin N_{G}(u). We similarly find λ(w)=Y\lambda^{\prime}(w)=Y, and then wOddG(p(u))wp(u)w\in\mathrm{Odd}_{G}(p(u))\Leftrightarrow w\in p(u) from condition [.Y][\prec.Y] for (p,)(p,\prec). Equation 88 reduces to give wOddGu(p(u))wOddG(p(u))w\in\mathrm{Odd}_{G\star u}(p^{\prime}(u))\Leftrightarrow w\in\mathrm{Odd}_{G}(p(u)). Therefore, we have wOddGu(p(u))wp(u)w\in\mathrm{Odd}_{G\star u}(p^{\prime}(u))\Leftrightarrow w\in p^{\prime}(u) as required.

Suppose uOddG(p(u))u\in\mathrm{Odd}_{G}(p(u)). Equation 88 implies uOddGu(p(u))u\in\mathrm{Odd}_{G\star u}(p^{\prime}(u)) because uNG(u)u\notin N_{G}(u). We also have up(u)u\in p^{\prime}(u) if and only if up(u)u\notin p(u) from the definition of pp^{\prime}. Each of the conditions [λ.XY][\lambda.XY]-[λ.Y][\lambda.Y] then follow straightforwardly since the flipping of set membership matches the changes to labels between λ\lambda and λ\lambda^{\prime}.

Suppose instead that uOddG(p(u))u\notin\mathrm{Odd}_{G}(p(u)). Equation 88 now implies uOddGu(p(u))u\notin\mathrm{Odd}_{G\star u}(p^{\prime}(u)). Since uu must be corrected in some way, up(u)u\in p(u) must hold, and hence up(u)u\in p^{\prime}(u). The only measurement bases that correspond to this correction give λ(u){YZ,Y,Z}\lambda(u)\in\{YZ,Y,Z\}. This also gives λ(u){YZ,Y,Z}\lambda^{\prime}(u)\in\{YZ,Y,Z\}, so the conditions [λ.XY][\lambda.XY]-[λ.Y][\lambda.Y] still hold.

Now we need to show that the same conditions hold for any vO¯{u}v\in\overline{O}\setminus\{u\}. For [.X][\prec.X]-[.Y][\prec.Y], we will do this by case distinction over the cases of p(v)p^{\prime}(v).

Suppose that uOddG(p(v))u\in\mathrm{Odd}_{G}(p(v)). Note that uvu\preceq v implies λ(u)=Zup(v)\lambda(u)=Z\Leftrightarrow u\notin p(v) and λ(u)=Yup(v)\lambda(u)=Y\Leftrightarrow u\in p(v) from conditions [.X][\prec.X]-[.Y][\prec.Y] for (p,)(p,\prec).

[.X][\prec.X]: Consider some wp(v)=p(v)Δ{u}w\in p^{\prime}(v)=p(v)\Delta\{u\} with wvw\neq v and wvw\preceq v.

  • If w=uw=u, then wp(v)w\notin p(v) and uvu\preceq v, so λ(u)=Z\lambda(u)=Z and λ(u)=Y\lambda^{\prime}(u)=Y.

  • If wp(v)w\in p(v) and wuw\neq u, then [.X][\prec.X] gives λ(w){X,Y}\lambda(w)\in\{X,Y\}, so λ(w){X,Y}\lambda^{\prime}(w)\in\{X,Y\}.

[.Z][\prec.Z]: Consider some wOddGu(p(v))=OddG(p(v))Δ(NG(u)p(v))w\in\mathrm{Odd}_{G\star u}(p^{\prime}(v))=\mathrm{Odd}_{G}(p(v))\Delta(N_{G}(u)\cap p(v)) with wvw\neq v and wvw\preceq v.

  • If w=uw=u then uvu\preceq v, so λ(w){Y,Z}\lambda(w)\in\{Y,Z\} and λ(w){Y,Z}\lambda^{\prime}(w)\in\{Y,Z\}.

  • If wOddG(p(v))w\in\mathrm{Odd}_{G}(p(v)), wuw\neq u, and wNG(u)p(v)w\notin N_{G}(u)\cap p(v) then by [.Z][\prec.Z] we have λ(w){Y,Z}\lambda(w)\in\{Y,Z\}. If λ(w)=Z\lambda(w)=Z then λ(w)=Z\lambda^{\prime}(w)=Z. If λ(w)=Y\lambda(w)=Y, then wp(v)w\in p(v) by [.Y][\prec.Y], so wNG(u)w\notin N_{G}(u) by Equation 88 and therefore λ(w)=Y\lambda^{\prime}(w)=Y.

  • If wOddG(p(v))w\notin\mathrm{Odd}_{G}(p(v)) and wNG(u)p(v)w\in N_{G}(u)\cap p(v), then by [.X][\prec.X] and [.Y][\prec.Y] we must have λ(w)=X\lambda(w)=X, so λ(w)=Y\lambda^{\prime}(w)=Y.

[.Y][\prec.Y]: Consider any wvw\preceq v with wvw\neq v and λ(w)=Y\lambda^{\prime}(w)=Y.

  • If wNG(u)w\in N_{G}(u), then λ(w)=X\lambda(w)=X and wuw\neq u. Using [.Z][\prec.Z] we get wOddG(p(v))w\notin\mathrm{Odd}_{G}(p(v)), so Equation 88 reduces to wOddGu(p(v))w\in\mathrm{Odd}_{G\star u}(p^{\prime}(v)) if and only if wp(v)w\in p(v). Since wuw\neq u, this happens if and only if wp(v)=p(v)Δ{u}w\in p^{\prime}(v)=p(v)\Delta\{u\}.

  • If w=uw=u, then λ(w)=Z\lambda(w)=Z. By [.X][\prec.X] we have up(v)u\notin p(v) and by assumption uOddG(p(v))u\in\mathrm{Odd}_{G}(p(v)). These mean up(v)=p(v)Δ{u}u\in p^{\prime}(v)=p(v)\Delta\{u\} and uOddGu(p(v))u\in\mathrm{Odd}_{G\star u}(p^{\prime}(v)) by Equation 88.

  • If wNG(u)w\notin N_{G}(u) and wuw\neq u, then λ(w)=Y\lambda(w)=Y. Equation 88 gives wOddGu(p(v))w\in\mathrm{Odd}_{G\star u}(p^{\prime}(v)) if and only if wOddG(p(v))w\in\mathrm{Odd}_{G}(p(v)). Using [.Y][\prec.Y], this happens if and only if wp(v)w\in p(v) and thus if and only if wp(v)=p(v)Δ{u}w\in p^{\prime}(v)=p(v)\Delta\{u\}.

Otherwise, suppose uOddG(p(v))u\notin\mathrm{Odd}_{G}(p(v)).

[.X][\prec.X]: Consider some wp(v)=p(v)w\in p^{\prime}(v)=p(v) with wvw\neq v and wvw\preceq v.

  • If w=uw=u, then by [.X][\prec.X] and [.Y][\prec.Y] we have λ(u)=X=λ(w)\lambda(u)=X=\lambda^{\prime}(w).

  • If wuw\neq u, then by [.X][\prec.X] we have λ(w){X,Y}\lambda(w)\in\{X,Y\}, so λ(w){X,Y}\lambda^{\prime}(w)\in\{X,Y\}.

[.Z][\prec.Z]: Consider some wOddGu(p(v))=OddG(p(v))Δ(NG(u)p(v))w\in\mathrm{Odd}_{G\star u}(p^{\prime}(v))=\mathrm{Odd}_{G}(p(v))\Delta(N_{G}(u)\cap p(v)) with wvw\neq v and wvw\preceq v. Since uNG(u)u\notin N_{G}(u) and uOddG(p(v))u\notin\mathrm{Odd}_{G}(p(v)), wuw\neq u.

  • If wNG(u)w\in N_{G}(u), then Equation 88 gives wOddG(p(v))Δp(v)w\in\mathrm{Odd}_{G}(p(v))\Delta p(v). Conditions [.X][\prec.X]-[.Y][\prec.Y] imply that λ(w){X,Z}\lambda(w)\in\{X,Z\}, so λ(w){Y,Z}\lambda^{\prime}(w)\in\{Y,Z\}.

  • If wNG(u)w\notin N_{G}(u), wOddG(p(v))w\in\mathrm{Odd}_{G}(p(v)) and λ(w)=λ(w)\lambda^{\prime}(w)=\lambda(w), so the result follows straightforwardly from [.Z][\prec.Z] for (p,)(p,\prec).

[.Y][\prec.Y]: Consider any wvw\preceq v with wvw\neq v and λ(w)=Y\lambda^{\prime}(w)=Y.

  • If w=uw=u, then λ(u)=Z\lambda(u)=Z. From [.X][\prec.X], up(v)=p(v)u\notin p(v)=p^{\prime}(v), and uOddGu(p(v))u\notin\mathrm{Odd}_{G\star u}(p^{\prime}(v)) since uOddG(p(v))u\notin\mathrm{Odd}_{G}(p(v)) by assumption and uNG(u)u\notin N_{G}(u).

  • If wNG(u)w\in N_{G}(u), then λ(w)=X\lambda(w)=X. From [.Z][\prec.Z], wOddG(p(v))w\notin\mathrm{Odd}_{G}(p(v)). Equation 88 then reduces to wOddGu(p(v))w\in\mathrm{Odd}_{G\star u}(p^{\prime}(v)) if and only if wp(v)=p(v)w\in p(v)=p^{\prime}(v).

  • If wNG(u)w\notin N_{G}(u) and wuw\neq u, then λ(w)=Y\lambda(w)=Y. Equation 88 gives wOddGu(p(v))w\in\mathrm{Odd}_{G\star u}(p^{\prime}(v)) if and only if wOddG(p(v))w\in\mathrm{Odd}_{G}(p(v)), which happens if and only if wp(v)=p(v)w\in p(v)=p^{\prime}(v) by [.Y][\prec.Y] for (p,)(p,\prec).

[λ.XY][\lambda.XY]-[λ.YZ][\lambda.YZ]: Suppose λ(v){XY,XZ,YZ}\lambda(v)\in\{XY,XZ,YZ\}. Since vO¯{u}v\in\overline{O}\setminus\{u\}, vp(v)v\in p^{\prime}(v) if and only if vp(v)v\in p(v). Whether or not vp(v)v\in p(v) and vOdd(p(v))v\in\mathrm{Odd}(p(v)) is given by [λ.XY][\lambda.XY]-[λ.YZ][\lambda.YZ] for (p,)(p,\prec) and the value of λ(v)\lambda(v).

  • If vNG(u)v\in N_{G}(u), then Equation 88 gives vOddGu(p(v))v\in\mathrm{Odd}_{G\star u}(p^{\prime}(v)) if and only if vOddG(p(v))Δp(v)v\in\mathrm{Odd}_{G}(p(v))\Delta p(v). This change in the odd neighbourhood coincides with the definition of λ\lambda^{\prime} flipping the labels of XZXZ and YZYZ.

  • If vNG(u)v\notin N_{G}(u), then Equation 88 gives vOddGu(p(v))v\in\mathrm{Odd}_{G\star u}(p^{\prime}(v)) if and only if vOddG(p(v))v\in\mathrm{Odd}_{G}(p(v)), which is enough since λ(v)=λ(v)\lambda^{\prime}(v)=\lambda(v).

[λ.X][\lambda.X]-[λ.Y][\lambda.Y]: We will prove these conditions by considering the possible cases for λ(v){X,Y,Z}\lambda(v)\in\{X,Y,Z\} in turn. In each case, since vuv\neq u, vp(v)v\in p^{\prime}(v) if and only if vp(v)v\in p(v).

If λ(v)=Z\lambda(v)=Z, then λ(v)=Z\lambda^{\prime}(v)=Z and we get vp(v)v\in p(v) (vp(v)v\in p^{\prime}(v)) from [λ.Z][\lambda.Z] for (p,)(p,\prec).

Suppose λ(v)=X\lambda(v)=X, so vOddG(p(v))v\in\mathrm{Odd}_{G}(p(v)) from [λ.X][\lambda.X] for (p,)(p,\prec).

  • If vNG(u)v\in N_{G}(u), then λ(v)=Y\lambda^{\prime}(v)=Y and Equation 88 gives vOddGu(p(v))v\in\mathrm{Odd}_{G\star u}(p^{\prime}(v)) if and only if vp(v)v\notin p(v) (vp(v)v\notin p^{\prime}(v)).

  • If vNG(u)v\notin N_{G}(u), then λ(v)=X\lambda^{\prime}(v)=X and Equation 88 gives vOddGu(p(v))v\in\mathrm{Odd}_{G\star u}(p^{\prime}(v)).

Suppose λ(v)=Y\lambda(v)=Y, so vp(v)vOddG(p(v))v\in p(v)\Leftrightarrow v\notin\mathrm{Odd}_{G}(p(v)) from [λ.Y][\lambda.Y] for (p,)(p,\prec).

  • If vNG(u)v\in N_{G}(u), then λ(v)=X\lambda^{\prime}(v)=X. Since vOddG(p(v))Δp(v)v\in\mathrm{Odd}_{G}(p(v))\Delta p(v), Equation 88 gives vOddGu(p(v))v\in\mathrm{Odd}_{G\star u}(p^{\prime}(v)).

  • If vNG(u)v\notin N_{G}(u), then λ(v)=Y\lambda^{\prime}(v)=Y. Equation 88 gives vOddGu(p(v))v\in\mathrm{Odd}_{G\star u}(p^{\prime}(v)) if and only if vOddG(p(v))v\in\mathrm{Odd}_{G}(p(v)). From [λ.Y][\lambda.Y] and vuv\neq u, this happens if and only if vp(v)v\notin p^{\prime}(v).

Lemma D.15.

Let (Γ,α)(\Gamma,\alpha) and (Γ,α)(\Gamma^{\prime},\alpha^{\prime}) be the measurement patterns from Lemma D.12 related by local complementation about a vertex uI¯u\in\overline{I}. If (p,)(p,\prec) is a focussed Pauli flow for Γ\Gamma, then (p,)(p^{\prime},\prec) is a focussed pauli flow for Γ\Gamma^{\prime}, where pp^{\prime} is defined in \succ-order (from outputs backwards) as

p(v):={p(v)Δ{u}if uOddG(p(v))p(v)if uOddG(p(v))}Δ\scalerelΔwO¯{v}wp(v)OddG(p(v))wNG(u){u}wNG(u)λ(w)=XYw=uλ(u){X,Y,Z}p(w)p^{\prime}(v):=\left\{\begin{array}[]{ll}p(v)\Delta\{u\}&\text{if }u\in\mathrm{Odd}_{G}(p(v))\\ p(v)&\text{if }u\notin\mathrm{Odd}_{G}(p(v))\end{array}\right\}\Delta\operatorname*{\scalerel*{\Delta}{\sum}}_{\begin{subarray}{c}w\in\overline{O}\setminus\{v\}\\ w\in p(v)\cup\mathrm{Odd}_{G}(p(v))\\ w\in N_{G}(u)\cup\{u\}\\ w\in N_{G}(u)\Rightarrow\lambda(w)=XY\\ w=u\Rightarrow\lambda(u)\notin\{X,Y,Z\}\end{subarray}}p^{\prime}(w) (89)

Furthermore, if p^\hat{p} is a focussed set for Γ\Gamma, then we obtain a corresponding focussed set for Γ\Gamma^{\prime} as

p^:={p^Δ{u}if uOddG(p^)p^if uOddG(p^)}Δ\scalerelΔwO¯wp^OddG(p^)wNG(u){u}wNG(u)λ(w)=XYw=uλ(u){X,Y,Z}p(w)\hat{p^{\prime}}:=\left\{\begin{array}[]{ll}\hat{p}\Delta\{u\}&\text{if }u\in\mathrm{Odd}_{G}(\hat{p})\\ \hat{p}&\text{if }u\notin\mathrm{Odd}_{G}(\hat{p})\end{array}\right\}\Delta\operatorname*{\scalerel*{\Delta}{\sum}}_{\begin{subarray}{c}w\in\overline{O}\\ w\in\hat{p}\cup\mathrm{Odd}_{G}(\hat{p})\\ w\in N_{G}(u)\cup\{u\}\\ w\in N_{G}(u)\Rightarrow\lambda(w)=XY\\ w=u\Rightarrow\lambda(u)\notin\{X,Y,Z\}\end{subarray}}p^{\prime}(w) (90)
Proof.

Lemma D.14 gives a Pauli flow for Γ\Gamma^{\prime}, which we will rename as (q,)(q,\prec). We can view (q,)(q,\prec) as an intermediate in the construction of (p,)(p^{\prime},\prec). It is not necessarily focussed, but we can refocus it using Lemma 4.6. Recall that this adds correction sets together according to Lemma B.1 for any case where the focussed conditions do not hold for qq. We just need to show that these cases match those in the definition of pp^{\prime}.

As usual, the proofs for Pauli flows and focussed sets are almost identical, so herein we could change out references of qq for

q^:={p^Δ{u}if uOddG(p^)p^if uOddG(p^)\hat{q}:=\begin{cases}\hat{p}\Delta\{u\}&\text{if }u\in\mathrm{Odd}_{G}(\hat{p})\\ \hat{p}&\text{if }u\notin\mathrm{Odd}_{G}(\hat{p})\end{cases} (91)

as an intermediate in the construction of p^\hat{p^{\prime}}.

We will find the counterexamples to the focussed conditions for (q,)(q,\prec) by considering q(v)q(v) for an arbitrary vO¯v\in\overline{O}, and all of the cases for wO¯{v}w\in\overline{O}\setminus\{v\}, covering each case of λ(w)\lambda(w) for each of w=uw=u, wNG(u)w\in N_{G}(u), and wNG(u){u}w\notin N_{G}(u)\cup\{u\}.

Firstly, we have w=uw=u:

  • λ(u)=XY\lambda(u)=XY, λ(u)=XZ\lambda^{\prime}(u)=XZ: By [FZ][FZ], uOddG(p(v))u\notin\mathrm{Odd}_{G}(p(v)), so q(v)=p(v)q(v)=p(v). This hence breaks [FX][FX] for qq if up(v)u\in p(v), i.e. if up(v)OddG(p(v))u\in p(v)\cup\mathrm{Odd}_{G}(p(v)). ✗

  • λ(u)=XZ\lambda(u)=XZ, λ(u)=XY\lambda^{\prime}(u)=XY: [FX][FX] gives up(v)u\notin p(v). By Equation 88, we break [FZ][FZ] for qq if uOddG(p(v))u\in\mathrm{Odd}_{G}(p(v)), i.e. if up(v)OddG(p(v))u\in p(v)\cup\mathrm{Odd}_{G}(p(v)). ✗

  • λ(u)=YZ=λ(u)\lambda(u)=YZ=\lambda^{\prime}(u): [FX][FX] gives up(v)u\notin p(v). From the definition of q(v)q(v), uq(v)u\in q(v) (breaking [FX][FX] for qq) if uOddG(p(v))u\in\mathrm{Odd}_{G}(p(v)), i.e. if up(v)OddG(p(v))u\in p(v)\cup\mathrm{Odd}_{G}(p(v)). ✗

  • λ(u)=X=λ(u)\lambda(u)=X=\lambda^{\prime}(u): By [FZ][FZ], uOddG(p(v))u\notin\mathrm{Odd}_{G}(p(v)). We hence have uOddGu(q(v))u\notin\mathrm{Odd}_{G\star u}(q(v)) by Equation 88. ✓

  • λ(u)=Y\lambda(u)=Y, λ(u)=Z\lambda^{\prime}(u)=Z: [FY][FY] gives up(v)uOddG(p(v))u\in p(v)\Leftrightarrow u\in\mathrm{Odd}_{G}(p(v)). In both cases for the definition of q(v)q(v), this gives uq(v)u\notin q(v). ✓

  • λ(u)=Z\lambda(u)=Z, λ(u)=Y\lambda^{\prime}(u)=Y: We have up(v)u\notin p(v) from [FX][FX]. The definition of q(v)q(v) then gives uq(v)uOddG(p(v))u\in q(v)\Leftrightarrow u\in\mathrm{Odd}_{G}(p(v)), and Equation 88 gives uOddGu(q(v))uOddG(p(v))u\in\mathrm{Odd}_{G\star u}(q(v))\Leftrightarrow u\in\mathrm{Odd}_{G}(p(v)). Hence uq(v)uOddGu(q(v))u\in q(v)\Leftrightarrow u\in\mathrm{Odd}_{G\star u}(q(v)). ✓

Next, suppose wNG(u)w\in N_{G}(u). In each case, the definition of q(v)q(v) gives wq(v)wp(v)w\in q(v)\Leftrightarrow w\in p(v) and Equation 88 gives wOddGu(q(v))wp(v)ΔOddG(p(v))w\in\mathrm{Odd}_{G\star u}(q(v))\Leftrightarrow w\in p(v)\Delta\mathrm{Odd}_{G}(p(v)).

  • λ(w)=XY\lambda(w)=XY, λ(w)=XY\lambda^{\prime}(w)=XY: By [FZ][FZ], we have wOddG(p(v))w\notin\mathrm{Odd}_{G}(p(v)). This means it breaks [FZ][FZ] for qq when wp(v)w\in p(v), i.e. when wp(v)OddG(p(v))w\in p(v)\cup\mathrm{Odd}_{G}(p(v)). ✗

  • λ(w){XZ,YZ,Z}\lambda(w)\in\{XZ,YZ,Z\}, λ(w){XZ,YZ,Z}\lambda^{\prime}(w)\in\{XZ,YZ,Z\}: wp(v)w\notin p(v) by [FX][FX], so wq(v)w\notin q(v). ✓

  • λ(w)=X\lambda(w)=X, λ(w)=Y\lambda^{\prime}(w)=Y: wOddG(p(v))w\notin\mathrm{Odd}_{G}(p(v)) holds by [FZ][FZ], so wOddGu(q(v))wp(v)w\in\mathrm{Odd}_{G\star u}(q(v))\Leftrightarrow w\in p(v) and hence wq(v)wOddGu(q(v))w\in q(v)\Leftrightarrow w\in\mathrm{Odd}_{G\star u}(q(v)). ✓

  • λ(w)=Y\lambda(w)=Y, λ(w)=X\lambda^{\prime}(w)=X: By [FY][FY], we have wp(v)ΔOddG(p(v))w\notin p(v)\Delta\mathrm{Odd}_{G}(p(v)), and therefore wOddGu(q(v))w\notin\mathrm{Odd}_{G\star u}(q(v)). ✓

For the final case of wNG(u){u}w\notin N_{G}(u)\cup\{u\}, we have λ(w)=λ(w)\lambda^{\prime}(w)=\lambda(w), wq(v)wp(v)w\in q(v)\Leftrightarrow w\in p(v), and wOddGu(q(v))wOddG(p(v))w\in\mathrm{Odd}_{G\star u}(q(v))\Leftrightarrow w\in\mathrm{Odd}_{G}(p(v)), so all of the focussed conditions are preserved.

In summary, we find that applying Lemma 4.6 to (q,)(q,\prec) will add focussed corrections to q(v)q(v) for any wp(v)OddG(p(v))w\in p(v)\cup\mathrm{Odd}_{G}(p(v)) such that w=uw=u and λ(u){XY,XZ,YZ}\lambda(u)\in\{XY,XZ,YZ\} or wNG(u)w\in N_{G}(u) and λ(w)=XY\lambda(w)=XY. This exactly results in (p,)(p^{\prime},\prec), meaning this is a focussed Pauli flow for Γ\Gamma^{\prime}. ∎

Lemma D.16.

Let (Γ,α)(\Gamma,\alpha) and (Γ,α)(\Gamma^{\prime},\alpha^{\prime}) be the measurement patterns and corresponding focussed Pauli flows (p,)(p,\prec) and (p,)(p^{\prime},\prec) from Lemma D.15 formed by local complementation around a vertex uI¯u\in\overline{I}. Let 𝐏v\mathbf{P}^{\bot v} be the primary extraction string for vv in (Γ,α)(\Gamma,\alpha) from (p,)(p,\prec). Then 𝐏v:=PvvPvv𝐏v\mathbf{P^{\prime}}^{\bot v}:=P^{\prime\bot v}_{v}\mathcal{R}^{\dagger}P^{\bot v}_{v}\mathbf{P}^{\bot v}\mathcal{R} is the corresponding primary extraction string in (Γ,α)(\Gamma^{\prime},\alpha^{\prime}) from (p,)(p^{\prime},\prec), where

:=(wNG(u)wO{v}eiπ4Zw)(w=uwO{v}eiπ4Xw)(wO¯(NG(u){u}){v}wvwNG(u)λ(u)=XYw=uλ(w){X,Y,Z}e(1)Dw+Awvpiπ4Pwvv𝐏w)\begin{split}\mathcal{R}:=&\left(\prod_{\begin{subarray}{c}w\in N_{G}(u)\\ w\in O\cup\{v\}\end{subarray}}e^{i\tfrac{\pi}{4}Z_{w}}\right)\left(\prod_{\begin{subarray}{c}w=u\\ w\in O\cup\{v\}\end{subarray}}e^{-i\tfrac{\pi}{4}X_{w}}\right)\\ &\left(\prod_{\begin{subarray}{c}w\in\overline{O}\cap(N_{G}(u)\cup\{u\})\setminus\{v\}\\ w\succ v\\ w\in N_{G}(u)\Rightarrow\lambda(u)=XY\\ w=u\Rightarrow\lambda(w)\notin\{X,Y,Z\}\end{subarray}}^{\succ}e^{(-1)^{D_{w}+A_{w\to v}^{p^{\prime}}}i\tfrac{\pi}{4}P^{w\to v}_{v}\mathbf{P^{\prime}}^{\bot w}}\right)\end{split} (92)

Furthermore, if 𝐏\mathbf{P} is the stabilizer from a focussed set p^\hat{p} in (Γ,α)(\Gamma,\alpha), then 𝐏:=𝐏\mathbf{P^{\prime}}:=\mathcal{R}^{\dagger}\mathbf{P}\mathcal{R} is the corresponding stabilizer for (Γ,α)(\Gamma^{\prime},\alpha^{\prime}).

Proof.

We proceed following a similar strategy to Lemma D.3 of simultaneously showing that 𝐏v\mathbf{P^{\prime}}^{\bot v} operates only on the outputs and that it matches the extraction string from (p,)(p^{\prime},\prec) up to phase, then showing that it is a valid extraction string.

The conjugation of Pvv𝐏vP^{\bot v}_{v}\mathbf{P}^{\bot v} by the eiπ4Xue^{-i\tfrac{\pi}{4}X_{u}} and eiπ4Zwe^{i\tfrac{\pi}{4}Z_{w}} terms adjusts the Pauli terms of the operator in the same way as the intermediate Pauli flow from Lemma D.14. The eiπ4Xue^{-i\tfrac{\pi}{4}X_{u}} term adds an XX when conjugating ZZ or YY, matching the addition of {u}\{u\} to p(v)p(v) if uOdd(p(v))u\in\mathrm{Odd}(p(v)). Similarly, the eiπ4Zwe^{i\tfrac{\pi}{4}Z_{w}} term adds a ZZ when conjugating XX or YY, matching the update of the odd neighbourhood according to Equation 88.

Each of the remaining terms in \mathcal{R} cover the cases for the focussing in Lemma D.15. The movement of e(1)Dw+Awvpiπ4Pwvv𝐏we^{(-1)^{D_{w}+A_{w\to v}^{p^{\prime}}}i\tfrac{\pi}{4}P^{w\to v}_{v}\mathbf{P^{\prime}}^{\bot w}} adds Pwvv𝐏wP^{w\to v}_{v}\mathbf{P^{\prime}}^{\bot w} if it anticommutes with the operator. From Lemma C.9 and PvPwv=(1)FwvpkPwvPvP^{\bot v}P^{w\to v}=(-1)^{F_{w\to v}^{p_{k}}}P^{w\to v}P^{\bot v}, the combined operators anticommute if wpk(v)Odd(pk(v))w\in p_{k}(v)\cup\mathrm{Odd}(p_{k}(v)) (where pkp_{k} is the intermediate Pauli flow at this stage in the focussing). This matches the focussing step, which adds p(w)p^{\prime}(w) when wpk(v)Odd(pk(v))w\in p_{k}(v)\cup\mathrm{Odd}(p_{k}(v)) doesn’t satisfy the focussed conditions - by Lemma D.15, this corresponds to the conditions on ww in the definition of \mathcal{R}.

Combining these together, we get that \mathcal{R} maps Pvv𝐏vP^{\bot v}_{v}\mathbf{P}^{\bot v} to the equivalent for (p,)(p^{\prime},\prec) up to phase.

To complete this for the phase, it remains to show that 𝐏v\mathbf{P^{\prime}}^{\bot v} is a valid primary extraction string. Recall from Van den Nest’s Theorem (Equation 83) that local complementation of the graph state is balanced by rotations on uu and its neighbours. Let’s look at how these rotations affect the measurements on those qubits in each case.

λ(w)\lambda(w) w=uw=u wNG(u)w\in N_{G}(u)
XYXY +XZ,π2|eiπ4X\bra{+_{XZ,\tfrac{\pi}{2}}}e^{i\tfrac{\pi}{4}X} =+XY,0|=\bra{+_{XY,0}} +XY,π2|eiπ4Z\bra{+_{XY,\tfrac{\pi}{2}}}e^{-i\tfrac{\pi}{4}Z} +XY,0|\approx\bra{+_{XY,0}}
XZXZ +XY,π2|eiπ4X\bra{+_{XY,\tfrac{\pi}{2}}}e^{i\tfrac{\pi}{4}X} +XZ,0|\approx\bra{+_{XZ,0}} +YZ,0|eiπ4Z\bra{+_{YZ,0}}e^{-i\tfrac{\pi}{4}Z} +XZ,0|\approx\bra{+_{XZ,0}}
YZYZ +YZ,π2|eiπ4X\bra{+_{YZ,\tfrac{\pi}{2}}}e^{i\tfrac{\pi}{4}X} =+YZ,0|=\bra{+_{YZ,0}} +XZ,0|eiπ4Z\bra{+_{XZ,0}}e^{-i\tfrac{\pi}{4}Z} +YZ,0|\approx\bra{+_{YZ,0}}
XX +X,α(w)|eiπ4X\bra{+_{X,\alpha(w)}}e^{i\tfrac{\pi}{4}X} +X,α(w)|\approx\bra{+_{X,\alpha(w)}} +Y,α(w)|eiπ4Z\bra{+_{Y,\alpha(w)}}e^{-i\tfrac{\pi}{4}Z} +X,α(w)|\approx\bra{+_{X,\alpha(w)}}
YY +Z,α(w)+π|eiπ4X\bra{+_{Z,\alpha(w)+\pi}}e^{i\tfrac{\pi}{4}X} +Y,α(w)|\approx\bra{+_{Y,\alpha(w)}} +X,α(w)+π|eiπ4Z\bra{+_{X,\alpha(w)+\pi}}e^{-i\tfrac{\pi}{4}Z} +Y,α(w)|\approx\bra{+_{Y,\alpha(w)}}
ZZ +Y,α(w)|eiπ4X\bra{+_{Y,\alpha(w)}}e^{i\tfrac{\pi}{4}X} +Z,α(w)|\approx\bra{+_{Z,\alpha(w)}} +Z,α(w)|eiπ4Z\bra{+_{Z,\alpha(w)}}e^{-i\tfrac{\pi}{4}Z} +Z,α(w)|\approx\bra{+_{Z,\alpha(w)}}

We can now consider the primary extraction string of some vO¯v\in\overline{O}. As usual, we define 𝒞\mathcal{C^{\prime}} to be the linear map of interest from Definition 4.2 for (Γ,α)(\Gamma^{\prime},\alpha^{\prime}) and let 𝒞\mathcal{C} refer to the equivalent for (Γ,α)(\Gamma,\alpha).

𝒞:=(wvλ(w){X,Y,Z}+λ(w),0|w)(wO¯{v}λ(w){X,Y,Z}+λ(w),α(w)|w)EGuNI¯\mathcal{C^{\prime}}:=\left(\prod_{\begin{subarray}{c}w\succ v\\ \lambda^{\prime}(w)\notin\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda^{\prime}(w),0}}_{w}\right)\left(\prod_{\begin{subarray}{c}w\in\overline{O}\setminus\{v\}\\ \lambda^{\prime}(w)\in\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda^{\prime}(w),\alpha^{\prime}(w)}}_{w}\right)E_{G\star u}N_{\overline{I}}\\ (93)

We start by applying the reverse of the extraction algorithm to modify the measurement angles in the diagram to match those in the table above. Since this changes the angles (which must be 0 to extract any rotation before them), we must perform this in \prec-order.

𝒞(wvwNG(u){u}wNG(u)λ(w)=XYw=uλ(w){X,Y,Z}+λ(w),π2|we(1)1+Dwiπ4Pww)(wvwuwNG(u)λ(w){XZ,YZ}wNG(u)λ(w){X,Y,Z}+λ(w),0|w)(wO¯{v}λ(w){X,Y,Z}+λ(w),α(w)|w)EGuNI¯=(wvwNG(u){u}wNG(u)λ(w)=XYw=uλ(w){X,Y,Z}e(1)1+Dw+Awvpiπ4Pwvv𝐏w)(wvwNG(u){u}wNG(u)λ(w)=XYw=uλ(w){X,Y,Z}+λ(w),π2|w)(wvwuwNG(u)λ(w){XZ,YZ}wNG(u)λ(w){X,Y,Z}+λ(w),0|w)(wO¯{v}λ(w){X,Y,Z}+λ(w),α(w)|w)EGuNI¯\begin{split}\mathcal{C^{\prime}}\approx&\left(\prod_{\begin{subarray}{c}w\succ v\\ w\in N_{G}(u)\cup\{u\}\\ w\in N_{G}(u)\Rightarrow\lambda^{\prime}(w)=XY\\ w=u\Rightarrow\lambda^{\prime}(w)\notin\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda^{\prime}(w),\tfrac{\pi}{2}}}_{w}e^{(-1)^{1+D_{w}}i\tfrac{\pi}{4}P^{\bot w}_{w}}\right)\\ &\left(\prod_{\begin{subarray}{c}w\succ v\\ w\neq u\\ w\in N_{G}(u)\Rightarrow\lambda^{\prime}(w)\in\{XZ,YZ\}\\ w\notin N_{G}(u)\Rightarrow\lambda^{\prime}(w)\notin\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda^{\prime}(w),0}}_{w}\right)\left(\prod_{\begin{subarray}{c}w\in\overline{O}\setminus\{v\}\\ \lambda^{\prime}(w)\in\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda^{\prime}(w),\alpha^{\prime}(w)}}_{w}\right)E_{G\star u}N_{\overline{I}}\\ =&\left(\prod_{\begin{subarray}{c}w\succ v\\ w\in N_{G}(u)\cup\{u\}\\ w\in N_{G}(u)\Rightarrow\lambda^{\prime}(w)=XY\\ w=u\Rightarrow\lambda^{\prime}(w)\notin\{X,Y,Z\}\end{subarray}}^{\prec}e^{(-1)^{1+D_{w}+A_{w\to v}^{p^{\prime}}}i\tfrac{\pi}{4}P^{w\to v}_{v}\mathbf{P^{\prime}}^{\bot w}}\right)\left(\prod_{\begin{subarray}{c}w\succ v\\ w\in N_{G}(u)\cup\{u\}\\ w\in N_{G}(u)\Rightarrow\lambda^{\prime}(w)=XY\\ w=u\Rightarrow\lambda^{\prime}(w)\notin\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda^{\prime}(w),\tfrac{\pi}{2}}}_{w}\right)\\ &\left(\prod_{\begin{subarray}{c}w\succ v\\ w\neq u\\ w\in N_{G}(u)\Rightarrow\lambda^{\prime}(w)\in\{XZ,YZ\}\\ w\notin N_{G}(u)\Rightarrow\lambda^{\prime}(w)\notin\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda^{\prime}(w),0}}_{w}\right)\left(\prod_{\begin{subarray}{c}w\in\overline{O}\setminus\{v\}\\ \lambda^{\prime}(w)\in\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda^{\prime}(w),\alpha^{\prime}(w)}}_{w}\right)E_{G\star u}N_{\overline{I}}\end{split} (94)

Next, we apply Van den Nest’s Theorem to yield 𝒞\mathcal{C}.

𝒞(wvwNG(u){u}wNG(u)λ(w)=XYw=uλ(w){X,Y,Z}e(1)1+Dw+Awvpiπ4Pwvv𝐏w)(wvwNG(u){u}wNG(u)λ(w)=XYw=uλ(w){X,Y,Z}+λ(w),π2|w)(wvwuwNG(u)λ(w){XZ,YZ}wNG(u)λ(w){X,Y,Z}+λ(w),0|w)(wO¯{v}λ(w){X,Y,Z}+λ(w),α(w)|w)eiπ4Xu(wNG(u)eiπ4Zw)EGNI¯(wvwNG(u){u}wNG(u)λ(w)=XYw=uλ(w){X,Y,Z}e(1)1+Dw+Awvpiπ4Pwvv𝐏w)(w=uwOwvwO¯{v}λ(w){X,Y,Z}eiπ4Xw)(wNG(u)wOwvwO¯{v}λ(w){X,Y,Z}eiπ4Zw)(wvλ(w){X,Y,Z}+λ(w),0|w)(wO¯{v}λ(w){X,Y,Z}+λ(w),α(w)|w)EGNI¯=(w=uvwvλ(w){X,Y,Z}eiπ4Xw)(wO¯NG(u){v}wvλ(w){X,Y,Z}eiπ4Zw)𝒞\begin{split}\mathcal{C^{\prime}}\approx&\left(\prod_{\begin{subarray}{c}w\succ v\\ w\in N_{G}(u)\cup\{u\}\\ w\in N_{G}(u)\Rightarrow\lambda^{\prime}(w)=XY\\ w=u\Rightarrow\lambda^{\prime}(w)\notin\{X,Y,Z\}\end{subarray}}^{\prec}e^{(-1)^{1+D_{w}+A_{w\to v}^{p^{\prime}}}i\tfrac{\pi}{4}P^{w\to v}_{v}\mathbf{P^{\prime}}^{\bot w}}\right)\left(\prod_{\begin{subarray}{c}w\succ v\\ w\in N_{G}(u)\cup\{u\}\\ w\in N_{G}(u)\Rightarrow\lambda^{\prime}(w)=XY\\ w=u\Rightarrow\lambda^{\prime}(w)\notin\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda^{\prime}(w),\tfrac{\pi}{2}}}_{w}\right)\\ &\left(\prod_{\begin{subarray}{c}w\succ v\\ w\neq u\\ w\in N_{G}(u)\Rightarrow\lambda^{\prime}(w)\in\{XZ,YZ\}\\ w\notin N_{G}(u)\Rightarrow\lambda^{\prime}(w)\notin\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda^{\prime}(w),0}}_{w}\right)\left(\prod_{\begin{subarray}{c}w\in\overline{O}\setminus\{v\}\\ \lambda^{\prime}(w)\in\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda^{\prime}(w),\alpha^{\prime}(w)}}_{w}\right)\\ &e^{i\tfrac{\pi}{4}X_{u}}\left(\prod_{w\in N_{G}(u)}e^{-i\tfrac{\pi}{4}Z_{w}}\right)E_{G}N_{\overline{I}}\\ &\approx\left(\prod_{\begin{subarray}{c}w\succ v\\ w\in N_{G}(u)\cup\{u\}\\ w\in N_{G}(u)\Rightarrow\lambda^{\prime}(w)=XY\\ w=u\Rightarrow\lambda^{\prime}(w)\notin\{X,Y,Z\}\end{subarray}}^{\prec}e^{(-1)^{1+D_{w}+A_{w\to v}^{p^{\prime}}}i\tfrac{\pi}{4}P^{w\to v}_{v}\mathbf{P^{\prime}}^{\bot w}}\right)\left(\prod_{\begin{subarray}{c}w=u\\ w\in O\vee w\preceq v\\ w\in\overline{O}\setminus\{v\}\Rightarrow\lambda(w)\notin\{X,Y,Z\}\end{subarray}}e^{i\tfrac{\pi}{4}X_{w}}\right)\\ &\left(\prod_{\begin{subarray}{c}w\in N_{G}(u)\\ w\in O\vee w\preceq v\\ w\in\overline{O}\setminus\{v\}\Rightarrow\lambda(w)\notin\{X,Y,Z\}\end{subarray}}e^{-i\tfrac{\pi}{4}Z_{w}}\right)\left(\prod_{\begin{subarray}{c}w\succ v\\ \lambda(w)\notin\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda(w),0}}_{w}\right)\\ &\left(\prod_{\begin{subarray}{c}w\in\overline{O}\setminus\{v\}\\ \lambda(w)\in\{X,Y,Z\}\end{subarray}}\bra{+_{\lambda(w),\alpha(w)}}_{w}\right)E_{G}N_{\overline{I}}\\ &=\mathcal{R}^{\dagger}\left(\prod_{\begin{subarray}{c}w=u\neq v\\ w\preceq v\\ \lambda(w)\notin\{X,Y,Z\}\end{subarray}}e^{i\tfrac{\pi}{4}X_{w}}\right)\left(\prod_{\begin{subarray}{c}w\in\overline{O}\cap N_{G}(u)\setminus\{v\}\\ w\preceq v\\ \lambda(w)\notin\{X,Y,Z\}\end{subarray}}e^{-i\tfrac{\pi}{4}Z_{w}}\right)\mathcal{C}\end{split} (95)

The final step is then to introduce Pvv𝐏vP^{\bot v}_{v}\mathbf{P}^{\bot v}, move it through \mathcal{R} and reverse the construction to return to 𝒞\mathcal{C^{\prime}}.

𝒞(w=uvwvλ(w){X,Y,Z}eiπ4Xw)(wO¯NG(u){v}wvλ(w){X,Y,Z}eiπ4Zw)𝐏vPvv𝒞=𝐏vPvv(w=uvwvλ(w){X,Y,Z}eiπ4Xw)(wO¯NG(u){v}wvλ(w){X,Y,Z}eiπ4Zw)𝒞𝐏vPvv𝒞\begin{split}\mathcal{C^{\prime}}&\approx\mathcal{R}^{\dagger}\left(\prod_{\begin{subarray}{c}w=u\neq v\\ w\preceq v\\ \lambda(w)\notin\{X,Y,Z\}\end{subarray}}e^{i\tfrac{\pi}{4}X_{w}}\right)\left(\prod_{\begin{subarray}{c}w\in\overline{O}\cap N_{G}(u)\setminus\{v\}\\ w\preceq v\\ \lambda(w)\notin\{X,Y,Z\}\end{subarray}}e^{-i\tfrac{\pi}{4}Z_{w}}\right)\mathbf{P}^{\bot v}P^{\bot v}_{v}\mathcal{C}\\ &=\mathbf{P^{\prime}}^{\bot v}P^{\prime\bot v}_{v}\mathcal{R}^{\dagger}\left(\prod_{\begin{subarray}{c}w=u\neq v\\ w\preceq v\\ \lambda(w)\notin\{X,Y,Z\}\end{subarray}}e^{i\tfrac{\pi}{4}X_{w}}\right)\left(\prod_{\begin{subarray}{c}w\in\overline{O}\cap N_{G}(u)\setminus\{v\}\\ w\preceq v\\ \lambda(w)\notin\{X,Y,Z\}\end{subarray}}e^{-i\tfrac{\pi}{4}Z_{w}}\right)\mathcal{C}\\ &\approx\mathbf{P^{\prime}}^{\bot v}P^{\prime\bot v}_{v}\mathcal{C^{\prime}}\end{split} (96)

Hence 𝐏v\mathbf{P^{\prime}}^{\bot v} is a valid primary extraction string for vv, and by Lemma C.8 it is exactly the one generated by (p,)(p^{\prime},\prec). As usual, the proof is virtually identical for stabilizers from focussed sets. ∎

Theorem D.17.

(Restatement of Theorem 5.3) Performing local complementation about a vertex uu corresponds to the following sequence of actions on the PDDAG:

  1. 1.

    For each output ww neighbouring uu, a (Zw,π2)(Z_{w},\tfrac{\pi}{2}) rotation is pulled from the initial stabilizer block all the way to the end of the rotation DAG;

  2. 2.

    If uu is an output, a (Xu,π2)(X_{u},-\tfrac{\pi}{2}) rotation is pulled from the initial stabilizer block all the way to the end of the rotation DAG;

  3. 3.

    For each vertex ww neighbouring uu with λ(w)=XY\lambda(w)=XY, and for uu itself if λ(u)\lambda(u) is planar, we pull a (𝐏w,(1)Dwπ2)\left(\mathbf{P^{\prime}}^{\bot w},(-1)^{D_{w}}\tfrac{\pi}{2}\right) rotation from the initial stabilizer block to merge it into the existing rotation for ww or uu. We do this in \succ-order over such ww vertices.

Proof.

Lemma D.12 shows that the additions of π2\tfrac{\pi}{2} to measurement angles and outputs matches the set of rotations that are moved in the above PDDAG rewrite sequence.

The updates for the Pauli strings for each rotation and the stabilizers/tableau are covered by Lemma D.16. In particular, in each case we consider planar vertices and so all of the PwvvP^{w\to v}_{v} terms in \mathcal{R} are II, meaning the update to the extraction string corresponds to the effect of the 3.2. However, the phase may differ in the update from PvP^{\bot v} to PvP^{\prime\bot v}.

PvP^{\bot v} eiπ4XvPveiπ4Xve^{i\tfrac{\pi}{4}X_{v}}P^{\bot v}e^{-i\tfrac{\pi}{4}X_{v}} eiπ4ZvPveiπ4Zve^{-i\tfrac{\pi}{4}Z_{v}}P^{\bot v}e^{i\tfrac{\pi}{4}Z_{v}}
XX XX YY
YY Z-Z X-X
ZZ YY ZZ

This shows that we experience an extra phase flip in the extraction string for uu when λ(v)=XZ\lambda(v)=XZ, balanced by the negating of α(u)\alpha(u) in the statement of Lemma D.12. For vNG(u)v\in N_{G}(u), we get an extra phase flip for λ(v){XZ,YZ}\lambda(v)\in\{XZ,YZ\} from Equation 10, which cancels with the above for λ(v)=XZ\lambda(v)=XZ and is balanced by the negating of α(v)\alpha(v) when λ(v)=YZ\lambda(v)=YZ. ∎

Example D.18.

Again, we start from the same measurement pattern from Example C.13 and apply local complementation about vertex dd. This complements the connectivity within {a,b,c,o2}\{a,b,c,o_{2}\}.

SSRY(α3)RY(\alpha_{3})RX(α4)RX(\alpha_{4})RY(α5)RY(\alpha_{5})RZ(α6)RZ(\alpha_{6})RZ(α0)RZ(\alpha_{0})RY(α2)RY(\alpha_{2})RZ(α1)RZ(\alpha_{1})RY(α7)RY(\alpha_{7})iiaabbccooiiddaao2o_{2}cco1o_{1}bbRX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})Zad+1Z^{a_{d}+1}HH|0\ket{0}RY((1)adα(b))RY((-1)^{a_{d}}\alpha(b))RZ((1)ad+1α(a))RZ((-1)^{a_{d}+1}\alpha(a))RZ(π2)RZ(\tfrac{\pi}{2})RZ(π2)RZ(-\tfrac{\pi}{2})RX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})RX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})Zad+1Z^{a_{d}+1}HH|0\ket{0}RY((1)adα(b))RY((-1)^{a_{d}}\alpha(b))RZ((1)ad+1α(a))RZ((-1)^{a_{d}+1}\alpha(a))RZ(π2)RZ(\tfrac{\pi}{2})RZ(π2)RZ(-\tfrac{\pi}{2})RX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})RX(α(i))RX(-\alpha(i))RX(α(c))RX(-\alpha(c))iiddo2o_{2}cco1o_{1}bbiiddaao2o_{2}cco1o_{1}bb
vv λ(v)\lambda^{\prime}(v) α(v)\alpha^{\prime}(v) p(v)p^{\prime}(v) Odd(p(v))\mathrm{Odd}(p^{\prime}(v)) {u|vu}\{u|v\prec u\}
ii XYXY α(i)\alpha(i) b,c,o2b,c,o_{2} i,a,d,o1i,a,d,o_{1} a,b,c,o1,o2a,b,c,o_{1},o_{2}
aa XZXZ α(a)-\alpha(a) a,c,o1,o2a,c,o_{1},o_{2} a,d,o1a,d,o_{1} c,o1,o2c,o_{1},o_{2}
bb XYXY α(b)+π2\alpha(b)+\tfrac{\pi}{2} cc b,d,o1,o2b,d,o_{1},o_{2} c,o1,o2c,o_{1},o_{2}
cc XYXY α(c)+π2\alpha(c)+\tfrac{\pi}{2} o1o_{1} cc o1o_{1}
dd ZZ α(d)+π\alpha(d)+\pi d,o2d,o_{2} d,o2d,o_{2} o2o_{2}

We update the focussed set p^\hat{p} to p^={c,o1,o2}\hat{p^{\prime}}=\{c,o_{1},o_{2}\}, and to preserve semantics we also have an RZ(π2)RZ(-\tfrac{\pi}{2}) applied to output o2o_{2}.

Now we turn to the sequence of rewrites on the PDDAG. For step 1, o2o_{2} neighbours dd so we pull a (I1Z2,π2)(I_{1}Z_{2},\tfrac{\pi}{2}) rotation through to the end. The 3.2 update the rotations with anticommuting Pauli strings (the rotation from aa, the tableau row and rotation from ii, and the free stabilizer from p^\hat{p}) by multiplication.

Ins Outs Sign
XX YY ZZ ()ad+1(-)^{a_{d}+1}
ZZ YY ++
ZZ YY ++
SSRY(α3)RY(\alpha_{3})RX(α4)RX(\alpha_{4})RY(α5)RY(\alpha_{5})RZ(α6)RZ(\alpha_{6})RZ(α0)RZ(\alpha_{0})RY(α2)RY(\alpha_{2})RZ(α1)RZ(\alpha_{1})RY(α7)RY(\alpha_{7})iiaabbccooiiddaao2o_{2}cco1o_{1}bbRX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})Zad+1Z^{a_{d}+1}HH|0\ket{0}RY((1)adα(b))RY((-1)^{a_{d}}\alpha(b))RZ((1)ad+1α(a))RZ((-1)^{a_{d}+1}\alpha(a))RZ(π2)RZ(\tfrac{\pi}{2})RZ(π2)RZ(-\tfrac{\pi}{2})RX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})RX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})Zad+1Z^{a_{d}+1}HH|0\ket{0}RY((1)adα(b))RY((-1)^{a_{d}}\alpha(b))RZ((1)ad+1α(a))RZ((-1)^{a_{d}+1}\alpha(a))RZ(π2)RZ(\tfrac{\pi}{2})RZ(π2)RZ(-\tfrac{\pi}{2})RX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})RX(α(i))RX(-\alpha(i))RX(α(c))RX(-\alpha(c))iiddo2o_{2}cco1o_{1}bbiiddaao2o_{2}cco1o_{1}bb(I1Y2,α(i)){(I_{1}Y_{2},\alpha(i))}((1)ad+1Z1X2,α(a)){((-1)^{a_{d}+1}Z_{1}X_{2},\alpha(a))}(I1Z2,π2){(I_{1}Z_{2},\tfrac{\pi}{2})}((1)ad+1Y1Z2,α(b)){((-1)^{a_{d}+1}Y_{1}Z_{2},\alpha(b))}(X1I2,α(c)){(X_{1}I_{2},\alpha(c))}

Step 2 does not apply since dd is not an output. Finally, in step 3, dd is not planar but it is adjacent to bb and cc that are labelled as XYXY. Since bcb\prec c, we first pull out the (X1I2,π2)(X_{1}I_{2},\tfrac{\pi}{2}) rotation.

Ins Outs Sign
XX ZZ ZZ ()ad+1(-)^{a_{d}+1}
ZZ YY ++
YY YY -
SSRY(α3)RY(\alpha_{3})RX(α4)RX(\alpha_{4})RY(α5)RY(\alpha_{5})RZ(α6)RZ(\alpha_{6})RZ(α0)RZ(\alpha_{0})RY(α2)RY(\alpha_{2})RZ(α1)RZ(\alpha_{1})RY(α7)RY(\alpha_{7})iiaabbccooiiddaao2o_{2}cco1o_{1}bbRX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})Zad+1Z^{a_{d}+1}HH|0\ket{0}RY((1)adα(b))RY((-1)^{a_{d}}\alpha(b))RZ((1)ad+1α(a))RZ((-1)^{a_{d}+1}\alpha(a))RZ(π2)RZ(\tfrac{\pi}{2})RZ(π2)RZ(-\tfrac{\pi}{2})RX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})RX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})Zad+1Z^{a_{d}+1}HH|0\ket{0}RY((1)adα(b))RY((-1)^{a_{d}}\alpha(b))RZ((1)ad+1α(a))RZ((-1)^{a_{d}+1}\alpha(a))RZ(π2)RZ(\tfrac{\pi}{2})RZ(π2)RZ(-\tfrac{\pi}{2})RX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})RX(α(i))RX(-\alpha(i))RX(α(c))RX(-\alpha(c))iiddo2o_{2}cco1o_{1}bbiiddaao2o_{2}cco1o_{1}bb(I1Y2,α(i)){(I_{1}Y_{2},\alpha(i))}((1)adY1X2,α(a)){((-1)^{a_{d}}Y_{1}X_{2},\alpha(a))}(I1Z2,π2){(I_{1}Z_{2},\tfrac{\pi}{2})}((1)ad+1Z1Z2,α(b)){((-1)^{a_{d}+1}Z_{1}Z_{2},\alpha(b))}(X1I2,α(c)+π2){(X_{1}I_{2},\alpha(c)+\tfrac{\pi}{2})}

Then we pull out the ((1)ad+1Z1Z2,π2)((-1)^{a_{d}+1}Z_{1}Z_{2},\tfrac{\pi}{2}) rotation for bb.

Ins Outs Sign
XX ZZ ZZ ()ad+1(-)^{a_{d}+1}
ZZ ZZ XX ()ad(-)^{a_{d}}
YY YY -
SSRY(α3)RY(\alpha_{3})RX(α4)RX(\alpha_{4})RY(α5)RY(\alpha_{5})RZ(α6)RZ(\alpha_{6})RZ(α0)RZ(\alpha_{0})RY(α2)RY(\alpha_{2})RZ(α1)RZ(\alpha_{1})RY(α7)RY(\alpha_{7})iiaabbccooiiddaao2o_{2}cco1o_{1}bbRX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})Zad+1Z^{a_{d}+1}HH|0\ket{0}RY((1)adα(b))RY((-1)^{a_{d}}\alpha(b))RZ((1)ad+1α(a))RZ((-1)^{a_{d}+1}\alpha(a))RZ(π2)RZ(\tfrac{\pi}{2})RZ(π2)RZ(-\tfrac{\pi}{2})RX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})RX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})Zad+1Z^{a_{d}+1}HH|0\ket{0}RY((1)adα(b))RY((-1)^{a_{d}}\alpha(b))RZ((1)ad+1α(a))RZ((-1)^{a_{d}+1}\alpha(a))RZ(π2)RZ(\tfrac{\pi}{2})RZ(π2)RZ(-\tfrac{\pi}{2})RX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})RX(α(i))RX(-\alpha(i))RX(α(c))RX(-\alpha(c))iiddo2o_{2}cco1o_{1}bbiiddaao2o_{2}cco1o_{1}bb((1)adZ1X2,α(i)){((-1)^{a_{d}}Z_{1}X_{2},\alpha(i))}((1)adY1X2,α(a)){((-1)^{a_{d}}Y_{1}X_{2},\alpha(a))}(I1Z2,π2){(I_{1}Z_{2},\tfrac{\pi}{2})}((1)ad+1Z1Z2,α(b)+π2){((-1)^{a_{d}+1}Z_{1}Z_{2},\alpha(b)+\tfrac{\pi}{2})}(X1I2,α(c)+π2){(X_{1}I_{2},\alpha(c)+\tfrac{\pi}{2})}

We now find that this is the same PDDAG that would be extracted after applying the local complementation on the measurement pattern (take care when determining the phases during extraction as the phase from including dd in p(v)Odd(p(v))p^{\prime}(v)\cup\mathrm{Odd}(p^{\prime}(v)) is now (1)ad+1(-1)^{a_{d}+1} because α(d)=α(d)+π\alpha^{\prime}(d)=\alpha(d)+\pi). In the final step, it is important to have maintained the convention of extracting as ((1)Dv𝐏v,α(v))((-1)^{D_{v}}\mathbf{P}^{\bot v},\alpha(v)) and keeping the 1-1 terms with the string rather than the angle. If we had instead moved ((1)adZ1Z2,π2)((-1)^{a_{d}}Z_{1}Z_{2},-\tfrac{\pi}{2}), we would end up with a rotation of α(b)π2\alpha(b)-\tfrac{\pi}{2} and different phases on the rotation and tableau row for ii.

Remark D.19.

One should note that the action of local complementation is not quite self-inverse due to some measurement angles being updated by π2\tfrac{\pi}{2}. However, performing the inverse update is also valid and just relies on using the other case of Equation 83 to flip the angles that are added. This can similarly be simulated by just flipping the angles of the rotations being moved through the PDDAG.

Now that we have the ability to simulate the effects of local complementation, extending this to pivoting is trivial since it simply decomposes into a sequence of local complementations.

Definition D.20.

Given a graph G=(V,E)G=(V,E) with some designated edge uvEu\sim v\in E, the pivot of GG about the edge uvu\sim v is the operation resulting in the graph:

Guv:=Guvu(=Gvuv)G\wedge uv:=G\star u\star v\star u(=G\star v\star u\star v) (97)
Lemma D.21.

Let (Γ,α)(\Gamma,\alpha) describe a measurement pattern with Γ=(G,I,O,λ)\Gamma=(G,I,O,\lambda) and some chosen vertices u,vI¯u,v\in\overline{I} such that uvu\sim v. Then performing a pivot around the edge uvu\sim v gives an equivalent measurement pattern (Γ,α)(\Gamma^{\prime},\alpha^{\prime}) where Γ=(Guv,I,O,λ^)\Gamma^{\prime}=(G\wedge uv,I,O,\hat{\lambda}), for all a{u,v}a\in\{u,v\} and wO¯{u,v}w\in\overline{O}\setminus\{u,v\}

(λ(a),α(a))\displaystyle(\lambda^{\prime}(a),\alpha^{\prime}(a)) :={(YZ,α(a))if λ(a)=XY(XZ,π2α(a))if λ(a)=XZ(XY,α(a))if λ(a)=YZ(Z,α(a))if λ(a)=X(Y,α(a)+π)if λ(a)=Y(X,α(a))if λ(a)=Z\displaystyle:=\begin{cases}(YZ,-\alpha(a))&\text{if }\lambda(a)=XY\\ (XZ,\tfrac{\pi}{2}-\alpha(a))&\text{if }\lambda(a)=XZ\\ (XY,-\alpha(a))&\text{if }\lambda(a)=YZ\\ (Z,\alpha(a))&\text{if }\lambda(a)=X\\ (Y,\alpha(a)+\pi)&\text{if }\lambda(a)=Y\\ (X,\alpha(a))&\text{if }\lambda(a)=Z\\ \end{cases} (98)
(λ(w),α(w))\displaystyle(\lambda^{\prime}(w),\alpha^{\prime}(w)) :={(λ(w),α(w)+π)if wNG(u)NG(v)λ(w){XY,X,Y}(λ(w),α(w))if wNG(u)NG(v)λ(w){XZ,YZ}(λ(w),α(w))otherwise\displaystyle:=\begin{cases}(\lambda(w),\alpha(w)+\pi)&\text{if }w\in N_{G}(u)\cap N_{G}(v)\wedge\lambda(w)\in\{XY,X,Y\}\\ (\lambda(w),-\alpha(w))&\text{if }w\in N_{G}(u)\cap N_{G}(v)\wedge\lambda(w)\in\{XZ,YZ\}\\ (\lambda(w),\alpha(w))&\text{otherwise}\end{cases} (99)

plus each output neighbouring both uu and vv is followed by a ZZ gate and if each of uu or vv is an output then it is followed by a Hadamard gate.

Proof.

We can similarly extend the case for planar measurements given in the proof of [6, Lemma 4.5] to Pauli measurements by considering how they embed into the planes as in Equation 66. Similarly, this follows by using Van den Nest’s Theorem [34] (Equation 83) multiple times, alternating the phases of the angles each time, and rotating the measurement projections accordingly. ∎

Since this proof requires alternating between the different phase variants of Equation 83, simulating the effect in the PDDAG requires alternating between the different variants of local complementation as mentioned in Remark D.19 but is otherwise just a trivial application of Theorem 5.3.

D.4 Alternative Focussed Pauli Flows

Lemma D.22.

Let (Γ,α)(\Gamma,\alpha) describe a measurement pattern with a focussed set p^\hat{p}, vertex vO¯v\in\overline{O}, and two focussed Pauli flows (p,)(p,\prec) and (p,)(p^{\prime},\prec) related by the addition of p^\hat{p} to p(v)p(v) as in Lemma B.6. Let 𝐏^\mathbf{\hat{P}} be the stabilizer corresponding to p^\hat{p}, and 𝐏v\mathbf{P}^{\bot v} and 𝐏v\mathbf{P^{\prime}}^{\bot v} be the primary extraction strings for vv according to (p,)(p,\prec) and (p,)(p^{\prime},\prec^{\prime}) respectively. Then 𝐏v=𝐏v𝐏^\mathbf{P^{\prime}}^{\bot v}=\mathbf{P}^{\bot v}\mathbf{\hat{P}}.

Proof.

Lemma C.7 immediately gives this result up to phase. To invoke Lemma C.8, we consider the linear map 𝒞\mathcal{C} for extraction strings of vv. From the conditions of Lemma B.6 and the definition of \prec^{\prime}, any wp^Odd(p^)w\in\hat{p}\cup\mathrm{Odd}(\hat{p}) must satisfy wvw\neq v and λ(w){X,Y,Z}vw\lambda(w)\notin\{X,Y,Z\}\Rightarrow v\prec w. So both Pvv𝐏vP^{\bot v}_{v}\mathbf{P}^{\bot v} and 𝐏^\mathbf{\hat{P}} are stabilizers of 𝒞\mathcal{C}, meaning they combine to give the stabilizer Pvv𝐏v𝐏^P^{\bot v}_{v}\mathbf{P}^{\bot v}\mathbf{\hat{P}} which defines this as a valid primary extraction string. ∎

Theorem D.23.

(Restatement of Theorem 5.4) Let (Γ,α)(\Gamma,\alpha) describe a measurement pattern with some focussed Pauli flow (p,)(p,\prec), a focussed set p^\hat{p}, and some vertex uO¯u\in\overline{O} such that wp^Odd(p^).λ(w){XY,XZ,YZ}wuuw\forall w\in\hat{p}\cup\mathrm{Odd}(\hat{p}).\lambda(w)\in\{XY,XZ,YZ\}\Rightarrow w\neq u\wedge u\prec w. Updating p(u)p(u) to p(u)Δp^p(u)\Delta\hat{p} corresponds to a free action on the isometry tableau if uu is an input, and applying the 3.1 to the rotation from uu with the stabilizer of p^\hat{p} if uu has a planar label.

Therefore, any two focussed Pauli flows for the same labelled open graph yield PDDAGs that are related by a sequence of applications of the 3.1 and free actions on the isometry tableau.

Proof.

This update on the Pauli flow is the same as from Lemma B.6, meaning Lemma D.22 gives the update to the primary extraction strings. For both uses of uu in extraction, we assume uu has a planar label. If uu is an input considered for the tableau of the PDDAG, multiplication of a row of the tableau by a free stabilizer is a free action as it just gives another equivalent set of generators for the stabilizer group. On the other hand, if uu is some planar vertex giving a rotation in the PDDAG, we note that 𝐏^\mathbf{\hat{P}} remains a stabilizer after applying each of the rotations for vertices wuw\preceq u (they commute according to Lemma C.9), allowing us to apply the 3.1 to get the same effect.

To show that any two focussed Pauli flows (p,)(p,\prec) and (p,)(p^{\prime},\prec^{\prime}) can be related using this, we start with (p,)(p,\prec) and derive the sequence of transformations needed to reach (p,)(p^{\prime},\prec^{\prime}).

We consider weakening of the partial order in a Pauli flow to be a free action, as well as the reverse so long as the Pauli flow conditions are preserved, since neither affect the semantics or extraction. So suppose wlog that \prec and \prec^{\prime} are minimal, i.e. \prec is the transitive closure of {(u,v)|vp(u)Odd(p(u))uvλ(v){XY,XZ,YZ}}\{(u,v)|v\in p(u)\cup\mathrm{Odd}(p(u))\wedge u\neq v\wedge\lambda(v)\in\{XY,XZ,YZ\}\} (we ignore Pauli measurements by Lemma B.11).

We proceed inductively over \prec. Under some indexing of the vertices respecting \prec, let vv be the first for which p(v)p(v)p(v)\neq p^{\prime}(v), i.e. wv.p(v)=p(v)\forall w\prec v.p(v)=p^{\prime}(v). Our assumptions on minimality then imply that wO¯.wvwv\forall w\in\overline{O}.w\prec v\Leftrightarrow w\prec^{\prime}v.

By Lemma B.7, pv^:=p(v)Δp(v)\hat{p^{v}}:=p(v)\Delta p^{\prime}(v) is a focussed set for any vO¯v\in\overline{O}. Conditions [λ.XY][\lambda.XY]-[λ.YZ][\lambda.YZ] imply that λ(v){XY,XZ,YZ}vpv^Odd(pv^)\lambda(v)\in\{XY,XZ,YZ\}\Rightarrow v\notin\hat{p^{v}}\cup\mathrm{Odd}(\hat{p^{v}}). Using conditions [.X][\prec.X] and [.Z][\prec.Z], we also have wpv^Odd(pv^).wvλ(w){XY,XZ,YZ}vwvw\forall w\in\hat{p^{v}}\cup\mathrm{Odd}(\hat{p^{v}}).w\neq v\wedge\lambda(w)\in\{XY,XZ,YZ\}\Rightarrow v\prec w\vee v\prec^{\prime}w. Since vwvwv\prec^{\prime}w\Rightarrow v\preceq^{\prime}w and vwvwv\preceq^{\prime}w\Leftrightarrow v\preceq w by the minimality assumption, we now have wpv^Odd(pv^).λ(w){XY,XZ,YZ}wvvw\forall w\in\hat{p^{v}}\cup\mathrm{Odd}(\hat{p^{v}}).\lambda(w)\in\{XY,XZ,YZ\}\Rightarrow w\neq v\wedge v\preceq w. This means that combining (p,)(p,\prec) with v^\hat{v} according to Lemma B.6 (and reducing to the minimal order) gives a focussed Pauli flow equal to (p,)(p^{\prime},\prec^{\prime}) up to vv in \prec.

Repeating this inductively over the remaining vertices will eventually yield (p,)(p^{\prime},\prec^{\prime}). ∎

Example D.24.

We revisit the measurement pattern from Example C.13. Recall that we have a focussed set p^={c,o2}\hat{p}=\{c,o_{2}\} with Odd(p^)={a,o1}\mathrm{Odd}(\hat{p})=\{a,o_{1}\}, so we can freely add this to the correction sets for any of ii, bb, or dd. Suppose we do so for bb and dd to give the following focussed Pauli flow:

vv λ(v)\lambda(v) p(v)p^{\prime}(v) Odd(p(v))\mathrm{Odd}(p^{\prime}(v)) {u|vu}\{u|v\prec u\}
ii XYXY b,o2b,o_{2} i,ai,a a,b,c,o1,o2a,b,c,o_{1},o_{2}
aa YZYZ a,c,d,o2a,c,d,o_{2} d,o1,o2d,o_{1},o_{2} c,o1,o2c,o_{1},o_{2}
bb XYXY d,o1,o2d,o_{1},o_{2} a,b,d,o2a,b,d,o_{2} a,c,o1,o2a,c,o_{1},o_{2}
cc XYXY o1o_{1} cc o1o_{1}
dd YY cc a,d,o1a,d,o_{1} a,c,o1,o2a,c,o_{1},o_{2}

The difference between p(d)p(d) and p(d)p^{\prime}(d) has no effect on the PDDAG since dd is not involved in the extraction procedure. So the only rewrites needed are the multiplication of the top row of the isometry tableau by the bottom, and applying the 3.1 to the bb rotation mapping Y1Z2(Y1Z2)(Z1X2)=X1Y2Y_{1}Z_{2}\mapsto(Y_{1}Z_{2})(Z_{1}X_{2})=-X_{1}Y_{2}.

Ins Outs Sign
XX XX YY ()ad(-)^{a_{d}}
ZZ XX ++
ZZ XX ++
SSRY(α3)RY(\alpha_{3})RX(α4)RX(\alpha_{4})RY(α5)RY(\alpha_{5})RZ(α6)RZ(\alpha_{6})RZ(α0)RZ(\alpha_{0})RY(α2)RY(\alpha_{2})RZ(α1)RZ(\alpha_{1})RY(α7)RY(\alpha_{7})iiaabbccooiiddaao2o_{2}cco1o_{1}bbRX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})Zad+1Z^{a_{d}+1}HH|0\ket{0}RY((1)adα(b))RY((-1)^{a_{d}}\alpha(b))RZ((1)ad+1α(a))RZ((-1)^{a_{d}+1}\alpha(a))RZ(π2)RZ(\tfrac{\pi}{2})RZ(π2)RZ(-\tfrac{\pi}{2})RX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})RX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})Zad+1Z^{a_{d}+1}HH|0\ket{0}RY((1)adα(b))RY((-1)^{a_{d}}\alpha(b))RZ((1)ad+1α(a))RZ((-1)^{a_{d}+1}\alpha(a))RZ(π2)RZ(\tfrac{\pi}{2})RZ(π2)RZ(-\tfrac{\pi}{2})RX(π2)RX(\tfrac{\pi}{2})RX(π2)RX(-\tfrac{\pi}{2})RX(α(i))RX(-\alpha(i))RX(α(c))RX(-\alpha(c))iiddo2o_{2}cco1o_{1}bbiiddaao2o_{2}cco1o_{1}bb(I1X2,α(i)){(I_{1}X_{2},\alpha(i))}((1)adZ1Y2,α(a)){((-1)^{a_{d}}Z_{1}Y_{2},\alpha(a))}(X1I2,π2){(X_{1}I_{2},\tfrac{\pi}{2})}((1)adX1Y2,α(b)){((-1)^{a_{d}}X_{1}Y_{2},\alpha(b))}