Skip to main content

A Static Analysis of Entanglement

  • Conference paper
  • First Online:
Verification, Model Checking, and Abstract Interpretation (VMCAI 2025)

Abstract

Managing quantum variables in quantum programs presents specific challenges due to the possible occurrence of entanglement, the quantum mechanical phenomenon for which two variables can reach a state where they cannot be separated into two distinct individual states. Such a phenomenon may lead to critical issues due to unintended measurements, which may alter the outcome of computations involving entangled variables. To address this problem, we propose a static analysis based on the abstract interpretation framework to soundly and automatically detect entanglement occurring in quantum programs. By constructing an abstract domain for the entanglement property, our analysis identifies cases where side effects from quantum operations may produce unwanted entanglement, thus reducing the possibility of unintended computational side effects.

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

Notes

  1. 1.

    Danny Greenberg, Mike Horne, and Anton Zeilinger experimentally created this three-particle entanglement showing that quantum mechanics is not compatible with Einstein’s theory of ‘hidden variables’.

  2. 2.

    We refer here to the Hilbert space vector norm defined as \(\Vert \left| {\psi }\right\rangle \Vert = \sqrt{\langle \psi \rangle }\), where \(\left\langle {\psi }\right| \) is the conjugate transpose of \(\left| {\psi }\right\rangle \) and \(\langle x\rangle {y}\) is the inner product between vector \(\left| {x}\right\rangle \) and vector \(\left| {y}\right\rangle \).

  3. 3.

    In [2] we call the direct inseparability property as being at the same level.

  4. 4.

    The following GitHub repository NicolaAssolini98/EntaglementAnalysis contains our prototype implemented in Python.

References

  1. Aleksandrowicz, G., et al.: Qiskit: an Open-source Framework for Quantum Computing (Jan 2019). https://doi.org/10.5281/zenodo.2562111

  2. Assolini, N., Di Pierro, A., Mastroeni, I.: Abstracting entanglement. In: Proceedings of the 10th ACM SIGPLAN International Workshop on Numerical and Symbolic Abstract Domains (NSAD 2024) (2024). https://doi.org/10.1145/3689609.3689998

  3. Assolini, N., Di Pierro, A., Mastroeni, I.: Static analysis of quantum programs. In: Static Analysis: 31th International Symposium, SAS 2024, Pasadena, USA, 20-22 October 2024. Proceedings. Springer (2024)

    Google Scholar 

  4. Bennett, C.H., Wiesner, S.J.: Communication via one- and two-particle operators on einstein-podolsky-rosen states. Phys. Rev. Lett. 69, 2881–2884 (1992). https://doi.org/10.1103/PhysRevLett.69.2881, https://link.aps.org/doi/10.1103/PhysRevLett.69.2881

  5. Boykin, P., Mor, T., Pulver, M., Roychowdhury, V., Vatan, F.: A new universal and fault-tolerant quantum basis. Inform. Process. Lett. 75(3), 101–107 (2000). https://doi.org/10.1016/S0020-0190(00)00084-3, https://www.sciencedirect.com/science/article/pii/S0020019000000843

  6. Bruni, R., Giacobazzi, R., Gori, R., Ranzato, F.: A correctness and incorrectness program logic. J. ACM 70(2) (2023). https://doi.org/10.1145/3582267

  7. Cousot, P., Cousot, R.: Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In: Proceedings of the 4th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages, POPL 1977, pp. 238-252. Association for Computing Machinery, New York (1977). https://doi.org/10.1145/512950.512973, https://doi.org/10.1145/512950.512973

  8. Cousot, P., Cousot, R.: Systematic design of program analysis frameworks. In: Proceedings of the 6th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages. p. 269-282. POPL ’79, Association for Computing Machinery, New York, NY, USA (1979). https://doi.org/10.1145/567752.567778, https://doi.org/10.1145/567752.567778

  9. Deutsch, D., Penrose, R.: Quantum theory, the church-turing principle and the universal quantum computer. Proc. Royal Soc. London. A. Mathe. Phys. Sci. 400(1818), 97–117 (1985). https://doi.org/10.1098/rspa.1985.0070, https://royalsocietypublishing.org/doi/abs/10.1098/rspa.1985.0070

  10. Di Pierro, A., Mancini, S., Memarzadeh, L., Mengoni, R.: Homological analysis of multi-qubit entanglement. Europhy. Lett. 123(3), 30006 (2018). https://doi.org/10.1209/0295-5075/123/30006

  11. Feng, Y., Li, S.: Abstract interpretation, Hoare logic, and incorrectness logic for quantum programs. Inform. Comput. 294, 105077 (2023). https://doi.org/10.1016/j.ic.2023.105077, https://www.sciencedirect.com/science/article/pii/S0890540123000809

  12. Ferrara, P., Negrini, L., Arceri, V., Cortesi, A.: Static analysis for dummies: experiencing LiSA. In: Proceedings of the 10th ACM SIGPLAN International Workshop on the State Of the Art in Program Analysis, pp. 1-6. SOAP 2021. Association for Computing Machinery, New York (2021). https://doi.org/10.1145/3460946.3464316

  13. Fürntratt, H., Schnabl, P., Krebs, F., Unterberger, R., Zeiner, H.: Towards higher abstraction levels in quantum computing. In: International Conference on Service-Oriented Computing, pp. 162–173. Springer (2023). https://doi.org/10.1007/978-981-97-0989-2_13

  14. Gottesman, D.: The heisenberg representation of quantum computers. arXiv preprint quant-ph/9807006 (1998)

    Google Scholar 

  15. Green, A.S., Lumsdaine, P.L.F., Ross, N.J., Selinger, P., Valiron, B.: An introduction to quantum programming in quipper. In: Dueck, G.W., Miller, D.M. (eds.) RC 2013. LNCS, vol. 7948, pp. 110–124. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-38986-3_10

    Chapter  MATH  Google Scholar 

  16. Guo, J., et al.: isq: an integrated software stack for quantum programming. IEEE Trans. Quantum Eng. 4, 1–16 (2023). https://doi.org/10.1109/TQE.2023.3275868

    Article  MATH  Google Scholar 

  17. Heim, B., et al.: Quantum programming languages. Nat. Rev. Phys. 2(12), 709–722 (2020). https://doi.org/10.1038/s42254-020-00245-7

    Article  MATH  Google Scholar 

  18. Honda, K.: Analysis of quantum entanglement in quantum programs using stabilizer formalism. arXiv preprint arXiv:1511.01572 (2015)

  19. JavadiAbhari, A., et al.: Scaffcc: a framework for compilation and analysis of quantum computing programs. In: Proceedings of the 11th ACM Conference on Computing Frontiers, CF 2014, Association for Computing Machinery, New York(2014). https://doi.org/10.1145/2597917.2597939

  20. Kaye, P., Laflamme, R., Mosca, M.: An introduction to quantum computing. OUP Oxford (2006)

    Google Scholar 

  21. Khedker, U.P., Sanyal, A., Sathe, B.: Data Flow Analysis: Theory and Practice. CRC Press, 1st edn. (2009). https://doi.org/10.1201/9780849332517

  22. Nielsen, M.A., Chuang, I.L.: Quantum Computation and Quantum Information: 10th Anniversary Edition. Cambridge University Press (2010)

    Google Scholar 

  23. O’Hearn, P.W.: Incorrectness logic. Proc. ACM Program. Lang. 4(POPL) (2019). https://doi.org/10.1145/3371078

  24. Paykin, J., Rand, R., Zdancewic, S.: Qwire: a core language for quantum circuits. SIGPLAN Not. 52(1), 846–858 (2017). https://doi.org/10.1145/3093333.3009894

  25. Peng, Y., Ying, M., Wu, X.: Algebraic reasoning of quantum programs via non-idempotent kleene algebra. In: Proceedings of the 43rd ACM SIGPLAN International Conference on Programming Language Design and Implementation, PLDI 2022, pp. 657-670. Association for Computing Machinery, New York (2022). https://doi.org/10.1145/3519939.3523713, https://doi.org/10.1145/3519939.3523713

  26. Perdrix, S.: Quantum patterns and types for entanglement and separability. Electr. Notes Theoret. Comput. Sci. 170, 125–138 (2007). https://doi.org/10.1016/j.entcs.2006.12.015, https://www.sciencedirect.com/science/article/pii/S157106610700059X, proceedings of the 3rd International Workshop on Quantum Programming Languages (QPL 2005)

  27. Perdrix, S.: Quantum entanglement analysis based on abstract interpretation. In: Alpuente, M., Vidal, G. (eds.) SAS 2008. LNCS, vol. 5079, pp. 270–282. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-69166-2_18

    Chapter  MATH  Google Scholar 

  28. Quantinuum: guppylang (2024). https://github.com/CQCL/guppylang

  29. Rand, R., Sundaram, A., Singhal, K., Lackey, B.: Extending gottesman types beyond the clifford group. In: The Second International Workshop on Programming Languages for Quantum Computing (PLanQC 2021) (2021)

    Google Scholar 

  30. Rand, R., Sundaram, A., Singhal, K., Lackey, B.: Gottesman types for quantum programs. arXiv preprint arXiv:2109.02197 (2021)

  31. Seidel, R., et al.: Qrisp: A framework for compilable high-level programming of gate-based quantum computers (2024). https://arxiv.org/abs/2406.14792

  32. Seidl, H., Wilhelm, R., Hack, S.: Compiler Design: Analysis and Transformation. Springer (2012)

    Google Scholar 

  33. Vidal, G.: Entanglement monotones. J. Mod. Optics 47(2-3), 355–376 (2000). https://doi.org/10.1080/09500340008244048, https://www.tandfonline.com/doi/abs/10.1080/09500340008244048

  34. Ward, M.: The closure operators of a lattice. Annals Math. 43(2), 191–196 (1942). https://doi.org/10.2307/1968865, http://www.jstor.org/stable/1968865

  35. Winskel, G.: The formal semantics of programming languages: an introduction. MIT press (1993)

    Google Scholar 

  36. Ying, M.: Floyd–hoare logic for quantum programs. ACM Trans. Program. Lang. Syst. 33(6) (2012). https://doi.org/10.1145/2049706.2049708

  37. Ying, M.: Foundations of quantum programming. Morgan Kaufmann (2016)

    Google Scholar 

  38. Yu, N., Palsberg, J.: Quantum abstract interpretation. In: Proceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation, PLDI 2021, pp. 542-558. Association for Computing Machinery, New York (2021). https://doi.org/10.1145/3453483.3454061, https://doi.org/10.1145/3453483.3454061

  39. Yuan, C., McNally, C., Carbin, M.: Twist: sound reasoning for purity and entanglement in quantum programs. Proc. ACM Program. Lang. 6(POPL) (2022). https://doi.org/10.1145/3498691

Download references

Acknowledgment

Alessandra Di Pierro was supported by INdAM - GNCS Project CUP_E53C22001930001, Isabella Mastroeni by the project SERICS (PE00000014) under the MUR National Recovery and Resilience Plan funded by the European Union - NextGenerationEU and by PRIN2022PNRR “RAP-ARA” (PE6) - MUR: P2022HXNSC.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Nicola Assolini .

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

Assolini, N., Di Pierro, A., Mastroeni, I. (2025). A Static Analysis of Entanglement. In: Shankaranarayanan, K., Sankaranarayanan, S., Trivedi, A. (eds) Verification, Model Checking, and Abstract Interpretation. VMCAI 2025. Lecture Notes in Computer Science, vol 15530. Springer, Cham. https://doi.org/10.1007/978-3-031-82703-7_3

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-82703-7_3

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-82702-0

  • Online ISBN: 978-3-031-82703-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics