Skip to main content

Model-Based Testing of Quantum Computations

  • Conference paper
  • First Online:
Tests and Proofs (TAP 2024)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 15153))

Included in the following conference series:

  • 108 Accesses

Abstract

Quantum computers are able to effectively solve certain types of problems being intractable by classical computers, including tasks from linear optimization, machine learning and simulation of natural phenomena. The counter-intuitive behavior of quantum algorithms makes it particularly important to develop practical techniques and tools to support the analysis and quality assurance of quantum programs. For classical programs, software testing is today one of the most effective and easy-to-use quality-assurance techniques. However, many postulates of quantum physics like superposition, entanglement and non-cloneability of qubit states as well as the probabilistic outcome and destructive effects of qubit measurements obstruct any straight-forward adaptation of classical testing techniques to quantum programs. Recent works either treat quantum programs as black-box components with classical interfaces to apply end-to-end testing or shift the focus of quality assurance to formal verification of quantum programs. In this paper, we instead propose a model-based framework for testing quantum computations at the level of execution traces. Our approach is independent of the quantum programming language and hardware used and utilizes probabilistic transition systems as abstract test model for both the specification and implementation to be tested. In our model, we carefully distinguish between controllable and observable as well as between nondeterministic and probabilistic test steps. Our framework makes quantum program testing a partly reactive process that can be complemented by statistical approaches for identifying erroneous qubit states by repeated measurements.

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. Ali, S., Arcaini, P., Wang, X., Yue, T.: Assessing the effectiveness of input and output coverage criteria for testing quantum programs. In: 2021 14th IEEE Conference on Software Testing, Verification and Validation (ICST), pp. 13–23 (2021). https://doi.org/10.1109/ICST49551.2021.00014

  2. Amy, M.: Towards large-scale functional verification of universal quantum circuits. Electron. Proc. Theor. Comput. Sci. 287, 1–21 (2019). https://doi.org/10.4204/EPTCS.287.1

    Article  MathSciNet  Google Scholar 

  3. GarcĂ­a de la Barrera, A., GarcĂ­a-RodrĂ­guez de Guzmán, I., Polo, M., Piattini, M.: Quantum software testing: State of the art. J. Softw. Evol. Process 35(4), e2419 (2023). https://doi.org/10.1002/smr.2419

  4. Bernot, G., Gaudel, M.C., Marre, B.: Software testing based on formal specifications: a theory and a tool. Softw. Eng. J. (1991). https://doi.org/10.1049/sej.1991.0040

    Article  Google Scholar 

  5. Biamonte, J., Perkowski, M.: Testing a quantum computer, October 2004. https://doi.org/10.48550/arXiv.quant-ph/0409023

  6. Briegel, H.J., Browne, D.E., Dür, W., Raussendorf, R., Van den Nest, M.: Measurement-based quantum computation. Nat. Phys. 5(1), 19–26 (2009). https://doi.org/10.1038/nphys1157

    Article  Google Scholar 

  7. Burgholzer, L., Wille, R.: Advanced equivalence checking for quantum circuits. IEEE Trans. Comput. Aided Des. Integr. Circuits Syst. 40(9), 1810–1824 (2021). https://doi.org/10.1109/TCAD.2020.3032630

    Article  Google Scholar 

  8. Campos, J., Souto, A.: QBugs: a collection of reproducible bugs in quantum algorithms and a supporting infrastructure to enable controlled quantum software testing and debugging experiments (2021). https://doi.org/10.48550/arXiv.2103.16968

  9. Cerezo, M., et al.: Variational quantum algorithms. Nat. Rev. Phys. 3(9), 625–644 (2021). https://doi.org/10.1038/s42254-021-00348-9

    Article  Google Scholar 

  10. Chareton, C., Bardin, S., Lee, D., Valiron, B., Vilmart, R., Xu, Z.: Formal methods for quantum programs: a survey (2021). https://arxiv.org/abs/2109.06493

  11. Christoff, I.: Testing equivalences and fully abstract models for probabilistic processes. In: Baeten, J.C.M., Klop, J.W. (eds.) CONCUR 1990. LNCS, vol. 458, pp. 126–138. Springer, Heidelberg (1990). https://doi.org/10.1007/BFb0039056

    Chapter  Google Scholar 

  12. Cramer, M., et al.: Efficient quantum state tomography. Nat. Commun. 1(1) (2010). https://doi.org/10.1038/ncomms1147

  13. De Nicola, R., Hennessy, M.: Testing equivalences for processes. Theoret. Comput. Sci. 34(1), 83–133 (1984). https://doi.org/10.1016/0304-3975(84)90113-0

    Article  MathSciNet  Google Scholar 

  14. Dey, N., Ghosh, M., kundu, S.S., Chakrabarti, A.: QDLC – the quantum development life Cycle (2020). https://doi.org/10.48550/arXiv.2010.08053

  15. Eisert, J., et al.: Quantum certification and benchmarking. Nat. Rev. Phys. 2(7), 382–390 (2020). https://doi.org/10.1038/s42254-020-0186-4

    Article  Google Scholar 

  16. Elben, A., et al.: The Randomized Measurement Toolbox. Nat. Rev. Phys. 5(1), 9–24 (2022). https://doi.org/10.1038/s42254-022-00535-2

    Article  Google Scholar 

  17. Farhi, E., Harrow, A.W.: Quantum supremacy through the quantum approximate optimization algorithm (2019). https://doi.org/10.48550/arXiv.1602.07674

  18. Feng, Y., Duan, R., Ji, Z., Ying, M.: Probabilistic bisimulations for quantum processes. Inf. Comput. 205(11), 1608–1639 (2007). https://doi.org/10.1016/j.ic.2007.08.001

    Article  MathSciNet  Google Scholar 

  19. Feng, Y., Duan, R., Ying, M.: Bisimulation for Quantum processes. ACM Trans. Program. Lang. Syst. 34(4) (2012). https://doi.org/10.1145/2400676.2400680

  20. Gerhold, M., Stoelinga, M.: IOCO theory for probabilistic automata. Electron. Proc. Theor. Comput. Sci. 180, 23–40 (2015). https://doi.org/10.4204/EPTCS.180.2

    Article  Google Scholar 

  21. Gerhold, M., Stoelinga, M.: Model-based testing of probabilistic systems. In: Stevens, P., Wasowski, A. (eds.) Fundamental Approaches to Software Engineering. pp. 251–268. Springer, Berlin (2016). https://doi.org/10.1007/978-3-662-49665-7_15

  22. Grover, L.K.: A fast quantum mechanical algorithm for database search. In: Proceedings of the Twenty-Eighth Annual ACM Symposium on Theory of Computing, STOC 1996, pp. 212-219. ACM, New York, NY, USA (1996). https://doi.org/10.1145/237814.237866

  23. Harrow, A.W., Hassidim, A., Lloyd, S.: Quantum algorithm for linear systems of equations. Phys. Rev. Lett. 103, 150502 (2009). https://doi.org/10.1103/PhysRevLett.103.150502

    Article  MathSciNet  Google Scholar 

  24. Honarvar, S., Mousavi, M.R., Nagarajan, R.: Property-based testing of quantum programs in Q#. In: Proceedings of the IEEE/ACM 42nd International Conference on Software Engineering Workshops, ICSEW 2020, pp. 430-435. ACM, New York, NY, USA (2020). https://doi.org/10.1145/3387940.3391459

  25. Huang, Y., Martonosi, M.: QDB: from quantum algorithms towards correct quantum programs. In: Barik, T., Sunshine, J., Chasins, S. (eds.) 9th Workshop on Evaluation and Usability of Programming Languages and Tools (PLATEAU 2018), vol. 67, pp. 4:1–4:14. Schloss Dagstuhl – Leibniz-Zentrum fĂĽr Informatik (2019). https://doi.org/10.4230/OASIcs.PLATEAU.2018.4

  26. Huang, Y., Martonosi, M.: Statistical assertions for validating patterns and finding bugs in quantum programs. In: Proceedings of the 46th International Symposium on Computer Architecture, pp. 541-553. ACM, New York, NY, USA (2019). https://doi.org/10.1145/3307650.3322213

  27. Hynninen, T., Kasurinen, J., Knutas, A., Taipale, O.: Software testing: survey of the industry practices. In: 2018 41st International Convention on Information and Communication Technology, Electronics and Microelectronics (MIPRO), pp. 1449–1454 (2018). https://doi.org/10.23919/MIPRO.2018.8400261

  28. Javadi-Abhari, A., et al.: Quantum computing with Qiskit (2024). https://doi.org/10.48550/arXiv.2405.08810

  29. Knill, E.: Conventions for quantum pseudocode (2022). https://doi.org/10.48550/arXiv.2211.02559

  30. Liu, J., Byrd, G.T., Zhou, H.: Quantum circuits for dynamic runtime assertions in quantum computation. In: Proceedings of the Twenty-Fifth International Conference on Architectural Support for Programming Languages and Operating Systems, ASPLOS 2020, pp 1017-1030. ACM, New York, NY, USA (2020). https://doi.org/10.36227/techrxiv.11319929

  31. Luthmann, L., Mennicke, S., Lochau, M.: Compositionality, decompositionality and refinement in input/output conformance testing. In: Kouchnarenko, O., Khosravi, R. (eds.) FACS 2016. LNCS, vol. 10231, pp. 54–72. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-57666-4_5

    Chapter  Google Scholar 

  32. Mendiluze, E., Ali, S., Arcaini, P., Yue, T.: Muskit: a mutation analysis tool for quantum software testing. In: 2021 36th IEEE/ACM International Conference on Automated Software Engineering (ASE), pp. 1266–1270 (2021). https://doi.org/10.1109/ASE51524.2021.967856

  33. Miranskyy, A., Zhang, L.: On Testing quantum programs. In: 2019 IEEE/ACM 41st International Conference on Software Engineering: New Ideas and Emerging Results (ICSE-NIER), pp. 57–60 (2019). https://doi.org/10.1109/ICSE-NIER.2019.00023

  34. Miranskyy, A., Zhang, L., Doliskani, J.: On testing and debugging quantum software (2021). https://doi.org/10.48550/arXiv.2103.09172

  35. Moore, C., Crutchfield, J.P.: Quantum automata and quantum grammars. Theoret. Comput. Sci. 237(1), 275–306 (2000). https://doi.org/10.1016/S0304-3975(98)00191-1

    Article  MathSciNet  Google Scholar 

  36. Nielsen, M.A., Chuang, I.L.: Quantum Computation and Quantum Information. Cambridge University Press, Cambridge (2010)

    Google Scholar 

  37. Peham, T., Burgholzer, L., Wille, R.: Equivalence checking of quantum circuits with the ZX-calculus. IEEE J. Emerg. Sel. Top. Circ. Syst. 12(3), 662–675 (2022). https://doi.org/10.1109/JETCAS.2022.3202204

    Article  Google Scholar 

  38. Preskill, J.: Quantum computing in the NISQ era and beyond. Quantum 2, 79 (2018). https://doi.org/10.22331/q-2018-08-06-79

  39. Segala, R.: Testing probabilistic automata. In: Montanari, U., Sassone, V. (eds.) CONCUR 1996. LNCS, vol. 1119, pp. 299–314. Springer, Heidelberg (1996). https://doi.org/10.1007/3-540-61604-7_62

    Chapter  Google Scholar 

  40. Selinger, P., Valiron, B.: A lambda calculus for quantum computation with classical control. In: Urzyczyn, P. (ed.) TLCA 2005. LNCS, vol. 3461, pp. 354–368. Springer, Heidelberg (2005). https://doi.org/10.1007/11417170_26

    Chapter  Google Scholar 

  41. Shor, P.: Algorithms for quantum computation: discrete logarithms and factoring. In: Proceedings 35th Annual Symposium on Foundations of Computer Science, pp. 124–134 (1994). https://doi.org/10.1109/SFCS.1994.365700

  42. Tretmans, J.: Test generation with inputs, outputs and repetitive quiescence. Softw. Concepts Tools 17(3), 103–120 (1996), https://api.semanticscholar.org/CorpusID:8056400

  43. Wang, J., Gao, M., Jiang, Y., Lou, J., Gao, Y., Zhang, D., Sun, J.: QuanFuzz: fuzz testing of quantum program (2018). https://doi.org/10.48550/arXiv.1810.10310

  44. Wang, Q., Liu, J., Ying, M.: Equivalence checking of quantum finite-state machines. J. Comput. Syst. Sci. 116, 1–21 (2021). https://doi.org/10.1016/j.jcss.2020.08.004

    Article  MathSciNet  Google Scholar 

  45. Wang, X., Arcaini, P., Yue, T., Ali, S.: Application of combinatorial testing to quantum programs. In: 2021 IEEE 21st International Conference on Software Quality, Reliability and Security (QRS), pp. 179–188 (2021). https://doi.org/10.1109/QRS54544.2021.00029

  46. Ying, M., Feng, Y.: Model checking quantum systems — a survey (2018). https://doi.org/10.48550/arXiv.1807.09466

  47. Zhao, J.: Quantum software engineering: landscapes and horizons. CoRR abs/2007.07047 (2020)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Malte Lochau .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2025 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Lochau, M., Schaefer, I. (2025). Model-Based Testing of Quantum Computations. In: Huisman, M., Howar, F. (eds) Tests and Proofs. TAP 2024. Lecture Notes in Computer Science, vol 15153. Springer, Cham. https://doi.org/10.1007/978-3-031-72044-4_7

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-72044-4_7

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-72043-7

  • Online ISBN: 978-3-031-72044-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics