The birth of science and logic are inextricably woven. The evolution of computer science and technology would have been impossible without its logical foundation. Conversely, the new model of computation has provided great opportunities for the development of logic. This “entanglement” between logic and computer science has lasted throughout the last century till now, even before the emergence of ENIAC–the first electronic general-purpose computer. Logic is ubiquitous in modern computer science. One typical example is temporal logic, the logical formulism for reasoning about time and the timing of events which was introduced to computer science by Pnueli in his seminal work . Temporal logic has become a widely accepted language for stating and specifying properties of concurrent programs and general reactive systems 
. It is interpreted over models that abstract away from the actual time at which events occur, retaining only temporal ordering information about the states of a system. The necessity of introducing temporal logic is from the following observations. The correctness of concurrent programs and general reactive systems usually involves reasoning about the corresponding events at different moments in an execution of the system. The expected property of reactive systems, e.g., the liveness properties–something good must eventually happen, as well as fairness properties–a fundamental concept of unbounded nondeterminism of concurrent systems , can not be stated as a formula of static logic.
Due to the increasing maturity in the research on quantum program verification, and the potential interest and understanding of the behavior of concurrency in quantum systems, great effort has been expended in the design of quantum programming language [37, 56, 10, 55, 58, 3, 29, 1, 65, 49, 50, 46, 28, 54, 27, 17, 33, 20, 32], as surveyed in [24, 57]. Simultaneously, various quantum logics and techniques have been developed for the verification of quantum programs [2, 5, 6, 13, 16, 18, 19, 21, 25, 34, 4, 53, 60, 67, 75, 72, 73]. Notably, Ying  established quantum Hoare logic for both partial correctness and total correctness with (relative) completeness for the notion of quantum weakest precondition proposed by D’Hondt and Panangaden . Of all the properties, the termination of quantum programs has received a fair amount of attention [1, 69, 74, 41, 77, 40]. Quantum process algebra was introduced to model the quantum communication between quantum processors, and thus forms a model of concurrent quantum systems [33, 71, 20]. Temporal logics for quantum states were introduced and then the model-checking problem for this logic was studied in [43, 8, 7, 42].
Concurrency is a necessary concept to explore the computational power of distributed quantum computing systems. Most of the aforementioned research on the correctness of quantum programs considered programs with exits only. Those are programs with a distinct beginning and end with computational instruction in between, whose correctness statement describes the relation between the input and successful completion of the program. These approaches completely ignore an important class of quantum operating systems or real-time type quantum programs, for instance, the quantum internet , for which halting is an abnormal situation.
Understanding the combined behaviour of quantum features and concurrency is nontrivial. Quantum mechanics naturally generate probabilistic branching due to quantum measurement as does quantum programs. On the other hand, non-determinism plays a central role in concurrent programs. A comprehensive definition of a quantum concurrent program which would intergrade quantum probability and non-determinism is still missing. Previous work including should be regarded as concurrent quantum programs but not quantum concurrent programs because that concurrency does not depend on quantum data but purely classical.
To define the propositional variables of quantum temporal logic, we revisit the (algebraic counter-part of) quantum logic of quantum mechanics which originated in the milestone paper  by Garrett Birkhoff and John von Neumann, who were attempting to reconcile the apparent inconsistency of classical logic with the facts concerning the measurement of complementary variables in quantum mechanics, at which time quantum logic was defined as the set of principles for manipulating the projections on a Hilbert space which was viewed as quantum propositions about physical observables in John von Neumann’s classic treatise . Projective operators in a Hilbert space correspond one-to-one with the closed subspaces, and the Lwner order restricted on projection operators coincides with the inclusion between the corresponding subspaces. The structure of the set of closed subspaces of a Hilbert has been thoroughly investigated in the development of quantum logic for over 80 years. The idea of using quantum projections as a quantum predicate was discussed in , where the algebraic structure of the set of closed subspaces and orthomodular lattices theory is reviewed [14, 35]. Recently, this idea was also used to develop quantum relational Hoare logic (qRHL) in [63, 62, 9]. It was employed in providing an applied quantum Hoare Logic in .
Contributions of the Paper: In this paper, we derive a quantum Temporal logic (QTL) as a verification tool of quantum concurrent programs. More precisely, our contribution is as follows:
We provide a model of quantum concurrent programs which combines quantum probability and non-determinism. In this model, the quantum concurrent program consists of a shared quantum register, a class of quantum programs which can access the quantum register and a scheduler (classical) register which records the program that needs to be performed in the next round. Each program is given as finite lines (locations) of commands with an initial location. Each command consists of a quantum super-operator and a measurement in which the classical index outcome of measurements is used to choose a location of this program and modify the scheduler register, which can be non-deterministically.
We investigate quantum temporal logic, QTL, which generalizes Pnueli’s classical temporal logic . Birkhoff and von Neumann used projection as quantum atomic propositions where a state satisfies a proposition if the state falls into the subspace corresponding to the projection in . In light of this method, we define the basic temporal operators, (next), (until), (almost surely until) , (eventually), (almost surely eventually) and (always). Note that we do not allow negation although (conjunction), (disjunction) are introduced as usual.
We study the QTL for deterministic quantum concurrent programs with exits as an example of the general model. We provide a quantum compiler for Q-While, a widely studied quantum extension of the while-language . We prove a quantum Böhm-Jacopini theorem  which states that any deterministic quantum concurrent program is equivalent to a Q-While program. Based on this theorem, for deterministic quantum concurrent program,
(a) we present a logic with completeness for reasoning and thus fill an important gap in the verification of quantum programs;
(b) we provide polynomial time algorithms which compute the reachability super-operator and average running time;
(c) we demonstrate a quantum analogue of the Kleene closure which compute the entanglement-assisted reachable space.
We study the decidability of basic QTL formulae. For deterministic quantum program, we show that is decidable while the decidabilities of , , and are equivalent to the decidability of the famous Skolem problem. For general quantum concurrent programs, we prove that , , and are all decidable which solves the open question of .
We list the reasons for employing projection as quantum atomic propositions in the following.
It enables us to define logical operators (conjunction), (disjunction).
Each projection corresponds to a projective measurement which is physically implementable. The state satisfies if and only if the measurement outcomes when applying on the state. Moreover, the state, if satisfies , will not collapse after applying the measurement. Therefore, our logic fits very well in the testing and debugging of quantum concurrent programs.
For deterministic quantum program with exit, the set of input states such that the program terminates in finite steps, and the set of input states such that the program terminates with probability 1, can be characterized by closed subspaces, respectively, or equivalently projections, as observed in .
1.1 Related Work and Comparison
 defined a flowchart low-level quantum programming languages and provided a technique of translating quantum flowchart programs into Q-While.
introduced a quantum Markov decision process is as a semantic model of non-deterministic and quantum concurrent programs in which each program is given as a quantum operation and a finite set of measurements is given. At each step, a quantum program is applied or a measurement is performed.
Compared with  and , the classical control of the model here has a richer structure. Each program consists of a class of commands, marked in corresponding program locations, where each command is a tuple of a quantum operation together with a quantum measurement. The classical control information is recorded in the scheduler register together with the locations of each program. At each step, according to the value of the schedule register, the command corresponding to the current location of the corresponding program is applied. Our quantum Böhm-Jacopini theorem is stronger than the one of  in the sense that we only need a single syntax of Q-While to characterize the original deterministic program.
Organisation of the Paper: We provide preliminaries about quantum information in Section 2. In Section 3, we introduce the model of quantum concurrent programs. In Section 4, we give the formal definition of quantum temporal logic (syntax, semantics). In Section 5, we study the deterministic quantum concurrent programs with exits as an example. In Section 6, we studied the decidability of quantum temporal logic.
2 Quantum Information: Preliminaries and Notations
This section presents the background and notations on quantum information and quantum computation mainly according to the textbook by .
A Hilbert space
is a linear vector space which can be finite dimensional or separable. A separable Hilbert space has a countable orthonormal basis. For any finite integer, an -dimensional Hilbert space is the space of complex vectors. We use Dirac’s notation, , to denote a complex vector in . The inner product of two vectors and is denoted by , which is the product of the Hermitian conjugate of , denoted by , and vector . The norm of a vector is denoted by .
Linear operators are linear mappings between Hilbert spaces. Operators between -dimensional Hilbert spaces are represented by matrices. For example, the identity operator
is the identity matrix on. The Hermitian conjugate of operator is denoted by . Operator is Hermitian if . The trace of an operator is the sum of the entries on the main diagonal, i.e., . We write to mean the inner product between and . A Hermitian operator is positive semidefinite (resp., positive definite) if for all vectors , (resp., ). This gives rise to the Löwner order among operators:
A positive semidefinite operator is called a projection if
There is a one-to-one correspondence between projection and closed linear subspace. the Löwner order among projections is equivalent to the subset relation among closed linear subspaces.
2.2 Quantum States
The state space of a quantum system is a Hilbert space. The state space of a qubit
, or quantum bit, is a 2-dimensional Hilbert space. One important orthonormal basis of a qubit system is thecomputational basis with and , which encode the classical bits 0 and 1 respectively. Another important basis, called the basis, consists of and . The state space of multiple qubits is the tensor product of single qubit state spaces. For example, classical 00 can be encoded by (written or even for short) in the Hilbert space . The Hilbert space for an -qubit system is .
A pure quantum state is represented by a unit vector, i.e., a vector with . A mixed state can be represented by a classical distribution over an ensemble of pure states , i.e., the system is in state with probability . One can also use density operators to represent both pure and mixed quantum states. A density operator for a mixed state representing the ensemble is a positive semidefinite operator , where is the outer-product of ; in particular, a pure state can be identified with the density operator . Note that holds for all density operators. A positive semidefinite operator on is said to be a partial density operator if . The set of partial density operators is denoted by .
2.3 Quantum Operations
Operations on closed quantum systems can be characterized by unitary operators. An operator is unitary if its Hermitian conjugate is its own inverse, i.e., . For a pure state , a unitary operator describes an evolution from to . For a density operator , the corresponding evolution is . The Hadamard operator transforms between the computational and the basis. For example, and .
More generally, the evolution of a quantum system can be characterized by an super-operator , which is a completely-positive and trace-non-increasing linear map from to for Hilbert spaces . For every super-operator , there exists a set of Kraus operators such that for any input . Note that the set of Kraus operators is finite if the Hilbert space is finite-dimensional. The Kraus form of is written as . A unitary evolution can be represented by the super-operator . An identity operation refers to the super-operator . A super-operator is trace-non-increasing if for any initial state , the final state after applying satisfies . A super-operator is called trace preserving if holds for any initial state . The Schrödinger-Heisenberg dual of a super-operator , denoted by , is defined as follows: for every state and any operator , . The Kraus form of is .
2.4 Quantum Measurements
The way to extract information about a quantum system is called a quantum measurement. A quantum measurement on a system over Hilbert space can be described by a set of linear operators with . If we perform a measurement on a state , the outcome is observed with probability for each . A major difference between classical and quantum computation is that a quantum measurement changes the state. In particular, after a measurement yielding outcome , the state collapses to . For example, a measurement in the computational basis is described by . If we perform the computational basis measurement on state , then with probability the outcome is and becomes . With probability the outcome is and becomes . Quantum measurements are essentially probabilistic; but we adopt a convention from  to present them. We can combine probability and density operator into a partial density operator This convention significantly simplifies the presentation.
A projective measurement on a system with state space is described by a collection of projections over satisfying where index stands for the measurement outcomes that may occur. If the state of a quantum system was immediately before the measurement is performed on it, then the probability that outcome occurs is and the state of the system after the measurement is Actually, a general measurement can always be implemented by a projective measurement together with a unitary transformation if an ancillary system is allowed. In the circuit model of quantum computation, measurements are usually assumed to be in the computational basis, which is a special kind of projective measurement.
For a mixed state (density operator) , its support
is defined as the (topological) closure of the subspace spanned by the eigenvectors of
with nonzero eigenvalues. It is easy to see that, where stands for ortho-complement. The definition of support can be naturally generalized to semi-definite positive operators. An important fact of projective measurements is that, given a state and projection such that , if we apply the (yes/no) projective measurement on , the state is not changed.
2.5 Jordan Canonical Forms
Let be a square matrix with rational entries. The minimal polynomial of is the unique monic polynomial of least degree such that . By the Cayley-Hamilton Theorem, the degree of is at most .
We can write any matrix as
for some invertible matrixand block diagonal Jordan matrix , with each block with size having the following form
where the binomial coefficient is defined to be 0 for .
Moreover, given a rational matrix , its Jordan Normal Form can be computed in polynomial time, as shown in . Here, the input size of the problem is the total lengths of the binary representation of all the input entries, and the complexity is measured in terms of binary operations. We associate each algebraic number with its minimal polynomial (thus, irreducible) and a sufficiently good rational approximation, which uniquely identifies the particular root of the polynomial.
2.6 Matrix Representation of Super-Operators
The matrix representation of a super-operator is usually easier to manipulate than the super-operator itself.
Suppose super-operator on a finite-dimensional Hilbert space has the operator-sum representation for all partial density operators , and . Then the matrix representation of is the following matrix:
where stands for the conjugate of matrix , i.e. with being the conjugate of complex number , whenever .
The following lemma illustrates the usefulness of the matrix representation of super-operator .
We write for the (unnormalized) maximally entangled state in , where is an orthonormal basis of . Let be the matrix representation of super-operator . Then for any matrix , we have:
Let the matrix representations of super-operators be with Jordan decomposition where is a nonsingular matrix, and is the Jordan normal form of :
with being a -Jordan block of eigenvalue . The next lemma describes the structure of the matrix representation of super-operator .
for all .
If then the dimension of the th Jordan block .
2.7 Convergence of the decreasing chain of finite union of subspaces
We use the following result proved in .
Suppose is a union of a finite number of subspaces of for all . If is a decreasing chain, i.e., , then there exists such that for all .
2.8 Kronecker’s Theorem
The classical Kronecker approximation theorem is formulated as follows.
Given real n-tuples and , the condition: , such that
holds if and only if for any with , is also an integer.
In simpler language, the first condition states that the tuple can be approximated arbitrarily well by integer scaling of and integer vectors. In other words, the decimal part of is dense in the set .
To characterize the limit points of , we also need the following result from  which characterized all such that , or equivalently .
Given algebraic numbers, , one can in polynomial time calculate the following set
Remark: is a lattice, i.e., for all and . The algorithm outputs a basis of the lattice .
2.9 Skolem-Mahler-Lech Theorem and Skolem Problem
The Skolem-Mahler-Lech theorem is useful in our analysis. We use the version in .
If the zero set of a linear recurrence series with and being dimensional integer vectors and invertible matrix is infinite, it is eventually periodic, i.e. it agrees with a periodic set for sufficiently large . In fact, a slightly stronger statement is true: the zero set is the union of a finite set and a finite number of residue classes . For any prime number , can be bounded by .
It is not known whether the following Skolem Problem is decidable for .
Given a linear recurrence set with and being dimensional integer vectors and invertible matrix, determine whether the zero set of is empty.
3 Systems and Programs
Before providing the general model of quantum sequential and quantum concurrent programs, we recall the framework of classical systems provided in .
A dynamic discrete system consists of
is the set of states the system may assume (possibly infinite).
is the transition relation holding between a state and its possible successors, .
is the initial state .
An execution of the system is a sequence:
where for each , holds. The system is deterministic if for any , there is only one such that holds. Otherwise, it is non-deterministic.
Similarly, we can form our quantum system as follows: A dynamic discrete time quantum system consists of
is the Hilbert space that the system may assume (finite dimensional or separable).
is the transition relation holding between a state and its possible successors, .
is the initial state with .
An execution of the system is a sequence:
where for each , holds. Many different execution sequences are possible as is nondeterministic in general.
As quantum mechanics is linear, the most natural choice of is a super-operator introduced in Section 2. However, this would not result in non-determinism. Non-determinism always corresponds to a finite discrete set. Like the classical framework, we would like the non-determinism to depend on the state. This motivates us to introduced measurement at each step of transition because quantum measurement is the only way to extract classical information from quantum systems.
This concept of discrete quantum system discussed below is very general. Being chiefly motivated by problems in the quantum programming area, all the examples and following discussions will be addressed to the verification of programs. Further structuring of state notion is needed to particularize quantum system into quantum programs.
3.1 Sequential Quantum Programs
The sequential quantum programs is given in the following structure.
A sequential quantum program is a six tuple
is a Hilbert space, called the state space. contains the data component and ranges over an infinite domain, the quantum state of . It can be freely structured into individual variables and data structures for fitting actual applications.
is the control component and assumes a finite number of values, taken to be labels or locations in the program. Without loss of generality, we let be the set of locations, can be regarded as the program length.
is a mapping which associates each location with a corresponding trace preserving super-operator and a quantum measurement satisfying . They are used to describe the evolution of the system caused by action. Note that we can assume a uniform as the number of outcomes for the measurements at all locations because we assume is finite.
denotes the next location choice mapping.
is the initial state of the system, which lies in .
is the initial location of the program.
where can be regarded as the control component of the program.
To clarify the transition of the system, we look at the joint distribution of the locations and the quantum data. Due to the probability distribution induced by quantum measurements, the actual state including the location of the program, is not always of the form, but is as follows:
We express the transition as follows.
In the first step, is applied on the initial state
Then, measurement is performed and based on the measurement outcome, classical index, and the corresponding location, the location is changed accordingly. In other words, any state of the following form with is reachable non-deterministically
Generally, at each step, the state is transformed by the following two sub-steps.
Apply super-operators according to the location and obtain .
Apply quantum measurement and change location accordingly. The overall state becomes the following for any non-deterministically
3.1.1 Quantum Sequential Program with Exit
This program becomes deterministic if and only if for all and .
Our model of sequential quantum program can also simulate quantum programs with exit by assuming an exit location such that and do not change the state, and for all . More precisely, we let for all and .
We define two kinds of terminations of quantum programs with exits with exit location .
Let , and denote the state of the system at step (time) .
We say that terminates if there exists such that .
We say that almost terminates if for any there exists such that for all .
The termination of a quantum program is rare whereas almost terminaition is much more common as illustrated in the following example.
: , goto ;
: Measure using , if the outcome is , goto , otherwise, goto ;
: Apply gate on , goto
This program is a deterministic program with exit, with as the exit location.
The initial state is .
After the first step, the state becomes .
After the second step, the state becomes .
After the third step, the state becomes .
After the fourth step, the state becomes .
After the -th step, the state becomes .
After the -th step, the state becomes .
For any finite , the program will not reach exactly. That is, does not terminate. On the other hand, almost terminates because for any , we can find such that for any such that .
3.2 Quantum Concurrent Programs
To illustrate the quantum concurrent programs, we allow more than one control component. The following model implements the process call, although it does not behave like the recursive model of the quantum programs with exits investigated in .
An -party quantum concurrent program is an eight tuple
is a Hilbert space, called the state space.
with being the control component, locations, of process .
is a mapping which associates each location with a corresponding trace preserving super-operator and a quantum measurement satisfying . They are used to describe the evolution of the system caused by action.
is the register of the scheduler, which records the acting program.
with denoting the next location choice and the next program mapping.
is an initial state of the system, which lies in .
with being the initial location of Program .
denotes the acting program in the first round.
Intuitively, this model admits programs running concurrently by processors. At each step of the concurrent system, one program is selected, and the statement at its location is executed. The statement contains a quantum measurement which helps to select the program to be executed in the next step.
Formally, the state of the system always lies in defined as
The initial state is
At the first step, according to data , is chosen and is applied on the initial state to obtain
Then measurement is performed and based on the measurement outcome, classical index, and the corresponding location, the location is changed according to . In other words, any state of the following form with is reachable non-deterministically
where only ’s location of all locations and the scheduler register would be changed.
Generally, at each step, the state
is transformed by the following two sub-steps
Apply super-operators according to the scheduler and location to obtain
Apply quantum measurement and change the location accordingly. The overall state becomes the following for any non-deterministically
We say is admissible of the system if is the initial state and can be obtained by executing the system upon state for all .
This program becomes deterministic if and only if for all , and .
This model can also simulate a quantum program with exit by assuming an exit location for each such that and do not change the state, and for each and .
4 QTL: Specifications and Their Classification
To express the system properties and their development in time, we express the relations on states in a suitable language. When applied to programs, this will be a relation between the quantum data, the locations of all processors together with the data of the scheduler.
The most general verification problem is to establish facts about the developments of the properties in time by introducing time variables as well as the time functional
where denotes the states, including the classical control components, in time . Arbitrary time dependency can be expressed in the above formulism.
To illustrate our ideas without lengthy demonstration, we limit the expression power of the language with respect to dependency in time. More precisely, we only investigate basic predicates with single time variable and two time variables.
4.1 Syntax of Quantum Temporal Logic
As previously mentioned, we only use projections as atomic propositions to build QTL, where consists of all the operators of the following form
where are all projections of . contains two special elements, and .
Let and . We say that satisfies , written , if ; that is, .
More precisely, QTL is built up from the logical operators and , the temporal modal (next), (until), (almost surely until), , , (eventually), (almost surely eventually) and (always). The operators and are introduced to characterize the asymptotical probabilistic behaviour induced by the quantum probability.
Formally, the set of QTL formulas over is inductively defined as follows:
if then is an QTL formula;
if then is an QTL formula;