Typed compositional quantum computation with lenses
Pith reviewed 2026-05-24 06:34 UTC · model grok-4.3
The pith
Discrete lenses in Coq control currying on quantum states to separate circuit structure from gate content.
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
Core claim
We propose a type-theoretic framework for describing and proving properties of quantum computations, in particular those presented as quantum circuits. Our proposal is based on an observation that, in the polymorphic type system of Coq, currying on quantum states allows us to apply quantum gates directly inside a complex circuit. By introducing a discrete notion of lens to control this currying, we are further able to separate the combinatorics of the circuit structure from the computational content of gates. We apply our development to define quantum circuits recursively from the bottom up, and prove their correctness compositionally.
What carries the argument
Discrete lens controlling currying on quantum states in Coq's polymorphic type system.
If this is right
- Quantum circuits can be defined recursively from the bottom up using the lens construct.
- Correctness of circuits can be proved compositionally without mixing structure and computation.
- Gates can be applied directly inside complex circuits through controlled currying.
- The combinatorics of circuit wiring remain independent of the computational content of individual gates.
Where Pith is reading between the lines
- The separation of structure and content may reduce the complexity of verifying larger quantum algorithms built from repeated subcircuits.
- Similar lens-based control could be explored in other typed functional languages that support polymorphic state manipulation for quantum or classical reversible computation.
- The recursive bottom-up style might integrate with existing categorical models of quantum computation to yield hybrid verification tools.
Load-bearing premise
Currying on quantum states inside Coq's polymorphic type system can be controlled by a discrete lens construct without breaking the underlying quantum semantics or requiring additional axioms.
What would settle it
A concrete quantum circuit whose structure cannot be separated from its gate content using the discrete lens, or whose correctness proof fails to hold compositionally under the lens-controlled currying in Coq.
read the original abstract
We propose a type-theoretic framework for describing and proving properties of quantum computations, in particular those presented as quantum circuits. Our proposal is based on an observation that, in the polymorphic type system of Coq, currying on quantum states allows us to apply quantum gates directly inside a complex circuit. By introducing a discrete notion of lens to control this currying, we are further able to separate the combinatorics of the circuit structure from the computational content of gates. We apply our development to define quantum circuits recursively from the bottom up, and prove their correctness compositionally.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The paper presents a Coq development for typed quantum computation that introduces a discrete lens construct to control currying of quantum states within Coq's polymorphic type system. This separation of circuit combinatorics from gate semantics enables bottom-up recursive definitions of quantum circuits together with compositional correctness proofs that preserve unitarity by induction on the lens structure.
Significance. If the result holds, the work supplies machine-checked proofs of compositional correctness for recursively defined quantum circuits inside an existing dependently-typed framework (using only standard Coq libraries for vectors and complex numbers). The lens-based separation of structure from semantics is a concrete strength for modularity and reproducibility in formal quantum programming.
minor comments (2)
- [Abstract] The abstract states that the lens 'commutes with the standard tensor-product representation' but does not name the precise Coq definition or lemma that establishes this commutation.
- [Section 3] Section 3 (or equivalent) would benefit from an explicit statement of the induction hypothesis used for the unitarity preservation proof.
Simulated Author's Rebuttal
We thank the referee for their positive review of the manuscript and their recommendation to accept.
Circularity Check
No significant circularity detected
full rationale
The paper is a self-contained Coq formalization that defines a discrete lens construct to manage currying of quantum states inside the polymorphic type system, then uses it to separate circuit structure from gate semantics and prove recursive circuit correctness by induction. All steps rely on standard Coq libraries for vectors and complex numbers plus explicit inductive proofs that preserve unitarity; no parameter fitting, self-referential definitions, or load-bearing self-citations appear. The development is machine-checked and externally falsifiable against the tensor-product semantics of quantum states, satisfying the criteria for independent content.
Axiom & Free-Parameter Ledger
Forward citations
Cited by 1 Pith paper
-
Hybrid Path-Sums for Hybrid Quantum Programs
Hybrid Path-Sums offer a new symbolic framework with rewriting rules and assertions to represent, simplify, and verify properties of hybrid quantum-classical programs.
Reference graph
Works this paper leans on
-
[1]
F. Bancilhon and N. Spyratos. Update semantics of relational views. ACM Trans. Database Syst. , 6(4):557–575, dec 1981. https://doi.org/10.1145/319628.319634 doi:10.1145/319628.319634
-
[2]
Davi M.J. Barbosa, Julien Cretin, Nate Foster, Michael Greenberg, and Benjamin C. Pierce. Matching lenses: alignment and view update. In Proceedings of the 15th ACM SIGPLAN International Conference on Functional Programming , ICFP '10, page 193–204, New York, NY, USA, 2010. Association for Computing Machinery. https://doi.org/10.1145/1863543.1863572 doi:1...
-
[3]
An automated deductive verification framework for circuit-building quantum programs
Christophe Chareton, S \'e bastien Bardin, Fran c ois Bobot, Valentin Perrelle, and Beno \^i t Valiron. An automated deductive verification framework for circuit-building quantum programs. In Nobuko Yoshida, editor, Programming Languages and Systems, ESOP 2021 , volume 12648 of Lecture Notes in Computer Science , pages 148--177, Cham , March 2021. Springe...
-
[4]
In Luca Aceto, Ivan Damg ˚ ard, Leslie Ann Goldberg, Magn´ us M
Bob Coecke and Ross Duncan. Interacting quantum observables. In Luca Aceto, Ivan Damg rd, Leslie Ann Goldberg, Magn \'u s M. Halld \'o rsson, Anna Ing \'o lfsd \'o ttir, and Igor Walukiewicz, editors, Automata, Languages and Programming , pages 298--310, Berlin, Heidelberg, 2008. Springer Berlin Heidelberg. https://doi.org/10.1007/978-3-540-70583-3_25 doi...
-
[5]
Picturing Quantum Processes: A First Course in Quantum Theory and Diagrammatic Reasoning
Bob Coecke and Aleks Kissinger. Picturing Quantum Processes: A First Course in Quantum Theory and Diagrammatic Reasoning . Cambridge University Press, 2017. https://doi.org/10.1017/9781316219317 doi:10.1017/9781316219317
-
[6]
Hierarchy builder: Algebraic hierarchies made easy in Coq with Elpi (system description)
Cyril Cohen, Kazuhiko Sakaguchi, and Enrico Tassi. Hierarchy builder: Algebraic hierarchies made easy in Coq with Elpi (system description). In 5th International Conference on Formal Structures for Computation and Deduction ( FSCD 2020), June 29--July 6, 2020, Paris, France (Virtual Conference) , volume 167 of LIPIcs , pages 34:1--34:21. Schloss Dagstuhl ...
-
[7]
Combinators for Bidirectional Tree Transformations: A Linguistic Approach to the View-Update Problem
J. Nathan Foster, Michael B. Greenwald, Jonathan T. Moore, Benjamin C. Pierce, and Alan Schmitt. Combinators for bidirectional tree transformations: A linguistic approach to the view-update problem. ACM Trans. Program. Lang. Syst. , 29(3):17, 2007. https://doi.org/10.1145/1232420.1232424 doi:10.1145/1232420.1232424
-
[8]
The typed polymorphic label-selective -calculus
Jacques Garrigue and Hassan A \" t-Kaci. The typed polymorphic label-selective -calculus. In Proc. ACM Symposium on Principles of Programming Languages , pages 35--47, 1994. https://doi.org/10.1145/174675.174434 doi:10.1145/174675.174434
-
[9]
Jacques Garrigue and Takafumi Saikawa. QECC proof scripts. URL: https://github.com/t6s/qecc
-
[10]
Daniel M. Greenberger, Michael A. Horne, and Anton Zeilinger. Going beyond bell's theorem. In Menas Kafatos, editor, Bell's Theorem, Quantum Theory and Conceptions of the Universe , pages 69--72. Springer Netherlands, Dordrecht, 1989. https://doi.org/10.1007/978-94-017-0849-4_10 doi:10.1007/978-94-017-0849-4_10
-
[11]
A verified optimizer for quantum circuits
Kesha Hietala, Robert Rand, Shih-Han Hung, Xiaodi Wu, and Michael Hicks. A verified optimizer for quantum circuits. Proc. ACM Program. Lang. , 5(POPL), January 2021. https://doi.org/10.1145/3434318 doi:10.1145/3434318
-
[12]
VyZX : A vision for verifying the ZX calculus, 2022
Adrian Lehmann, Ben Caldwell, and Robert Rand. VyZX : A vision for verifying the ZX calculus, 2022. https://arxiv.org/abs/2205.05781 arXiv:2205.05781 , https://doi.org/10.48550/arXiv.2205.05781 doi:10.48550/arXiv.2205.05781
-
[13]
VyZX: Formal Verification of a Graphical Quantum Language
Adrian Lehmann, Ben Caldwell, Bhakti Shah, and Robert Rand. VyZX : Formal verification of a graphical quantum language, 2023. https://arxiv.org/abs/2311.11571 arXiv:2311.11571 , https://doi.org/10.48550/arXiv.2311.11571 doi:10.48550/arXiv.2311.11571
work page internal anchor Pith review Pith/arXiv arXiv doi:10.48550/arxiv.2311.11571 2023
-
[14]
Formal verification of quantum programs: Theory, tools and challenges, 2022
Marco Lewis, Sadegh Soudjani, and Paolo Zuliani. Formal verification of quantum programs: Theory, tools and challenges, 2022. https://arxiv.org/abs/2110.01320 arXiv:2110.01320 , https://doi.org/10.1145/3624483 doi:10.1145/3624483
-
[15]
Jennifer Paykin, Robert Rand, and Steve Zdancewic. QWIRE : A core language for quantum circuits. In Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages , POPL '17, page 846–858, 2017. https://doi.org/10.1145/3009837.3009894 doi:10.1145/3009837.3009894
-
[16]
Qiskit: An Open-source Framework for Quantum Computing
Qiskit contributors . Qiskit: An open-source framework for quantum computing, 2023. https://doi.org/10.5281/zenodo.2573505 doi:10.5281/zenodo.2573505
-
[17]
Peter W. Shor. Scheme for reducing decoherence in quantum computer memory. Phys. Rev. A , 52:R2493--R2496, October 1995. https://doi.org/10.1103/PhysRevA.52.R2493 doi:10.1103/PhysRevA.52.R2493
-
[18]
Quantum and classical registers
Dominique Unruh. Quantum and classical registers. CoRR , abs/2105.10914, 2021. https://arxiv.org/abs/2105.10914 arXiv:2105.10914 , https://doi.org/10.48550/arXiv.2105.10914 doi:10.48550/arXiv.2105.10914
-
[19]
Foundations of Quantum Programming
Mingsheng Ying. Foundations of Quantum Programming . Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, 1st edition, 2016. https://doi.org/10.1016/C2014-0-02660-3 doi:10.1016/C2014-0-02660-3
-
[20]
CoqQ : Foundational verification of quantum programs
Li Zhou, Gilles Barthe, Pierre-Yves Strub, Junyi Liu, and Mingsheng Ying. CoqQ : Foundational verification of quantum programs. Proc. ACM Program. Lang. , 7(POPL), January 2023. https://doi.org/10.1145/3571222 doi:10.1145/3571222
discussion (0)
Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.