Abstract
Dynamic Quantum Logic (DQL) has been used as a logical framework for manually proving the correctness of quantum programs. This paper presents an automated approach to quantum program verification at the cost of simplifying DQL to Basic Dynamic Quantum Logic (BDQL). We first formalize quantum states, quantum gates, and projections in bra-ket notation and use a set of laws from quantum mechanics and matrix operations to reason on quantum computation. We then formalize the semantics of BQDL and specify the behavior and desired properties of quantum programs in the scope of BDQL. Formal verification of whether a quantum program satisfies desired properties is conducted automatically through an equational simplification process. We use Maude, a rewriting logic-based specification/programming language, to implement our approach. To demonstrate the effectiveness of our automated approach, we successfully verified the correctness of five quantum protocols: Superdense Coding, Quantum Teleportation, Quantum Secret Sharing, Entanglement Swapping, and Quantum Gate Teleportation, using our support tool.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
References
Akatov, D.: The logic of quantum program verification. Master’s thesis, Oxford University (2005)
Baltag, A., Smets, S.: LQP: the dynamic logic of quantum information. Math. Struct. Comput. Sci. 16(3), 491–525 (2006)
Baltag, A., Bergfeld, J., Kishida, K., Sack, J., Smets, S., Zhong, S.: PLQP & company: decidable logics for quantum algorithms. Int. J. Theor. Phys. 53(10), 3628–3647 (2014)
Baltag, A., Smets, S.: Reasoning about quantum information: an overview of quantum dynamic logic. Appli. Sci. 12(9) (2022)
Bennett, C.H., Brassard, G., Crépeau, C., Jozsa, R., Peres, A., Wootters, W.K.: Teleporting an unknown quantum state via dual classical and Einstein-Podolsky-Rosen channels. Phys. Rev. Lett. 70, 1895–1899 (1993)
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)
Bergfeld, J.M., Sack, J.: Deriving the correctness of quantum protocols in the probabilistic logic for quantum programs. Soft. Comput. 21(6), 1421–1441 (2017)
Biamonte, J., Wittek, P., Pancotti, N., Rebentrost, P., Wiebe, N., Lloyd, S.: Quantum machine learning. Nature 549(7671), 195–202 (2017)
Birkhoff, G., von Neumann, J.: The logic of quantum mechanics. Ann. Math. 57(4), 823–843 (1936)
Clavel, M., Durán, F., Eker, S., Lincoln, P., Martí-Oliet, N., Meseguer, J., Talcott, C.L. (eds.): All About Maude - A High-Performance Logical Framework, How to Specify, Program and Verify Systems in Rewriting Logic. LNCS, vol. 4350. Springer (2007). https://doi.org/10.1007/978-3-540-71999-1
Do, C.M., Ogata, K.: Symbolic model checking quantum circuits in maude. In: The 35th International Conference on Software Engineering and Knowledge Engineering, SEKE 2023 (2023)
Farhi, E., Goldstone, J., Gutmann, S., Lapan, J., Lundgren, A., Preda, D.: A quantum adiabatic evolution algorithm applied to random instances of an np-complete problem. Science 292(5516), 472–475 (2001)
Gay, S., Nagarajan, R., Papanikolaou, N.: Probabilistic model-checking of quantum protocols. arXiv preprint quant-ph/0504007 (2005)
Gottesman, D., Chuang, I.L.: Demonstrating the viability of universal quantum computation using teleportation and single-qubit operations. Nature 402(6760), 390–393 (1999)
Hardegree, G.M.: The conditional in quantum logic. Synthese, 63–80 (1974)
Harel, D., Kozen, D., Tiuryn, J.: Dynamic Logic. MIT Press (2000)
Harrow, A.W., Hassidim, A., Lloyd, S.: Quantum algorithm for linear systems of equations. Phys. Rev. Lett. 103, 150502 (2009)
Herman, L., Marsden, E.L., Piziak, R.: Implication connectives in orthomodular lattices. Notre Dame J. Formal Logic 16(3), 305–328 (1975)
Hillery, M., Bužek, V., Berthiaume, A.: Quantum secret sharing. Phys. Rev. A 59, 1829–1834 (1999)
Meseguer, J.: Twenty years of rewriting logic. J. Log. Algebraic Methods Program 81(7–8), 721–781 (2012)
Nielsen, M.A., Chuang, I.L.: Quantum Computation and Quantum Information: 10th Anniversary Edition. Cambridge University Press (2011)
Paykin, J., Rand, R., Zdancewic, S.: Qwire: a core language for quantum circuits. SIGPLAN Not. 52(1), 846–858 (2017)
Rédei, M.: Quantum logic in algebraic approach. FTPH, vol. 91. Springer (1998). https://doi.org/10.1007/978-94-015-9026-6
Shor, P.: Algorithms for quantum computation: discrete logarithms and factoring. In: Proceedings 35th Annual Symposium on Foundations of Computer Science, pp. 124–134 (1994)
Ying, M.: Floyd-hoare logic for quantum programs. ACM Trans. Program. Lang. Syst. (TOPLAS) 33(6), 1–49 (2012)
Ying, M., Feng, Y.: Quantum loop programs. Acta Informatica 47(4), 221–250 (2010)
Ying, M., Feng, Y.: Model checking quantum systems – a survey (2018)
Żukowski, M., Zeilinger, A., Horne, M.A., Ekert, A.K.: “Event-ready-detectors” Bell experiment via entanglement swapping. Phys. Rev. Lett. 71, 4287–4290 (1993)
Acknowledgements
The authors are grateful to the anonymous reviewers for their valuable feedback. The research was supported by JAIST Research Grant for Fundamental Research. The research of the first author was supported by Grant-in-Aid for JSPS Research Fellow Grant Number JP22KJ1483. The research of the second and the third authors was supported by JST SICORP Grant Number JPMJSC20C2 and JSPS KAKENHI Grant Number JP24H03370.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Appendix
Appendix
1.1 Proof of Theorem 1
Before embarking on the proof of Theorem 1, we show a lemma.
Lemma 1
The following holds for any M:
-
1.
\([\![[\textbf{skip}]A]\!]^M=[\![A]\!]^M\);
-
2.
\([\![[\textbf{abort}]A]\!]^M=\mathcal {H}\);
-
3.
\([\![[\textbf{abort};b]A]\!]^M=[\![[\textbf{abort}]A]\!]^M\);
-
4.
\([\![[\textbf{skip};b]A]\!]^M=[\![[b]A]\!]^M\);
-
5.
\([\![[(a\mathrel {;}b)\mathrel {;}c]A]\!]^M=[\![[a\mathrel {;}(b\mathrel {;}c)]A]\!]^M\);
-
6.
\([\![[(a\cup b)\mathrel {;}c]A]\!]^M=[\![(a\mathrel {;}c)\cup (b\mathrel {;}c)]A]\!]^M\);
-
7.
\([\![[a\mathrel {;}b]A]\!]^M=[\![[a][b]A]\!]^M\);
-
8.
\([\![[a\cup b]A]\!]^M=[\![[a]A]\!]^M\cap [\![[b]A]\!]^M\);
-
9.
\([\![[B?]A]\!]^M=[\![B\rightarrow A]\!]^M\in \mathcal {C}(\mathcal {H})\), where \(B\rightarrow A\) denotes the Sasaki hook [18] defined as \(\lnot (A\wedge \lnot (A\wedge B))\).
Proof
1 to 8 are easy to show. For 9, some knowledge of Hilbert space theory is required. Observe that \([\![[B?]A]\!]^M\) is the inverse image \(P_{[\![B]\!]^M}^{-1}([\![A]\!]^M)\) of \([\![A]\!]^M\) under \(P_{[\![B]\!]^M}\). That is,
Therefore, \([\![[B?]A]\!]^M=[\![B\rightarrow A]\!]^M\in \mathcal {C}(\mathcal {H})\) (see [15]).
We use Lemma 1 to prove Theorem 1 without mentioning it.
Proof
We prove by simultaneous structural induction on formulas in BDQL and star-free regular programs. The case \(A=p\in L_0\) is immediate. The cases \(A=\lnot B\) and \(A=B\wedge C\) follow from the basic fact in Hilbert space theory. Thus, we only discuss the case \(A=[a]B\).
-
Case 1 \(a=\textbf{skip}\). We have \([\![[a]B]\!]^M=[\![B]\!]^M\in \mathcal {C}(\mathcal {H})\) by the induction hypothesis \([\![B]\!]^M\in \mathcal {C}(\mathcal {H})\).
-
Case 2 \(a=\textbf{abort}\). We have \([\![[a]B]\!]^M=\mathcal {H}\in \mathcal {C}(\mathcal {H})\).
-
Case 3 \(a=\pi \in \varPi _0\). Observe that \([\![[a]B]\!]^M\) is the inverse image of \([\![B]\!]^M\) under v(a). In other words, \([\![[a]B]\!]^M\) is the image \((v(a)^\dagger )([\![B]\!]^M)\) of \([\![B]\!]^M\) under the adjoint operator \(v(a)^\dagger \) of v(a). Let \(X^\perp \) be the orthogonal complement of a subspace X of \(\mathcal {H}\), and write \(X^{\perp \perp }\) for \((X^\perp )^\perp \). Recall that \(X\in \mathcal {C}(\mathcal {H})\) if and only if \(X^{\perp \perp }=X\). By the induction hypothesis \([\![B]\!]^M\in \mathcal {C}(\mathcal {H})\),
$$\begin{aligned} ([\![[a]B]\!]^M)^{\perp \perp }&=((v(a)^\dagger )([\![B]\!]^M))^{\perp \perp }=((v(a)^\dagger )(([\![B]\!]^M)^\perp ))^\perp \\ &=(v(a)^\dagger )(([\![B]\!]^M)^{\perp \perp })=(v(a)^\dagger )([\![B]\!]^M)=[\![[a]B]\!]^M. \end{aligned}$$Consequently, \([\![[a]B]\!]^M\in \mathcal {C}(\mathcal {H})\).
-
Case 4 \(a=b\mathrel {;}c\). We further split the case with respect to b.
-
Case 4.1 \(b=\textbf{skip}\). \([\![[a]B]\!]^M=[\![[c]B]\!]^M\in \mathcal {C}(\mathcal {H})\) by the induction hypothesis \([\![[c]B]\!]^M\in \mathcal {C}(\mathcal {H})\).
-
Case 4.2 \(b=\textbf{abort}\). \([\![[a]B]\!]^M=[\![[\textbf{abort}]B]\!]^M=\mathcal {H}\in \mathcal {C}(\mathcal {H})\).
-
Case 4.3 \(b=\pi \). \([\![[a]B]\!]^M=[\![[\pi ][c]B]\!]^M\). By the induction hypothesis, \([\![[c]B]\!]^M\in \mathcal {C}(\mathcal {H})\). Thus, it follows from the similar argument of case 3 above that \([\![[a]B]\!]^M\in \mathcal {C}(\mathcal {H})\).
-
Case 4.4 \(b=b_1\mathrel {;}b_2\).
$$ [\![[a]B]\!]^M=[\![[b_1\mathrel {;}(b_2\mathrel {;}c)]B]\!]^M=[\![[b_1][b_2\mathrel {;}c]B]\!]^M\in \mathcal {C}(\mathcal {H}) $$by the induction hypothesis \([\![[b_1][b_2\mathrel {;}c]B]\!]^M\in \mathcal {C}(\mathcal {H})\).
-
Case 4.5 \(b=b_1\cup b_2\).
$$ [\![[a]B]\!]^M=[\![[(b_1\mathrel {;}c)\cup (b_2\mathrel {;}c)]B]\!]^M=[\![[b_1\mathrel {;}c]B]\!]^M\cap [\![[b_2\mathrel {;}c]B]\!]^M\in \mathcal {C}(\mathcal {H}) $$by the induction hypothesis \([\![[b_1\mathrel {;}c]B]\!]^M,[\![[b_2\mathrel {;}c]B]\!]^M\in \mathcal {C}(\mathcal {H})\).
-
Case 4.6 \(b=C?\).
$$ [\![[a]B]\!]^M=[\![[C?][c]B]\!]^M=[\![C\rightarrow [c]B]\!]^M\in \mathcal {C}(\mathcal {H}) $$by the induction hypothesis \([\![C]\!]^M,[\![[c]B]\!]^M\in \mathcal {C}(\mathcal {H})\).
-
-
Case 5 \(a=b\cup c\). We have \([\![[a]B]\!]^M=[\![[b]B]\!]^M\cap [\![[c]B]\!]^M\in \mathcal {C}(\mathcal {H})\) by the induction hypothesis \([\![[b]B]\!]^M,[\![[c]B]\!]^M\in \mathcal {C}(\mathcal {H})\).
-
Case 6 \(a=C?\). We have \([\![[C?]B]\!]^M=[\![C\rightarrow B]\!]^M\in \mathcal {C}(\mathcal {H})\) by the induction hypothesis \([\![B]\!]^M,[\![C]\!]^M\in \mathcal {C}(\mathcal {H})\).
Rights and permissions
Copyright information
© 2024 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Takagi, T., Do, C.M., Ogata, K. (2024). Automated Quantum Program Verification in Dynamic Quantum Logic. In: Gierasimczuk, N., Velázquez-Quesada, F.R. (eds) Dynamic Logic. New Trends and Applications. DaLí 2023. Lecture Notes in Computer Science, vol 14401. Springer, Cham. https://doi.org/10.1007/978-3-031-51777-8_5
Download citation
DOI: https://doi.org/10.1007/978-3-031-51777-8_5
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-51776-1
Online ISBN: 978-3-031-51777-8
eBook Packages: Computer ScienceComputer Science (R0)