When are two different encoder graphs equivalent?
Picture two banks of sockets: inputs on the left, outputs on the right. A wire connects a pair of sockets. If wires only go between the banks, write the drawing as a table of zeros and ones, one row per input and one column per output. Here is a drawing with two inputs and three outputs:
The first two outputs have one wire each. The third is shared by both inputs. Try adding the second row to the first, with : two marks at the same position cancel. This moves the shared output to the second column, but does not remove it. Could more flexible moves on the graph do better?
- What survives the moves explains what can be measured even when a move makes a wire within one bank.
- Two rows, three nonzero types counts four kinds of columns to find the fewest shared outputs in the entire bipartite class.
This is a reading companion to Haobo Ma and Wenlin Zhang’s version 2 paper (CC BY 4.0). The historical question comes from Khesin and Li, §8, p. 23; the paper also credits an earlier version in Li’s 2023 report. The subject here is a specified graph relation without decorations, not a decision procedure for equivalence of arbitrary quantum codes.
What survives the moves
Label the inputs and outputs separately. Four kinds of moves are allowed: locally complement at any vertex (toggle every edge between two of its neighbors); permute the inputs or outputs within their own bank; add one input row to a different row modulo two (change only the cross-bank wires); or delete an edge joining two inputs. The equivalence relation allows walking either way through these moves. In particular, the middle of a walk need not be bipartite. Only the endpoints are required to have cross-bank wires exclusively. We omit output Clifford decorations.
For any nonnegative , let be bipartite encoder graphs with inputs and outputs. If , a finite sequence of output permutations, input permutations and additions of distinct binary input rows takes to . Every graph along this sequence is bipartite. (Manuscript Theorem 1.)
1. Count independent patterns across a cut
Pick a set of outputs and separate them from all the other vertices. Write a 0–1 table for just the wires crossing this cut. Its rank is the maximum number of independent row patterns under addition modulo two: a pattern you can make from the others does not add another independent row. For example, together have rank two because the third is the sum of the first two. Write for the rank of the cut table.
If , a single output relabeling makes their cut ranks agree for every output subset . This statement does not require bipartite endpoints.
If the center of a local complementation lies in , add its row to the other rows on its side that are adjacent to it. If the center is on the other side, do the analogous column additions. These operations undo themselves and preserve rank. An input row addition becomes a column addition in the cut table because all inputs are outside . Deleting an input–input edge does not touch the cut. Input permutations reorder columns; output permutations relabel the family of cuts. Combine the successive output relabelings to get one relabeling that works for every .
2. Recover the choices of columns that sum to zero
At a bipartite endpoint, no wire crosses from to an output outside . The cut rank is just the rank of the columns of the cross-bank matrix. There are ways of selecting columns inside whose sum is zero: there is one free binary choice per missing independent constraint. The exact set of selected columns is called the support. Work up from smaller sets. Subtract the counts for all proper exact supports from the count for selections inside , leaving the count for exact support . In binary arithmetic there is only one selection with that support: every selected coefficient is one.
For equal-size binary matrices, agreement of ranks on every column subset is equivalent to agreement of their kernels (the 0–1 vectors whose weighted column sums vanish), and to agreement of their row spaces (the sets of all binary row sums).
The counting argument gives ranks to kernel. A zero-sum vector has dot product zero with every row. Taking the orthogonal complement twice returns the original space in finite-dimensional binary linear algebra, so the kernel and row space determine one another. Conversely, restrict the row-space vectors to coordinates in : the dimension of this smaller space gives the rank of the columns in .
3. Turn a row space back into a sequence of moves
If are binary matrices with equal row spaces, an invertible binary matrix satisfies . Row swaps and additions of distinct rows take to .
Reduce both tables to the same reduced row echelon form and run the second reduction backwards. There is no scaling step other than multiplying by one. At bipartite endpoints the cross-bank matrix determines the entire graph, so every step can stay bipartite. For zero inputs or zero outputs the only bipartite graph is edgeless and the empty sequence suffices.
For bipartite encoder graphs of the same size, these conditions are equivalent: equivalence under the original moves; equality of row spaces after some output relabeling; equality of all output cut ranks after some output relabeling. Steps 1 and 2 give graph equivalence to cut ranks to row spaces. Step 3 gives the reverse implication from row spaces to graph equivalence.
Permutations are made of swaps, and . Thus output permutations and additions of distinct input rows suffice. With fewer than two inputs there is no input swap to replace.
Where the argument stops
The pinned Lean declaration for Theorem 1 matches the graph moves in the paper. The supporting and derived statements above explain its mechanism; the book does not present them as separately verified public declarations. Trying all output permutations is not a polynomial-time algorithm for general size. The step that reads a matrix from cut ranks needs bipartite endpoints, and the cut ranks tested here are not a complete invariant of arbitrary graphs. Completeness of the graph moves for quantum-code equivalence is the separate Khesin–Li Conjecture 6.3, not a consequence of this proof.
Two rows, three nonzero types
With two inputs a column has only four possible types: has no wire, and have one wire each, and is shared. Write for their counts in that order. Our opening example has no zero columns and one of each nonzero type. Changing rows can change which type is shared, but it cannot squeeze three distinct nonzero types into two.
Follow the three columns: why can the shared output move but not disappear?
Two bipartite encoder graphs with two inputs and the same outputs are equivalent exactly when and the sorted triple of counts agree, retaining repetitions. Over equivalent bipartite drawings, the least shared-output count is , and the least edge count is . In rank two the minimum is attainable with two identity pivot columns. The upper bound is sharp for each . With output labels fixed, cut ranks on singletons and pairs already determine the row space. (Manuscript Corollary 7.)
Any two distinct nonzero columns form a basis, so choosing two distinct nonzero images specifies an invertible row change. The third column is their sum and goes to the remaining type. Thus the three nonzero types can be permuted at will, while zero stays zero. The row-space test and output permutations now give the classification.
Send a least frequent type to to minimize sharing. Every nonzero column contributes one wire, and each shared column contributes one extra wire. The three counts sum to , so their minimum is at most their average. Rank two means at least two types occur; once the least frequent type is sent to , both and occur and can serve as pivots. To attain the bound, distribute columns among the three types as evenly as possible. At least two types occur when , and the least count is exactly .
A one-column cut has rank zero exactly for the zero type. For two nonzero columns the cut has rank one exactly when the columns coincide. This recovers the partition by type with labels fixed. The names of the nonzero types can be permuted by an invertible row change, so the partition determines the row space.
In the opening example, the three counts are all one. Every equivalent bipartite drawing therefore needs one shared output, though the old upper bound in Khesin–Li Proposition 8.2 (p. 23) gives zero. The example already has two identity pivot columns. The new bound is the best uniform upper bound on the minimum; for a particular drawing, the exact answer still comes from counting its types. Sorting the counts also gives a canonical representative without enumerating output permutations.
With one input the only invertible binary row change is the identity. The row-space criterion reduces to permuting a single row, so its weight, the number of ones, completely classifies the drawing. This includes no outputs and no wires.
One connected drawing, or a connected class?
The identity matrix draws two separate wires. Add its second row to its first and the result draws a path through all four vertices. A class can thus contain both a connected drawing and a disconnected drawing. Ask instead: Does this class contain any disconnected drawing at all?
For a rank-two bipartite encoder graph with two inputs, every graph in its equivalence class is connected, including the nonbipartite members, exactly when and are all positive. These classes correspond to unordered triples of positive integers summing to ; for there is just . (Manuscript Corollary 9.)
A zero column isolates an output in the original drawing. If one nonzero type is missing, rank two means the other two occur. Send them to and to get two disjoint stars.
Conversely suppose an equivalent graph is disconnected. Let be the inputs and outputs in its -th component, using the output relabeling from the cut-rank invariant. The only possible wires across the cut of are to inputs in its own component. Hence . The sum of the column-block ranks is at least the whole rank, two, and the total input count is also two. Equality holds throughout. An input-free component would therefore give zero columns, and an output-free component cannot contain an input. Disconnectedness would require two components of one input each. Each corresponding block has rank one and can contain only one nonzero type, contradicting the presence of all three. The classification by counts now gives the positive triples.
The version 2 manuscript proves the two-input classification, minimum and class connectedness on paper. The pinned Lean theorem for move reduction does not assert them; the two linked requests give the exact scopes for contributing formal proofs. The connected-class result appears already in Li’s Claim F and Khesin–Li Proposition 8.1; the criterion here works for every .
Verification ledger
Lean-verified results correspond to frozen declarations in trureturing. Written proofs and open items are listed separately below. The table lists the Lean correspondence; links are fixed to the pinned commit, so they do not drift with upstream changes.
Formal basis: trureturing commit 8a24ea4e79de · the-omega-institute/trureturing
| Item | Title | Lean declaration | Frozen state |
|---|---|---|---|
| Theorem 0.1 | Move reduction at bipartite endpoints | D5.S3.Quantum.Codes.KhesinLiBipartiteEncoderEquivalence.result | 970b93f1a8 |
Written proofs
These results cite DOI sources, book proofs and registered formalization requests. They are not kernel-verified and are excluded from LEAN ✓ counts.
- Corollary 0.7 — Two-input classification and the exact shared-output minimum · Proof · DOI: 10.5281/zenodo.24404944 · Corollary 7 · trureturing-requests#531
- Corollary 0.9 — Connectedness of the whole two-input class · Proof · DOI: 10.5281/zenodo.24404944 · Corollary 9 · trureturing-requests#532
Open problems and conjectures
The following items are explicitly marked open; the book does not treat them as proved.
(none)