Next Article in Journal
High-Payload Data-Hiding Method for AMBTC Decompressed Images
Next Article in Special Issue
The Triangle Wave Versus the Cosine: How Classical Systems Can Optimally Approximate EPR-B Correlations
Previous Article in Journal
Structure and Phase Composition of a W-Ta-Mo-Nb-V-Cr-Zr-Ti Alloy Obtained by Ball Milling and Spark Plasma Sintering
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A First Step to the Categorical Logic of Quantum Programs

1
Department of foundation of computer science, the John Paul II Catholic University of Lublin, 20-950 Lublin, Poland
2
Institute of logic and cognition, Sun Yat-sen University, Guangzhou 510970, China
*
Author to whom correspondence should be addressed.
Entropy 2020, 22(2), 144; https://doi.org/10.3390/e22020144
Submission received: 2 December 2019 / Revised: 1 January 2020 / Accepted: 7 January 2020 / Published: 24 January 2020
(This article belongs to the Special Issue Foundations of Quantum Mechanics and Quantum Information Theory)

Abstract

:
The long-term goal of our research is to develop a powerful quantum logic which is useful in the formal verification of quantum programs and protocols. In this paper we introduce the basic idea of our categorical logic of quantum programs (CLQP): It combines the logic of quantum programming (LQP) and categorical quantum mechanics (CQM) such that the advantages of both LQP and CQM are preserved while their disadvantages are overcome. We present the syntax, semantics and proof system of CLQP. As a proof-of-concept, we apply CLQP to verify the correctness of Deutsch’s algorithm and the concealing property of quantum bit commitment.

1. Introduction

Quantum programs and quantum protocols are two pillars of quantum computing. The exponential speedup provided by Shor’s factoring algorithm and the quadratic speedup provided by Grover’s search algorithm over their classical counterparts has brought quantum computing into the limelight. The unconditional security offered by quantum protocols such as quantum key distribution has grabbed strong interests from both the academic and the industrial community. Designing quantum programs and protocols is an error-prone task due to the counter-intuitive nature of quantum systems. Therefore, verification techniques for quantum programs and quantum protocols will be indispensable in the coming era of quantum computation. For example, a number of quantum process calculi [1,2,3,4] have been proposed for the formal verification of quantum protocols. Some quantum logics have been developed to verify both quantum programs and quantum protocols.
Quantum logic began with Birkhoff and von Neumann [5]. Traditional quantum logic [5,6,7,8,9,10] focuses on the order-theoretic structure of testable properties in the quantum world and is based on the lattice of closed subspaces of a (usually infinite dimensional) Hilbert space. The success of quantum computation and quantum information has inspired new quantum logics [11,12] which are based on finite dimensional Hilbert spaces, such as qubits. Brunet and Jorrand [13] proposed to extend the Birkhoff–von Neumann quantum logic to reasoning about quantum programs. Chadha et al. [14] presented a first attempt to develop a Hoare-like logic for quantum programs. Some useful proof rules for reasoning about quantum programs were introduced by Fenget et al. [15]. A full-fledged Hoare-like logic for both partial and total correctness of quantum programs was established in Ying [16].
The logic for quantum programs (LQP) [17,18,19,20,21] is an extension of traditional quantum logic and quantum Hoare logic. It has been used to verify quantum search algorithms [20], quantum leader election [20], quantum key distribution [21] and quantum voting [22]. The expressive power of LQP is largely determined by the constant symbols it incorporates. There is no systematic study of constant symbols in the literature of LQP. In Baltag and Smets [18], the authors chose the following unitary operators as constant symbols: X, Z, H and CNOT. In Rad et al. [22], Bell states are used as constant symbols. Those operators are not universal. Therefore, there are still many quantum states and operators that cannot be expressed in LQP. Another limitation of the presentation of constant symbols in LQP is the missing satisfying axiomatization. Different axioms for different constant symbols are introduced, depending on which programs/protocols are to be verified. These two limitations make LQP not a convenient tool in the formal verification of quantum programs and protocols: To verify a quantum program or protocol in LQP, we have to first find an appropriate set of constant symbols to express the program/protocol, then we still need to introduce a set of axioms for these constant symbols such that some desired properties of the targeting program/protocol can be proved axiomatically. This procedure usually consumes a lot of time and intelligence. We believe that LQP cannot be successful in formal verification if these two limitations are not overcome.
In this paper, we will overcome these limitations by extending LQP to the categorical logic of quantum programs (CLQP). CLQP is a combination of LQP and categorical quantum mechanics (CQM) [23,24,25,26]. The main feature of the construction of CLQP is the representation of constant symbols of LQP by morphisms in the ZX-calculus, a graphical calculus of CQM. Inherited from the universality of the ZX-calculus [24], CLQP has stronger expressive power than LQP. CLQP also inherits the graphical axiomatization of the ZX-calculus such that many properties of a quantum program and protocols can be proved concisely and graphically, when the program/protocol is specified in CLQP. On the other hand, CLQP preserves the various logical operations (for example, boolean connectives, programs constructors, epistemic modality and probabilistic modality) of LQP. These operations allow us to express various properties that are not expressible in CQM. In a nutshell, CLQP keeps the advantages of both LQP and CQM, while overcoming their limitations. These features make CLQP a powerful tool for the formal specification and verification of quantum programs and protocols.
The structure of this paper is as follows. In Section 2 we will introduce the syntax, semantics and axiomatization of CLQP. Then in Section 3 we apply CLQP to the verification of quantum programs and protocols. We conclude this paper with future work in Section 4.

2. Categorical Logic for Quantum Programs

2.1. Syntax

For each natural number n 1 , we build the n-qubit categorical logic of quantum programs CLQP n . To build the language of CLQP n , we are given the following: A finite set of natural numbers N = { 1 , , n } , a countable set of propositional variables P , a countable set of operational variables O , constants symbols of propositions and unitary operations built from the ZX-calculus.

2.1.1. Constants from Categorical Quantum Mechanics

Categorical quantum mechanics is the study of quantum computation and quantum foundations using category theory. The ZX-calculus, a graphical language of quantum computation developed in the framework of CQM, is introduced by Coecke and Duncan [24,27]. It is founded on a dagger symmetric monoidal category (†-SMC) C . (A concise introduction to †-SMC is provided in the Appendix A.)
The objects of C are natural numbers: 0 , 1 , 2 , ; the tensor of objects is just the addition of numbers: m n = m + n . 0 is the unit object of C . In the matrix interpretation of the ZX-calculus, an object n is interpreted as the 2 n dimensional Hilbert space C 2 n . An identity morphism of C is interpreted as the identity map on the corresponding Hilbert space. A swap morphism σ m , n is interpreted as the map S W A P m , n to which we have S W A P m , n ( | a | b ) = | b | a for all | a C 2 m and | b C 2 n . Apart from the identity morphisms and swap morphisms, the following are also the basic morphisms of C :
  • Z-spiders Z m n ( α ) : m n , for every real number α R , of which the matrix interpretation and graphical representation are respectively
    Entropy 22 00144 i001
    We call α the phase of Z m n ( α ) . The graph is read from bottom to top. We consider the wires at the bottom as input and those on the top as output. We usually omit the phase in the graphical representation when it is 0.
  • X-spiders X m n ( α ) : m n , for every real number α R , of which the matrix interpretation and graphical representation are respectively
    Entropy 22 00144 i002
    Similarly, we call α the phase of X m n ( α ) .
  • The identity morphism I d : 1 1 . The matrix interpretation of I d is the identity map on the Hilbert space C 2 . The graphical representation of I d is a straight line
    Entropy 22 00144 i003
  • The H-box H : 1 1 , of which the matrix interpretation and graphical representation are respectively
    Entropy 22 00144 i004
  • e : 0 0 is interpreted as the number 1. The graphical representation of e is the empty graph
    Entropy 22 00144 i005
  • SWAP morphism σ : 2 2 , of which the matrix interpretation and graphical representation are respectively
    Entropy 22 00144 i006
  • Bell state β : 0 2 , of which the matrix interpretation and graphical representation are respectively
    Entropy 22 00144 i007
  • Bell effect β : 2 0 , of which the matrix interpretation and graphical representation are respectively
    Entropy 22 00144 i008
The morphisms of C are generated by applying sequential and parallel composition of the basic morphisms, or by applying the dagger operation † to a morphism. The matrix interpretation of sequential and parallel composition of morphisms is the matrix production and tensor product, respectively. The graphical representation of sequential composition of morphisms is to put one graph on top of another, while the parallel composition of morphisms is represented by putting graphs side-by-side. The matrix interpretation of † is the adjoint operation. The graphical representation of † is to turn the graph upside-down, meanwhile changing the sign of phases that appear in the graph.
The ZX-calculus is a universal language for quantum computing in the sense that it can represent all linear maps between qubit systems. Another impressive feature of the ZX-calculus is that it admits a sound and complete axiomatization [28,29,30] to derive equations between morphisms. The axiomatization of the ZX-calculus will play an important role in the axiomatization of CLQP. There are two kinds of axioms to determine whether two morphisms of C are equivalent: The structure axioms for C as a †-SMC, as well as the rewriting axioms listed in Figure 1. Note that we identify the basic morphism I d with the identity morphism 1 1 C ( 1 , 1 ) and the basic morphism SWAP as the swap morphism σ 1 , 1 C ( 2 , 2 ) . Also note that those axioms listed in Figure 1 are only a fragment of all axioms of the ZX-calculus. We omit other axioms for the sake of simplicity. The interested readers can found all axioms of the ZX-calculus in [29,30].

2.1.2. Syntax of Clqp

We use L n to denote the language of CLQP n . L n is defined by the following BNF:
Definition 1
(Language of CLQP n ). For p P and U O ,
  • a : = U U c o ϕ ? a ; a a a a *
  • ϕ : = p c p ¬ ϕ ϕ ϕ [ α ] ϕ K I ϕ P r ϕ
Here c o and c p are respectively an operational constant and a propositional constant expressed by the ZX-calculus. More precisely, c o is a morphism from n to n, while c p is a morphism from 0 to n. For example, Z 2 2 ( π ) is an operational constant of L 2 and X 0 3 ( π ) is a propositional constant of L 3 . For all I N and I , K I is an epistemic modality. For all r [ 0 , 1 ] , P r is a probabilistic modality.
The intended meaning of those formulas is the following:
  • a is a program.
  • U is an operational variable that refers to a unitary operation on C 2 n .
  • U is the adjoint of U.
  • c o is an operational constant that refers to a specific operation on C 2 n .
  • ϕ ? is the program that refers to the test of proposition ϕ .
  • a 1 ; a 2 is the sequential composition of a 1 and a 2 (applying first a 1 and then a 2 ).
  • a 1 a 2 is the non-deterministic choice between of a 1 and a 2 (applying either a 1 or a 2 ).
  • a * is the iteration of a , meaning that to repeat a a finite, but non-deterministically determined, number of times.
  • ϕ is a formula.
  • ⊤ is a propositional constant representing logical truth.
  • p is a propositional variable.
  • c p is a propositional constant that refers to a specific state on C 2 n .
  • ¬ is the classical negation.
  • ∧ is the classical conjunction.
  • [ a ] ϕ means that “ ϕ will be the case after every execution of a ”.
  • K I ϕ means that “subsystem I carries the information that ϕ is the case”.
  • P r ϕ means that “testing property ϕ (on the current state) will succeed with probability r ”.
We define logical absurdity as : = ¬ , classical disjunction as ϕ ψ : = ¬ ( ¬ ϕ ¬ ψ ) and quantum negation as ϕ : = [ ϕ ? ] . Classical implication and equivalence are respectively defined as ϕ ψ : = ¬ ϕ ψ and ϕ ψ : = ( ϕ ψ ) ( ψ ϕ ) . Quantum join is defined as ϕ ψ : = ( ϕ ψ ) . A range of probabilistic formulas are defined as: P r ϕ : = P ( 1 r ) ϕ , P = r ϕ : = P r ϕ P r ϕ , P > r ϕ : = ¬ P r ϕ , P < r ϕ : = ¬ P r ϕ .
Comparing to LQP, the syntax of CLQP is an extension of LQP with the following additional components: operational constants, propositional constants and the iteration ∗. The iteration ∗ is not included in LQP. We put it back into our logic such that it can be used to verify quantum programs with the while-loop, for example the quantum walk algorithm [31] and the famous HHL (Harrow–Hassidim–Lloyd) quantum algorithms for solving systems of linear equations, which is a cornerstone of quantum machine learning.

2.2. Semantics

The semantics of CLQP n is based on the following structure.
Definition 2
(Quantum Dynamic Frame [18]). Let H = C 2 n be the 2 n dimensional Hilbert space. The n-qubit quantum dynamic frame build on H is the following structure:
Σ ( H ) : = ( Σ , { S ? } S T , { U } U U ) .
1. 
Σ is the set of all one-dimensional subspace of H , called the set of states. We denote a state s = x ¯ of H using any of the non-zero vector x H that generates it.
2. 
Call two states s and t orthogonal and write s t if and only if x s and y t , x | y = 0 . For a set of states S Σ , we put S : = { t Σ : t s , s S } and we denote S ¯ = ( S ) the biorthogonal closure of S.
3. 
A set of states S Σ is called a testable property iff it is biorthogonally closed, i.e., S = S ¯ . We denote T P ( Σ ) the set of all testable properties.
4. 
Every testable property S uniquely corresponds to a subspaces W S of H by taking W S : = S .
5. 
For every testable property S, there is a partial map S ? on Σ, called a quantum test, induced by P W S the projector onto the subspace W S :
  • S ? ( x ¯ ) : = P W S ( x ) ¯ Σ , if x ¯ S .
  • S ? ( x ¯ ) : = undefined, otherwise.
We denote by S ? Σ × Σ the binary relation corresponding to the partial map S ? , i.e., given by s S ? t iff S ? ( s ) = t .
6. 
U is the set of all unitary maps on H . For every unitary map U on H , the corresponding binary relation U Σ × Σ is given by s U t iff U ( x ) = y for some vector x s , y t .
An n-qubit quantum dynamic model is a pair M = ( Σ ( H ) , V , R ) , in which Σ ( H ) : = ( Σ , { S ? } S T , { U } U U ) is an n-qubit quantum dynamic frame. V is valuation function which maps every p P to a set of states V ( p ) Σ and every c p to a singleton set which contains the special state indicated by c p . R is an interpretation function that maps quantum programs to relations over Σ . An operational variable U is interpreted by a relation R ( U ) = U Σ × Σ induced by a unitary map. An operational constant c o is interpreted by the relation R ( c o ) = c o Σ × Σ induced by the unitary map c o indicates. More precisely, ( s , t ) R ( c o ) iff there are x s and y t such that c o ( x ) = y , where c o is the matrix interpretation of c o . A test ϕ ? is interpreted by the relation R ( ϕ ? ) Σ × Σ induced by the quantum projector P W V ( ϕ ) ¯ . The adjoint of a program U is interpreted by the relation R ( U ) , which is defined by ( s , t ) R ( U ) iff there are x s and y t such that U ( x ) = y . The relational interpretation is extend to arbitrary quantum programs as follows:
  • R ( a 1 ; a 2 ) = R ( a 2 ) R ( a 1 ) .
  • R ( a 1 a 2 ) = R ( a 1 ) R ( a 2 ) .
  • R ( a * ) = ( R ( a ) ) * , i.e., the reflexive transitive closure of R ( a ) .
Definition 3
(Semantics of CLQP n ). Let M = ( Σ ( H ) , V , R ) be an n-qubit quantum dynamic model. Let s Σ .
  • M , s n p iff s V ( p ) .
  • M , s n c p iff { s } = V ( c p ) .
  • M , s n ¬ ϕ iff not M , s n ϕ .
  • M , s n ϕ ψ iff M , s n ϕ and M , s n ψ .
  • M , s n [ a ] ϕ iff for all t, if ( s , t ) R ( a ) then M , t n ϕ .
  • M , s n K I ϕ iff for all t, if s I t then M , t n ϕ . Here the relation I is defined as follows. For all unit vector x s and y t , let ρ x = | x x | and ρ y = | y y | be the density operator of x and y respectively. Let t r N I be the partial trace over the environment N I . Then s I t holds iff t r N I ( ρ x ) = t r N I ( ρ y ) .
  • M , s n P r ϕ iff for all unit vector x s , x | P W V ( ϕ ) ¯ | x r .
The semantics of CLQP n largely coincides with the semantics of LQP: For all formulas that appear in both LQP and CLQP n , their semantics in CLQP are the same as their semantics in LQP. As usual, by Φ n ϕ we mean for all n-qubit quantum dynamic model M and all state s in M, if M , s n ψ for all ψ Φ , then M , s n ϕ . We say that ϕ is valid in CLQP n if n ϕ .

2.3. Axiomatization

Now we introduce a sound proof system for CLQP. This proof system is an extension of the proof system of LQP with axioms of the ZX-calculus. It consists of the following axioms and rules:
  • Axioms of dynamic logic:
    -
    All propositional tautologies.
    -
    Kripke Axiom: [ a ] ( p q ) ( [ a ] q [ a ] q ) .
    -
    PDL1: [ a ; b ] p [ b ] [ a ] p .
    -
    PDL2: [ a b ] p [ a ] p [ b ] p .
    -
    PDL3: [ a * ] p ( p [ a ] [ a * ] p ) .
    -
    PDL4: [ a * ] ( p [ a ] p ) ( p [ a * ] p ) .
  • Axioms of quantum system, in which we use the abbreviations a ϕ : = ¬ [ a ] ¬ ϕ , ϕ : = ¬ ϕ , ϕ : = ¬ ¬ ϕ .
    -
    Testability Axiom: p [ q ? ] p .
    -
    Partial Functionality: ¬ [ p ? ] q [ p ? ] ¬ q .
    -
    Adequacy: ( p q ) p ? q .
    -
    Repeatability: ( p p ) [ p ? ] p .
    -
    Unitary bijectivity 1: p [ U ; U ] p .
    -
    Unitary bijectivity 2: p [ U ; U ] p .
    -
    Proper Superpositions: a p [ b ] p .
    -
    Adjointness: p [ q ? ] q ? p .
  • Axioms of the epistemic modality:
    -
    K: K I ( p q ) ( K I p K I q ) .
    -
    T: K I p p .
    -
    S4: K I p K I K I p .
    -
    S5: ¬ K I p K I ¬ K I p .
  • Axioms of probability:
    -
    P 0 p .
    -
    P = 1 .
    -
    P = 0 ( p p ) .
    -
    ( p q ) ( P = r p P = r q ) .
    -
    ( p q ) ( P = r ( p q ) ( P = s p P r s q ) ) .
    -
    ( ( p q ) P = r q [ q ? ] P = s p ) P = r s p .
    -
    ( ( p q ) P > 0 p P > 0 q ) P > 0 ( P = r p P = 1 r q ) .
  • Rules:
    -
    Modus Ponens (MP): ϕ ϕ ψ ψ .
    -
    Necessitation (Nec): ϕ [ a ] ϕ .
    -
    Uniform Substitution (US): ϕ ( p ) ϕ ( q / p ) .
    -
    ZX equivalence: if a 1 = a 2 in the ZX-calculus, then [ a 1 ] p [ a 2 ] p .
Theorem 1.
All axioms and rules above are sound with respect to the semantics of CLQP n , for all n 1 .
Proof.
(sketch) Axioms of dynamic logic are valid because they are valid in every dynamic logic and CLQP is a special dynamic logic. The validity of axioms of quantum systems is shown in [17,18]. Axioms of epistemic logic are valid because I is an equivalence relation. The validity of axioms of probability can be found in [21]. The rules MP and US are valid in all logical systems. The rule Nec is valid because [ a ] is a necessity modality. The rule ZX equivalence is valid because if a 1 = a 2 in the ZX-calculus, then by the soundness of the ZX calculus we know they represent the same linear map. □
Remark 1.
In CLQP 1 , axioms of the ZX-calculus are simplified. Those axioms of single-qubit ZX-calculus can be found in Backens [32].

3. CLQP for Verification

In this section we are going to demonstrate the usage of CLQP by applying it to the formal verification of quantum programs and protocols. For the sake of simplicity, we choose to verify the correctness of Deutsch’s algorithm and the concealing property of quantum bit commitment protocols.

3.1. Deutsch’S Algorithm

Deutsch’s algorithm is a simple algorithm that solves a slightly contrived problem [33]. It determines whether a function f from { 0 , 1 } to { 0 , 1 } is constant or balanced, where f being constant means that f ( 0 ) = f ( 1 ) and balanced otherwise. We can formalize Deutsch’s algorithm in CLQP 2 . First, as it is shown in Chapter 12 of [26], we build an oracle U f as the following:
Entropy 22 00144 i009
Formally, we have U f = ( I Z 2 1 ( 0 ) ) ( I f I ) ( X 1 2 ( 0 ) I ) . It holds that for all f : { | 0 , | 1 } { | 0 , | 1 } , we have U f ( | x , y ) = | x | y f ( x ) . The unitary operation of Deutsch’s Algorithm is graphically represented as the following:
Entropy 22 00144 i010
After this operation, a measurement on the { | 0 , | 1 } basis is applied to the first qubit. The function f is constant if and only if the result of the measurement is | 0 .
There are four functions from { | 0 , | 1 } to { | 0 , | 1 } . Let them be f 1 , f 2 , f 3 , f 4 , where f 1 ( | 0 ) = | 0 , f 1 ( | 1 ) = | 1 , f 2 ( | 0 ) = | 1 , f 2 ( | 1 ) = | 0 , f 3 ( | 0 ) = f 3 ( | 1 ) = | 0 , f 4 ( | 0 ) = f 4 ( | 1 ) = | 1 . Note that up to a non-zero scalar, we have f 1 = X 1 1 ( 0 ) , f 2 = X 1 1 ( π ) , f 3 = X 0 1 ( 0 ) Z 1 0 ( π ) , f 4 = X 0 1 ( π ) Z 1 0 ( π ) .
Entropy 22 00144 i011
The correctness of Deutsch’s Algorithm can be expressed by the following deduction:
  • X 0 1 ( 0 ) X 0 1 ( π ) 2 [ ( H I ) U f ( H H ) ] P = 1 K 1 ( X 0 1 ( 0 ) ) for all constant function f.
  • X 0 1 ( 0 ) X 0 1 ( π ) 2 [ ( H I ) U f ( H H ) ] P = 0 K 1 ( X 0 1 ( 0 ) ) for all balanced function f .
Equivalently, it can be characterized by the validity of the following formula of CLQP 2 :
( X 0 1 ( 0 ) X 0 1 ( π ) ) ( [ ( H I ) ( U f 1 U f 2 ) ( H H ) ] P = 1 K 1 ( X 0 1 ( 0 ) ) ) ,
( X 0 1 ( 0 ) X 0 1 ( π ) ) ( [ ( H I ) ( U f 3 U f 4 ) ( H H ) ] P = 0 K 1 ( X 0 1 ( 0 ) ) )
.
The graphical representation of the ZX-calculus can significantly simplify the proof of the validity of the above formula.
  • Suppose the function is f 1 , then we have
    Entropy 22 00144 i012
    From the rightmost graph we know that P = 1 K 1 ( X 0 1 ( 0 ) ) is satisfied the first qubit is in the X 0 1 ( 0 ) state.
  • Suppose the function is f 2 , then we have
    Entropy 22 00144 i013
    Apparently, P = 1 K 1 ( X 0 1 ( 0 ) ) is satisfied in the rightmost graph.
  • Suppose the function is f 3 , then we have
    Entropy 22 00144 i014
    Note that Z 1 0 ( π ) Z 1 0 ( 0 ) is 0. We know that P = 0 K 1 ( X 0 1 ( 0 ) ) is satisfied in the rightmost graph.
  • Suppose the function is f 4 , then we have
    Entropy 22 00144 i015
    Since the absorbing scalar 0 is in the rightmost graph, we know that P = 0 K 1 ( X 0 1 ( 0 ) ) is satisfied.

3.2. Quantum Bit Commitment

A bit commitment protocol consists of two phases: commit and opening. In the commit phase, Alice the sender chooses a bit a ( a = 0 or 1) which she wishes to commit to the receiver Bob. Then Alice presents Bob some evidence about the bit. The committed bit cannot be known by Bob prior to the opening phase. Later, in the opening phase, Alice announces some information for reconstructing a. Bob then reconstructs a bit a using Alice’s evidence and announcement. A correct bit commitment protocol will ensure that a = a . A bit commitment protocol is concealing if Bob cannot know the bit Alice committed before the opening phase and it is binding if Alice cannot change the bit she committed after the commit phase.
Quantum bit commitment (QBC) was first proposed by Bennett and Brassard in 1984 [34]. In a QBC protocol, quantum operation and communication are used to ensure the concealing and binding property. In the literature [35,36,37], it is acknowledged that a general model of QBC protocols should at least includes the following ingredients:
  • The Hilbert space required to describe the protocol is the tensor product of the Hilbert spaces that play a role in the protocol.
  • The total system is initially in a pure state.
  • Every action taken by a party corresponds to that party performing a unitary operation on the systems in his/her possession.
  • Every communication corresponds to a party sending a subset of the systems in his/her possession to the other party.
Bearing this common knowledge in mind, a rigorous and simple formalization of quantum bit commitment is given as follows.
Definition 4.
A quantum bit commitment protocol consists of the following:
1. 
Two finite dimensional Hilbert spaces A and B.
2. 
Two pure states | L , | R A B .
3. 
A completely positive map O p e n on A B such that O p e n ( | L L | ) is orthogonal to O p e n ( | R R | ) .
This formalization provides a high level description of quantum bit commitment. Initially, Alice (possibly with the help of Bob) prepares a state | L or | R of quantum system A B depending on the value of Alice’s bit. (Note that | L and | R are not the initial state of the QBC protocol, but the final state of the commit phase. Starting from a pure state, a commit phase may involve many rounds of actions and communications). Alice sends T r A ( | L L | ) or T r A ( | R R | ) to Bob to perform the commitment. At the opening stage, Alice sends the rest sub-state of | L or | R to Bob to allow him to verify her commitment. Bob applies the completely positive map O p e n to determine Alice’s commitment. The QBC protocol is concealing if T r A ( | L L | ) = T r A ( | R R | ) . It is binding if there is no unitary map U on A such that ( U I ) | L = | R .
In CLQP, the concealing property of the QBC protocol can be characterized by the validity of the following formula:
K B c L K B c R
Here c L and c R are respectively the propositional constant that characterized the state | L and | R . The universality of the ZX calculus ensures that c L and c R can be characterized in CLQP. The validity of this formula implies that { | L } ¯ B { | R } ¯ , which further entails that T r A ( | L L | ) = T r A ( | R R | ) . It seems the binding property cannot be characterized by formulas of CLQP. However, we can still use the ZX-calculus to prove non-binding since the ZX-calculus is universal and sound.

4. Conclusions and Future Work

In this paper we introduce the basic ideas of the categorical logic of quantum programs. We present the syntax, semantics and proof system of this logic and demonstrate its usage in the formal verification of quantum programs and protocols. In a nutshell, CLQP is an extension of LQP with a universal set of constant symbols and iteration ∗.
Our long-term goal is to develop CLQP as a powerful tool for the verification of quantum programs and protocols. In the recent future, we will study the decidability and complexity of CLQP. We will also apply CLQP to the formal verification of more complicated quantum programs and protocols, for example the HHL algorithm in quantum machine learning. The semantics of CLQP presented in this paper is based on pure quantum states. The development of mixed-state semantics is in our agenda.

Author Contributions

Conceptualization, X.S. and F.H.; Methodology, X.S.; Validation, F.H.; Formal analysis, X.S. and F.H.; Writing—original draft preparation, X.S.; Writing—review and editing, X.S. and F.H.; Funding acquisition, X.S. All authors have read and agreed to the published version of the manuscript.

Funding

The project is funded by the Minister of Science and Higher Education within the program under the name“Regional Initiative of Excellenc” in 2019-2022, project number: 028/RID/2018/19, the amount of funding: 11 742 500 PLN.

Acknowledgments

The authors are grateful to Xishun Zhao for daily discussion.

Conflicts of Interest

The authors declare no conflict of interest.

Appendix A. Dagger Symmetric Monoidal Category

Definition A1
(Category). A category C consists of:
1. 
a collection o b ( C ) of objects,
2. 
for every pair of objects A , B , a set C ( A , B ) of morphisms,
3. 
for every object A, a special identity morphism: 1 A C ( A , A ) ,
4. 
sequential composition operation for morphisms:
: C ( B , C ) × C ( A , B ) C ( A , C ) ,
satisfying the following conditions:
1. 
is associative on morphisms: ( h g ) f = h ( g f ) ,
2. 
is unital on morphisms: 1 B f = f = f 1 A , for all f C ( A , B ) .
Definition A2
(Strict Monoidal Category [26]). A strict monoidal category C is a category equipped with:
1. 
a parallel composition operation for objects:
: o b ( C ) × o b ( C ) o b ( C ) ,
2. 
a unit object I o b ( C ) ,
3. 
and a parallel composition operation for morphisms:
: C ( A , B ) × C ( C , D ) C ( A C , B D )
satisfying the following conditions:
1. 
⊗ is associative and unital on objects:
( A B ) C = A ( B C ) A I = A = I A
2. 
⊗ is associative and unital on morphisms:
( f g ) h = f ( g h ) f 1 I = f = 1 I f
3. 
⊗ and ∘ satisfy the interchange law:
( g 1 g 2 ) ( f 1 f 2 ) = ( g 1 f 1 ) ( g 2 f 2 )
.
Definition A3
(Symmetric Monoidal Category [26]). A strict monoidal category is symmetric if it is equipped with a swap morphism:
σ A , B : A B B A
defined for all objects A , B , satisfying:
  • σ B , A σ A , B = 1 A B ,
  • σ A , I = 1 A ,
  • ( g f ) σ A , B = σ A , B ( f g ) , for all f C ( A , A ) , g C ( B , B ) ,
  • ( 1 B σ A , C ) ( σ A , B 1 C ) = σ A , B C .
Definition A4
(Dagger Functor † [26]). A dagger functor for a strict monoidal category is an operation † that satisfy the following:
  • identity on objects: A = A ,
  • reserves morphisms: ( f : A B ) : = f : B A ,
  • is involutive: ( f ) = f ,
  • and respects the symmetric monoidal category structure:
    ( g f ) = f g ( f g ) = f g
A dagger symmetric monoidal category is a strict monoidal category equiped with a dagger functor.

References

  1. Feng, Y.; Duan, R.; Ji, Z.; Ying, M. Probabilistic bisimulations for quantum processes. Inf. Comput. 2007, 205, 1608–1639. [Google Scholar] [CrossRef] [Green Version]
  2. Ying, M.; Feng, Y.; Duan, R.; Ji, Z. An algebra of quantum processes. ACM Trans. Comput. Log. 2009, 10, 19. [Google Scholar] [CrossRef]
  3. Feng, Y.; Duan, R.; Ying, M. Bisimulation for Quantum Processes. ACM Trans. Program. Lang. Syst. 2012, 34, 17. [Google Scholar] [CrossRef] [Green Version]
  4. Kubota, T.; Kakutani, Y.; Kato, G.; Kawano, Y.; Sakurada, H. Semi-automated verification of security proofs of quantum cryptographic protocols. J. Symb. Comput. 2016, 73, 192–220. [Google Scholar] [CrossRef]
  5. Birkhoff, G.; von Neumann, J. The Logic of Quantum Mechanics. Ann. Math. 1936, 37, 823–843. [Google Scholar] [CrossRef]
  6. Piron, C. Axiomatique quantique. Helv. Phys. Acta 1964, 37, 439–468. [Google Scholar]
  7. Malinowski, J. Quantum experiments and the lattice of orthomodular logics. Log. Anal. 1999, 35, 165–166. [Google Scholar]
  8. Malinowski, J. On the lattice of orthomodular logics. Bull. Sect. Log. 1999, 28, 11–18. [Google Scholar]
  9. Ledda, A.; Konig, M.; Paoli, F.; Giuntini, R. MV-Algebras and Quantum Computation. Stud. Log. 2006, 82, 245–270. [Google Scholar] [CrossRef]
  10. Giuntini, R.; Ledda, A.; Paoli, F. Expanding Quasi-MV Algebras by a Quantum Operator. Stud. Log. 2007, 87, 99–128. [Google Scholar] [CrossRef]
  11. Gudder, S. Quantum Computational Logic. Int. J. Theor. Phys. 2003, 42, 39–47. [Google Scholar] [CrossRef]
  12. Dunn, J.M.; Moss, L.S.; Wang, Z. Editors’ Introduction: The Third Life of Quantum Logic: Quantum Logic Inspired by Quantum Computing. J. Philos. Log. 2013, 42, 443–459. [Google Scholar] [CrossRef]
  13. Brunet, O.; Jorrand, P. Dynamic quantum logic for quantum programs. Int. J. Quantum Inf. 2004, 2, 45–54. [Google Scholar] [CrossRef] [Green Version]
  14. Chadha, R.; Mateus, P.; Sernadas, A. Reasoning About Imperative Quantum Programs. Electron. Notes Theor. Comput. Sci. 2006, 158, 19–39. [Google Scholar] [CrossRef] [Green Version]
  15. Feng, Y.; Duan, R.; Ji, Z.; Ying, M. Proof rules for the correctness of quantum programs. Theor. Comput. Sci. 2007, 386, 151–166. [Google Scholar] [CrossRef] [Green Version]
  16. Ying, M. Floyd-hoare logic for quantum programs. ACM Trans. Program. Lang. Syst. 2011, 33, 19:1–19:49. [Google Scholar] [CrossRef]
  17. Baltag, A.; Smets, S. Complete Axiomatizations for Quantum Actions. Int. J.Theor. Phys. 2005, 44, 2267–2282. [Google Scholar] [CrossRef] [Green Version]
  18. Baltag, A.; Smets, S. LQP: The dynamic logic of quantum information. Math. Struct. Comput. Sci. 2006, 16, 491–525. [Google Scholar] [CrossRef]
  19. Baltag, A.; Smets, S. A Dynamic-Logical Perspective on Quantum Behavior. Stud. Log. 2008, 89, 187–211. [Google Scholar] [CrossRef] [Green Version]
  20. Baltag, A.; Bergfeld, J.; Kishida, K.; Sack, J.; Smets, S.; Zhong, S. PLQP & Company: Decidable Logics for Quantum Algorithms. Int. J. Theor. Phys. 2014, 53, 3628–3647. [Google Scholar] [CrossRef]
  21. Bergfeld, J.M.; Sack, J. Deriving the correctness of quantum protocols in the probabilistic logic for quantum programs. Soft. Comput. 2017, 21, 1421–1441. [Google Scholar] [CrossRef] [Green Version]
  22. Rad, S.R.; Shirinkalam, E.; Smets, S. A Logical Analysis of Quantum Voting Protocols. Int. J. Theor. Phys. 2017, 56, 3991–4003. [Google Scholar] [CrossRef]
  23. Abramsky, S.; Coecke, B. A Categorical Semantics of Quantum Protocols. In Proceedings of the 19th IEEE Symposium on Logic in Computer Science (LICS 2004), Turku, Finland, 14–17 July 2004; pp. 415–425. [Google Scholar] [CrossRef] [Green Version]
  24. Coecke, B.; Duncan, R. Interacting quantum observables: Categorical algebra and diagrammatics. New J. Phys. 2011, 13, 1–85. [Google Scholar] [CrossRef]
  25. Coecke, B.; Heunen, C.; Kissinger, A. Categories of quantum and classical channels. Quantum Inf. Process. 2016, 15, 5179–5209. [Google Scholar] [CrossRef]
  26. Coecke, B.; Kissinger, A. Picturing Quantum Processes: A First Course in Quantum Theory and Diagrammatic Reasoning; Cambridge University Press: Cambridge, UK, 2017. [Google Scholar]
  27. Coecke, B.; Duncan, R. Interacting Quantum Observables. In International Colloquium on Automata, Languages, and Programming; Springer: Berlin/Heidelberg, Germany, 2008; Volume 5126, pp. 298–310. [Google Scholar] [CrossRef]
  28. Backens, M. The ZX-calculus is complete for stabilizer quantum mechanics. New J. Phys. 2014, 16, 093021. [Google Scholar] [CrossRef]
  29. Jeandel, E.; Perdrix, S.; Vilmart, R. A Complete Axiomatisation of the ZX-Calculus for Clifford+T Quantum Mechanics. In Proceedings of the Thirty-Third Annual ACM/IEEE Symposium on Logic in Computer Science, Oxford, UK, 12 July 2018. [Google Scholar]
  30. Hadzihasanovic, A.; Ng, K.F.; Wang, Q. Two complete axiomatisations of pure-state qubit quantum computing. In Proceedings of the Thirty-Third Annual ACM/IEEE Symposium on Logic in Computer Science, Oxford, UK, 12 July 2018. [Google Scholar]
  31. Ambainis, A. Quantum walks and their algorithmic applications. Int. J. Quantum Inf. 2003, 1, 507–518. [Google Scholar] [CrossRef] [Green Version]
  32. Backens, M. The ZX-calculus is complete for the single-qubit Clifford+T group. In Proceedings of the 12th International Conference on Quantum Physics and Logic, Oxford, UK, 15–17 July 2015. [Google Scholar]
  33. Yanofsky, N.; Mannucci, M. Quantum Computing for Computer Scientists; Cambridge University Press: Cambridge, UK, 2008. [Google Scholar]
  34. Bennetta, C.; Brassard, G. Quantum cryptography: Public key distribution and coin tossing. In Proceedings of the IEEE International Conference on Computers, Systems and Signal Processing, Bangalore, India, 9–12 December 1984; pp. 175–179. [Google Scholar]
  35. Mayers, D. Unconditionally secure quantum bit commitment is impossible. Phys. Rev. Lett. 1997, 78, 3414–3417. [Google Scholar] [CrossRef] [Green Version]
  36. Lo, H.K.; Chau, H.F. Is Quantum Bit Commitment Really Possible? Phys. Rev. Lett. 1997, 78, 3410–3413. [Google Scholar] [CrossRef] [Green Version]
  37. Spekkens, R.W.; Rudolph, T. Degrees of concealment and bindingness in quantum bit commitment protocols. Phys. Rev. A 2001, 65, 012310. [Google Scholar] [CrossRef] [Green Version]
Figure 1. ZX-calculus rules.
Figure 1. ZX-calculus rules.
Entropy 22 00144 g001

Share and Cite

MDPI and ACS Style

Sun, X.; He, F. A First Step to the Categorical Logic of Quantum Programs. Entropy 2020, 22, 144. https://doi.org/10.3390/e22020144

AMA Style

Sun X, He F. A First Step to the Categorical Logic of Quantum Programs. Entropy. 2020; 22(2):144. https://doi.org/10.3390/e22020144

Chicago/Turabian Style

Sun, Xin, and Feifei He. 2020. "A First Step to the Categorical Logic of Quantum Programs" Entropy 22, no. 2: 144. https://doi.org/10.3390/e22020144

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop