Skip to main content
Log in

Symbolic Reasoning About Quantum Circuits in Coq

  • Regular Paper
  • Published:
Journal of Computer Science and Technology Aims and scope Submit manuscript

Abstract

A quantum circuit is a computational unit that transforms an input quantum state to an output state. A natural way to reason about its behavior is to compute explicitly the unitary matrix implemented by it. However, when the number of qubits increases, the matrix dimension grows exponentially and the computation becomes intractable. In this paper, we propose a symbolic approach to reasoning about quantum circuits. It is based on a small set of laws involving some basic manipulations on vectors and matrices. This symbolic reasoning scales better than the explicit one and is well suited to be automated in Coq, as demonstrated with some typical examples.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Similar content being viewed by others

References

  1. Nielsen M A, Chuang I L. Quantum Computation and Quantum Information: 10th Anniversary Edition. Cambridge University Press, 2010. https://doi.org/10.1017/CBO9780511976667.

  2. Paykin J, Rand R, Zdancewic S. QWIRE: A core language for quantum circuits. In Proc. the 44th ACM SIGPLAN Symposium on Principles of Programming Languages, Jan. 2017, pp.846-858. https://doi.org/10.1145/3009837.3009894.

  3. Dirac P. A new notation for quantum mechanics. Mathematical Proceedings of the Cambridge Philosophical Society, 1939, 35(3): 416-418. https://doi.org/10.1017/S0305004100021162.

    Article  MathSciNet  MATH  Google Scholar 

  4. Shi W, Cao Q, Deng Y, Jiang H, Feng Y. Symbolic reasoning about quantum circuits in Coq. arXiv:2005.11023, 2021. https://arxiv.org/abs/2005.11023, Sept. 2021.

  5. Kafatos M. Bell’s Theorem, Quantum Theory, and Conceptions of the Universe. Kluwer Academics, 1989.

  6. Bennett C H, Brassard G, Crépeau C, Jozsa R, Peres A, Wootters W. Teleporting an unknown quantum state via dual classical and Einstein-Podolsky-Rosen channels. Physical Review Letters, 1993, 70(13): 1895-1899. https://doi.org/10.1103/PhysRevLett.70.1895.

    Article  MathSciNet  MATH  Google Scholar 

  7. Deutsch D, Jozsa R. Rapid solutions of problems by quantum computation. Proceedings of the Royal Society A: Mathematical and Physical Sciences, 1992, 439(1907): 553-558. https://doi.org/10.1098/rspa.1992.0167.

    Article  MATH  Google Scholar 

  8. Boender J, Kammüller F, Nagarajan R. Formalization of quantum protocols using Coq. In Proc. the 12th International Workshop on Quantum Physics and Logic, Jul. 2015, pp.71-83. https://doi.org/10.4204/EPTCS.195.6.

  9. Cruz-Filipe L, Geuvers H, Wiedijk F. C-CoRN, the constructive Coq repository at Nijmegen. In Proc. the 3rd Int. Conf. Mathematical Knowledge Management, Sept. 2004, pp.88-103. https://doi.org/10.1007/978-3-540-27818-4_7.

  10. Cano G, Cohen C, Déenès M, Mörtberg A, Vincent S. Formalized linear algebra over elementary divisor rings in Coq. Logical Methods in Computer Science, 2016, 12(2): Article No. 7. https://doi.org/10.2168/LMCS-12(2:7)2016.

  11. Rand R, Paykin J, Zdancewic S. QWIRE practice: Formal verification of quantum circuits in Coq. In Proc. the 14th Int. Conf. Quantum Physics and Logic, Jul. 2018, pp.119-132. https://doi.org/10.4204/EPTCS.266.8.

  12. Rand R, Paykin J, Lee D, Zdancewic S. ReQWIRE: Reasoning about reversible quantum circuits. In Proc. the 15th Int. Conf. Quantum Physics and Logic, Jun. 2018, pp.299-312. https://doi.org/10.4204/EPTCS.287.17.

  13. Hietala K, Rand R, Hung S, Wu X, Hicks M. Verified optimization in a quantum intermediate representation. arXiv:1904.06319, 2019. https://arxiv.org/abs/1904.06319, Sept. 2021.

  14. Nam Y, Ross N, Su Y, Childs A, Maslov D. Automated optimization of large quantum circuits with continuous parameters. npj Quantum Information, 2018, 4(1): Article No. 23. https://doi.org/10.1038/s41534-018-0072-4.

  15. Mahmoud M Y, Felty A P. Formalization of metatheory of the Quipper quantum programming language in a linear logic. Journal of Automated Reasoning, 2019, 63(4): 967-1002. https://doi.org/10.1007/s10817-019-09527-x.

    Article  MathSciNet  MATH  Google Scholar 

  16. Felty A P, Momigliano A. Hybrid: A definitional two-level approach to reasoning with higher-order abstract syntax. Journal of Automated Reasoning, 2012, 48(1): 43-105. https://doi.org/10.1007/s10817-010-9194-x.

    Article  MathSciNet  MATH  Google Scholar 

  17. Green A S, Lumsdaine P L, Ross N J, Selinger P, Valiron B. Quipper: A scalable quantum programming language. In Proc. the 34th ACM SIGPLAN Conference on Programming Language Design and Implementation, Jun. 2013, pp.333-342. https://doi.org/10.1145/2491956.2462177.

  18. Liu J, Zhan B, Wang S, Ying S, Liu T, Li Y, Ying M, Zhan N. Formal verification of quantum algorithms using quantum Hoare logic. In Proc. the 31st Int. Conf. Computer Aided Verification, Jul. 2019, pp.187-207. https://doi.org/10.1007/978-3-030-25543-5_12.

  19. Nipkow T, Paulson L, Wenzel M. Isabelle/HOL: A Proof Assistant for Higher-Order Logic. Springer, 2002. https://doi.org/10.1007/3-540-45949-9.

  20. Ying M. Foundations of Quantum Programming. Morgan Kaufmann, 2016.

  21. Unruh D. Quantum relational Hoare logic. Proceedings of the ACM on Programming Languages, 2019, 3(POPL): Article No. 33. https://doi.org/10.1145/3290346.

  22. Beillahi S M, Mahmoud M Y, Tahar S. A modeling and verification framework for optical quantum circuits. Formal Aspects of Computing, 2019, 31(3): 321-351. https://doi.org/10.1007/s00165-019-00480-5.

    Article  MathSciNet  MATH  Google Scholar 

  23. Mahmoud M Y, Aravantinos Y, Tahar S. Formalization of infinite dimension linear spaces with application to quantum theory. In Proc. the 5th Int. Symp. NASA Formal Methods, May 2013, pp.413-427. https://doi.org/10.1007/978-3-642-38088-4_28.

  24. Chareton C, Bardin S, Bobot F, Perrelle V, Valiron B. An automated deductive verification framework for circuit-building quantum programs. In Proc. the 30th European Symposium on Programming, March 27-April 1, 2021, pp.148-177. https://doi.org/10.1007/978-3-030-72019-3_6.

  25. Amy M. Towards large-scale functional verification of universal quantum circuits. In Proc. the 15th Int. Conf. Quantum Physics and Logic, Jun. 2018, pp.1-21. https://doi.org/10.4204/EPTCS.287.1.

  26. Shor P W. Algorithms for quantum computation: Discrete log and factoring. In Proc. the 35th Annual Symposium on Foundations of Computer Science, Nov. 1994, pp.124-133. https://doi.org/10.1109/SFCS.1994.365700.

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Yu-Xin Deng.

Supplementary Information

ESM 1

(PDF 81 kb)

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Shi, WJ., Cao, QX., Deng, YX. et al. Symbolic Reasoning About Quantum Circuits in Coq. J. Comput. Sci. Technol. 36, 1291–1306 (2021). https://doi.org/10.1007/s11390-021-1637-9

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11390-021-1637-9

Keywords

Navigation