Add minimum-length Clifford transvection decomposition - #119
Open
Marcus P S (marcusps) wants to merge 18 commits into
Open
Marcus P S (marcusps) wants to merge 18 commits into
Marcus P S (marcusps) wants to merge 18 commits into
Conversation
Catch up
Implement a linear-size decomposition of a Clifford into Clifford transvections (pi/4 Pauli exponents) reproducing its symplectic (conjugation) action, plus the centralizer generators (the paper's headline application), in the paulimer crate. - paulimer::clifford::clifford_to_transvections: greedy O'Meara-style reduction producing O(n) factors that reproduce the symplectic action (signs and global phase are not tracked; contrast the sign-exact, O(n^2) clifford_to_pauli_exponents). Not guaranteed strictly minimal; exact r/r+1 minimality via congruence triangulation is a follow-up. - paulimer::clifford::clifford_centralizer: generators of Paulis fixed up to sign under conjugation (kernel of the residue map over GF(2), via binar). - Python bindings CliffordUnitary.to_transvections() / .centralizer() with .pyi stubs. - Extensive Rust (unit + proptest) and Python (hypothesis) tests: symplectic round trip, linear factor bound, no-shorter-than-minimum, and centralizer conjugation-fixedness. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Implement `clifford_to_transvections_minimal`, decomposing a Clifford into a minimal-length ordered product of Clifford transvections (pi/4 Pauli exponents) reproducing its symplectic action with r or r+1 factors (r = residue rank). The core is an exact, complete congruence-triangularization of the residue form E via memoized backtracking: the paper's forward-greedy pivot search is incomplete at rank >= 5 (it can dead-end on a bad non-isotropic pivot even when a triangularization exists), and its line-411 claim that every non-hyperbolic form is triangularizable is incorrect. The r+1 branch appends a fix vector that restores triangularizability at the same rank. Subspaces proven unsolvable are memoized by canonical RREF key to keep the search tractable. Add Python binding `CliffordUnitary.to_transvections_minimal`, .pyi stub, and Rust + hypothesis tests (symplectic-action roundtrip, minimality bound r/r+1, minimal <= greedy length). Track the regression seed for the previously-failing n=4 case. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Document two issues found while implementing clifford_to_transvections_minimal: 1. The paper's claim that a non-hyperbolic symplectic map's residue matrix is always congruence-triangularizable (hence decomposes into exactly r transvections) is false over F2. The clean r/(r+1) dichotomy is Dieudonne's theorem (O'Meara, Symplectic Groups, Thm 2.1.11), stated only for F != F2; O'Meara's Sec 2.3 explicitly notes it fails over F2. We give a machine-checked 2-qubit counterexample (residue rank 3, minimal length 4) and a census showing 210 non-hyperbolic maps in Sp(4,2) require r+1. 2. Even when a triangularization exists, the forward-greedy pivot search is incomplete for r >= 5; fixed by complete memoized backtracking. States the adopted criterion (min = r iff the residue core is congruence-lower-triangularizable, else r+1) with honest caveats about exact minimality for large m. All references verified against the sources. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Ensure the Clifford -> transvection decomposition (arXiv:2102.11380) is referenced across docs, READMEs, and examples: - Add a runnable Jupyter example (bindings/python/examples/clifford-transvection-decomposition.ipynb) showing greedy vs minimal decomposition, rebuild + symplectic-action verification, the r / r+1 factor count, and the non-hyperbolic r+1 case from the correction note. - Reference the decomposition in paulimer/README.md (Clifford features + documentation list) and in the Python bindings README (feature bullet + quick-start snippet). - Make this branch self-contained: rephrase the intra-doc links to clifford_to_pauli_exponents / to_pauli_exponents (which live on a separate branch) into plain text, so cargo doc builds standalone. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Generate residue-space candidates lazily without fixed-width masks, preventing eager exponential allocation and rank-64 shift overflow while preserving exhaustive search order. Document the exact search's remaining exponential time and memoization costs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: GPT-5.6 Sol <noreply@openai.com>
Marcus P S (marcusps)
marked this pull request as ready for review
July 17, 2026 04:35
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ford-to-transvections-minimal
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Apply the conventions established while addressing @jmbr's review on the phased-outcome / decomposition stack (PRs microsoft#115/microsoft#116) to the transvection decomposition, anticipating the same feedback here: - Replace the seed + internal-RNG proptests (`seed in any::<u64>()` feeding `CliffordUnitary::random`) with a `Gate`-sequence `Strategy`, mirroring phased_clifford_dense.rs and measure_with_hint_sign_test.rs, so a failing input shrinks to a minimal gate sequence instead of an opaque seed. The deterministic sweep (which needs no shrinking) keeps using a seeded RNG. - Derive `qubit_count` inside `next_transvection` from `working.num_qubits()` instead of threading it as a parameter, matching the earlier "derive qubit count" tidy on the Gaussian-elimination decomposition. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 16f923fe-a72a-4430-97b0-b7677f48dfb7
…inimal Update the minimal-decomposition rung with the latest from the lower rung clifford-to-pauli-exp-unphased (79c66e3): the Gate-strategy proptests and the param-less next_transvection tidy, applying the @jmbr review conventions from PRs microsoft#115/microsoft#116/microsoft#117 to this branch too. Also align the branch's own minimal-decomposition tests with those conventions: convert the remaining seed + internal-RNG proptests (minimal_reproduces_symplectic_action, minimal_is_r_or_r_plus_one_and_at_most_greedy) to the shared Gate strategy so they shrink to a minimal gate sequence, and drop the committed transvection_test.proptest-regressions seed file. The deterministic seeded sweeps (which need no shrinking) keep using random_clifford. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 16f923fe-a72a-4430-97b0-b7677f48dfb7
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rorr + 1factors.Correctness and published reference
Builds on Decomposition of Clifford Gates (arXiv:2102.11380). Theorem 3’s existence conclusion is correct, but its construction incorrectly assumes every non-hyperbolic map has a congruence-triangularizable residue core and therefore a length-
rdecomposition.This PR implements the exact criterion: the minimum is
rprecisely when the full nonsymmetric residue core is congruence triangularizable, andr + 1otherwise. The correction note identifies Callan’s class-A exceptions and retains a deterministic two-qubit regression with residue rank three and minimum length four.The corrected proof was checked independently with an interactive theorem prover. The check establishes the residue-rank lower bound, exact length-
rcriterion, universalr + 1upper bound, strict minimality, and the residue-fix theorem used by the fallback.Review series
This is the second of two dependent PRs and is stacked on #118. Review and merge #118 first. Until it merges and this branch is rebased, GitHub shows its commits cumulatively; this PR’s new review scope is the strict-minimum algorithm, correction note, tests, and examples.