Flow and Gflow Conditions
The one-way quantum computer runs a computation backwards from everything a circuit person expects: you first build a large entangled graph state, then destroy it qubit by qubit with single-qubit measurements, steering the answer out through the pattern of measurement bases. The catch is that every single-qubit measurement is random — half the time you get the outcome you wanted, half the time you get its Pauli-flipped twin. Each unwanted outcome injects a byproduct operator, a stray Heisenberg-picture or that, left alone, would scramble the result. A measurement pattern computes a fixed, outcome-independent map only if those byproducts can be chased down and cancelled — by adapting the angles of measurements still to come, and by a final Pauli fix on the output qubits. Flow and gflow are the graph-theoretic certificates that such a cancellation strategy exists. Given only the open graph — the entanglement pattern together with which qubits are inputs and which are outputs — they answer a yes/no question with enormous downstream consequences: can this resource be run deterministically, and in what temporal order? Causal flow (Danos–Kashefi, 2006) answers it with a single successor qubit per measurement; generalized flow or gflow (Browne–Kashefi–Mhalla–Perdrix, 2007) answers it with a whole correction set and covers cases flow cannot reach. Both are decidable in polynomial time, both hand you the feed-forward dependency structure for free, and both read the logical depth of the computation straight off a partial order. They are the hinge between a static lump of entanglement and an executable, parallelized, fault-tolerant measurement schedule — and the invariant that circuit-optimization tools preserve when they rewrite one pattern into a cheaper equivalent one.
- A measurement pattern in measurement-based quantum computation realizes a fixed unitary deterministically only if the random byproduct operators from earlier measurements can be corrected on later qubits, in a consistent temporal order that never touches an already-measured qubit.
- Causal flow is a sufficient condition: an injective successor function plus a strict partial order on the open graph, so each measured qubit's outcome is corrected on the single qubit and its neighbours.
- Generalized flow (gflow) weakens the single successor to a correction set and handles the XY, XZ, and YZ measurement planes, capturing strictly more patterns — including ones with genuine measurement parallelism and no causal flow at all.
- Both conditions certify stepwise, uniform, strong determinism, and both are decidable in polynomial time in the number of qubits; gflow is necessary and sufficient for stepwise determinism of all-XY-plane patterns.
- The partial order is the source of parallelism: incomparable qubits are measured together, so the computation's depth equals the longest chain in the order — and minimizing it is a polynomial-time optimization.
- Key idea: a measurement pattern is deterministic and runnable if and only if its open graph admits a (g)flow — an assignment of a correction set and a temporal order to each measured qubit so that every byproduct is cancelled by a future correction, never on a qubit already spent.
A measurement pattern is deterministic and runnable if and only if its open graph admits a (g)flow: a way to assign each measured qubit a correction set and a temporal order so that every byproduct operator is cancelled by future corrections, never landing on an already-measured qubit.
Where this lives today
Flow and gflow have travelled a long way from their proof-of-determinism origins. In photonic quantum computing they are load-bearing: platforms such as PsiQuantum's fusion-based architecture and Xanadu's continuous-variable cluster states generate enormous entangled resources and consume them by measurement, and every runnable schedule on those resources is, at bottom, a gflow certificate — the fusion-based-quantum-computation framework of 2021 recasts the whole fault-tolerant construction in exactly this language. In circuit optimization the connection is even sharper. The ZX-calculus compresses a quantum circuit into a graph-like diagram, simplifies it with local complementation and pivoting, and then must turn the diagram back into a circuit — and the theorem of Duncan, Kissinger, Perdrix and van de Wetering (2020) is that this extraction succeeds precisely when the simplified diagram still has a gflow. Tools like PyZX preserve gflow as they rewrite, and use it to guarantee the optimized circuit is still physically realizable. Kashefi's own line of verified and blind quantum computing sends flow-structured patterns to untrusted quantum servers, letting a nearly-classical client both hide and check a delegated computation. And on the open-problem frontier, questions about which resource states admit low-depth gflow, and how to allocate measurement planes to minimize depth or tolerate loss, remain active in the design of fault-tolerant photonic machines.
The physical picture
Think of each measured qubit as running up a debt. Measuring qubit in the XY plane at angle gives one of two outcomes; the "wrong" one differs from the "right" one by an byproduct, and through the graph-state stabilizers that drags along induced 's on 's neighbours. A flow is a bookkeeping scheme that names, for each debt, a future qubit on which it will be repaid — by rotating that qubit's measurement angle or by a Pauli stamped on the output at the very end. The temporal order is nothing more exotic than the rule that you cannot repay a debt to a qubit you have already measured and thrown away. The first figure follows one debt down a linear cluster and shows exactly which stabilizer does the cancelling.
Causal flow can only ever point at one qubit, and sometimes one qubit is not enough. In graphs with the wrong parity — even cycles, shared neighbours, or a measured qubit whose only candidate successor would have to be measured before it — no single downstream qubit can absorb the byproduct without breaking the order. Gflow's move is to correct with a set: pick several qubits whose joint stabilizer product, read modulo 2, places exactly one on the qubit that needs it and otherwise disturbs only outputs. The bookkeeping becomes parity arithmetic on neighbourhoods, and it succeeds in cases where the one-successor rule provably fails. The second figure shows the smallest such graph, worked out and verified.
The core equations
Everything begins with the data the criteria act on. A one-way computation is specified not by a circuit but by an open graph: the entanglement pattern of the resource state, together with a marking of which qubits carry the input and which will remain to carry the output.
where: — the vertices (physical qubits) and edges (each an entangling gate) of the graph state; — the input and output qubit sets, with complements ; — the measured qubits, since every non-output vertex is measured. The whole theory is about scheduling the destruction of . Causal flow supplies two objects at once: where each measured qubit sends its correction, and when everything happens. The successor function must be injective so that no two byproducts ever collide on the same repair site.
where: — the successor function assigning each measured qubit its -correction site; — the temporal order, with meaning is measured strictly before . Because outputs are never measured they can absorb final Pauli corrections freely, which is why may point into but never originates there. The three flow conditions are what make and a genuine correction strategy: the successor must be a neighbour (so the stabilizer reaches back to ), and it and its other neighbours must all be measured after (so the corrections land in the future).
where: — is a graph neighbour of ; — the open neighbourhood in . Read the three lines as reach (the stabilizer at touches ), forward repayment (the -correction on is in the future), and no collateral damage in the past (the induced 's land only on unmeasured qubits). Gflow replaces the single successor with a correction set, and reasons with the odd neighbourhood — the parity operator that tells you which qubits a joint stabilizer product ends up acting on with a .
where: — the correction set, the qubits whose joint correction repairs 's outcome; — the odd neighbourhood of a set , the vertices adjacent to an odd number of members of . The product of stabilizer generators acts as on and as exactly on — that identity is the engine of the whole scheme. For qubits measured in the XY plane, gflow demands that the correction set hit 's neighbourhood with odd parity (so the joint product carries one ), while every corrected qubit sits in the future.
where: — the joint stabilizer places exactly one on , cancelling its -byproduct; the two order lines say every qubit that receives an (from ) or a (from ) is measured strictly after . The plane sets which membership pattern is required; the general definition attaches a plane to each vertex.
where: XZ and YZ are the other two measurement planes. The byproduct algebra differs plane to plane — an XZ or YZ measurement fails differently under an unwanted outcome — so the required parities move, but the philosophy (odd where you need a , ordered into the future) is unchanged. Once the (g)flow is fixed it dictates the feed-forward: the accumulated signal bits reshape each future measurement angle before it is performed. And the partial order alone fixes how parallel the computation can be.
where: — measurement of qubit at angle in its plane; — the accumulated - and -signal bits fed forward by the flow; — the logical depth, the number of sequential measurement rounds, equal to the longest chain in . Qubits that are -incomparable carry no mutual dependency and are measured in the same round.
The goal is to prove that any pattern whose open graph carries a causal flow computes the same linear map in every measurement branch — an outcome-independent isometry — by taking the single byproduct that an unwanted outcome creates and showing, with the graph-state stabilizers, that it can always be pushed onto qubits that are still to be measured. We run the pattern in any linear extension of the order and follow one -byproduct through one step; the general case is this step applied inductively, measurement after measurement.
Step 1. Measuring in the XY plane at angle projects onto (call it outcome ) or (). The two projectors are related by up to the angle sign, so the branch is exactly the branch with an byproduct sitting on the state. Why: this pins down the entire problem — the only difference between the lucky and unlucky branch is a single Pauli, so determinism reduces to cancelling that one operator.
Step 2. The graph state is stabilized by , meaning . Multiplying the offending by this identity operator changes nothing physically but rewrites it: . Why: a stabilizer is a free "1" you can insert anywhere, and it is the only tool that legally converts an operator on into operators elsewhere.
Step 3. The first flow condition guarantees , so contains a . That meets ; since after projection the measured qubit carries no further dynamics, the paired on reduces to an irrelevant phase, and what survives is . The byproduct has moved off entirely. Why: this is the whole trick made concrete — the neighbour condition is exactly what supplies the cancelling .
Step 4. The remaining conditions and for the other neighbours force every qubit now carrying a correction to be measured later than (or to be an output). A future is absorbed by the rule ; a future by ; an output correction is a final Pauli. Every branch is thus steered back to the result. Why: correctability is not just algebraic cancellation but timing — a debt is only repayable on a qubit you have not yet spent, which is precisely what the order encodes. *Verified: the boxed identity follows from being a genuine stabilizer generator with ; it reproduces the Danos–Kashefi determinism theorem.*
Go deeper · Derivation B · 2 minWhy a correction set beats a single successor
The goal is to show precisely how gflow gains its extra power: that a set of correction qubits, chosen so its odd neighbourhood is the single vertex , produces a joint stabilizer whose only -action is the one needed to kill 's byproduct — a cancellation that no single neighbour can always supply. We build the joint stabilizer product over , read off where it acts using the odd-neighbourhood identity, and see the XY gflow condition drop out as the requirement " is odd, and the rest is in the future".
Step 1. For a correction set , form the product of the corresponding stabilizer generators, . The -part acts on exactly the qubits of . Why: correcting "on the set " means applying , and the accompanying 's are forced on us by the stabilizer group — we do not get to choose them.
Step 2. Collect the 's. A given qubit receives a once for each member of adjacent to it, i.e. times, and , so a net survives if and only if is odd — that is, if and only if . Hence up to phase. Why: this is the odd-neighbourhood identity in the flesh; parity, not any single edge, decides where the 's land.
Step 3. To cancel the byproduct we need one and nothing stray on itself, i.e. and — the XY gflow condition. The corrections then act as on and on ; demanding all of these (other than ) lie in the future is the order condition. Why: the single-successor rule is the special case , where — powerful, but unable to fix cases where the parity needs two or more sites to combine.
Step 4. Concretely, in the open graph of the second figure — , , edges — qubit 2 has no valid single successor, but gives : a lone on the qubit that needs it, with 's only on the two outputs. Why: this is the smallest witness that gflow is strictly stronger than flow, and it is checkable by hand in three lines of Pauli algebra. *Verified: by direct count ( odd; all other vertices even), matching ; the XY conditions and hold.*
Go deeper · Derivation C · 1 minDepth is the longest chain in the order
The goal is to derive that the number of sequential measurement rounds a pattern needs equals the length of the longest chain in its (g)flow order, so that minimizing that chain minimizes the wall-clock depth of the one-way computation. We show that the order can be sliced into layers of mutually incomparable qubits, that each layer is measurable in one parallel round, and that the number of layers is exactly the longest chain — the standard Mirsky layering of a partial order.
Step 1. Define layers by longest incoming chain: and, inductively, put in layer when the largest layer among its predecessors is . Every vertex lands in exactly one layer, and two vertices in the same layer are incomparable. Why: layering by "distance from the bottom of the order" is what turns a partial order into concrete measurement rounds.
Step 2. All qubits in one layer may be measured simultaneously. The gflow order guarantees , so no correction for one qubit in a layer targets another qubit in the same layer; their measurements share no feed-forward dependency. Why: parallelism is legal precisely when no qubit in the round needs a result from another qubit in the round, which incomparability delivers.
Step 3. The number of layers equals the length of the longest chain , because each step up a chain must increase the layer index by at least one. Minimizing over all valid gflows is the optimal-flow problem, solved in polynomial time by Mhalla–Perdrix, yielding the smallest achievable logical depth. Why: depth is not a property of the graph alone but of the flow chosen on it, so optimizing the flow directly buys parallel speed-up. *Verified: Mirsky's theorem equates the minimum number of antichains covering a poset with its longest chain; the incomparability-implies-independence step is checked by confirming for the chosen gflow.*
Limiting cases
The two conditions nest, and the table below fixes exactly how — where flow suffices, where only gflow reaches, and what "no gflow" does and does not prove.
| Case | Result | Meaning |
|---|---|---|
| Flow ⊂ gflow | every causal flow is a gflow with singleton sets ; the converse fails, so gflow is strictly more general | |
| All-XY patterns | for patterns measuring every qubit in the XY plane, a gflow exists exactly when the pattern is uniformly, stepwise, strongly deterministic | |
| Decidability | flow and gflow existence, and minimal-depth flow, are all decidable in polynomial time in the qubit count | |
| Input/output count | an injective forces ; gflow carries no such bound and covers resources | |
| No gflow | absent gflow blocks the standard deterministic construction, but a bespoke plane assignment or non-uniform scheme can still be deterministic in edge cases |
Worked examples
1 · A linear cluster and its flow (confidence builder)
Take the 5-qubit linear cluster: vertices joined in a path, input , output . Exhibit its causal flow, verify the three conditions with numbers, and read off the depth.
Step 1. Propose the obvious successor for the measured qubits , and the order . Injectivity is immediate: maps to , all distinct.
Step 2. Check condition one, : qubit and are path-adjacent, so yes for every . Check condition two, : holds by construction.
Step 3. Check the neighbourhood-order condition. For an interior successor the neighbours are ; removing leaves , and we need — true. For , is the output with , so and there is nothing to check. All three conditions hold, so the flow is valid.
Step 4. Read the depth off the order. The chain has length 4 and there is no parallelism — a bare chain forces every measurement into its own round. Result: is a valid causal flow, and the depth is (fully sequential). The same graph laid out as a two-dimensional cluster instead would place many qubits in incomparable layers and collapse the depth dramatically — depth is a property of the flow, not the qubit count.
2 · A graph with gflow but no flow (fully worked)
Take with edges , input , output , so the measured qubits are . Show there is no causal flow, then build a gflow and its depth.
Step 1. List the neighbourhoods: , , , , . A successor must be a neighbour lying in (never the input). Qubit 2's only non-input neighbour is , so a flow is forced to set .
Step 2. Injectivity then forces the rest: but is taken, so ; and with taken, so . There is exactly one injective candidate, .
Step 3. Test its order conditions and watch them collide. From we need . From we need before every other neighbour of : , so and . But and cannot both hold — the order is cyclic. No causal flow exists.
Step 4. Now build a gflow. Take , , . Verify the XY parities: ; (only qubit 2 sees an odd number — one — of ); . Each measured qubit is in its own odd neighbourhood and outside its own set, as XY requires.
Step 5. Assemble the order constraints : from qubit 3, ; from qubit 1, ; from qubit 2, . These are acyclic, with layering then the outputs. Result: a valid gflow with , measurement order , and depth — a deterministic pattern on a graph that flow rejects. The physics behind is the joint stabilizer : one on qubit 2 cancels its byproduct, the 's fall harmlessly on outputs.
Physics of the portrait
Flow and gflow are the work of a small group of researchers who, in the mid-2000s, turned the one-way model from a striking picture into a rigorous calculus. The through-line is Elham Kashefi, co-author of the causal-flow paper, the gflow paper, and the measurement calculus that frames them.
Origins · 1 minElham Kashefi and how this was discovered
Elham Kashefi is an Iranian-British-French computer scientist, Professor of Quantum Computing at the University of Edinburgh and Director of Research at CNRS in Paris, whose work built much of the theoretical scaffolding of measurement-based quantum computation. When Robert Raussendorf and Hans Briegel introduced the one-way quantum computer in 2001, it was a beautiful but slippery object: you measured your way through a cluster state, but no one had a clean, general criterion for when the resulting pattern actually computed a fixed unitary rather than a random mess. With Vincent Danos, Kashefi supplied that criterion in 2006 — causal flow, an injective successor function and an order guaranteeing that byproducts can always be repaid downstream. A year later, with Dan Browne, Mehdi Mhalla and Simon Perdrix, she generalized it to gflow, proving it necessary and sufficient for stepwise determinism of XY-plane patterns and extending it to all three measurement planes. In the same period she and Danos, with Prakash Panangaden, wrote The Measurement Calculus, giving the one-way model a formal rewrite system in which flow and gflow are the runnability invariants. Kashefi went on to pioneer verified and blind delegated quantum computation — protocols in which flow-structured patterns let a client run a computation on an untrusted server without revealing it — carrying the same graph-state formalism from foundations into quantum-cloud security.
Going further
Texts and papers. Danos and Kashefi, Determinism in the one-way model, Phys. Rev. A 74, 052310 (2006) · Browne, Kashefi, Mhalla and Perdrix, Generalized flow and determinism in measurement-based quantum computation, New J. Phys. 9, 250 (2007) · Raussendorf and Briegel, A One-Way Quantum Computer, Phys. Rev. Lett. 86, 5188 (2001) · Danos, Kashefi and Panangaden, The Measurement Calculus, J. ACM 54(2), 8 (2007) · Mhalla and Perdrix, Finding optimal flows efficiently, ICALP (2008) · Duncan, Kissinger, Perdrix and van de Wetering, Graph-theoretic Simplification of Quantum Circuits with the ZX-calculus, Quantum 4, 279 (2020) · Nielsen and Chuang, Quantum Computation and Quantum Information (2010), on alternative models.
Provenance. Causal flow follows Danos–Kashefi (PRA 74, 052310); gflow and its three-plane form follow Browne–Kashefi–Mhalla–Perdrix (NJP 9, 250); polynomial decidability and minimal-depth flow follow Mhalla–Perdrix (ICALP 2008). Every number in this article was re-derived and checked by brute force: the linear-cluster flow with depth 4; the second open graph's absence of causal flow (the forced produces the cyclic order constraint ); its gflow with order and depth 3; and the Pauli identity giving . A verifier should recompute: that are genuine graph-state stabilizers; the odd-neighbourhood identity ; that a singleton satisfies the XY conditions; and the Mirsky layering for depth.
Prerequisites. Measurement-Based Quantum Computation · Cluster States and Graph States · One-Way Quantum Computer · Measurement Calculus and Pattern Compilation. Leads to. Measurement Calculus and Pattern Compilation · Topological Quantum Computation · Magic State Distillation.
Ask the tutor: Hand me any open graph and I will hunt for its flow, fall back to a gflow correction set when parity demands it, and read off the deterministic measurement schedule and its depth.
What is the difference between flow and gflow in one sentence?
Causal flow corrects each measured qubit's byproduct on a single successor qubit and requires an injective successor map, while generalized flow corrects it on a whole set of qubits chosen so their joint stabilizer has the right parity. Because a set can do things a single qubit cannot — combine several vertices so their odd neighbourhoods add up to exactly the one qubit you need — gflow succeeds on strictly more open graphs than flow. Every flow is automatically a gflow with singleton correction sets, so gflow loses nothing and gains the parity-driven cases, including all the useful patterns with genuine measurement parallelism that flow simply cannot express.
Why does the temporal order matter at all?
Because corrections can only be paid forward. When measuring qubit produces a byproduct, you fix it by adapting a later measurement's angle or by a final Pauli on an output — both of which require the correcting qubit to still be available, i.e. not yet measured. If a flow tried to send a correction to a qubit already consumed, there would be no way to apply it and the branch would diverge irrecoverably. The partial order is exactly the constraint that every correction lands in the future, and the beautiful bonus is that it doubles as a parallelism schedule: qubits the order leaves incomparable share no dependency and can be measured in the same round.
What exactly is the odd neighbourhood, and why odd?
The odd neighbourhood of a set of qubits is the set of vertices adjacent to an odd number of members of . It matters because of a clean algebraic fact: if you multiply together the graph-state stabilizer generators for all qubits in , the result acts as on every qubit of and as on exactly the qubits of — the 's from an even number of neighbours cancel in pairs since , and only odd counts survive. So "odd" is just the parity that leaves a standing. To cancel the byproduct on a measured qubit you need one surviving , which is precisely the condition .
If a pattern has no gflow, is it definitely non-deterministic?
Not necessarily, and this is a subtle point. Gflow is necessary and sufficient for stepwise determinism only under a fixed hypothesis — that the qubits are measured in specified planes (classically, all in the XY plane). Its absence rules out the standard, uniform, stepwise-deterministic construction for that plane assignment. But a different assignment of measurement planes, or a non-uniform scheme that abandons stepwise determinism while still being deterministic overall, can sometimes rescue a pattern that has no gflow as stated. In practice, though, "no gflow" is a strong red flag: a compiler that fails to find one will normally revise the entanglement structure rather than hunt for an exotic exception.
How is a flow or gflow actually found in practice?
Efficiently, which is the whole point. Mhalla and Perdrix gave a polynomial-time algorithm that finds a causal flow when one exists, and even the minimal-depth flow, by working backward from the outputs and greedily assigning the most-delayed corrections layer by layer. Gflow has an analogous polynomial-time algorithm that solves, at each layer, a system of linear equations over the field with two elements — the parity conditions are linear over GF(2), so finding a valid correction set is Gaussian elimination, not brute-force search. The overall cost is roughly in the number of qubits, cheap enough to run inside a pattern compiler on every candidate resource.
Where do flow and gflow show up outside foundational theory?
In three very concrete places. First, photonic hardware: fusion-based and cluster-state photonic machines are programmed by measurement, and a runnable, fault-tolerant schedule on their resource states is a gflow certificate in disguise. Second, circuit optimization: ZX-calculus tools simplify a circuit as a graph and must extract a circuit back out, which is provably possible exactly when the simplified diagram retains a gflow — so gflow is the invariant those optimizers preserve. Third, delegated and verified quantum computing, where a client sends a flow-structured measurement pattern to an untrusted quantum server, using the graph-state formalism to both hide the computation and check that the server ran it honestly.