and Computation Report : 1-way quantum finite automata: strengths, weaknesses and generalizations

Octave Mariotti

Although it has been studied for a few decades, quantum computation is still full of unknown. A factor making this exploration difficult is the complexity of building quantum computers, as they require the ability to operate on a theoretically unbounded number of . Of course, this is not possible in practice, as even classical computers do not have the infinite memory of Turing Machines. It remains nonetheless that effectively implementing quantum algorithms, such as Shor’s factoring algorithm, is not likely to be done in the next decade. However, there exists others models of quantum computation, derived from classical models, such as quantum push-down or finite automata. A study of the later reveals some interesting properties, hinting that the power of quantum computation is more complicated than simply being able to perform several computation in parallel by operating on a superposition of states. In this report, we will present the most important results of [1], and try to motivate the study of small models. Since the main results are broken down into several technical proofs, related to each other in such a way that none could reasonably be evicted, we will mainly present ideas behind the proofs in order to convince a sceptical reader that these results are indeed provable rather than extensive demonstrations.

1 Background

The slow advancement towards the construction of a full quantum computer could mean that the first efficient quantum computer to be built will not be fully quantic, but instead only use small quantum devices as accelerators. Indeed, 1-way quantum automata only require a quantum system bounded in size to function : a classical device reads the input letter by letter, and applies the corresponding transformations to the quantum system. This prediction, stated in 1998 in [1],

1 still holds some truth today, despite a much more active research in quantum computing. Quantums automata were simultaneously introduced by Kondacs and Watrous [4] and Moore and Crutchfield [5], with slightly different models. One year later, Ambainis and Freivalds further develop this model in "1-way quantum finite automata: strengths, weaknesses and generalizations"[1], and show several interesting properties as well as extensions of it. Since then, research on quantum automata did not undergo any breakthrough, and they most notably have become tools to introduce and demonstrate key concepts of quantum computing.

2 Definition

In order to formally define 1-way quantum finite automata, one must first define finite automata, reversible finite automata and probabilistic reversible finite automata.

Definition 1. A finite automaton (FA) is tuple M = (Q, Σ, δ, q0,Qacc,Qrej) where :

• Q is a finite set of state.

• Σ is the input alphabet.

• #, $ ∈/ Σ are respectively the left and right endmarkers of the tape

• Γ = Σ ∪ {#, $} is the working alphabet.

• δ : Q × Γ × Q −→ R is the transition function, that gives the of a specific transition occurring.

• q0 is the initial state of the automaton.

• Qacc and Qrej are respectively the set of accepting and rejecting states.

Qnon = Q\(Qacc ∪ Qrej) is the set of non-halting states. Finally, we require that

X ∀(q, a) ∈ Q × Γ, δ(q, a, q0) = 1 q0∈Q

This ensures that δ gives the probability to take a given transition.

When the computation begins, the automaton starts in qo, and the left endmarker # is read.

The automaton ends up in state q1 with probability δ(qo, #, q1). The computation continues

2 until the state leaves Qnon. Note that we can always restrict the termination of computation to 0 0 this case by specifying δ(q, $, q ) in a smart way (that is, for any q, q ∈ Qacc ∪ Qrej). A FA is deterministic when for any (q, a) ∈ Q × Γ, there is exactly one q0 ∈ Q such that reading a in q leads to q0, or more formally, such that δ(q, a, q0) = 1. This definition of FAs differs a bit from classical ones, but it is easy to seee that they hold the same computational power while being closer to quantum automata in the way they work.

a, 1/2

$ q1 qacc

b; [a, 1/2]

#, 1/2

[a, 1/3]; [b, 2/3];$ q0 q3 [a, 2/3]; [b, 1/3]

#, 1/2

a; [b, 1/2]

q2 qrej $

b, 1/2

Figure 1: A finite automaton

Definition 2. A reversible finite automaton (RFA) is a deterministic finite automaton such that for any (a, q0) ∈ Γ × Q, there is at most one q ∈ Q such that reading a in q leads to q0, or more formally, such that δ(q, a, q0) = 1.

Intuitively, they are deterministic automata whose computations can be traced : given the last state and the input, there is only one way to go back to qo following the letters of the input from the last to first.

Definition 3. A reversible automaton with probabilistic choices (PRFA) is a finite automaton such that for any (a, q0) ∈ Γ × Q, there is at most one q ∈ Q such that reading a in q leads to q0, or more formally, such that δ(q, a, q0) 6= 0.

3 It is the probabilistic analogue of the RFA. Of course, being reversible restrict the probabil- istic choices that the automaton can make. a

$ q1 qacc

b #, 1/2

[a, 1/3]; [b, 2/3] $ 0 q0 q3 qacc [a, 2/3]; [b, 1/3]

#, 1/2 a

q2 qrej $

b

Figure 2: A reversible automaton with probabilistic choices

Although these models may seem unnatural, they can be viewed as classical analogues to quantum finite automata, as the reversibility is mandatory in quantum computing. PRFAs will in particular be used to asses the power of quantum automata by comparing what they can compute. Indeed, QFAs are probabilistic reversible automata, which make PRFAs the adequate model to determine what comes from quantum computation and what is simply probabilistic.

Definition 4. A 1-way quantum finite automaton (QFA) can be defined as a tuple M =

(Q, Σ, δ, q0,Qacc,Qrej), with the same convention as finite automata, except that the transition function δ : Q × Γ × Q −→ C changes codomain, and we require :

X ∀(q, a) ∈ Q × Γ, |δ(q, a, q0)|2 = 1 q0∈Q

We call an element of l2(Q) a superposition of states, and for q ∈ Q, we denote by |qi the superposition with value 1 at q and 0 anywhere else.

To ease comprehension and manipulation, we define, for any a ∈ Γ, Va : l2(Q) −→ l2(Q)

4 by X 0 0 Va(|qi) = δ(q, a, q ) |q i q0∈Q It maps the current state to the next when reading a, and can easily be extended to superpositions.

Previous assumptions implies that Vais unitary for any a.

There are two different models of computations for QFAs.

-once[5] In the measure-once computation, an automaton reads its input and applies the corresponding unitaries to its superposition letter after letter. Then, when the right endmarker is read, a measurement is performed, and the superposition collapses

either to a state of Qacc or Qrej

• Measure-many[4] In the measure many model, the state of the automaton is observed

after each transformation by a unitary, in the measurement basis Enon⊕Eacc⊕Erej, which are the subspaces spanned by the non-halting, accepting and rejecting states respectively. The computation ends when a measurement makes the superposition collapse to a halting subspace.

It was shown in [4] that measure-many automata actually contain measure-once automata. Therefore, we will only consider the second model. A working example of quantum finite automata can be found in the proof of claim1.

3 Computational properties of QFAs

The first results concerning QFAs were quite pessimistic. In fact, they are only able to recognize a strict subset of regular languages [4]. We will see that they have the surprising property that their power depends on their probability of acceptance. If we require it to be higher than 7/9, then their power is similar to that of RFAs. Conversely, those which accept with a smaller probability are slightly more powerful.

Theorem 1. Let L be a language and M be its minimal automaton. Assume that there is a word x and two states q1, q2 ∈ Q satisfying:

• q1 6= q2,

• If M starts in state q1 and reads x, it passes to q2,

5 • If M starts in state q2 and reads x, it passes to q2,

• q2 is neither “all-accepting” state, nor “all-rejecting” state.

Then L cannot be recognized by a QFA with probability at least 7/9 +  for any fixed  > 0.

x q1 q2 x

Figure 3: The "forbidden construction"

Proof. The proof recalls many concepts of Markov chains. Given a QFA M recognizing L, we show that for some word y, the probability of M giving the correct answer on y is less than 7/9 + . It relies on decomposing the non-halting subspace of states in two subspaces : transient and recurrent. Reading x will decrease the probability of being in the transient subspace, up to 0 when reading it infinitely many times. Then, we show that the probability of halting relies only on the part of the decomposition belonging to the transient subspace, and we bound this probability. Finally, we show that decid- ing whether y ∈ L is inconsistent with a 7/9 +  bound, as M cannot distinguish y from xiy with enough certainty.

Theorem 2. Let L be a language and M be its minimal automaton. If M does not contain the “forbidden construction” of theorem1, then L can be recognized by a reversible finite auto- maton.

Proof. We define non-reversibility as a tuple (q1, q2, q, a) where q1, q2, q ∈ Q, a ∈ Σ, q1 6= q2, and reading a in q1 or q2 leads to q. Such tuples can be partially ordered with the relation : 0 0 0 0 0 0 (q1, q2, q, a) < (q1, q2, q , a ) if and only if q1 or q2 is reachable from q. We can verify that < is transitive and anti-reflexive. Hence, given an automaton M verifying the hypothesis of the theorem, we can turn it into a reversible automaton. Indeed, if it is not reversible, it must contain a tuple (q1, q2, q, a) maximal with respect to <. We can duplicate q and all states reachable from q, such that reading a in q1 leads to the first copy, and reading a in q2 leads to the second copy. This decrease the finite number non-reversibility tuples of M by one. Applying this construction recursively turns M into a reversible automaton.

Corollary 1. A language can be recognized by a quantum finite automaton with probability 7/9 +  if and only if it can be recognized by a reversible finite automaton.

6 Proof. Follows from theorem1 and2.

Claim 1. The language L = a∗b∗ can be recognized by a QFA with the probability of correct answer p = 0.68 ... where p is the root of p3 + p = 1.

q0

p # − , √ √ 1 p , #

p a, (1 − p) q1 a, p(1 − p) q2 [a, p]; b [ a, p

√ − √ 1 p $

]; −

b a, $ ;

qrej qacc

Figure 4: The QFA M recognizing a∗b∗

Proof. We will see how M acts depending on its input

• Case 1 : a∗ √ √ The state after reading # is |ψi = 1 − p |q1i + p |q2i. Then :

p p √ Va(|ψi) = 1 − p[(1 − p) |q1i + p(1 − p) |q2i + p |qreji] √ p p + p[(p) |q2i + p(1 − p) |q1i − 1 − p |qreji] p √ = (1 − p + p) 1 − p |q1i + (1 − p + p) p |q2i = |ψi

Thus, the state remains |ψi while reading a’s, and upon reading the right endmarker, M accepts with probability p.

7 • Case 2 : a∗b+ √ √ When the first b is read, the state becomes Vb(|ψi) = 1 − p |qreji+ p |q2i. Performing

a measurement in this state has probability 1 − p to end up in qrej, in which case the

computation ends, and probability p to end up in q2, in which case M will end up accepting the input with probability 1. Thus, the acceptance probability is p.

• Case 3 : x∈ / a∗b∗

The initial segment of x is a∗b+a+. Reading the first b makes M reject with probability (1 − p). Then, reading a makes it reject with probability p(1 − p). Then, another b or the right endmarker follows, making once again M reject with probability p2(1 − p).

This yields

2 Prej ≥ 1 − p + p(1 − p) + p (1 − p) ≥ (1 + p + p2)(1 − p) ≥ 1 − p3 ≥ p

Corollary 2. Some languages can be recognized by QFAs with probability p, but not with probability greater than 7/9.

Proof. The minimal automaton of a∗b∗ contains the forbidden construction of theorem1.

This shows that QFAs are a bit more powerful than PRFAs, meaning that quantum phenom- ena can help computation, even on such restricted models.

4 Complexity

Although QFAs lack computational capabilities compared to their classical counterparts, they have the ability to be more space-efficient than finite automata on some computations[1]. Since the time needed for a computation on finite automata is always linearly related to its input, a natural complexity measure for such models is the number of states of the automata. Let us first state a simple conversion bound.

8 Claim 2. Let L be a language recognized by a QFA with n states. Then it can be recognized by a deterministic automaton with 2O(n) states.

We will show that for some languages, the converse holds, that is QFAs can be exponentially more space-efficient than classical finite automata, even probabilistic.

i Theorem 3. Let p be a prime. Define the language Lp = {a , p divides i}. Any finite automaton recognizing Lp has at least p states. However, for any  > 0, there exists a QFA of size O(log(p)) recognising Lp with probability 1 − .

$ #; [a, cos φ] q0 qacc

Proof. We will construct an automaton ac- i a, φ

cepting words in Lp with probability 1, and sin sin rejecting the others with probability at least φ a, i 7/8. Then, we increase the probability of cor- $ q q rect answer to 1 − . a, cos φ 1 rej

For k ∈ {1, . . . , p − 1}, we define the Figure 5: shape of the QFA Uk 2πk j automaton Uk as in figure5, where φ = p . Then, reading a leads to the state cos(jφ) |q0i + i sin(jφ) |q1i If p divides j, then reading the right endmarker leads to acceptance with probability 1. Thus j every Uk accepts words of Lp with probability 1. For a ∈/ Lp, we say that Uk is good if it rejects it with probability greater than 1/2.

Then we show that there exists a subset of size d8 ln(p)e of the Uk such that sufficiently many are good so that the automaton built with one starting state leading to a uniform superposition of such Uk rejects with high enough probability. We can the transform each uk to an automaton containing 2d non-halting states, where d depends on  in order to increase the probability of correct answer. The modified automaton is simply d copies of Uk, such that its state is the tensor products of all the copies. It has 2d − 1 rejecting states and 1 accepting states, and only the state d corresponding to all copies in the state q0 leads to acceptance, whose amplitude is cos (jφ).

Theorem 4. Any probabilistic finite automaton recognizing Lp with probability 1/2 + , for a fixed  > 0, has at least p states.

Proof. Suppose that such an automaton exists. Since it uses a single-letter alphabet, it can be viewed as a . Splitting ergodic and transient states, we reduce our study to a Markov chain containing only one ergodic set, as two or more can be studied separately.

9 Then, we can bound the probability distribution on the accepting states, contradicting the law of large numbers for Markov chains stated in [3] (Theorem 4.2.1).

However, it was also shown that QFAs are not always space efficient. In particular, [2] contains a proof that a specific language takes almost exponentially more states to be recognized on a QFA than on a DFA.

5 Conclusion

In contrast to more general models, such as quantum circuits, the benefit of quantum automata over their classical counterparts is very limited, and they will most certainly not yield a revolu- tion in computing. However, the properties presented in [1] are peculiar enough to hint that they are still complex objects whose behaviour can surprise us, as the results of theorems1 and2. As such, they are interesting to study as "limited quantum computers", to precisely analyse the contribution of to computation. In particular, theorems3 and4 show that in spite of Holevo’s bound, that states that we can only retrieve one classical bit from a , the infinite space that it can span can still be used to increase efficiency. As stated by the au- thors, such results could help us devise quantum algorithms by extending QFAs or using them as subroutines.

References

[1] A. Ambainis and R. Freivalds. 1-way quantum finite automata: strengths, weaknesses and generalizations, 1998.

[2] A. Ambainis, A. Nayak, A. Ta-Shma, and U. Vazirani. Dense quantum coding and a lower bound for 1-way quantum automata, 1998.

[3] John G. Kemeny and James Laurie Snell. Finite Markov chains. Undergraduate texts in mathematics. Springer, New York, 1976. Reprint of the 1960 ed. published by Van Nostrand, Princeton, N.J., in the University series in undergraduate mathematics.

[4] A. Kondacs and J. Watrous. On the power of quantum finite state automata. In Proceedings 38th Annual Symposium on Foundations of Computer Science, pages 66–75, Oct 1997.

[5] C. Moore and J. Crutchfield. Quantum automata and quantum grammars. 1997.

10