Skip to main content

Hybrid Quantum-Classical Circuit Simplification with the ZX-Calculus

  • Conference paper
  • First Online:
Programming Languages and Systems (APLAS 2021)

Abstract

We present a complete optimization procedure for hybrid quantum-classical circuits with classical parity logic. While common optimization techniques for quantum algorithms focus on rewriting solely the pure quantum segments, there is interest in applying a global optimization process for applications such as quantum error correction and quantum assertions. This work, based on the pure-quantum circuit optimization procedure by Duncan et al., uses an extension of the formal graphical ZX-calculus called as an intermediary representation of the hybrid circuits to allow for granular optimizations below the quantum-gate level. We define a translation from hybrid circuits into diagrams that admit the graph-theoretical focused-gFlow property, needed for the final extraction back into a circuit. We then derive a number of gFlow-preserving optimization rules for diagrams that reduce the size of the graph, and devise a strategy to find optimization opportunities by rewriting the diagram guided by a Gauss elimination process. Then, after extracting the circuit, we present a general procedure for detecting segments of circuit-like diagrams which can be implemented with classical gates in the extracted circuit. We have implemented our optimization procedure as an extension to the open-source python library PyZX.

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

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

References

  1. Amy, M., Maslov, D., Mosca, M.: Polynomial-time T-depth optimization of Clifford+T circuits via matroid partitioning. IEEE Trans. Comput.-Aided Des. 33(10), 1476–1489 (2014)

    Article  Google Scholar 

  2. de Beaudrap, N., Horsman, D.: The ZX calculus is a language for surface code lattice surgery. Quantum 4, 218 (2020)

    Article  Google Scholar 

  3. Carette, T., Jeandel, E., et al.: Completeness of graphical languages for mixed states quantum mechanics. In: Proceedings of ICALP, pp. 108:1–108:15 (2019)

    Google Scholar 

  4. Chancellor, N., Kissinger, et al.: Graphical structures for design and verification of quantum error correction (2016)

    Google Scholar 

  5. Coecke, B., Duncan, R.: Interacting quantum observables. In: Aceto, L., Damgård, I., Goldberg, L.A., Halldórsson, M.M., Ingólfsdóttir, A., Walukiewicz, I. (eds.) ICALP 2008. LNCS, vol. 5126, pp. 298–310. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-70583-3_25

    Chapter  Google Scholar 

  6. Coecke, B., Kissinger, A.: Picturing quantum processes. In: Chapman, P., Stapleton, G., Moktefi, A., Perez-Kriz, S., Bellucci, F. (eds.) Diagrams 2018. LNCS (LNAI), vol. 10871, pp. 28–31. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-91376-6_6

    Chapter  Google Scholar 

  7. Cross, A.W., Bishop, L.S., et al.: Open quantum assembly language (2017)

    Google Scholar 

  8. Duncan, R., Kissinger, A., et al.: Graph-theoretic simplification of quantum circuits with the ZX-calculus. Quantum 4, 279 (2020)

    Article  Google Scholar 

  9. Duncan, R., Lucas, M.: Verifying the steane code with quantomatic. In: Proceedings of QPL, pp. 33–49 (2013)

    Google Scholar 

  10. Duncan, R., Perdrix, S.: Rewriting measurement-based quantum computations with generalised flow. In: Abramsky, S., Gavoille, C., Kirchner, C., Meyer auf der Heide, F., Spirakis, P.G. (eds.) ICALP 2010. LNCS, vol. 6199, pp. 285–296. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-14162-1_24

    Chapter  Google Scholar 

  11. Green, A.S., Lumsdaine, P.L.F., et al.: Quipper: a scalable quantum programming language. In: Proceedings of PLDI, pp. 333–342 (2013)

    Google Scholar 

  12. Heyfron, L., Campbell, E.T.: An efficient quantum compiler that reduces T count (2018)

    Google Scholar 

  13. Jeandel, E., Perdrix, S., Vilmart, R.: Completeness of the ZX-calculus. LMCS 16(2), 11:1-11:72 (2020)

    MathSciNet  MATH  Google Scholar 

  14. Jozsa, R.: An introduction to measurement based quantum computation. In: NATO Science Series, III, vol. 199, pp. 137–158 (2005)

    Google Scholar 

  15. Khammassi, N., Guerreschi, G.G., et al.: cqasm v1.0: towards a common quantum assembly language (2018)

    Google Scholar 

  16. Kissinger, A., van de Wetering, J.: PyZX: large scale automated diagrammatic reasoning. In: ENTCS, vol. 318, pp. 229–241 (2020)

    Google Scholar 

  17. Kissinger, A., van de Wetering, J.: Reducing T-count with the ZX-calculus (2020)

    Google Scholar 

  18. Li, G., Zhou, L., Yu, N., et al.: Projection-based runtime assertions for testing and debugging quantum programs. PAPL 4(OOPSLA), 1–29 (2020)

    Google Scholar 

  19. Mhalla, M., Murao, M., Perdrix, S., Someya, M., Turner, P.S.: Which graph states are useful for quantum information processing? In: Bacon, D., Martin-Delgado, M., Roetteler, M. (eds.) TQC 2011. LNCS, vol. 6745, pp. 174–187. Springer, Heidelberg (2014). https://doi.org/10.1007/978-3-642-54429-3_12

    Chapter  MATH  Google Scholar 

  20. Miller-Bakewell, H.: Finite verification of infinite families of diagram equations. In: Proceedings of QPL, pp. 27–52 (2019)

    Google Scholar 

  21. Selinger, P.: Quantum circuits of T-depth one. Phys. Rev. A 87(4), 042302 (2013)

    Article  Google Scholar 

  22. Steiger, D.S., Häner, T., Troyer, M.: ProjectQ: an open source software framework for quantum computing. Quantum 2, 49 (2018)

    Article  Google Scholar 

  23. van de Wetering, J.: ZX-calculus for the working quantum computer scientist (2020)

    Google Scholar 

  24. Zhou, H., Byrd, G.T.: Quantum circuits for dynamic runtime assertions in quantum computation. IEEE Comput. Arch. Lett. 18(2), 111–114 (2019)

    Article  Google Scholar 

Download references

Acknowledgements

The authors would like to thank Kostia Chardonnet and Renaud Vilmart for their suggestions on the classicalization problem, and John van de Wetering for his help with the pyzx library. This work was supported in part by the French National Research Agency (ANR) under the research project SoftQPRO ANR-17-CE25-0009-02, and by the DGE of the French Ministry of Industry under the research project PIA-GDN/QuantEx P163746-484124, and by the project STIC-AmSud project Qapla’ 21-SITC-10.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Agustín Borgna .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Borgna, A., Perdrix, S., Valiron, B. (2021). Hybrid Quantum-Classical Circuit Simplification with the ZX-Calculus. In: Oh, H. (eds) Programming Languages and Systems. APLAS 2021. Lecture Notes in Computer Science(), vol 13008. Springer, Cham. https://doi.org/10.1007/978-3-030-89051-3_8

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-89051-3_8

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-89050-6

  • Online ISBN: 978-3-030-89051-3

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics