Next Article in Journal
Vibration Analysis of Piezoelectric Cantilever Beams with Bimodular Functionally-Graded Properties
Next Article in Special Issue
Estimating Algorithmic Information Using Quantum Computing for Genomics Applications
Previous Article in Journal
Fatigue Cracking of Additively Manufactured Materials—Process and Material Perspectives
 
 
Order Article Reprints
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Quantum Turing Machines: Computations and Measurements

1
LIPN, UMR 7030 CNRS, Institut Galilée, Université Sorbonne Paris Nord, 93430 Villetaneuse, France
2
Dipartimento di Informatica—Scienza e Ingegneria, Università di Bologna, 40126 Bologna, Italy
3
Inria Sophia-Antipolis, 06902 Valbonne, France
4
Dipartimento di Informatica, Università di Verona, 37134 Verona, Italy
*
Author to whom correspondence should be addressed.
S. Martini: Research partially conducted while on sabbatical leave at the Collegium—Lyon Institute for Advanced Studies, 2018–2019.
Appl. Sci. 2020, 10(16), 5551; https://doi.org/10.3390/app10165551
Received: 5 July 2020 / Revised: 6 August 2020 / Accepted: 7 August 2020 / Published: 11 August 2020
(This article belongs to the Special Issue Explorations in Quantum Computing)

Abstract

:
Contrary to the classical case, the relation between quantum programming languages and quantum Turing Machines (QTM) has not been fully investigated. In particular, there are features of QTMs that have not been exploited, a notable example being the intrinsic infinite nature of any quantum computation. In this paper, we propose a definition of QTM, which extends and unifies the notions of Deutsch and Bernstein & Vazirani. In particular, we allow both arbitrary quantum input, and meaningful superpositions of computations, where some of them are “terminated” with an “output”, while others are not. For some infinite computations an “output” is obtained as a limit of finite portions of the computation. We propose a natural and robust observation protocol for our QTMs, which does not modify the probability of the possible outcomes of the machines. Finally, we use QTMs to define a class of quantum computable functions—any such function is a mapping from a general quantum state to a probability distribution of natural numbers. We expect that our class of functions, when restricted to classical input-output, will not be different from the set of the recursive functions.

1. Introduction

It is an early recognition of computer science that programming (and programming languages) could benefit from solid semantical foundations. At the end of the 50s of the last century, both for clarity purposes and for the need of an entrance ticket into the “science club”, some prominent scientists started using mathematical techniques for the description of programming languages (e.g., Chomsky’s generative grammars, in the form of Backus-Naur Form [1]). Even more important is the proposal of general semantical models for the meaning of programs, represented at its best by McCarthy’s “mathematical theory of computation” [2], where a definition of the class of computable functions is presented as a general model for the semantics of (Algol) programs. The model is clearly idealised, in which it assumes that execution happens without physical limitations of space and time, in what will be, from that moment onwards, the standard model for programming languages, where one may assume Turing-completeness, despite each implementation being a finite state machine. The standard model builds on a long process during which Turing machines are viewed as idealised models of actual computers, and thus provide a basis for some theoretical investigation, among which the first studies on computational complexity.
Quantum computations and quantum programming languages have followed a different path. A solid and ever growing body of research is present on semantics and mathematical methods (e.g., see [3,4,5,6,7,8,9]), but the relations of these languages with the basic notion of (quantum) Turing machines (as introduced by Deutsch in his seminal paper on quantum computation [10]; also see [11] for a quantum-mechanical model of Turing machines) has received much less study than in the classical case. The exception is, of course, the definition of quantum Turing machines (QTMs) by Bernstein & Vazirani [12] (B&V, from now on) and its use in the establishment of a sound quantum computational complexity. However, their machines, have several strong constraints, reasonable for the purpose of a theory of computational complexity, but that do not permit to exploit all the features of the idealised model of computation that QTMs provide. In particular, meaningful computations are defined only for classical inputs (a single natural number with amplitude 1), and B&V’s “well-behaved” QTMs “terminate” synchronously—either all paths in superpositions enter a final state at the same time, or all of them diverge. As a consequence, there is no chance to study—and give meaning—to infinite computations, since for B&V’s “well-behaved” QTMs “non termination” corresponds to classical divergence.
Our aim is to provide a definition of QTMs with both quantum data and quantum control, hence broader than B&V’s one, and to base on this notion an explicit definition of a class of functions “computed by QTMs”. First of all, we allow a QTM to “start” its computation on an arbitrary quantum input—that is, a denumerable superposition of configurations, each representing a natural number. Second, because any computation of a QTM is always an infinite one, we want to give meaning also to some of these infinite computations. For such infinite behaviours, an “output” is obtained as a limit of finite portions of the computation. In order to accommodate these two aims with the unitary condition of the evolution, we have first to carefully define the very notion of QTM, in such a way that, when a computation of the machine enters into a “final state”, its evolution continues to remain in that final state, without changing the output written on the tape. This kind of evolution is obtained by enriching the machines by means of a suitable counter, which plays no role during the standard evolution of the machine, but starts to be increased when a path of the computation enters into a final state (a dual treatment, by reversibility, is done for the initial state). Differently from B&V, any computation path (that is, any element of the superposition) evolves independently from the others: any path may terminate at its own time, or may diverge. Like B&V, we give local conditions ensuring that the resulting evolution respects the unitary condition.
We propose a suitable protocol for termination and observation of the result, which is robust with respect to the choice of the time instants in which the measurements for observing the results are made. This is in contrast to both B&V, where one has to know the exact termination time, and to Deutsch, where a partial measurement is made at every single step of the computation. The termination criteria for B&V and Deutsch is also one of the main obstacles for their use to define meaningful infinite computations. In all the paper, with the exception of Section 6.2 when discussing papers of other authors, we use “termination” and not “halting”. Because there is no real halting for QTMs, we use a term different from the standard one used for classical TMs, to remark the difference.
Once we have a robust notion of QTMs and their observation protocol, we define the notion of “function computable by a QTM”, as a mapping between superpositions of initial classical configurations to probability distributions of natural numbers, which is obtained (in general) as a limit of an infinite QTM computation. Because not all infinite computations are meaningful to the limit, the resulting class of quantum computable functions also contains non-total functions, as is usual in computability theory.
We stress that we are not proposing a kind of “super Turing computability”. We expect that our class of functions, when restricted to classical input-output and computable amplitudes, will not be different from the set of the recursive functions (see the end of Section 3.5).
We believe it is interesting to have a class of machines and functions that could be seen as a simple, and standard, model of quantum programs, thus opening the door to a quantum computability theory that could be of use for the semantics of quantum programming languages.

Organization of the Paper

Section 2 introduces the central notion of Quantum Turing Machines; the technical definitions are preceded by a lengthy discussion on the motivations of the most delicate issues. We conclude the section with a theorem giving local conditions for unitarity, as in [12]. Section 3 uses QTMs to define a class of partial quantum computable functions. Section 4 deals with the problem of observables with respect to QTM computations. The protocols of Deutsch [10,12] are discussed, and a new observational protocol is proposed, proving that it agrees with the notion of computable functions of the previous section. In particular, we discuss, in detail, Deutsch’s protocol, in which sense our proposal is different, and how it is related to Ozawa’s termination protocol [13]. In Section 5, we propose a detailed comparison with the approach of B&V. Section 6 is a detailed discussion of related work and other approaches. Finally, we discuss in the Appendix A some additional technical issues.

2. Quantum Turing Machines

In this section, we define quantum Turing machines. Before the formal statements (Definitions 1, 3 and 4, etc.), we will discuss, in detail, some of the notions that will be introduced, to motivate and explain our technical choices. We assume the reader be familiar with classical Turing machines (otherwise, see [14]), which we assume defined with a tape infinite in both directions.
Like a classical Turing Machine (TM), a Quantum Turing Machine (QTM) has a tape (a sequence of cells) containing symbols (one in each cell) from a finite tape alphabet Σ , which includes at least the symbols 1 and □: 1 is used to code natural numbers in unary notation, while □ is the blank symbol. We shall consider computations starting from tapes containing a sequence of n + 1 symbols 1 (the encoding of the natural number n); thus, in the following, for any n N , we shall use n ̲ to denote the string 1 n + 1 . By the Greek letters α , β , possibly indexed, we shall instead denote strings in Σ * , and by α β , we shall denote the concatenation of α and β . Finally, we shall use λ to denote the empty string.

2.1. Plain Configurations

The basic elements to describe the configuration of a QTM are the finite sequences of symbols on the tape (as usual, we assume that only a finite portion of the tape contains non-blank symbols), the current internal state of the machine, and the current position of the head reading a symbol in a cell of the tape. We assume that each cell of the tape has a fixed address (an integer number), corresponding to its position on the tape. That is, we assume the tape to be a function T : Z Σ , such that, at any moment of the execution, only a finite, contiguous part of the tape is not empty, i.e., at any step of the execution, there are two constants h k s.t., T ( i ) = for i < h and i k (thus, when h = k the tape is empty).
A canonical plain configuration of a given QTM M is a quadruple α , q , β , i Σ * × Q × Σ * × Z , s.t.:
1.
q Q is the current state, where Q is the finite set of the internal states of M.
2.
β Σ * is the right content of the tape (w.r.t. the head position), where Σ is the tape alphabet of the machine M. If β = u β λ , the symbol u Σ is the current symbol, which is the content of the current cell, while β Σ * is the longest string on the tape ending with a symbol different from □ and whose first symbol (if any) is written in the cell immediately to the right of the current cell. When β = λ instead, the right content of the tape, including the current cell, is empty, and the current symbol is □.
3.
α is the left content of the tape (w.r.t. the head position). That is, it is either the empty string λ , or it is the longest string on the tape starting with a symbol different from □, and whose last symbol is written in the cell immediately to the left of the current cell.
4.
i is the address of the current cell.
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
T ( j ) = a j i + u for i u j < i b j i for i j < i + v otherwise
where T ( j ) , implies that i u j < i + v .
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, because it will be useful to manipulate configurations that 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 that are 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 configuration, and that two configurations are equivalent if and only if they are in the same state, the address of the head is the same, and they correspond to the same tape.

2.2. Hilbert Space of Configurations

We will see in the following that a quantum configuration of a QTM cannot simply be a plain configuration, but it must be a weighted superposition of configurations: a vector of the Hilbert space 2 ( C ) , where C is a set of configurations, like the plain ones defined above.
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 1 2 ( B ) denotes the set of vectors { ϕ ϕ 2 ( B ) & ϕ = 1 } .
By using Dirac notation, we shall write | ϕ to denote the vector of 2 ( B ) corresponding to the function ϕ : B C . Moreover, for every C B , we shall write | C to denote the vector corresponding to C, which is, the function equal to 1 on C, and equal to 0 on the other elements of B . Finally, we remark that any vector | ϕ of 2 ( B ) can be written as i I d i | C i , for some denumerable set of indexes I s.t. { C i i I } B and d i C , for every i I . For more details on the basic notions of Hilbert spaces, see Appendix A.

2.3. Transitions of a QTM

Given a quantum configuration ϕ of a QTM M (see Section 2.7 for the formal definition), the main idea that is 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 only depends 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
U ( | C ) = p , v , d δ ( q , u ) ( p , v , d ) | C p , v , d ,
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 the new configuration obtained from C by changing the current state from q to p, by replacing the current symbol u with v, and by moving the tape head in the direction d.

2.4. Initial and Final Configurations

In B&V, the transition rule described above applies to every state of the machine. However, as already remarked in the introduction, this implies a severe restriction on the machines that one can actually consider as valid ones—the reversibility of unitary operators, and the problem of how to read the output, force to ask that, in a “well-behaved” QTM, if a configuration in superposition enters the final state, then all other configurations of the superposition must also enter into the final state.
The key point is that a QTM cannot stop into some final configuration C f , since the unitarity of U requires that U ( | C f ) be defined. On the other hand, we cannot assume that, after reaching some final configuration C f , the computation loops on it neither. As this would imply that C f could not be reached from any other configuration D C : if U ( | C f ) = | C f , then | C f = U 1 ( | C f ) , and U ( | D ) ( C f ) = U ( | D ) C f = D U 1 ( | C f ) = D C f = 0 , for D C f . When a final configuration C f is reached, the machine must evolve into a different configuration that preserves the output written on the tape, without breaking the unitarity of the evolution operator U. Let us assume to have a denumerable set of indexed configurations C f , n obtained by adding a counter n N to C f , for every final configuration C f . The configuration C f , 0 plays the usual role of the plain configuration C f and it is the only one that can be reached from a non final configuration; for every n N , the configuration C f , n + 1 is instead the only successor of C f , n , which is, U ( | C f , n ) = | C f , n + 1 , where | C f , n is the base vector corresponding to C f , n . In other words, the counter n is initialised to 0 and plays no role while the state is not final; when a branch of the computation enters a final state, the counter is still at 0, but it is increased by 1 at each following step.
Final configurations are not the only configurations on which it would be useful to loop. In some cases, in order to assure that the operator U is unitary, we need to introduce additional target configurations that behave as sinks, from which the machine cannot get out (see Remark 1, and the example in Section 5.3, whose graph representation is given in Figure 4). We have then to consider a whole set Q t of target states, containing the final state q f , s.t. for every plain configuration C t = α , 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 ) = | C t , n + 1 .
Moreover, when U is unitary, its inverse U 1 is unitary too, and it can be applied to any initial configuration. Therefore, even if we assume that a computation always starts from some initial plain configuration C j = α , q j , β , i , such a C j must have a predecessor | C j , 1 = U 1 ( | C j ) , and more generally a n-predecessor | C j , n = U n ( | C j ) . As already done for final configurations, we associate to 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 . For n > 0 , we get then U ( | C j , n ) = | C j , n 1 ; while U ( | C j , 0 ) has the usual behaviour expected from the machine on the plain initial configuration C j . As for final state and final configurations, it is useful to generalise the above behaviour to a set of source configurations corresponding to a set Q s of source states that contains the initial state q j .

2.5. Pre Quantum Turing Machines

In order to formally define QTMs, we first define a notion of pre Quantum Turing Machine, or pQTM. As we shall see later (Definition 7), a QTM is a pQTM whose evolution operator is unitary. Because the behaviour on target states and on source states whose counter is greater than 0 is fixed, in order to completely describe a pQTM, it suffices to give a transition function δ 0 : ( ( Q Q t ) × Σ ) 1 2 ( ( Q Q s ) × Σ × D ) , which, for every configuration C with current state q and current symbol u, gives the weight δ 0 ( q , u ) ( p , v , d ) of | C p , v , d in the superposed configuration reached from | C , where C p , v , d is obtained by replacing v for u, by moving the tape in the d direction, and by changing the current state to p.
Definition 1
(Pre Quantum Turing Machine). Given a finite set of states Q and an alphabet Σ, a pre Quantum Turing Machine (pQTM) is a tuple
M = Σ , Q , Q s , Q t , δ 0 , q i , q f
where
  • Q s Q is the set of source states of M, and q i Q s is a distinguished source state named the initial state of M;
  • Q t Q is the set of target states of M, and q f Q t is a distinguished target state named the final state of M;
  • Q s and Q t have the same cardinality and Q s Q t = ;
  • δ 0 : ( ( Q Q t ) × Σ ) 1 2 ( ( Q Q s ) × Σ × D ) is the quantum transition function of M, where D = { L , R } .
Remark 1
(Source and target states). Source and target states must be introduced to complete a QTM when the transitions implementing its expected behaviour fail to assure the local conditions of Theorem 1, required to get a unitary time evolution operator. In particular, the first condition states that the norm of the vector δ ( q , u ) corresponding to the transition from a configuration C with current state q and current symbol u, to a superposed configuration δ ( q , u ) ( p , v , d ) | C p , v , d must be equal to 1. Anyhow, in some case, the norm of the vector of the weights implementing the expected behavior of the machine might give a value smaller than 1, while, in no case, it cannot exceed the value of 1. To achieve the required local condition, we can add some new transitions to some special target state acting as a sink (i.e., from which the machine cannot get out), with a procedure reminding the one used to complete a non-deterministic automata by connecting all of the omitted transitions to a sink state. The main difference is that in the QTM case more than one target state may be necessary to achieve the goal. Moreover, because of the reversibility of QTMs, a similar condition must hold for the transitions entering into a given state. Accordingly, we must also take into account the case in which we need to complete the implementation of the expected behaviour by adding new transitions from some source states. Finally, we remark that the requirement that the sets of source and target states have the same cardinality is used to prove the unitarity of the evolution operator associated to our QTMs via a reduction to the B&V QTMs (see Theorem 1). We do have another, independent, and direct proof of this result (that we omit in this paper), and that also exploits the equinumerosity of source and target states. We conjecture then that this is indeed a necessary condition.
Remark 2
(On gödelization of QTMs). For a definition of gödelizable QTMs, we must restrict the definition of the transition function to computable complex numbers (see also [12].)
Definition 2 (computable numbers).
A real number x is computable if there exists a deterministic Turing machine that on input 1 n computes a binary representation of an integer m Z , such that | m 2 n x | 1 2 n . The set C ˜ of the computable complex numbers is the set of the complex numbers whose real and imaginary parts are both computable.
Now, let ˜ 1 2 ( B ) be the subset of 1 2 ( B ) s.t. the coefficients of the vectors are bound to be in C ˜ . We can say that a transition function δ ˜ 0 is computable when
δ ˜ 0 : ( ( Q Q t ) × Σ ) 1 2 ˜ ( ( Q Q s ) × Σ × D ) .
The gödelization of a QTM whose transition function is computable proceeds in the usual way. First of all, just observe that 1 2 ( ( Q Q s ) × Σ × D ) is a finite dimensional space, then each complex number x + i y C ˜ 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 the Turing machines computing x and y, respectively.

2.6. Configurations

We have already seen that, in order to properly deal with source and target states, we have to associate a counter to those states. For the sake of uniformity, we shall add a counter to every plain configuration. The counter will always be 0 for every non-source or non-target configuration.
Remark 3
(The counter). The counter can be seen as an additional device (for instance, as an additional tape or as a counting register) or directly implemented by a suitable extension of the basic Turing machine (for instance, by extending the tape alphabet). None of these implementations is canonical or it has a direct influence in what will be presented in the following. Appendix B provides a more detailed discussion of the implementation of the counter.
Definition 3
(configurations). Let M = ( Σ , Q , Q s , Q t , δ 0 , q 0 , q f ) be a pQTM. A configuration of M is a quintuple α , q , β , i , n Σ * × Q × Σ * × Z × N , where α , q , β , i is a plain configuration, and n is a counter associated to the configuration s.t. n = 0 , when q Q s Q t . A configuration of M is a source/target configuration when the corresponding state is a source/target state, and it is a final/initial configuration when the current state is final/initial. We have the following notations:
  • C M is the set of the configurations of M.
  • C M s and C M t are the sets of the source and of the target configurations of M, respectively.
  • C M i n i t and C M f i n are the sets of the initial and final configurations of M, respectively.
  • C M 0 is the set of the configurations α , q , β , i , 0 of M.
In the following, the subscript M in C M and in the other names indexed by the machine may be dropped when clear from the context.

2.7. Quantum Configurations

The evolution of a pQTM is described by superpositions of configurations in C M . If B C M is a set of configurations, a superposition of configurations in B is a vector of the Hilbert space 2 ( B ) (see, e.g., [15,16]). Quantum configurations of a pQTM M are the elements of 1 2 ( C M ) (namely, the unit vectors of 2 ( C M ) ). Because there is no bound on the size of the tape in a configuration, the set C M is infinite and the Hilbert space of the configurations 2 ( C M ) is infinite dimensional.
Definition 4
(quantum configurations). Let M be a pQTM. The elements of 1 2 ( C M ) are the quantum configurations (or more succinctly, q-configurations) of M.
We shall use Dirac notation (see Appendix A) for the elements ϕ , ψ of 2 ( C M ) , writing them | ϕ , | ψ .
Definition 5
(computational basis). For any set of configurations B C M and any C B , let | C : B C be the function
| C ( D ) = 1 i f C = D 0 i f C D .
The set CB ( B ) of all such functions is a Hilbert basis for 2 ( B ) (see, e.g., [17]). In particular, following the literature on quantum computing, CB ( C M ) is called the computational basis of 2 ( C M ) . Each element of the computational basis is called base q-configuration.
With a little abuse of language, we shall write | C | ϕ when ϕ ( C ) 0 . The span of CB ( B ) , denoted by span ( CB ( B ) ) , is the set of the finite linear combinations with complex coefficients of elements of CB ( B ) ; span ( B ) is a vector space, but not a Hilbert space. In order to get a Hilbert space from span ( CB ( B ) ) , we have to complete it, and 2 ( B ) is indeed the unique (up to isomorphism) completion of span ( CB ( B ) ) (see [12]). As a consequence, any bounded linear operator U on span ( CB ( B ) ) has a unique extension on 2 ( B ) , and, when U is unitary, its extension is unitary too.
For some basic definitions, properties, and notations on Hilbert spaces with denumerable basis, see Appendix A. In particular, Appendix A.1 presents a synoptic table of the so-called Dirac notation that we shall use in the paper.

2.8. Time Evolution Operator and QTM

In order to define the evolution operator of a pQTM M, it suffices to give its behaviour on the computational basis CB ( C M ) . In particular, we have to distinguish three cases:
1.
C C M 0 C M t .
Let C p , v , d C M 0 C M s be the configuration obtained by leaving the counter to 0, by replacing the symbol u in the current cell with the symbol v, by moving the head on the d direction, and by setting the machine into the new state p. In detail, if C α w , q , u β , i , 0 we have
C p , v , d α w v , p , β , i + 1 , 0 when d = R α , p , w v β , i 1 , 0 when = L .
and we define
W 0 , M ( | C ) = ( p , v , d ) ( Q Q s ) × Σ × D δ 0 ( q , u ) ( p , v , d ) | C p , v , d
where δ 0 is the quantum transition function of M, and, as already introduced at the end of Section 2.3, C p , v , d is the new configuration obtained from C by changing the current state from q to p, by replacing the current symbol u with v, and by moving the tape head in the direction d.
2.
C C M s C M 0 .
Let C 1 C M s be the source configuration obtained by decreasing by 1 the counter of C, we define
W s , M ( | C ) = | C 1
3.
C C M t .
Let C + 1 C M t C M 0 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
W 0 , M : span ( CB ( C M 0 C M t ) ) span ( CB ( C M 0 C M s ) ) W s , M : span ( CB ( C M s C M 0 ) ) span ( CB ( C M s ) ) W t , M : span ( CB ( C M t ) ) span ( CB ( C M t C M 0 ) )
defined on three disjoint subspaces. Moreover, because even the images of these three operators are disjoint, their sum
W M = W 0 , M + W s , M + W t , M
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 of q-configurations.
Definition 6
(time evolution operator). The time evolution operator of M is the unique continuous extension
U M : 2 ( C M ) 2 ( C M )
of the bounded linear operator W M : span ( CB ( C ) ) span ( CB ( C ) ) .
As it is the case for the operator W M , also the time evolution operator U M can be decomposed into three operators
U 0 , M : 2 ( C M 0 C M t ) 2 ( C M 0 C M s ) U s , M : 2 ( C M s C M 0 ) 2 ( C M s ) U t , M : 2 ( C M t ) 2 ( C M t C M 0 )
s.t.
U M = U 0 , M + U s , M + U t , M .
Definition 7
(QTM). A pQTM is a Quantum Turing Machine (QTM) when its time evolution operator U M is unitary.
As usual, U M i (the i-th iterate of U M ) is defined as U M 0 = i d , and U M i + 1 = U M U M i .

2.9. Computations

A computation of a QTM is an iteration of its evolution operator on some q-configuration. Because the time evolution operator of a QTM is unitary, it preserves the norm of its argument and maps q-configurations into q-configurations. By the way, this also holds for the inverse U M 1 of the time evolution operator.
Property 1.
Let M be a QTM. If | ϕ 1 2 ( C M ) , then U M i | ϕ 1 2 ( C M ) , for every i Z .
Definition 8
(initial and final configurations). A q-configuration | ϕ is initial when | ϕ 1 2 ( C M i n i t ) and is final when | ϕ 1 2 ( C M f i n ) . By | n ̲ , we denote the initial configuration λ , q 0 , n ̲ , 0 , 0 C M i n i t .
Definition 9
(computations). Let M be a QTM and let U M be its time evolution operator. For an initial q-configuration | ϕ 1 2 ( C i n i t ) , the computation of M on | ϕ is the denumerable sequence { | ϕ i } i N s.t.
1. 
| ϕ 0 = | ϕ ;
2. 
| ϕ i = U M i | ϕ .
Clearly, any computation of a QTM M is uniquely determined by its initial q-configuration. The computation of M on the initial q-configuration | ϕ will be denoted by K | ϕ M .
Remark 4.
The definition of the time evolution operator ensures that the final configurations reached along a computation are stable and do not interfere with other branches of the computation in superposition, which may enter into a final configuration later. Indeed, given a configuration | ϕ = | ϕ f + | ϕ n f , where | ϕ f 2 ( C f i n ) and | ϕ n f does not contain any final configuration, let | ψ = U i | ϕ = U i | ϕ f + U i | ϕ n f . Any final configuration in U i | ϕ n f has a value of the counter less than i, while any final configuration | C , k | ϕ formed of a plain configuration C and a counter k is mapped into a configuration | C , i + k ψ . Moreover, | C , k and | C , i + k have the same coefficient in | ϕ and | ψ , respectively, since ψ C , i + k = U i | ϕ , U i | C , k = ϕ C , k .

2.10. Local Conditions for Unitary Evolution

In analogy to the main approaches in the literature [12,18], it is possible to state a set of local condition for the quantum transition function δ 0 of pQTMs in order to ensure that the time evolution operator is unitary.
Theorem 1.
Let M be a pQTM with quantum transition function δ 0 . The time evolution operator U M : 2 ( C M ) 2 ( C M ) of M is unitary if and only if δ 0 satisfies the local conditions:
1. 
for any ( q , a ) ( Q Q t ) × Σ
( p , b , d ) ( Q Q s ) × Σ × D | δ 0 ( q , a ) ( p , b , d ) | 2 = 1
2. 
for any ( q , a ) , ( q , a ) ( Q Q t ) × Σ with ( q , a ) ( q , a )
( p , b , d ) ( Q Q s ) × Σ × D δ 0 ( q , a ) ( p , b , d ) * δ 0 ( q , a ) ( p , b , d ) = 0
3. 
for any ( q , a , b ) , ( q , a , b ) ( Q Q t ) × Σ 2
p ( Q Q s ) δ 0 ( q , a ) ( p , b , L ) * δ 0 ( q , a ) ( p , b , R ) = 0
where ( ) * denote the complex conjugate operator.
Proof. 
We show that, to any QTM M (as defined above), we can associate a B&V QTM N, which differs on the behaviour on source and target states only. The unitarity of M follows then from the unitarity of N.
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 alphabet Σ , and whose transition function ρ satisfies the following conditions:
1.
ρ is the same of the transition function δ 0 of M for any non-terminal state;
2.
for any terminal state q t and every current symbol u, ρ has a unique non-null transition, with weight 1, that leaves the current symbol on the tape unchanged, moves the head to the right, and goes into an initial state q s ; and,
3.
the non-null out transitions from two distinct terminal states lead to two distinct source states, defining in this way a bijection between the set of the target and source states.
In other words, ρ is defined by:
ρ ( q , u ) ( p , v , d ) = δ 0 ( q , u ) ( p , v , d ) for q Q Q t , p Q Q s , u , v Σ , d D ρ ( q , u ) ( s , v , d ) = 0 for q Q Q t , s Q s , u , v Σ , d D
and, assuming Q s = { s i } 0 i k and Q t = { t i } 0 i k
ρ ( t i , u ) ( s i , u , R ) = 1 for u Σ
ρ ( t i , u ) ( s i , v , L ) = 0 for u , v Σ
ρ ( t i , u ) ( q , v , d ) = 0 for q Q Q t , q s i , u , v Σ , d D
The above definition ensures that N is a B&V QTM whose configurations are the plain configurations of M, and s.t. its transition function ρ verifies B&V local conditions. By B&V, the evolution operator U N of N is then a unitary operator on the Hilbert space of the plain configurations of N and, as a consequence, its adjoint U N * is its inverse. We can take three linear operators
V 0 , M : span ( CB ( C M 0 C M s ) ) span ( CB ( C M 0 C M t ) ) V s , M : span ( CB ( C M s ) ) span ( CB ( C M s C M 0 ) ) V t , M : span ( CB ( C M t C M 0 ) ) span ( CB ( C M t ) )
defined by
V 0 , M | C = | D with | D = U N * | C when | C C M 0 C M s V s , M | C = | C + 1 when | C C M s V t , M | C = | C 1 when | C C M t C M 0
Which are the inverses of the three corresponding linear operators W 0 , M , W s , M , and W t M , respectively (see Section 2.8). Thus, the bounded linear operator V M = V 0 , M + V s , M + V t M is the inverse of W M = W 0 , M + W s , M + W t M , and its continuous extension (obtained by completion) is the inverse of U M . Moreover, such an operator is also the adjoint U M * of U M . Summing up, the adjoint U M * of U M is its inverse and, as a consequence, U M is unitary.  □
Remark 5.
The reader may wonder why we need to have cell indexes in configurations, when they are not used in many definitions of classical TMs. In fact, cell indexes are only needed in a very special case, which is of a completely empty tape. Let us suppose, indeed, to eliminate indexes, and to feed a completely blank tape to a QTM with only two states { q , r } , with no source and final states and no tape symbols, except □; let the transition function δ 0 be s.t.
  • δ 0 ( q , ) ( q , , L ) = 1 / 2
  • δ 0 ( q , ) ( q , , R ) = 1 / 2
  • δ 0 ( q , ) ( r , , L ) = 1 / 2
  • δ 0 ( q , ) ( r , , R ) = 1 / 2
  • δ 0 ( r , ) ( q , , L ) = 1 / 2
  • δ 0 ( r , ) ( q , , R ) = 1 / 2
  • δ 0 ( r , ) ( r , , L ) = 1 / 2
  • δ 0 ( r , ) ( r , , R ) = 1 / 2
It is easy to check that the conditions of Theorem 1 are satisfied, but trivially the induced time evolution operator 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). The indexing we use is consistent with the one adopted by Bernstein & Vazirani, [12]—Definition 3.2, pag. 1419. Here, we just want to point out that Bernstein & Vazirani only provides a fairly light informal definition of configuration. We have preferred a more pedantic formulation, which, in our opinion, is necessary to eliminate all of the reader’s doubts about the correctness of the proposed theorems.

2.11. A Comparison with Bernstein and Vazirani’s QTMs: Part 1

We refer to B&V [12] for the precise definitions of the QTMs used in that paper. For the sake of readability, we informally recall the notion of what they call well formed, stationary, normal form QTMs (B&V-QTMs in the following).
A B&V-QTM M = Σ , Q , δ , q 0 , q f is defined as our QTM (with one source state and one target state only) with the following differences:
1.
the set of configurations coincides with all possible classical configurations, namely all the set Σ * × Q × Σ * × Z ;
2.
no superposition is allowed in the initial q-configuration (it must be a classical configuration α , q , β , i with amplitude 1);
3.
given an initial configuration | C , the q-configuration ϕ k = U M k | C is the final q-configuration for the computation starting in | C , when: (i) all of the configurations in ϕ k are final; (ii) for all i < k , the q-configuration ϕ i = U M i | C does not contain any final configuration. When this is the case, we also say that the QTM halts in k steps in ϕ k ;
4.
if a QTM halts, then the tape head is on the start cell of the initial configuration; and,
5.
there is no counter and for every symbol a there is loop from the only final state q f into the only initial state q 0 , which is, δ ( q f , a ) ( q 0 , a , R ) = 1 for every a Σ . Therefore, because of the local unitary conditions (that must hold in the final state too), these are the only outgoing transitions from q f , and the only incoming ones into q 0 . Accordingly, δ ( q f , a ) ( q , a , d ) = 0 if ( q , a , d ) ( q 0 , a , R ) and δ ( q , a ) ( q 0 , a , d ) = 0 if ( q , a , d ) ( q f , a , R ) .
Theorem 2.
For any B&V-QTM M there is a QTM M s.t. for each initial configuration | C , if M with input | C halts in k steps in a final configuration | ϕ = U M k | C , then U M k | C = | ϕ .
Proof. 
The QTM M has the same states of M, the initial state q 0 is its only source state, and the final state q f is its only target state. Therefore, if M = Σ , Q , δ , q 0 , q f , we take M = Σ , Q , { q 0 } , { q f } , δ 0 , q 0 , q f , where δ 0 is the restriction of δ to ( ( Q Q t ) × Σ ) 2 ( ( Q Q s ) × Σ × D ) , which is, for each q q f and a Σ , we have δ 0 ( q , a ) ( p , b , d ) = δ ( q , a ) ( p , b , d ) , for every ( p , b , d ) ( Q Q s ) × Σ × D . Because the local unitary conditions hold for δ and, in a B&V-QTM, δ ( q , a ) ( q 0 , b , d ) = 0 , when q q f , the unitary local conditions hold for δ 0 too.
By construction, if U M i | C is not final for 0 i < k , then | ϕ k = U M k | C = U M k | C . In particular, this holds when | ϕ k is the final configuration of the B&V-QTM M.  □
We remark that the inverse cannot hold true: A B&V-QTM for a given input cannot exhibit both a non terminated computation and a terminated one (see Section 5.3 for a machine that cannot be simulated by a B&V-QTM).

3. Quantum Computable Functions

In this section, we address the problem of defining the concept of quantum computable function in an “ideal” way, without taking into account any measurement protocol. The problem of the observation protocol will be addressed in Section 4. Here, we show how each QTM naturally defines a computable function from the sphere of radius 1 in 2 ( C M ) to the set of (partial) probability distributions on the set of natural numbers.

3.1. Probability Distributions

Definition 10
(Probability distributions).
1. 
A partial probability distribution (PPD) of natural numbers is a function P : N R [ 0 , 1 ] such that n N P ( n ) 1 .
2. 
If n N P ( n ) = 1 , P is a probability distribution (PD).
3. 
P and P 1 denote the sets of all the PPDs and PDs, respectively.
4. 
If the set { n : P ( n ) 0 } is finite, P is finite.
5. 
Let P , P be two PPDs, we say that P P ( P < P ) if and only if for each n N , P ( n ) P ( n ) ( P ( n ) < P ( n ) ).
6. 
Let P = { P i } i N be a denumerable sequence of PPDs; P is monotone if and only if P i P j , for each i < j .
Remark 6.
In the following, we shall also use the notation P ( ) = 1 n N P ( n ) . By definition, 0 P ( ) 1 , and a PPD is a PD if and only if P ( ) = 0 . We also stress that ≤ is a partial order of PPDs and that any PD P is maximal w.r.t. to ≤.
Definition 11
(limit of a sequence of PPDs). Let P = { P i } i N be a sequence of PPDs. If, for each n N , 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 .

3.2. Monotone Sequences of Probability Distributions

Proposition 1.
Let P = { P i } i N P be a monotone sequence of PPDs.
1. 
lim i P i exists and it is the supremum P of P ;
2. 
n N ( P ) ( n ) = n N P i ( n ) i N ;
3. 
P P .
Proof. 
Because P i ( n ) 1 , every non-decreasing sequence { P i ( n ) } i N has a supremum sup { P i ( n ) } i N = lim i P i ( n ) . Thus, lim i P i is defined and P i lim i P i , for every i N . On the other hand, for any P s.t. P i P for i N , we have lim i P i ( n ) = sup { P i ( n ) } i N P ( n ) , for every n N ; namely, lim i P i P . We can then conclude (item 1 of Proposition 1) that P = lim i P i .
Let us now prove item 2 of Proposition 1. First of all, since 0 P i ( n ) ( P ) ( n ) for i , n N , we have n N ( P ) ( n ) sup n N P i ( n ) i N and
sup n N P i ( n ) i N sup n k P i ( n ) i N = n k sup P i ( n ) i N = n k ( P ) ( n )
for any k N . Thus,
sup n N P i ( n ) i N sup n k ( P ) ( n ) k N = lim k n k ( P ) ( n ) = n N ( P ) ( n )
Summing up, we can conclude, as
n N ( P ) ( n ) sup n N P i ( n ) i N n N ( P ) ( n )
Finally, by hypothesis, n N P i ( n ) 1 , for any i N . Therefore, n N ( P ) ( n ) = sup n N P i ( n ) i N 1 . Which proves (item 3 of Proposition 1) that P P .  □

3.3. PPD Sequence of a Computation

The computed output of a QTM will be defined (Definition 14) as the limit of the sequence of PPDs obtained along its computations.
Definition 12
(probability and q-configurations). Given a configuration C = α , q , β , i , n , let val [ C ] be the number of 1s in α β . For any | ϕ 2 ( C ) , let us define P | ϕ : N R 0 s.t.
P | ϕ ( n ) = C C f i n , val [ C ] = n | e C | 2
when | ϕ = C C e C | C .
Proposition 2.
If | ϕ is a q-configuration, P | ϕ is a PPD. Moreover, it is a PD if and only if | ϕ is final.
Proof. 
Let | ϕ = | ϕ 0 + | ϕ f with | ϕ 0 2 ( C M C M f i n ) , and | ϕ f 2 ( C M f i n ) . By the definition of P | ϕ , it is readily seen that P | ϕ = P | ϕ f and that n N P | ϕ ( n ) = n N P | ϕ f ( n ) = | ϕ f 1 . Therefore, P | ϕ is a PPD. Moreover, since | ϕ f = 1 if and only if | ϕ 0 = 0 . We see that P | ϕ is a PD if and only if | ϕ 0 = 0 , that is, if and only if | ϕ = | ϕ f .  □
Definition 13.
For any q-configuration | ϕ , we shall say that P | ϕ is the PPD associated to | ϕ , and we shall denote by P K | ϕ M the sequence of PPDs { P | ϕ i } i N associated to the computation K | ϕ M = { | ϕ i } i N .
The PPD sequence of any QTM computation is monotone. In the simple proof of this key property (Theorem 3) we see at work all of the constraints on the time evolution of a QTM M.
1.
That when in a final (target) configuration, the machine can only increment the counter; as a consequence, the val of final (target) configurations does not change.
2.
That when entering for the first time into a final (target) state, the value of the counter is initialised to 0.
3.
That when in a final (target) configuration | ϕ , n , the counter gives the number of steps n since M is looping into the plain configuration ϕ .
We stress that the last two properties defuse quantum interference between final configurations reached in a different number of steps.
Theorem 3
(monotonicity of computations). For any computation K | ϕ M of a QTM M, the sequence of PPDs P K | ϕ M is monotone.
Proof. 
Let us prove that P | ϕ P U | ϕ , for every | ϕ 2 ( C M ) . Let | ϕ = | ϕ 0 + k N | ϕ f , k , with | ϕ 0 2 ( C M C M f i n ) , and | ϕ f , k 2 ( C M f i n C M k ) , where C M k is the set of the configurations of M whose counter is equal to k N . For every n N , we see that P | ϕ ( n ) = k N P | ϕ f , k ( n ) . Let | ψ = | ψ 0 + k N | ψ f , k = U | ϕ . By the definition of U, we see that U | ϕ 0 = | ψ 0 + | ψ f , 0 and U | ϕ f , k = | ψ f , k + 1 . Therefore, P | ψ ( n ) = k N P | ψ f , k ( n ) = P | ψ f , 0 ( n ) + k N P | ϕ f , k ( n ) = P | ψ f , 0 ( n ) + P | ϕ ( n ) P | ϕ ( n ) .  □

3.4. Computed Output

We can now come back to the definition of the computed output of a QTM computation. The easy case is when a computation reaches a final q-configuration | ψ C f i n (meaning that all of the classical computations in superposition are “terminated”)—in this case the computed output is the PD P | ψ . The QTM keeps computing and transforming | ψ into other configurations, but all of these configurations have the same PD. However, we want to give meaning also to infinite” computations, which never reach a final q-configuration, yet producing some final configurations in the superpositions. For this purpose, we define the computed output as the limit of the PPDs yielded by the computation.
Definition 14
(computed output of a QTM). Let K | ϕ M = { | ϕ i } i N be the computation of the QTM M on the initial q-configuration | ϕ . The computed output of M on the initial q-configuration | ϕ is the PPD P = lim i P | ϕ i , which we shall also denote by lim K | ϕ M , or by the notation M | ϕ P .
Let us remark that, by Proposition 1 and Theorem 3, the limit in the above definition is well-defined for any computation. Therefore, a QTM has a computed output for any initial q-configuration | ϕ .
Definition 15
(finitary computations). Given a QTM M, a q-configuration | ϕ is finite if it is an element of span ( CB ( C M ) ) . A computation K | ϕ M = { | ϕ i } i N is finitary with computed output P if there exists a k s.t. | ϕ k is final and P | ϕ k = P .
Proposition 3.
Let K | ϕ M = { | ϕ i } i N be a finitary computation with computed output P , which is, M | ϕ P .
1. 
There exists a k, such that, for each j k , | ϕ j is final and P | ϕ j = P .
2. 
P is a PD.
Proof. 
By definition, there is a k s.t. | ϕ k is final. Let P | ϕ k = P . By Proposition 2, P is a PD. By monotonicity, P P | ϕ j , for every j k . Thus, because any PD is maximal for ≤ (see Remark 6), P = P | ϕ j , for every j k .  □
Given a computation K | ϕ M , we can then distinguish the following cases:
1.
K | ϕ M is finitary. In this case, M | ϕ P P 1 ; the output of the computation is then a PD and is determined after a finite number of steps;
2.
K | ϕ M is not finitary, but M | ϕ P P 1 . The output is a PD and is determined as a limit; and,
3.
K | ϕ M is not finitary, and M | ϕ P P P 1 (the sum of the probabilities of observing natural numbers is p < 1 ). Not only the result is determined as a limit, but we cannot extract a PD from the output.
The first two cases above give rise to what Definition 16 calls a q-total function. However, observe that, for an external observer, cases (2) and (3) are in general indistinguishable, since, at any finite stage of the computation, we may only observe a finite part of the computed output.
For some examples of QTMs and their computed output, see Section 5.

3.5. Quantum Partial Computable Functions

We want our quantum computable functions to be defined over a natural extension of the natural numbers. When using a QTM for computing a function, we stipulate that initial q-configurations are superpositions of initial classical (plain) configurations | C n , where the tape of the configuration C n encodes the number n. A natural choice for this encoding corresponds to take C n = | n ̲ = | λ , q 0 , n ̲ , 0 , 0 , where n ̲ denotes the string 1 n + 1 . Such q-configurations are naturally isomorphic to the space 1 2 ( N ) = ϕ : N C n N | ϕ ( n ) | 2 = 1 of square summable, denumerable sequences with unitary norm, under the bijective mapping ν ( d k n k ) = d k | n k ̲ . Observe that, for output, we simply count the number of (non contiguous) 1s on the tape, according to Definition 12.
Definition 16
(partial quantum computable functions).
1. 
A function f : 1 2 P is partial quantum computable (q-computable) if there exists a QTM M s.t. f ( x ) = P if and only if M ν ( x ) P .
2. 
A q-partial computable function f is quantum total (q-total) if for each x , f ( x ) P 1 .
It is out of the scope of the paper to investigate in details how this class exactly relates to other classes of computable functions when the input of QTMs is restricted to classical inputs. However, observe, that when the output is also required to be classical, and all amplitudes are computable, we expect to obtain the classical (partial) recursive functions. Indeed, any classical deterministic TM may be simulated by a reversible TM [19]; moreover, B&V show that reversible TMs are a special case of QTMs (Section 4 of [12]; see also our Section 5.2). On the other direction, when we have classical inputs and computable amplitudes, it is easy to simulate a QTM via a classical TM.

4. Observables

While the evolution of a closed quantum system (e.g., a QTM) is reversible and deterministic once its evolution operator is known, a (global) measurement of a q-configuration is an irreversible process, which causes the collapse of the quantum state to a new state. Technically, a measurement corresponds to a projection on a subspace of the Hilbert space of quantum states. For the sake of simplicity, in the case of QTMs, let us restrict to measurements observing if a configuration belongs to the subspace described by some set of base configurations B . The effect of such a measurement is summarised by the following:
Measurement
Given a set of configurations B C , a measurement observing if a quantum configuration | ϕ = C C e C | C belongs to the subspace generated by CB ( B ) gives a positive answer with a probability p = C B | e C | 2 , equal to the square of the norm of the projection of | ϕ onto 2 ( B ) , causing at the same time a collapse of the configuration into the normalised projection C B p 1 2 e C | C ; dually, with probability 1 p = C B | e C | 2 , it gives a negative answer and a collapse onto the subspace 2 ( C B ) orthonormal to 2 ( B ) , which is, into the normalised configuration C B ( 1 p ) 1 2 e C | C ,
This kind of measurement is a special case of the so called projective measurement that is a consequence of the postulates of quantum mechanics. For a detailed discussion, see e.g., [8,20].
Because of the irreversible modification produced by any measurement on the current configuration and, therefore, on the rest of the computation, we must deal with the problem of how to read the result of a computation. In other words, we need to establish some protocol to observe when a QTM has eventually reached a final configuration, and to read the corresponding result.

4.1. The Approach of Bernstein and Vazirani

We already discussed how B&V’s “sensible” QTMs are machines where all of the computations in superposition are in some sense terminating, and reach the final state at the same time (are “stationary”, in their terminology). More precisely, Definition 3.11 of B&V reads: “A final configuration of a QTM is any configuration in [final] state. If, when QTM M is run with input x, at time T the superposition contains only final configurations, and at any time less than T the superposition contains no final configuration, then M halts with running time T on input x.”
This is a good definition for a theory of computational complexity (where the problems are classical, and the inputs of QTMs are always classical) but it is of limited use in the semantics of quantum programming languages. Indeed, inputs of a B&V-QTM must be classical—we cannot extend by linearity a B&V-QTM on inputs in 1 2 , since there is no guarantee whatsoever that on different inputs the same QTM halts with the same running time.

4.2. The Approach of Deutsch

Deutsch [10] assumes that QTMs are enriched with a termination bit T. At the beginning of a computation, T is set to 0, then, the machine sets this termination bit to 1 when it enters into a final configuration. If we write | T = i for the function that returns 1 when the termination bit is set to i, and 0 otherwise, a generic q-configuration of a Deutsch’s QTM can be written as
| ϕ = | T = 0 C C f i n e C | C + | T = 1 D C f i n d D | D
The observer periodically measures T in a non destructive way (that is, without modifying the 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 i n | e C | 2 ) to the q-configuration
| ψ = | T = 0 C C f i n e C | C C C f i n | e C | 2
and the computation continues with | ψ .
2.
If the result of the measurement of T gives the value 1, | ϕ collapses (with probability D C f i n | d D | 2 ) to
| ψ = | T = 1 D C f i n d D | D D ¬ C f i n | d D | 2
and, immediately after the collapse, the observer makes a further measurement of the component D C f i n d D | D D C f i n | d D | 2 in order to read-back a final configuration.
Note that Deutsch’s protocol (in an irreversible way) spoils at each step the superposition of configurations. The main point of Deutsch’s approach is that a measurement must be performed immediately after some computation enters into a final state. In fact, since, at the following step, the evolution might lead the machine to exit the final state modifying the content of the tape, we would not be able to measure this output at all. In other words, either the termination bit acts as a trigger that forces a measurement each time it is set, or we perform a measurement after each step of the computation.

4.3. Problems with Deutsch Measurement

Because a QTM must be physically feasible, at least “in principle”, let us analyse, in detail, whether the termination protocol proposed by Deutsch [10] is realizable.
As any quantum system, a QTM evolves with respect to a continuos time. This means that the time evolution operator U of a machine M is the solution of the Schrödinger equation with a given Hamiltonian H and depends on the time [21]. In particular, when H is constant, the solution of the equation is
U t = e ( i / h ) H t for t R +
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
| ψ n + 1 = U ( n + 1 ) Δ | ψ 0 = e ( i / h ) H ( n + 1 ) Δ | ψ 0 = e ( i / h ) H Δ e ( i / h ) H n Δ | ψ 0 = U Δ U n Δ | ψ 0 = U Δ | ψ n
In other words, at each step n, the next configuration | ψ n + 1 is obtained by applying the evolution operator U Δ to the current configuration | ψ n .
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
| ψ n = | T = 1 D C f i n d D | D D ¬ C f i n | d D | 2
According to Deutsch’s approach, one has to perform a second measurement to read the actual value of the output on the tape. However, since we are in a continuous time setting, what is the time of this second measurement? Since it can be done only after the measure of the halt qubit T, this must take place at a time t n + ϵ = ( n + ϵ ) Δ , with ϵ > 0 . We can distinguish two cases (analogous reasonings apply for ϵ > 1 ):
1.
0 < ϵ < 1 . In this case, the tape is measured at an intermediate time between t n and t n + 1 , and the machine is in an intermediate configuration | ψ n + ϵ between | ψ n and | ψ n + 1 . Because the QTM is defined in terms of the unitary operator U Δ , its configurations are well-defined only at time t n , for n N . The quantum configuration | ψ n + ϵ is therefore unknown and depends on how the unitary operator U Δ is physically realised. In any case, in general it differs from | ψ n .
2.
ϵ = 1 . In this case the second measurement takes place at time t n + 1 , on the configuration | ψ n + 1 = U Δ | ψ n . That implies | ψ n | ψ n + 1 , since | ψ n = | ψ n + 1 may hold only in the trivial case the unitary operator U Δ is the identity and the | ψ n = | ψ 0 , for every n.
As a consequence, without additional restrictions on its evolution operator, Deutsch’s approach does not allow for extracting the result of the computation of a QTM.

4.4. Fixing the Measurement Protocol

Ozawa was the first to notice the above problem. In [13], he gave a revised formulation of the measurement protocol:
Once the halt qubit is set to the state | T = 1 , the quantum Turing machine no longer changes the halt qubit or the tape string.
However, since such a constraint would be too strong (as already remarked, if | ψ n + Δ = | ψ n , then U Δ must be the identity), Ozawa adds the footnote 11:
If the relevant outcome of the computation is designed to be written by the program in a restricted part of the tape, this condition can be weakened so that the quantum Turing machine may change the part of the tape string except that part of the tape.
In other words, instead of requiring that all tape stays unchanged after reaching a final configuration, only the interesting part of the output must become stable after the halt qubit is set to 1.
Unfortunately, Linden and Popescu maybe skipped that note, and in their unpublished paper [22] claimed that even Ozawa’s was unsatisfactory. Accordingly, a few years later, Ozawa replied harshly in [23]:
Recently, Linden and Popescu [22] claimed that the halt scheme given in [13] is not consistent with unitarity of the evolution operator. However, their argument applies only to the special case in which the whole tape is required not to change after the halt. As suggested in footnote 11 of [13], the conclusion in [13] can be obtained from the weaker condition for the general case where the tape is allowed to change except for the data slot. Linden and Popescu [22] disregarded this case and hence their conclusion is not generally true.
Although Ozawa was right, he did not explain how to stabilise what he called the data slot. The approach that we shall present in the following is then a sort of implementation of Ozawa’s protocol, for which we also prove in details the irrelevance of the number of executed measurements and of the measurement time.

4.5. Our Approach

The measurement of the output computed by our QTMs can be performed by following a variant of Deutsch’s approach. Because of the particular structure of the transition function of our QTMs, we shall see that we do not need any additional termination bit, that a measurement can be performed at any moment of the computation, and that, indeed, we can perform several measurements at distinct points of the computation without altering the result (in terms of the probabilistic distribution of the observed output).
Given a q-configuration | ϕ = | ϕ f + | ϕ n f , where | ϕ f 2 ( C f i n ) and | ϕ n f 2 ( C C f i n ) , our output measurement tries to get an output value from | ϕ by the following procedure:
1.
first of all, we observe the final states of | ϕ , forcing the q-configuration to collapse either into the final q-configuration | ϕ f / | ϕ f , or into the q-configuration | ϕ n f / | ϕ n f , which does not contain any final configuration;
2.
then, if the q-configuration collapses into | ϕ f / | ϕ f , we observe one of these configurations, say | C , which gives us the observed output val [ C ] = n , forcing the q-configuration to collapse into the final base q-configuration ( e c / | e c | ) | C ;
3.
otherwise, we leave unchanged the q-configuration | ϕ n f / | ϕ n f obtained after the first observation, and we say that we have observed the special value .
Summing up, an output measurement of | ϕ may lead to observe an output value n N associated to a collapse into a base final configuration | C | ϕ s.t. val [ ϕ ] = n or to observe the special value associated to a collapse into a q-configuration, which does not contain any final configuration.
Definition 17
(output observation). An output observation with collapsed q-configuration | ψ and observed output x N { } is the result of an output measurement of the q-configuration | ϕ = C C e C | C . Therefore, it is a triple | ϕ x | ψ s.t.
1. 
either x = n N , and
| ψ = e C | e C | | C w i t h C C f i n a n d val [ C ] = n   a n d   e c 0
2. 
or x = , and
| ψ = | ϕ n f | ϕ n f w h e r e | ϕ n f = C C f i n e C | C   a n d   | ϕ n f 0
The probability of an output observation is defined by
Pr { | ϕ x | ψ } = | e C | 2 i f x = n N | ϕ n f 2 i f x =
Remark 7.
For e C , e | C x | ϕ , with C C f i n and val [ C ] = n . Since e | C is a q-configuration, | e | = 1 . By the definition of output observation, x = n and | ϕ = ( e / | e | ) U | C = e | D , with | D = U | C CB ( C f i n ) and val [ D ] = n . Moreover, Pr { e | C x | ϕ } = | e | 2 = 1 .
Remark 8.
For every pair | ϕ x 1 | ψ 1 and | ϕ x 2 | ψ 2 of distinct output observations, ψ 1 and ψ 2 are in the orthonormal subspaces generated by the two disjoint sets B 1 , B 2 C , where B i = { C C | C | ψ i } .
Definition 18
(observed run). Let M be a QTM and U M be its time evolution operator. For any monotone increasing function τ : N N (that is, τ ( i ) < τ ( j ) for i < j ):
1. 
a τ -observed runof M on the initial q-configuration | ϕ is a sequence { | ϕ i } i N s.t.:
(a) 
| ϕ 0 = | ϕ ;
(b) 
U M | ϕ h x i | ϕ h + 1 , when h = τ ( i ) for some i N ;
(c) 
| ϕ h + 1 = U M | ϕ h otherwise.
2. 
Afinite τ -observed runof length k is any finite prefix of length k + 1 of some τ-observed run. Notation: if R = { | ϕ i } i N , then R [ k ] = { | ϕ i } i k .
In particular, let i d be the identity function on N . In the corresponding i d -observed run, a 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 final configuration; and,
2. 
or it eventually obtains such a value collapsing the q-configuration into a base final configuration e | C s.t. | e | = 1 and val [ C ] = n , and from that point onward all the configurations of the run are base final configurations e | C j = e U j | C s.t. val [ C j ] = n , and all the following observed outputs are equal to n (see Remark 7).
Definition 19.
Let R = { | ϕ i } i N be a τ-observed run.
1. 
The sequence { x i } i N s.t. | ϕ h x i | ϕ h + 1 , with h = τ ( i ) , is the output sequence of the τ-observed run R.
2. 
The observed output of R is the value x N { } (notation: R x ) defined by:
(a) 
x = n N , if x i = n for some i N ;
(b) 
x = otherwise.
3. 
For any k, the output sequence of the finite τ-observed run R [ τ ( k ) + 1 ] is the finite sequence { x i } i k and x k is its observed output.
Definition 20
(probability of a run). Let R = { | ϕ i } i N be a τ-observed run.
1. 
For k N , the probability of the finite τ-observed run R [ k ] is inductively defined by
(a) 
Pr { R [ 0 ] } = 1 ;
(b) 
Pr { R [ k + 1 ] } = Pr { R [ k ] } Pr { | ϕ k x i | ϕ k + 1 } w h e n   k = τ ( i )   f o r   s o m e   i N Pr { R [ k ] } o t h e r w i s e
2. 
Pr { R } = lim k Pr { R [ k ] } .
We remark that Pr { R } is well-defined, since 1 Pr { R [ i ] } Pr { R [ j ] } > 0 , for every i j . Therefore,
1 Pr { R } = lim k Pr { R [ k ] } = inf { Pr { R [ k ] } } k N 0 .
Remark 10.
Let R = { | ϕ i } i N be a τ-observed run s.t. R n , for some n N . As observed in Remark 9, for some k, we have R [ τ ( k ) ] n and R [ τ ( j ) ] , for j < k ; moreover, for i > τ ( k ) , | ϕ i = e | C i with | e | = 1 , C i C f i n , and val [ C i ] = n . As a consequence, Pr { R [ τ ( k ) + 1 ] } = Pr { R [ i ] } , for any i > τ ( k ) (since, by Remark 7, Pr { | ϕ τ ( i ) n | ϕ τ ( i ) + 1 } = 1 ) and Pr { R } = lim i R [ i ] = Pr { R [ τ ( k ) + 1 ] } .
Definition 21
(observed computation). The τ -observed computationof a QTM M on the initial q-configuration | ϕ , is the set K | ϕ , τ M of the τ-observed runs of M on | ϕ with the measure Pr : P ( K | ϕ , τ M ) C (where P ( K | ϕ , τ M ) is the set of the subsets of K | ϕ , τ M ) defined by
Pr B = R B Pr { R }
for every B K | ϕ , τ M .
By K [ k ] | ϕ , τ M we shall denote the set of the finite τ -observed runs of length k of M on | ϕ , with the measure Pr on its subsets (see Definition 21).
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 in K | ϕ , τ M .
Lemma 1.
Given R 1 , R 2 K | ϕ , τ M with R 1 = { ϕ 1 , i } i N { ϕ 2 , i } i N = R 2 , there is k 0 s.t.
1. 
ϕ 1 , i = ϕ 2 , i for i τ ( k ) , that is, R 1 [ τ ( k ) ] = R 2 [ τ ( k ) ] ;
2. 
for i > τ ( k ) , the q-configurations ϕ 1 , i ϕ 2 , i are in two orthonormal subspaces generated by two distinct subsets of C .
Proof. 
Let R 1 [ h ] = R 2 [ h ] be the longest common prefix of R 1 and R 2 . Because they both starts with | ϕ , such a prefix is not empty; moreover, by the definition of τ -observed run, it is readily seen that h = τ ( k ) , for some k.
Let us now prove item 2 of Lemma 1. If we take B a , j = { C C | C | ψ a , h + 1 + j } , for a = 1 , 2 and j N , we need to prove that B 1 , j B 2 , j = , for every j. By construction, ϕ 1 , h + 1 ϕ 2 , h + 1 and, for a = 1 , 2 , ϕ h x a ϕ a , h + 1 , for some x a , with ϕ h = ϕ a , h . Moreover, B 1 , 0 B 2 , 0 = (see Remark 8), at least one of the two observed values x 1 , x 2 is not ⊥, and one of the two q-configurations | ϕ 1 , h + 1 , | ϕ 2 , h + 1 is a final base q-configuration. W.l.o.g., let us assume that x 1 N and let | ϕ 1 , h + 1 = e | C , n , for some final plain configuration C and some n N . Subsequently, | ϕ 1 , h + 1 + j = e U j | C , n = e | C , n + j (see Remark 9) and B 1 , j = { | C , n + j } , for j N . Thus, to prove the assertion, it suffices to show that | C , n + j B 2 , j , for j N . Let us distinguish two cases:
1.
x 2 N and | ψ 2 , h + 1 = e | D , m , where D is a final plain configuration and m N . As already seen for | ψ 1 , h + 1 + j , for j N , we have | ψ 2 , h + 1 + j = e U j | D , m = e | D , m + j and B 2 , j = { | D , m + j } . Therefore, | C , n + j B 2 , j , since | C , n + j | D , m + j , for | C , n | D , m by construction.
2.
| ψ 2 , h + 1 2 ( C C f i n ) . Let | D , m B 2 , j C f i n , where D is a plain configuration and m N . By induction on j, it is readily seen that m < j n + j . Thus, | D , m | C , n + j .
 □
Lemma 2.
Let K | ϕ M = { ϕ i } i N be the computation of the QTM M on the initial q-configuration | ϕ and K | ϕ , τ M be the τ-observed computation on the same initial configuration. For every k N , we have that
| ϕ k = R K [ k ] | ϕ , τ M Pr { R } | ψ R
where | ψ R is the last q-configuration of the finite run R of length k.
Proof. 
By definition, ϕ = ϕ 0 and R = { ϕ } with Pr { R } = 1 , and ψ R = ϕ is the only run of length 0 in K | ϕ , τ M . Therefore, the assertion trivially holds for k = 0 .
Let us then prove the assertion by induction on k. By definition and the induction hypothesis
| ϕ k + 1 = U M | ϕ k = R K [ k ] | ϕ , τ M Pr { R } U M | ψ R
We have two possibilities:
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, because, by definition, Pr { R } = Pr { R } , we can conclude that
| ϕ k + 1 = R K [ k ] | ϕ , τ M Pr { R } U M | ψ R = R K [ k + 1 ] | ϕ , τ M 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
B R = { { ψ i } i k + 1 | ψ k x | ψ k + 1 }
By applying Definition 17, we easily check that
U M | ψ R = R B R Pr { | ψ R x | ψ R } | ψ R
Thus, by substitution, and Pr { R } Pr { | ψ R x | ψ R } = Pr { R }
| ϕ k + 1 = R K [ k ] | ϕ , τ M Pr { R } U M | ψ R = R K [ k ] | ϕ , τ M R B R Pr { R } Pr { | ψ R x | ψ R } | ψ R = R R K [ k ] | ϕ , τ M B R Pr { R } | ψ R = R K [ k + 1 ] | ϕ , τ M Pr { R } | ψ R
since R K [ k ] | ϕ , τ M B R = K [ k + 1 ] | ϕ , τ M .  □
We are finally in the position to prove that our observation protocol is compatible with the probability distributions that we defined as computed output of a QTM computation.
Theorem 4.
Let K | ϕ M = { ϕ i } i N be the computation of the QTM M on the initial q-configuration | ϕ and K | ϕ , τ M be the τ-observed computation on the same initial configuration. For every n N :
1. 
P | ϕ k ( n ) = Pr { R K [ k ] | ϕ , τ M R n } , for k = τ ( i ) + 1 and i N ; and,
2. 
P K | ϕ M ( n ) = Pr { R K | ϕ , τ M R n } .
Proof. 
Let us start with the first item. By Lemma 2, we know that
| ϕ k = R K [ k ] | ϕ , τ M Pr { R } | ψ R ,
where | ψ R is the last q-configuration of R. Because k = τ ( i ) + 1 , for some i, we also know that either ψ R C C f i n or | ψ R = u R | C R with C R C f i n and | u R | = 1 . Therefore,
P | ϕ k ( n ) = R B [ k , n ] Pr { R } u R | C R 2
where
B [ k , n ] = { R K [ k ] | ϕ , τ M R n } = { R K [ k ] | ϕ , τ M | ψ R = u R | C R with val [ C R ] = n }
By Lemma 1, we know that for every R 1 , R 2 B [ k , n ] , we have | C R 1 | C R 2 . Therefore
P | ϕ k ( n ) = R B [ k , n ] Pr { R } | u R | 2 = R B [ k , n ] Pr { R } = Pr B [ k , n ]
since | u R | = 1 . Which concludes the proof of the first item of the assertion.
In order to prove the second item, let B [ ω , n ] = { R K | ϕ , τ M R n } . We have that
Pr { R K | ϕ , τ M R n } = R B [ ω , n ] Pr { R } = lim i R B [ ω , n ] R [ τ ( i ) + 1 ] n Pr { R } ( * ) = lim i R B [ ω , n ] R [ τ ( i ) + 1 ] n Pr { R [ τ ( i ) + 1 ] } ( * * ) = lim i R B [ τ ( i ) + 1 , n ] Pr { R } = lim i Pr B [ τ ( i ) + 1 , n ]
since: ( * ) Pr { R } = Pr { R [ τ ( i ) + 1 ] } , when R [ τ ( i ) + 1 ] n (see Remark 10); ( * * ) , there is a bijection between B [ τ ( i ) + 1 , n ] and { R B [ ω , n ] R [ τ ( i ) + 1 ] n } (see Remark 9) mapping every R B [ τ ( i ) + 1 , n ] with last q-configuration u | C into R = { ψ j } j N { R B [ ω , n ] R [ τ ( i ) + 1 ] n } s.t R = R [ τ ( i ) + 1 ] and | ψ j = u U M j τ ( i ) 1 | C for j > τ ( i ) .
Therefore, by the (already proved) first item of the assertion
Pr { R K | ϕ , τ M R n } = lim i Pr B [ τ ( i ) + 1 , n ] = lim i P | ϕ τ ( i ) + 1 ( n ) = P K | ϕ M ( n )
 □
The above theorem shows that our protocol is not only realistic (unlike those of B&V and Deutsch), but also compatible with the theoretical probabilities defined for configurations in superposition. In particular, the theorem shows how it is possible to make measurements in a totally free way, without destroying the expressive power of quantum parallelism, i.e., without destroying the ability of a QTM to use quantum interference.

5. A Comparison With Bernstein and Vazirani’s QTMs: Part 2

Theorem 2 has shown that our QTMs generalise B&V-QTMs, since the computation of any B&V-QTM can be simulated by a corresponding QTM with the same transition function (up to transitions entering/leaving the initial/final state). The general framework, however, is substantially modified, and the “same” machine behaves in different ways in the two approaches. In this section, we give two simple examples of this.

5.1. QTM Transition Graphs

Let us represent a QTM M by means of a transition graph (a directed graph) whose nodes are the 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 ( a b , d , x ) . Every non-target node has at least one outgoing edge labelled by such a tuple, for any symbol a of the tape alphabet.
In addition to the arrows of δ 0 , to represent the looping transitions of target nodes, the graph contains a self-loop labelled by + 1 on any target node q t : to denote the fact that the only transition of any target configuration is the one that increases the counter by 1, without modifying the rest of the configuration. Dually, every source node q s has a self-loop labelled by 1 . The self-loop of q s is not its only outgoing arrow, since the corresponding counter decreasing transition applies to source configurations with a counter greater than 0 only; indeed, when the counter of a source configuration reaches the 0, the δ 0 transition function applies. On the other hand, the self-loop is the only incoming arrow of any source state q s , because no transition from another state can enter into it. The situation is dual for target states, for which the self-loop is the only outgoing arrow.
See Figure 4 for an example of source and target nodes of a transition graph: the state s and q 0 (which is also initial) are source states; the states p and q f (which is also final) are target states.

5.2. A Classical Reversible TM With Quantum Behaviour

In Figure 2, we give the transition graph of a B&V-QTM corresponding to a reversible TM: any reversible TM M can be transformed into a B&V-QTM by assuming that the weight of any transition of M is 1, and by adding a back-transition from the final state to the initial state.
In the example presented in Figure 2, q 0 is the initial state and q f is the final one, and they are connected by an arrow ( a a , R , 1 ) from q f to q 0 , where a { , 1 } . When started on an initial tape containing n + 1 ̲ (that is, n + 2 symbols 1, see Section 2), the machine M erases two 1s from the tape. When the initial tape contains instead 0 ̲ , M loops indefinitely on the middle state q, after erasing the unique symbol 1 on the tape. Summing up (remembering that for the computed output we just count the number of 1s on the tape, see Definition 12), M computes the predecessor n 1 (with probability 1), when fed with a representation of n > 0 , while it diverges (with probability 1) for n = 0 . However, if we feed M with a non classical input as | ψ = 1 2 | 0 ̲ + 1 2 | 2 ̲ , then M fails to give an answer according to B&V’s framework, since it reaches a q-configuration in which final and non-final base configurations superpose.
To transform M into a QTM according to our formalism (see Theorem 2), it suffices to replace the arrow from q f to q 0 by two self-loops: one (labelled 1 ) on the initial state q 0 , and one (labelled + 1 ) on the final state q f . We obtain then the QTM in Figure 3. By the definition of computed output, we can see that M 1 2 | 0 ̲ + 1 2 | 2 ̲ { 1 1 / 2 ; n 0 , i f n 1 } ; namely, with probability 1 / 2 the QTM halts with computed output 1; while with probability 1 / 2 it diverges.

5.3. A PD Obtained as a Limit

The example presented in Figure 4 shows a QTM that produces a PD only as an infinite limit. The tape alphabet of the machine M is Σ = { $ , 1 , } , the set of its source states is Q s = { q 0 , s } , the set of its 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 for any symbol of the alphabet but $, which is, a { 1 , } .
The machine M applies properly on initial configurations λ , q 0 , $ n ̲ , 0 , 0 , whose corresponding base vector will be denoted by | $ n ̲ (to simplify the definition of the machine, we use a slight variant of the enconding given in Section 3.5 in which the sequence n ̲ coding the number n is preceded by a $, which is indeed the only $ on the tape). On such inputs, after moving from the initial state 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 1 / 2 . We remark the source state s and the target state p: such states do not play any role when the machine computes on $ n ̲ , since none of them can be reached. Nevertheless, they must be added to deal with error situations, and to satisfy the local unitary conditions, in order to obtain a proper unitary time evolution for M (see Remark 1).
A simple calculation shows that M | $ n ̲ P , with P = { n + 1 1 ; m 0 , i f m n + 1 } ; namely, on the input $ n ̲ , M computes with probability 1 the successor n + 1 (the machine is indeed the identity 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 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 ̲ is a PPD s.t. P U j | $ n ̲ ( n + 1 ) < 1 and P U j | $ n ̲ ( m ) = 0 , for m n + 1 . Of course, this does not mean that we have to wait an infinite time to readback the result! A correct way to interpret this fact is that, for each n N , and each ϵ ( 0 , 1 / 2 ] , there exists k N s.t, for every j > k , 1 ϵ < P U j | $ n ̲ ( n + 1 ) 1 .

6. Related Works

After having analysed at the length the notions of B&V and Deutsch, we discuss in this section some other papers related to our work.

6.1. On Quantum Extensions of Turing Machines, And of Related Complete Formalisms

  • Strictly following the B&V approach, Nishimura and Ozawa [17,24] study the relationship between QTMs and quantum circuits (extending previous results by Yao [25]). They show that there exists a perfect computational correspondence between QTMs and uniform, finitely generated families of quantum circuits. Such a correspondence preserves the quantum complexity classes EQP, BQP, and ZQP.
  • Perdrix and Jorrand [26] proposes a new way to deal with quantum extensions of Turing Machines. The basic idea is reminiscent of the quantum-data/classical-control paradigm coined by Selinger [27,28]. In fact, in Perdrix QTM’s, the only quantum component is the tape whereas the control is completely classical.
  • Dal Lago, Masini, and Zorzi [3,29,30] extend the quantum-data/classical-control paradigm to a type free quantum λ -calculus that is proven to be in perfect correspondence with the QTMs of B&V. Following the ideas of the so-called Implicit Computational Complexity, the authors propose an alternative way to deal with the quantum classes EQP, BQP, and ZQP.

6.2. On the Readout Problem

The following papers address the problem of how to readout the result of a quantum computation. Because this is a key question in the definition of any quantum computing formalism, they deserve some deeper attention.
We recall, however, that our main interest is in QTMs as devices computing distributions of probability, and not functions over natural numbers.
  • Myers [31] tries to show that it is not possible to define a truly quantum general computer. The article highlights how the B&V approach fails on truly quantum data. In fact, in such a case, it is impossible to guarantee the synchronous termination of all the computations in superposition. Consequently, the use of a termination bit spoils the quantum superposition of the computation. This defect was well known, and it is for this reason that B&V did not define a general notion of quantum computability, but rather a notion sufficient to solve—in a quantum way—only classical decision problems. Myers’s criticism does not apply to our approach. Our QTMs are fully quantum, and they have an observational protocol of the result that does not depend on the synchronous termination of the computations in superposition.
  • In an unpublished note, Kieu and Danos [32] claim that: “For halting, it is desirable of the dynamics to be able to store the output, which is finite in terms of qubit resources, invariantly (that is, unchanged under the unitary evolution) after some finite time when the desirable output has been computed”. Unfortunately, it is not possible to enter into a truly invariant final quantum configuration—only a machine starting in a final configuration and computing the identity can accomplish this constraint. We overcome the problem by introducing a feasible (i.e., correct from a quantum point of view) notion of invariant, w.r.t. the readout, of final configurations. In this way, even if the final configuration changes, the output we read from that configuration does not change.
  • In another unpublished note, Linden and Popescu [22] address the problem of how to readout the result of a general quantum computer. The authors write: “We explicitly demonstrate the difficulties that arise in a quantum computer when different branches of the computation halt at different, unknown, times”, implicitly referring to the problems in extending the approach of B&V to general quantum inputs (see again [31], discussed above). In the first part of the work, the authors show that the problem cannot be solved by means of the so-called “ancilla”. The ancilla is an additional information added to the main information encoded by a configuration of the quantum machine. The idea is that, once a final state is reached, the machine keeps modifying the ancilla only. The authors show that the ancilla approach destroys the quantum capabilities of quantum machines, since only classical computations can survive to this treatment of ancilla. Even if reminiscent of the ancilla, our approach is technically different—the problems addressed by Linden and Popescu do not apply—since we carefully tailor the space of the possible configurations of the machines, allowing for the ancilla to play a role only during its final and initial evolution.
    In the second part of the work, the authors launch a strong attack against the use of termination bit, the solution originally proposed by Deutsch and successively refined by Ozawa [13]. The authors try to argue that the approach that was proposed by Deutsch/Ozawa cannot work. In fact, they show that, even if it is true that once the termination bit is set to 1, it remains firmly with such a value forever, any terminal configuration cannot be frozen, and keeps evolving according to the Hamiltonian of the system. Once again, our proposal does not have the defect depicted in the paper, because, far away to force a final configuration to remain stable, only the readout of a final configuration is stable in our approach.
  • Hines [33] shows how to ensure simultaneous coherent halting, provided that termination is guaranteed for a restricted class of quantum algorithms. This kind of approach that is based on coherent halting is intentionally not followed in our paper. Indeed, as previously remarked, we are interested in treating systems which includes, as a particular case, all classical computable functions—we cannot restrict to terminating computations.
  • Miyadera and Ohya [34] discuss the notion of probabilistic halting. In particular, “[…] the notion of halting is still probabilistic. That is, a QTM with an input sometimes halts and sometimes does not halt. If one can not get rid of the possibility of such a probabilistic halting, one can not tell anything certain for one experiment since one can not say whether an event of halting or non-halting occurred with probability one or just by accident, say with probability 10 40 ”. Therefore, they wonder about the existence of any algorithm to decide whether or not a QTM probabilistic halts. With no surprise, they conclude that such an algorithm cannot exist. In fact, because the non-probabilistic halting of a QTM corresponds to the simultaneous halting of all the superposing branchings of its computation, an algorithm deciding the probabilistic halting would decide the simultaneous termination of two classical reversible machines (by combining them into a unique QTM), which is clearly an undecidable problem. In a sense, the question of probabilistic or non-probabilistic halting is irrelevant for our approach. In our QTMs, the result of a computation is defined as a limit, and any computation converges to some result. Accordingly, the only possible readouts that we can get are approximations of such a result. At the same time, because we show that a repeated-measures protocol can retrieve the distribution associated to the output of a computation, we can accept to say that our approach is probabilistic.

7. Conclusions and Further Work

We find surprising that, in the thirty years since [10], a theory of quantum computable functions did not develop, and that the main interest remained in QTMs as computing devices for classical problems/functions. This is in sharp contrast with the original (Feynman’s and Deutsch’s) aim to have a better computing simulation of the physical world.
As always in these foundational studies, we had to go back to the basics, and look for a notion of QTM general enough to encompass previous approaches. We started with pre Quantum TMs (Definition 1), and defined then QTMs as those pre QTMs whose time evolution operator is unitary (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 (Theorem 1). Our QTMs are able to simulate B&V-QTMs (Theorem 2), but, contrary to B&V-QTMs, they may be used to give meaning to some “infinite” computations. Indeed, in Section 3 we showed that each QTM M naturally defines a computable function from the sphere of radius 1 in 2 ( C M ) (i.e., the superpositions of the configurations of M) to the set of (partial) probability distributions on the set of natural numbers. Such a definition is one of the main reasons for our definition of QTM, for it involves computations where some path “terminates”, while others do not. We remark that the definition implies monotonicity of quantum computations (Theorem 3), which is a consequence of the particular way final states are treated in order to defuse quantum interference, once such states are entered.
Particularly tricky is the way in which one reads a result from a quantum computation, which is the subject of Section 4, and, in particular, Section 4.5, which shows that our protocol is compatible with the theoretical probabilities defined for configurations in superposition (Theorem 4).
While several details of the proposed approach may well change during further study, we are confident the general picture may allow a fresh look to the problem of a quantum universal machine, to the termination of QTMs (for instance, characterising termination into the arithmetical hierarchy), and to the various degrees of partiality of quantum computable functions.

Author Contributions

All authors have contributed equally to the paper. All authors have read and agreed to the published version of the manuscript.

Funding

S. Martini received partial support from INdAM-GNSAGA.

Conflicts of Interest

The authors declare no conflict of interest.

Appendix A. Hilbert Spaces With Denumerable Basis

Definition A1
(Hilbert space of configurations). Given a denumerable set B , with 2 ( B ) we shall denote the infinite dimensional Hilbert space defined as follow.
The set of vectors in 2 ( B ) is the set
ϕ | ϕ : B C , C B | ϕ ( C ) | 2 <
and equipped with:
1. 
An inner sum + : 2 ( B ) × 2 ( B ) 2 ( B )
defined by ( ϕ + ψ ) ( C ) = ϕ ( C ) + ψ ( C ) ;
2. 
A multiplication by a scalar · : C × 2 ( B ) 2 ( B )
defined by ( a · ϕ ) ( C ) = a · ( ϕ ( C ) ) ;
3. 
An inner product · , · : 2 ( B ) × 2 ( B ) C
defined by ϕ , ψ = C B ϕ ( C ) * ψ ( C ) (observe that the condition C B | ϕ ( C ) | 2 < implies that C B ϕ ( C ) * ψ ( C ) converges for every pair of vectors).
4. 
The Euclidian norm is defined as ϕ = ϕ , ϕ .
The Hilbert space 2 = 2 ( N ) is the standard Hilbert space of denumerable dimension—all the Hilbert spaces with denumerable dimension are isomorphic to it. 1 2 is the set of the vectors of 2 with unit norm.
Definition A2
(computational basis). The set of functions
CB ( B ) = { | C : C B , | C : B C }
such that for each C
| C ( D ) = 1 i f C = D 0 i f C D
is calledcomputational basisof 2 ( B ) .
We can prove that [16]:
Theorem A1.
The set CB ( B ) is a Hilbert basis of 2 ( B ) .
Let us note that the inner product space span ( CB ( B ) ) defined by:
span ( CB ( B ) ) = i = 1 n c i S i | c i C , S i CB ( B ) , n N .
is a proper inner product subspace of 2 ( B ) , but it is not an Hilbert Space (this means that CB ( B ) is not an Hamel basis of 2 ( B ) ).
The completion of span ( CB ( B ) ) is a space isomorphic to 2 ( B ) .
By means of a standard result in functional analysis we have:
Theorem A2.
1. 
span ( CB ( B ) ) is a dense subspace of 2 ( B ) ;
2. 
2 ( B ) is the (unique! up to isomorphism) completion of span ( CB ( B ) ) .
Definition A3.
Let V be a complex inner product space, a linear application U : V V is called anisometryif U x , U y = x , y , for each x , y V ; moreover if U is also surjective, then it is calledunitary.
Since an isometry is injective, a unitary operator is invertible, and moreover, its inverse is also unitary.
Definition A4.
Let V be a complex inner product vector space, a linear application L : V V is called bounded if c > 0 x L x c x .
Theorem A3.
Let V be a complex inner product vectorial space, for each bounded application U : V V there is one and only one bounded application U * : V V s.t. x , U y = U * x , y . We say that U * is theadjointof U.
It is easy to show that if U is a bounded application, then U is unitary iff U is invertible and U * = U 1 .
Theorem A4.
Each bounded unitary operator U in span ( CB ( B ) ) has an unique continuous extension in 2 ( B ) [12].

Appendix A.1. Dirac Notation

We conclude this brief digest on Hilbert spaces, by a synopsis of the so-called Dirac notation, extensively used in the paper.
mathematical notionDirac notation
inner product ϕ , ψ ϕ ψ
vector ϕ | ϕ
dual of vector ϕ ϕ |
i.e., the linear application d ϕ
defined as d ϕ ( ψ ) = ϕ , ψ note that ϕ ψ = ϕ | ( | ψ )
Let L be a linear application, with ϕ | L | ψ we denote ϕ L ψ .

Appendix B. Implementation of the Counter

A TM purist might argue that the counter adds to the machine a device with a denumerable set of symbols, or with a denumerable set of states, which is not in the spirit of the finite representability of TMs. However, it is an easy exercice to implement the counter directly into the QTM, and in the following we shall briefly describe two ways to do it. Nevertheless, we stress that none of these implementations can be seen as natural or standard, and that, on the other hand, one could completely ignore the problem, assuming to add a clock to implement the counter. For these reasons, in the paper, we have preferred to give the more abstract solution, instead of any more concrete implementation.

Appendix B.1. Extra Symbols

A first possibility, that we followed in a previous version of the paper, is to duplicate the symbol alphabet Σ by adding a set of extra tape symbols Σ ¯ = { a ¯ a Σ } : a new symbol a ¯ , for any a Σ (including the blank □). In this way, when in a final state, the machine replaces any symbol a with the corresponding extra symbol a ¯ , and moves to the right. Dually, when in a source state, if the current cell contains an extra symbol a ¯ , the machine replaces the current symbol with the corresponding symbol a and moves to the right; otherwise, when the current symbol is a Σ , it behaves as specified by the main transition function δ 0 . The legal configurations are then restricted to three possible cases:
1.
α , q , β , i
2.
α γ ¯ , q t , β , i
3.
α , q s , γ ¯ β , i
where: α β γ Σ * , γ ¯ Σ ¯ * is the sequence of extra symbols obtained by replacing any symbol a of γ 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 seen that, to obtain an isomorphism between QTMs with extra symbols and QTMs with counters, it suffices to take the following bijection of configurations (where we use the same symbols as above):
1.
α , q , β , i α , q , β , i , 0
2.
α γ ¯ , q t , β , i α , q t , γ β , i | γ | , | γ |
3.
α , q s , γ ¯ β , i α γ , q s , β , i + | γ | , | γ |
where | γ | denotes the length of γ .

Appendix B.2. Additional Counter Tape

Another possibility is to add a second tape to the machine. The alphabet of this counter tape contains only one symbol ∗, in addition to the blank □ corresponding to the empty cell. A counter containing a value of n corresponds then to a tape with n symbols ∗, see Figure A1.
Figure A1. Implementation of the counter by means of a second tape with only one non blank symbol ∗.
Figure A1. Implementation of the counter by means of a second tape with only one non blank symbol ∗.
Applsci 10 05551 g0a1
Adding/subtracting 1 to the counter corresponds to write/delete a ∗ symbol. To implement these operations by a single step, it suffices that:
1.
When the machine is in a source state q s , the counter head is on the rightmost ∗ of the counter tape, if n > 0 , or on an empty cell, if n = 0 . If the current counter symbol is a ∗, any transition in the state q s replaces such a ∗ with a □, and moves the counter head to the left, until the current counter symbol becomes a □, in which case the machine starts its main evolution.
2.
When the machine is in a target state q t , the counter head is on the first empty cell of the counter tape to the right of the sequence of ∗. Any transition in the state q t replaces then the □ in the current counter cell with a ∗, and moves the counter head to the right.
3.
When the state is neither a source nor a target state, the counter tape is empty, and any transition leaves the counter tape unchanged.

References

  1. Backus, J.W. The Syntax and Semantics of the Proposed International Algebraic Language of the Zurich ACM-GAMM Conference. In Proceedings of the 1st International Conference on Information Processing, UNESCO, Paris, France, 15–20 June 1959; pp. 125–132. [Google Scholar]
  2. McCarthy, J. A Basis for a Mathematical Theory of Computation. In Computer Programming and Formal Systems; Studies in Logic and the Foundations of Mathematics Series, Braffort, P., Hirschberg, D., Eds.; North-Holland Publishing Company, Elsevier B.V.: Amsterdam, The Netherlands, 1963; Volume 35, pp. 33–70. [Google Scholar]
  3. Dal Lago, U.; Masini, A.; Zorzi, M. Confluence Results for a Quantum Lambda Calculus with Measurements. Electron. Notes Theor. Comput. Sci. 2011, 270, 251–261. [Google Scholar] [CrossRef][Green Version]
  4. Dal Lago, U.; Zorzi, M. Wave-Style Token Machines and Quantum Lambda Calculi. In Proceedings of the Third International Workshop on Linearity, LINEARITY 2014, Vienna, Austria, 13 July 2014; Alves, S., Cervesato, I., Eds.; Open Publishing Association: Waterloo, Australia, 2014; Volume 176, pp. 64–78. [Google Scholar] [CrossRef]
  5. Zorzi, M. On quantum lambda calculi: A foundational perspective. Math. Struct. Comput. Sci. 2016, 26, 1107–1195. [Google Scholar] [CrossRef]
  6. Viganò, L.; Volpe, M.; Zorzi, M. A branching distributed temporal logic for reasoning about entanglement-free quantum state transformations. Inf. Comput. 2017, 255, 311–333. [Google Scholar] [CrossRef][Green Version]
  7. Paolini, L.; Roversi, L.; Zorzi, M. Quantum programming made easy. In Proceedings of the Joint International Workshop on Linearity & Trends in Linear Logic and Applications, [email protected] 2018, Oxford, UK, 7–8 July 2018; Ehrhard, T., Fernández, M., de Paiva, V., de Falco, L.T., Eds.; Open Publishing Association: Waterloo, Australia, 2018; Volume 292, pp. 133–147. [Google Scholar] [CrossRef]
  8. Masini, A.; Zorzi, M. A Logic for Quantum Register Measurements. Axioms 2019, 8, 25. [Google Scholar] [CrossRef][Green Version]
  9. Paolini, L.; Piccolo, M.; Zorzi, M. QPCF: Higher-Order Languages and Quantum Circuits. J. Autom. Reason. 2019, 63, 941–966. [Google Scholar] [CrossRef][Green Version]
  10. Deutsch, D. Quantum theory, the Church-Turing principle and the universal quantum computer. Proc. R. Soc. Lond. Ser. A 1985, A400, 97–117. [Google Scholar]
  11. Benioff, P. The computer as a physical system: A microscopic quantum mechanical Hamiltonian model of computers as represented by Turing machines. J. Stat. Phys. 1980, 22, 563–591. [Google Scholar] [CrossRef]
  12. Bernstein, E.; Vazirani, U. Quantum Complexity Theory. SIAM J. Comput. 1997, 26, 1411–1473. [Google Scholar] [CrossRef]
  13. Ozawa, M. Quantum Nondemolition Monitoring of Universal Quantum Computers. Phys. Rev. Lett. 1998, 80, 631–634. [Google Scholar] [CrossRef][Green Version]
  14. Davis, M. Computability and Unsolvability; McGraw-Hill Series in Information Processing and Computers; McGraw-Hill Book Co. Inc.: New York, NY, USA, 1958. [Google Scholar]
  15. Conway, J.B. A Course in Functional Analysis, 2nd ed.; Graduate Texts in Mathematics Series; Springer: New York, NY, USA, 1990; Volume 96, xvi+399p. [Google Scholar]
  16. Roman, S. Advanced Linear Algebra, 3rd ed.; Graduate Texts in Mathematics Series; Springer: New York, NY, USA, 2008; Volume 135, xviii+522p. [Google Scholar]
  17. Nishimura, H.; Ozawa, M. Computational complexity of uniform quantum circuit families and quantum Turing machines. Theor. Comput. Sci. 2002, 276, 147–181. [Google Scholar] [CrossRef][Green Version]
  18. Ozawa, M.; Nishimura, H. Local transition functions of quantum Turing machines. Theor. Inform. Appl. 2000, 34, 379–402. [Google Scholar] [CrossRef][Green Version]
  19. Bennett, C.H. Logical reversibility of computation. IBM J. Res. Dev. 1973, 17, 525–532. [Google Scholar] [CrossRef]
  20. Kaye, P.; Laflamme, R.; Mosca, M. An Introduction to Quantum Computing; Oxford University Press: Oxford, UK, 2007; xii+274p. [Google Scholar]
  21. Isham, C.J. Lectures on Quantum Theory. Mathematical and Structural Foundations; Imperial College Press: London, UK, 1995; xii+220p. [Google Scholar]
  22. Linden, N.; Popescu, S. The Halting Problem for Quantum Computers. arXiv 1998, arXiv:quant-ph/9806054. [Google Scholar]
  23. Ozawa, M. Halting of Quantum Turing Machines. In Unconventional Models of Computation; Springer: Berlin/Heidelberg, Germany, 2002; pp. 58–65. [Google Scholar]
  24. Nishimura, H.; Ozawa, M. Perfect computational equivalence between quantum Turing machines and finitely generated uniform quantum circuit families. Quantum Inf. Process. 2009, 8, 13–24. [Google Scholar] [CrossRef][Green Version]
  25. Yao, A. Quantum Circuit Complexity. In Proceedings of the 34th Annual Symposium on Foundations of Computer Science, Palo Alto, CA, USA, 3–5 November 1993; IEEE Press: Los Alamitos, CA, USA, 1993; pp. 352–360. [Google Scholar]
  26. Perdrix, S.; Jorrand, P. Classically controlled quantum computation. Math. Struct. Comput. Sci. 2006, 16, 601–620. [Google Scholar] [CrossRef][Green Version]
  27. Selinger, P. Towards a Quantum Programming Language. Math. Struct. Comput. Sci. 2004, 14, 527–586. [Google Scholar] [CrossRef][Green Version]
  28. Selinger, P.; Valiron, B. A lambda calculus for quantum computation with classical control. Math. Struct. Comput. Sci. 2006, 16, 527–552. [Google Scholar] [CrossRef][Green Version]
  29. Dal Lago, U.; Masini, A.; Zorzi, M. On a Measurement-Free Quantum Lambda Calculus with Classical Control. Math. Struct. Comput. Sci. 2009, 19, 297–335. [Google Scholar] [CrossRef]
  30. Dal Lago, U.; Masini, A.; Zorzi, M. Quantum implicit computational complexity. Theor. Comput. Sci. 2010, 411, 377–409. [Google Scholar] [CrossRef][Green Version]
  31. Myers, J.M. Can a universal quantum computer be fully quantum? Phys. Rev. Lett. 1997, 78, 1823–1824. [Google Scholar] [CrossRef]
  32. Kieu, T.D.; Danos, M. The Halting problem for universal quantum computers. arXiv 1998, arXiv:quant-ph/9811001. [Google Scholar]
  33. Hines, P. Quantum circuit oracles for Abstract Machine computations. Theor. Comput. Sci. 2010, 411, 1501–1520. [Google Scholar] [CrossRef][Green Version]
  34. Miyadera, T.; Ohya, M. On Halting Process of Quantum Turing Machine. Open Syst. Inf. Dyn. 2005, 12, 261–264. [Google Scholar] [CrossRef][Green Version]
Figure 1. Transitions of a QTM.
Figure 1. Transitions of a QTM.
Applsci 10 05551 g001
Figure 2. A reversible TM as a quantum Turing Machines (QTM) à la Bernstein and Vazirani.
Figure 2. A reversible TM as a quantum Turing Machines (QTM) à la Bernstein and Vazirani.
Applsci 10 05551 g002
Figure 3. A reversible TM as a QTM.
Figure 3. A reversible TM as a QTM.
Applsci 10 05551 g003
Figure 4. A QTM computing the successor function (the identity w.r.t. the tape) as a limit.
Figure 4. A QTM computing the successor function (the identity w.r.t. the tape) as a limit.
Applsci 10 05551 g004

Share and Cite

MDPI and ACS Style

Guerrini, S.; Martini, S.; Masini, A. Quantum Turing Machines: Computations and Measurements. Appl. Sci. 2020, 10, 5551. https://doi.org/10.3390/app10165551

AMA Style

Guerrini S, Martini S, Masini A. Quantum Turing Machines: Computations and Measurements. Applied Sciences. 2020; 10(16):5551. https://doi.org/10.3390/app10165551

Chicago/Turabian Style

Guerrini, Stefano, Simone Martini, and Andrea Masini. 2020. "Quantum Turing Machines: Computations and Measurements" Applied Sciences 10, no. 16: 5551. https://doi.org/10.3390/app10165551

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