Quantum Turing Machines: computations and measurements

: Contrary to the classical case, the relation between quantum programming languages and


16
It is an early recognition of computer science that programming (and programming languages) 17 could benefit from solid semantical foundations. At the end of the 50s of last century, both for clarity 18 purposes and for the need of an entrance ticket into the "science club", some prominent scientists Given α, β ∈ Σ * , let α = a 0 a 1 . . . a u−1 and β = b 0 b 1 . . . b v−1 , with u, v ≥ 0. The plain configuration α, q, β, i corresponds to the tape In a canonical plain configuration α, q, β, i the string α does not start with a , and β does not end with a . This ensures that each tape corresponds to a unique canonical plain configuration, and vice versa. However, since it will be useful to manipulate configurations which are extended with blank cells to the right (of the right content) or to the left (of the left content), we shall also consider plain configurations α, q, β, i in which there is no restriction on α and β and we equate them up to the three equivalence relations induced by the following equations α l α β r β α, q, β, i α , q, β , i when α l α and β r β It is readily seen that any plain configuration is equivalent to a unique canonical plain 125 configuration, and that two configurations are equivalent iff they are in the same state, the address of 126 the head is the same, and they correspond to the same tape. 127 2.2. Hilbert space of configurations 128 We will see in the following that a quantum configuration of a QTM cannot be simply a plain 129 configuration, but it must be a weighted superposition of configurations: a vector of the Hilbert space 130 2 (C), where C is a set of configurations, like the plain ones defined above. 131 We recall that, for any denumerable set B, 2 (B) is the Hilbert space of square summable B-indexed sequences of complex numbers φ : B → C | ∑ C∈B |φ(C)| 2 < ∞ equipped with an inner product . | . and the euclidean norm φ = φ | φ , and that 2 1 (B) denotes Given a quantum configuration φ of a QTM M (see Section 2.7 for the formal definition), the main idea introduced by Deutsch [10] is that the machine evolves into another quantum configuration |ψ = U|φ , where U is a unitary operator on the Hilbert space of the configurations of M. By linearity and continuity, this also means that, if C is the set of configurations on which we define the Hilbert space of quantum configuration 2 (C) of M, the operator U, and then the behaviour of M, is completely determined by the value of U on the elements of C. B&V [12] refines this point by assuming that, as in a classical TM, for every C ∈ C, the transition from |C to a new configuration U|C depends only on the current state of M and on the current symbol of C, and that U|C is formed of configurations obtained by replacing the current symbol u of C with a new one, and by moving the tape head to the left or the right. Therefore, if we denote by D = {L, R} the set of the possible movements on the tape (where L stands for left and R for right), and q is the current state of M, we have where p ranges over the states of M, v ranges over its tape alphabet, δ(q, u)(p, v, d) ∈ C, and C p,v,d is 141 the new configuration obtained from C by changing the current state from q to p, by replacing the 142 current symbol u with v, and by moving the tape head in the direction d. In B&V, the transition rule described above applies to every state of the machine. However, as 145 already remarked in the introduction, this implies a severe restriction on the machines that one can 146 actually consider as valid ones-the reversibility of unitary operators, and the problem of how to read 147 the output, force to ask that, in a "well-behaved" QTM, if a configuration in superposition enters the 148 final state, then all other configurations of the superposition must also enter into the final state. 149 The key point is that a QTM cannot stop into some final configuration C f , since the unitarity 150 of U requires that U(|C f ) be defined. On the other hand, we cannot assume that, after reaching 151 some final configuration C f , the computation loops on it neither. As this would imply that C f could 152 not be reached from any other configuration D ∈ C: if U(|C f ) = |C f , then |C f = U −1 (|C f ), 153 and U(|D )(

When a final
154 configuration C f is reached, the machine must evolve into a different configuration which preserves the 155 output written on the tape, without breaking the unitarity of the evolution operator U. Let assume to 156 have a denumerable set of indexed configurations C f , n obtained by adding a counter n ∈ N to C f , for 157 every final configuration C f . The configuration C f , 0 plays the usual role of the plain configuration 158 C f and it is the only one that can be reached from a non final configuration; for every n ∈ N, the 159 configuration C f , n + 1 is instead the only successor of C f , n , that is, U(|C f , n ) = |C f , n + 1 , 160 where |C f , n is the base vector corresponding to C f , n . In other words, the counter n is initialised to 161 0 and plays no role while the state is not final; when a branch of the computation enters a final state, 162 the counter is still at 0, but it is increased by 1 at each following step. 163 Final configurations are not the only configurations on which it would be useful to loop. In 164 some cases, in order to assure that the operator U is unitary, we need to introduce additional target 165 configurations that behave as sinks, from which the machine cannot get out (see Remark 1, and the 166 example in Subsection 5.3, whose graph representation is given in Figure 4). We have then to consider 167 a whole set Q t of target states, containing the final state q f , s.t. for every plain configuration C t = 168 α, q t , β, i , with q t ∈ Q t , we have a set of indexed configurations C t , n , for n ∈ N, s.t. U(|C t , n ) = 169 |C t , n + 1 .

170
Moreover, when U is unitary, its inverse U −1 is unitary too, and can be applied to any initial 171 configuration. Therefore, even if we assume that a computation always starts from some initial 172 plain configuration C j = α, q j , β, i , such a C j must have a predecessor |C j,1 = U −1 (|C j ), and more 173 generally a n-predecessor |C j,n = U −n (|C j ). As already done for final configurations, we associate to 174 every C j a set of indexed configurations C j , n , with n ∈ N, s.t. U −1 (|C j , n ) = |C j , n + 1 , for n ∈ N.

175
For n > 0, we get then U(|C j , n ) = |C j , n − 1 ; while U(|C j , 0 ) has the usual behaviour expected 176 from the machine on the plain initial configuration C j . As for final state and final configurations, it is 177 useful to generalise the above behaviour to a set of source configurations corresponding to a set Q s of 178 source states which contains the initial state q j .

180
In order to formally define QTMs, we first define a notion of pre Quantum Turing Machine, or 181 pQTM. As we shall see later (Definition 7), a QTM is a pQTM whose evolution operator is unitary.

182
Since the behaviour on target states and on source states whose counter is greater than 0 is fixed, in 183 order to completely describe a pQTM, it suffices to give a transition function δ 0 :   for the transitions entering into a given state. So, we must also take into account the case in which we need 208 to complete the implementation of the expected behaviour by adding new transitions from some source states.

209
Finally, we remark that the requirement that the sets of source and target states have the same cardinality is 210 used to prove the unitarity of the evolution operator associated to our QTMs via a reduction to the B&V QTMs 211 (see Theorem 1). We do have another, independent, and direct proof of this result (that we omit in this paper), 212 and which also exploits the equinumerosity of source and target states. We conjecture then that this is indeed a 213 necessary condition. machine that on input 1 n computes a binary representation of an integer m ∈ Z such that | m 2 n − x| ≤ 1 2 n .

218
The set C of the computable complex numbers is the set of the complex numbers whose real and imaginary parts 219 are both computable. Now, let˜ 2 1 (B) be the subset of 2 1 (B) s.t. the coefficients of the vectors are bound to be in C. We can say that a transition functionδ 0 is computable wheñ The gödelization of a QTM whose transition function is computable proceeds in the usual way. First of all, just involved in the gödelization ofδ 0 can be replaced by a pair (n x , n y ), where n x and n y are the Gödel numbers of 223 the Turing machines computing x and y, respectively. 224 2.6. Configurations

225
We have already seen that, in order to properly deal with source and target states, we have to 226 associate a counter to those states. For the sake of uniformity, we shall add a counter to every plain 227 configuration. The counter will always be 0 for every non-source or non-target configuration.

228
Remark 3 (The counter). The counter can be seen as an additional device (for instance, as an additional tape or 229 as a counting register) or directly implemented by a suitable extension of the basic Turing machine (for instance, 230 by extending the tape alphabet). None of these implementations is canonical or has a direct influence in what 231 will be presented in the following. A more detailed discussion of the implementation of the counter is given in     In order to define the evolution operator of a pQTM M, it suffices to give its behaviour on the 268 computational basis CB(C M ). In particular, we have to distinguish three cases: we have and we define where δ 0 is the quantum transition function of M, and, as already introduced at the end of 274 Section 2.3, C p,v,d is is the new configuration obtained from C by changing the current state from 275 q to p, by replacing the current symbol u with v, and by moving the tape head in the direction d.
M be the source configuration obtained by decreasing by 1 the counter of C, we define W s,M (|C ) = |C −1 M be the target configuration obtained by increasing by 1 the counter of C, we define W t,M (|C ) = |C +1 We have then three linear operators defined on three disjoint subspaces. Moreover, since even the images of these three operators are disjoint, their sum defines an automorphism on the linear space of q-configurations W M : span(CB(C)) → span(CB(C)).
Indeed, since W M is bounded, it extends in a unique way to a continuous operator on the Hilbert space 277 of q-configurations.

278
Definition 6 (time evolution operator). The time evolution operator of M is the unique continuous extension of the bounded linear operator W M : span(CB(C)) → span(CB(C)).

279
As it is the case for the operator W M , also the time evolution operator U M can be decomposed into three operators 288 Definition 8 (initial and final configurations). A q-configuration |φ is initial when |φ ∈ 2 1 (C init M ) and is . By |n we denote the initial configuration λ, q 0 , n, 0, 0 ∈ C init M .

290
Definition 9 (computations). Let M be a QTM and let U M be its time evolution operator. For an initial Clearly, any computation of a QTM M is uniquely determined by its initial q-configuration. The 295 computation of M on the initial q-configuration |φ will be denoted by K M |φ . may enter into a final configuration later. Indeed, given a configuration |φ = |φ f + |φ n f , where |φ f ∈ configuration in U i |φ n f has a value of the counter less than i, while any final configuration |C, k ∈ |φ formed 301 of a plain configuration C and a counter k is mapped into a configuration |C, i + k ∈ ψ. Moreover, |C, k and 302 |C, i + k have the same coefficient in |φ and |ψ , respectively, since where () * denote the complex conjugate operator. Let M = Σ, Q, Q s , Q t , δ 0 , q i , q f . We take the B&V QTM N with the same states Q and the same 315 alphabet Σ, and whose transition function ρ satisfies the following conditions: 316 1. ρ is the same of the transition function δ 0 of M for any non-terminal state; 317 2. for any terminal state q t and every current symbol u, ρ has a unique non-null transition, with 318 weight 1, that leaves the current symbol on the tape unchanged, moves the head to the right, and 319 goes into an initial state q s ; 320 3. the non-null out transitions from two distinct terminal states lead to two distinct source states, 321 defining in this way a bijection between the set of the target and source states.

322
In other words, ρ is defined by: The above definition ensures that N is a B&V QTM whose configurations are the plain 323 configurations of M, and s.t. its transition function ρ verifies B&V local conditions. By B&V, the 324 evolution operator U N of N is then a unitary operator on the Hilbert space of the plain configurations 325 of N and, as a consequence, its adjoint U * N is its inverse. We can take three linear operators

336
• δ 0 (q, )(q, , L) = 1/2 It is easy to check that the conditions of Theorem 1 are satisfied, but trivially the induced time evolution operator 345 U is not an isometry since, given the empty string λ we have U(λ, q, λ) = U(λ, r, λ) = (λ, q, λ). We omit here the counter, which always remains set to zero.
A B&V-QTM M = Σ, Q, δ, q 0 , q f is defined as our QTM (with one source state and one target Remark 6. In the following, we shall also use the notation P(⊥) = 1 − ∑ n∈N P(n). By definition, 0 ≤ 400 P(⊥) ≤ 1, and a PPD is a PD iff P(⊥) = 0. We also stress that ≤ is a partial order of PPDs and that any PD 401 P is maximal w.r.t. to ≤.

402
Definition 11 (limit of a sequence of PPDs). Let P = {P i } i∈N be a sequence of PPDs. If for each n ∈ N 403 there exists l n = lim i→∞ P i (n), we say that lim i→∞ P i = P : N → R [0,1] , with P(n) = l n .  1. lim i→∞ P i exists and it is the supremum P of P ; We can then conclude (item 1) that P = lim i→∞ P i .

413
Let us now prove item 2. First of all, since 0 Summing up, we can conclude, as The computed output of a QTM will be defined (Definition 14) as the limit of the sequence of 417 PPDs obtained along its computations.
Proposition 2. If |φ is a q-configuration, P |φ is a PPD. Moreover, it is a PD iff |φ is final.
442 We can now come back to the definition of the computed output of a QTM computation. The easy 446 case is when a computation reaches a final q-configuration |ψ ∈ C f in (meaning that all the classical 447 computations in superposition are "terminated")-in this case the computed output is the PD P |ψ .

448
The QTM keeps computing and transforming |ψ into other configurations, but all these configurations 449 have the same PD. However, we want to give meaning also to "infinite" computations, which never  on the initial q-configuration |φ . The computed output of M on the initial q-configuration |φ is the PPD 454 P = lim i→∞ P |φ i , which we shall also denote by lim K M |φ , or by the notation M |φ → P. 455 Let us remark that, by Proposition 1 and Theorem 3, the limit in the above definition is well-defined 456 for any computation. Therefore, a QTM has a computed output for any initial q-configuration |φ . |φ k is final and P |φ k = P.
1. There exists a k, such that for each j ≥ k, |φ j is final and P |φ j = P.

462
2. P is a PD.

463
Proof. By definition, there is a k s.t. |φ k is final. Let P |φ k = P. By Proposition 2, P is a PD. By 464 monotonicity, P ≤ P |φ j , for every j ≥ k. Thus, since any PD is maximal for ≤ (see Remark 6), P = P |φ j , 465 for every j ≥ k.

466
Given a computation K M |φ , we can then distinguish the following cases:

498
While the evolution of a closed quantum system (e.g., a QTM) is reversible and deterministic once 499 its evolution operator is known, a (global) measurement of a q-configuration is an irreversible process,   The observer periodically measures T in a non destructive way (that is, without modifying the 537 rest of the state of the machine).
1. If the result of the measurement of T gives the value 0, |φ collapses (with a probability equal to ∑ C ∈C f in |e C | 2 ) to the q-configuration and the computation continues with |ψ .  Now, let ∆ be the duration of a single step of a Deutsch QTM. This means that after n steps of the QTM, we are at time t = n∆, and that for the corresponding configurations |ψ n of the QTM, it holds the following property In other words, at each step n, the next configuration |ψ n+1 is obtained by applying the evolution 552 operator U ∆ to the current configuration |ψ n .

553
Now, let us suppose that, as a consequence of the measurement of the halt qubit T, after n steps, and therefore at time t n = n∆, the system collapses to the quantum configuration According to Deutsch's approach, one has to perform a second measurement to read the actual value   But, since such a constraint would be too strong ( as already remarked, if |ψ n+∆ = |ψ n , then U ∆ must 574 be the identity), Ozawa adds the footnote 11:

575
If the relevant outcome of the computation is designed to be written by the program in a restricted 576 part of the tape, this condition can be weakened so that the quantum Turing machine may change the 577 part of the tape string except that part of the tape.

578
In other words, instead of requiring that all tape stays unchanged after reaching a final configuration, 579 only the interesting part of the output must become stable after the halt qubit is set to 1. approach that we shall present in the following is then a sort of implementation of Ozawa's protocol, 590 for which we also prove in details the irrelevance of the number of executed measurements and of the 591 measurement time. Given a q-configuration |φ = |φ f + |φ n f , where |φ f ∈ 2 (C f in ) and |φ n f ∈ 2 (C \ C f in ), our 600 output measurement tries to get an output value from |φ by the following procedure: The probability of an output observation is defined by For e ∈ C, e|C ↓ x |φ , with C ∈ C f in and val[C] = n. Since e|C is a q-configuration, |e| = 1.

628
In particular, let id be the identity function on N. In the corresponding id-observed run, a 629 measurement of the tape is performed after each step of the machine.
Remark 9. We stress that, given a τ-observed run R = {|φ i } i∈N : 1. either it never obtains a value n ∈ N as the result of an output observation, and then it never reaches a

652
C i ∈ C f in , and val[C i ] = n. As a consequence, Pr{R[τ(k) It is immediate to observe that the set K M |φ ,τ naturally defines an infinite tree labelled with q-configurations, where each infinite path starting from the root |φ corresponds to a τ-observed run 659 in K M |φ ,τ .
2. for i > τ(k), the q-configurations φ 1,i = φ 2,i are in two orthonormal subspaces generated by two distinct 663 subsets of C.
be the longest common prefix of R 1 and R 2 . Since they both starts with 665 |φ , such a prefix is not empty; moreover, by the definition of τ-observed run, it is readily seen that 666 h = τ(k), for some k.
where D is a plain configuration and m ∈ N. By 679 induction on j, it is readily seen that m < j ≤ n + j. Thus, |D, m = |C, n + j . Pr{R} |ψ R where |ψ R is the last q-configuration of the finite run R of length k.

684
Let us then prove the assertion by induction on k. By definition and the induction hypothesis We have two possibilities: 685 1. k = τ(i), for any i. In this case, there is a bijection between the runs of length k and those of length k + 1, since each run R ∈ K[k + 1] M |φ ,τ is obtained from a run R ∈ K[k] M |φ ,τ with last q-configuration |ψ R , by appending to R the q-configuration |ψ R = U M |ψ R . Moreover, since by definition, Pr{R } = Pr{R}, we can conclude that Pr{R }|ψ R 2. k = τ(i), for some i. In this case, every R ∈ K[k] M |φ ,τ with last q-configuration |ψ R generates a run R of length k + 1 for every output observation |ψ R ↓ x |ψ R , where R is obtained by appending |ψ R to R. Therefore, let R = {|ψ i } i≤k ∈ K[k] M |φ ,τ and By applying Definition 17, we easily check that

687
We are finally in the position to prove that our observation protocol is compatible with the 688 probability distributions that we defined as computed output of a QTM computation.

689
Theorem 4. Let K M |φ = {φ i } i∈N be the computation of the QTM M on the initial q-configuration |φ and 690 K M |φ ,τ be the τ-observed computation on the same initial configuration. For every n ∈ N: Proof. Let us start with the first item. By Lemma 2, we know that where |ψ R is the last q-configuration of R. Since k = τ(i) + 1, for some i, we also know that either ψ R ∈ C \ C f in or |ψ R = u R |C R with C R ∈ C f in and |u R | = 1. Therefore, By Lemma 1, we know that for every R 1 , R 2 ∈ B[k, n], we have |C R 1 = |C R 2 . Therefore since |u R | = 1. Which concludes the proof of the first item of the assertion.

694
In order to prove the second item, let B[ω, n] = {R ∈ K M |φ ,τ | R ↓ n }. We have that Therefore, by the (already proved) first item of the assertion The above theorem shows that our protocol is not only realistic (unlike those of B&V and Deutsch), Let us represent a QTM M by means of a transition graph (a directed graph) whose nodes are the 712 states of M, and whose arrows give its transition function (see Figure 1). Namely, if δ 0 (p, a)(q, b, d) = x = 0, the graph of M contains an arrow from the node of p to the node of q, labelled by the tuple 714 (a → b, d, x). Every non-target node has at least one outgoing edge labelled by such a tuple, for any 715 symbol a of the tape alphabet.

716
In addition to the arrows of δ 0 , to represent the looping transitions of target nodes, the graph 717 contains a self-loop labelled by +1 on any target node q t : to denote the fact that the only transition 718 of any target configuration is the one that increases the counter by 1, without modifying the rest of 719 the configuration. Dually, every source node q s has a self-loop labelled by −1. The self-loop of q s is 720 not its only outgoing arrow, since the corresponding counter decreasing transition applies to source In the example in Figure 2, q 0 is the initial state and q f is the final one, and they are connected by 732 an arrow (a → a, R, 1) from q f to q 0 , where a ∈ { , 1}. When started on an initial tape containing n + 1 733 (that is, n + 2 symbols 1, see Section 2), the machine M erases two 1s from the tape. When the initial The example in Figure 4 shows a QTM which produces a PD only as an infinite limit. The tape 748 alphabet of the machine M is Σ = {$, 1, }, the set of its source states is Q s = {q 0 , s}, the set of its 749 target states is Q t = {q f , p}, the state q 0 is initial, the state q f is final. In the figure, the symbol a stands 750 for any symbol of the alphabet but $, that is, a ∈ {1, }.

751
The machine M applies properly on initial configurations λ, q 0 , $n, 0, 0 , whose corresponding 752 base vector will be denoted by |$n (to simplify the definition of the machine, we use a slight variant 753 of the enconding given in subsection 3.5 in which the sequence n coding the number n is preceded 754 by a $, which is indeed the only $ on the tape). On such inputs, after moving from the initial state 755 q 0 to q 1 , M either ends up in the final state q f with probability 1/2, or it loops on q 1 with probability 756 1/2. We remark the source state s and the target state p: such states do not play any role when the 757 machine computes on $n, since none of them can be reached. Nevertheless, they must be added to w.r.t. the tape, since no transition of the machine changes any symbol on the tape; however, since n is a sequence of n + 1 symbols 1, the computation leaves all these symbols 1 on the tape, leading then to a 764 computed output of n + 1.) We stress that the PD P is obtained as a limit, since for every j ∈ N, P U j |$n 765 is a PPD s.t. P U j |$n (n + 1) < 1 and P U j |$n (m) = 0, for m = n + that the problem cannot be solved by means of the so-called "ancilla". The ancilla is an additional 814 information added to the main information encoded by a configuration of the quantum machine.

815
The idea is that, once a final state is reached, the machine keeps modifying the ancilla only. The Popescu do not apply-since we carefully tailor the space of the possible configurations of the 820 machines, allowing the ancilla to play a role only during its final and initial evolution.

821
In the second part of the work, the authors launch a strong attack against the use of termination   better computing simulation of the physical world.

855
As always in these foundational studies, we had to go back to the basics, and look for a notion 856 of QTM general enough to encompass previous approaches. We started with pre Quantum TMs 857 (Definition 1), and defined then QTMs as those pre QTMs whose time evolution operator is unitary 858 (Definition 7). Following analogous results in the literature, we showed that unitarity of the evolution operator for a QTM M is equivalent to a set of constraints formulated on the transition function of M 860 (Theorem 1). Our QTMs are able to simulate B&V-QTMs (Theorem 2), but, contrary to B&V-QTMs, 861 they may be used to give meaning to some "infinite" computations. Indeed, in Section 3 we showed 862 that each QTM M naturally defines a computable function from the sphere of radius 1 in 2 (C M ) (i.e.,

869
Particularly tricky is the way in which one reads a result from a quantum computation, which is 870 the subject of Section 4, and in particular 4.5, which shows that our protocol is compatible with the 871 theoretical probabilities defined for configurations in superposition (Theorem 4).

872
While several details of the proposed approach may well change during further study, we are 873 confident the general picture may allow a fresh look to the problem of a quantum universal machine, 874 to the termination of QTMs (for instance characterising termination into the arithmetical hierarchy), 875 and to the various degrees of partiality of quantum computable functions. if Ux, Uy = x, y , for each x, y ∈ V; moreover if U is also surjective, then it is called unitary.

979
Since an isometry is injective, a unitary operator is invertible, and moreover, its inverse is also

995
Appendix B Implementation of the counter 996 A TM purist might argue that the counter adds to the machine a device with a denumerable set of 997 symbols, or with a denumerable set of states, which is not in the spirit of the finite representability 998 of TMs. However, it is an easy exercice to implement the counter directly into the QTM, and in the 999 following we shall briefly describe two ways to do it. Nevertheless, we stress that none of these 1000 implementations can be seen as natural or standard, and that, on the other hand, one could completely 1001 ignore the problem, assuming to add a clock to implement the counter. For these reasons, in the paper, 1002 we have preferred to give the more abstract solution, instead of any more concrete implementation. where: αβγ ∈ Σ * , γ ∈ Σ * is the sequence of extra symbols obtained by replacing any symbol a of γ   1015 with the corresponding extra symbol a; q is any state; q t is a target state; q s is a source state. It is readily 1016 seen that, to obtain an isomorphism between QTMs with extra symbols and QTMs with counters, it 1017 suffices to take the following bijection of configurations (where we use the same symbols as above): Adding/subtracting 1 to the counter corresponds to write/delete a * symbol. To implement these 1027 operations by a single step, it suffices that: