text:
# Decidable and undecidable problems about quantum automata

## 1. Introduction

In this paper, we provide decidability and undecidability proofs for two problems associated with quantum finite automata. Quantum finite automata (QFA) were introduced by Moore and Crutchfield \[MC00\]; they are to quantum computers what finite automata are to Turing machines. Quantum automata are also analogous to the probabilistic finite automata introduced in the 1960s by Rabin that accept words with a certain probability \[Rab67\] (see also \[Paz71\] for a book-length treatment). A quantum automaton $`A`$ assigns real values $`\mathrm{Val}_A(w)`$ to input words $`w`$ (see below for a precise description of how these values are computed). $`\mathrm{Val}_A(w)`$ can be interpreted as the probability that on any given run of $`A`$ on the input word $`w`$, $`w`$ is accepted by $`A`$. Associated to a real threshold $`\lambda `$, the languages recognized by the automata $`A`$ with non-strict and strict threshold $`\lambda `$ are

$$L_{}=\{w:\mathrm{Val}_A(w)\lambda \}\text{ and }L_>=\{w:\mathrm{Val}_A(w)>\lambda \}.$$

Many properties of these languages are known in the case of probabilistic and quantum automata. For instance, it is known that the class of languages recognized by quantum automata is strictly contained in the class of languages recognized by probabilistic finite automata \[BP02\]. For probabilistic automata it is also known that the problem of determining if $`L_{}`$ is empty and the problem of determining if $`L_>`$ is empty are undecidable \[Rab63\]. This is true even for automata of fixed dimensions \[BC03\].

In this contribution, we consider the problem of determining for a quantum automata $`A`$ and threshold $`\lambda `$ if there exists a word $`w`$ for which $`\mathrm{Val}_A(w)\lambda `$ and if there exists a word $`w`$ for which $`\mathrm{Val}_A(w)>\lambda `$. We prove in Theorem 2.1 that the first problem is undecidable and in Theorem 3.1 that the second problem is decidable. For quantum automata it thus makes a difference to consider strict or non-strict thresholds. This result is in contrast with probabilistic automata for which both problems are undecidable.

Similarly to the languages $`L_{}`$ and $`L_>`$, one can define the languages $`L_{}`$ and $`L_<`$ and ask whether or not they are empty (of course, emptiness of $`L_{}`$ is equivalent to $`L_>`$ being equal to $`\mathrm{\Sigma }^{}`$). These two problems are known \[Rab63\] to be undecidable for probabilistic automata. For quantum automata our decidability results do again differ depending on whether we consider strict or non-strict inequalities. Our results are summarized in Table 1.

Before we proceed with the proofs, we first define what we mean by a quantum finite automaton. A number of different quantum automata models have been proposed in the literature and not all models are computationaly equivalent. For the “measure-many” model of quantum automata introduced by Kondacs and Watrous \[KW97\] the four problems of Table 1 are proved undecidable in \[Jea02\]. The model we consider here is the so-called Measure Once Quantum Finite Automaton introduced by Moore and Crutchfield \[MC00\]. These automata operate as follows. Let $`\mathrm{\Sigma }`$ be a finite set of input letters and let $`\mathrm{\Sigma }^{}`$ denote the set of finite input words (including the empty word); typical elements of $`\mathrm{\Sigma }^{}`$ will be denoted $`w=w_1\mathrm{}w_{|w|}`$ where $`w_i\mathrm{\Sigma }`$ and $`|w|`$ denotes the length of $`w`$. The QFA $`A`$ is given by a finite set of $`n`$ states, $`n\times n`$ unitary transition matrices $`X_\alpha `$ (one for each symbol $`\alpha `$ in $`\mathrm{\Sigma }`$), a (row) vector of unit norm $`s`$ (the initial configuration), and a $`n\times n`$ projection matrix $`P`$. Given a word $`w\mathrm{\Sigma }^{}`$, the value of $`w`$, denoted $`\mathrm{Val}_A(w)`$, is defined by

$$\mathrm{Val}_A(w)=sX_wP^2$$

In this expression, $``$ is the euclidean vector norm and we use the notation $`X_w`$ for the product $`X_{w_1}\mathrm{}X_{w_{|w|}}`$. For a vector $`v`$, the value $`vP^2`$ is the probability for the quantum state $`v`$ to be observed in acceptance space. The value $`\mathrm{Val}_A(w)`$ can thus be interpreted as the probability of observing the quantum state in acceptance space after having applied the operator sequence $`X_{w_1}`$ to $`X_{w_{|w|}}`$ to the initial quantum state $`s`$.

The rest of this paper is organized as follows. In Section 2, we reduce Post’s correspondence problem to the problem of determining if a quantum automata has a word of value larger than a given threshold. Post’s correspondence problem is undecidable and this therefore proves our first result. Our reduction uses an encoding of words in three dimensional space. In Section 3, we prove decidability of the same problem for strict inequality. For the proof we use the fact that any compact matrix group is algebraic and the group we consider can be given an effective description.

## 2. Undecidability for non strict inequality

We prove in this section that the problem of determining if a quantum automata has a word of value larger than some threshold is undecidable. The proof is by reduction from Post’s correspondence problem (PCP), a well-known undecidable problem. An instance of Post’s correspondence problem is given by a finite alphabet $`\mathrm{\Sigma }`$ and $`k`$ pairs of words $`(u_i,v_i)\mathrm{\Sigma }^{}\times \mathrm{\Sigma }^{}`$ for $`i=1,\mathrm{},k`$. A solution to the correspondence is any non-empty word $`w=w_1\mathrm{}w_n`$ over the alphabet $`\{1,\mathrm{},k\}`$ such that $`u_w=v_w`$, where $`u_w=u_{w_1}\mathrm{}u_{w_n}`$. This correspondence problem is known to be undecidable: there is no algorithm that decides if a given instance has a solution \[Pos46\]. It is easy to see that the problem remains undecidable when the alphabet $`\mathrm{\Sigma }`$ contains only two letters. The problem is also known to be undecidable for $`k=7`$ pairs \[MS96\] but is decidable for $`k=2`$ pairs; the decidability of the cases $`2<k<7`$ is yet unresolved. We are now ready to state our first result.

###### Theorem 2.1.

There is no algorithm that decides for a given automaton $`A`$ if there exists a word $`w`$ for which $`\mathrm{Val}_A(w)0`$, or if there exists one for which $`\mathrm{Val}_A(w)1`$. These problems remain undecidable even if the automaton is given by 7 matrices in dimension 6, or by 2 matrices in dimension 42.

Proof. We proceed by reduction from PCP. For our reduction we need to encode words by unitary matrices. We will take matrices that represent rotations of angle $`\mathrm{arccos}(3/5)`$ on, respectively, the first and the third axis:

$$\begin{array}{cc}X_a=\frac{1}{5}\left(\begin{array}{ccc}3& 4& 0\\ 4& 3& 0\\ 0& 0& 5\end{array}\right)& X_b=\frac{1}{5}\left(\begin{array}{ccc}5& 0& 0\\ 0& 3& 4\\ 0& 4& 3\end{array}\right)\end{array}$$

These matrices are unitary, $`X_aX_a^T=I=X_bX_b^T`$ and they generate a free group since a result from Swierczkowski ensures us that two irrationals rotations on orthogonal axes in $`^3`$ generate a free group. In addition to that, we now prove that there exists a vector $`t`$ such that $`tX_u=tX_w`$ implies $`u=w`$.

We will use here a method from \[Su90\]. One can show by induction that for any reduced matrix product $`M`$ of $`k`$ matrices111A product is said to be reduced if no two consecutive matrices in the product are inverse from each other. taken from the set $`\{X_a,X_b,X_a^1,X_b^1\}`$, we have

$$(\mathrm{3\; 0\; 4})M=(x_1x_2x_3)/5^k$$

with $`x_1,x_2,x_3`$, and $`5`$ divides $`x_2`$ if and only if $`k=0`$ (and then $`M=I`$).

The result is obviously true for $`k=0,1`$. Now, if $`M=M^{}X_1X_0`$, then $`(\mathrm{3\; 0\; 4})M=(x_1x_2x_3)/5^kX_aX_b=(x_4x_55x_3)/5^{k+1}X_b`$ for some $`x_4,x_5`$, and by induction hypothesis $`5`$ does not divide $`x_5`$. Now $`(\mathrm{3\; 0\; 4})M=(x_63x_5+20x_3x_7)/5^{k+2}`$ so that $`5`$ does not divide the second term. The proof for all the other cases is similar.

We will now call $`t`$ the row vector $`(\mathrm{3\; 0\; 4})`$. If $`tX_u=tX_v`$ then $`tX_uX_v^1=t`$. As the second component of $`t`$ is equal to $`0`$, the product must be trivial, and so $`u=v`$.

Given an instance $`(u_i,v_i)_{1ik}`$ of PCP over the alphabet $`\{a,b\}`$ and a word $`w\{1,\mathrm{},k\}^{}`$, we construct the matrix

$$Y_w=\frac{1}{2}\left(\begin{array}{cc}X_{u_w}+X_{v_w}& X_{u_w}X_{v_w}\\ X_{u_w}X_{v_w}& X_{v_w}+X_{u_w}\end{array}\right)$$

These matrices are unitary, and verify $`Y_{w\nu }=Y_wY_\nu `$

A solution of the original PCP problem is a nonempty word $`w\{1,\mathrm{},k\}^{}`$ such that the upper-right block of the matrix $`Y_w`$ is equal to zero. We may use the previously introduced vector $`t=(\mathrm{3\; 0\; 4})`$ to test this condition. We have

$$\left(\begin{array}{cc}t& 0\end{array}\right)Y_w=\frac{1}{2}\left(\begin{array}{cc}tX_{u_w}+tX_{v_w}& tX_{u_w}tX_{v_w}\end{array}\right)$$

and thus a solution of the PCP problem is a word $`w`$ such that the last three coordinates of $`yY_w`$ are equal to zero, where $`y=\left(\begin{array}{cc}t& 0\end{array}\right)`$. This condition can be tested with a projection matrix. Defining

$$P=\left(\begin{array}{cc}0_3& 0\\ 0& I_3\end{array}\right)$$

we have that the solutions of the original PCP problem are the words $`w`$ for which $`yY_wP=0`$, which is equivalent to

$$\mathrm{Val}_A(w)=yY_wP^2=0$$

The values taken by $`\mathrm{Val}_A(w)`$ are non-negative and so the problem of determining if there exists a word $`w`$ such that $`\mathrm{Val}_A(w)0`$ is undecidable. Notice also that $`yY_wI^2=1`$ and so

$$yY_w(IP)^21$$

with equality only for $`yY_wP=0.`$ Thus, the problem of determining if there exists a word $`w`$ such that $`\mathrm{Val}_A(w)1`$ is undecidable.

We now show how to reduce the number of matrices to two. We use a construction from Blondel \[BT97, BC03\]. Given the above matrices $`Y_i`$ and the projection matrix $`P`$, we define

$$Z_0=\left(\begin{array}{cccc}Y_1& 0& \mathrm{}& 0\\ 0& Y_2& \mathrm{}& 0\\ \mathrm{}& \mathrm{}& \mathrm{}& \mathrm{}\\ 0& 0& \mathrm{}& Y_7\end{array}\right)\text{ and }Z_1=\left(\begin{array}{cccc}0& I& 0& 0\\ 0& \mathrm{}& \mathrm{}& 0\\ \mathrm{}& \mathrm{}& \mathrm{}& I\\ I& 0& \mathrm{}& 0\end{array}\right)$$

When taking products of these two matrices the matrix $`Z_1`$ acts as a “selecting matrix” on the blocks of $`Z_0`$. Let us define $`x=\left(\begin{array}{cc}y& 0\end{array}\right)`$ and

$$Q=\left(\begin{array}{cccc}P& 0& \mathrm{}& 0\\ 0& 0& \mathrm{}& 0\\ \mathrm{}& \mathrm{}& \mathrm{}& \mathrm{}\\ 0& 0& \mathrm{}& 0\end{array}\right)$$

We claim that there exists a non-empty word $`w`$ over the alphabet $`\{1,\mathrm{},7\}`$ such that $`yY_wP=0`$ if and only if there exists a non-empty word $`\nu `$ over $`\{0,1\}`$ such that $`xZ_\nu Q=0`$. The complete proof of this claim is given in \[BT97\] and is not reproduced here. $`\mathrm{}`$

It is possible to give a stronger form to the second part of the Theorem. We prove below that, whatever threshold $`0\lambda <1`$ is used, the problem of determining if there exists a word for which $`\mathrm{Val}_A(w)\lambda `$ is undecidable. This result follows as a corollary of the following lemma.

###### Lemma 2.2.

Associated to every QFA $`𝒜`$ and threshold $`\lambda <1`$ we can effectively construct a QFA $`B`$ such that the language recognized with threshold $`\lambda `$ by $`B`$ is the language recognized with threshold $`0`$ by $`A`$. Moreover, if $`\lambda `$ and $`A`$ has only rational entries then $`B`$ can be chosen with rational entries.

Proof. The idea is to construct $`B`$ by adding a state to $`A`$. Let $`A`$ be given by the unitary matrices $`X_i^A`$, the projection matrix $`P^A`$ and the initial vector $`s^A`$. Let

$$X_i^B=\left(\begin{array}{cc}X_i^A& 0\\ 0& 1\end{array}\right)$$

and define $`s^B=\left(\begin{array}{cc}\sqrt{\lambda }s^A& \sqrt{1\lambda }\end{array}\right)`$. If we choose

$$P^B=\left(\begin{array}{cc}P^A& 0\\ 0& 0\end{array}\right)$$

we immediately have $`\mathrm{Val}_B(w)=\lambda \mathrm{Val}_A(w)`$ and the first part of lemma is proven. The entries $`\sqrt{\lambda }`$ and $`\sqrt{1\lambda }`$ do in general not need to be rational. It remains to show how the parameters of $`B`$ can be chosen rational when those of $`A`$ are. We therefore use Lagrange’s theorem to write $`\lambda `$ and $`1\lambda `$ as the sum of the square of four rational numbers, say $`\lambda =a_1^2+a_2^2+a_3^2+a_4^2`$ and $`1\lambda =b_1^2+b_2^2+b_3^2+b_4^2`$.

Now, if we define

$$s^B=\left(\begin{array}{ccc}a_1s^A& a_2\mathrm{}a_4& b_1\mathrm{}b_4\end{array}\right)X_i^B=\left(\begin{array}{cc}X_i^A& 0\\ 0& I_7\end{array}\right)P^B=\left(\begin{array}{ccc}P^A& 0& 0\\ 0& I_3& 0\\ 0& 0& 0_4\end{array}\right)$$

we have immediately $`\mathrm{Val}_B(w)=a_1^2\mathrm{Val}_A(w)+a_2^2+a_3^2+a_4^2`$, $`s^B^2=1`$ and the lemma is proved. $`\mathrm{}`$

Combining Lemma 2.2 with Theorem 2.1, we immediately obtain:

###### Corollary 2.3.

For any rational $`\lambda `$, $`0\lambda <1`$, there is no algorithm that decides if a given quantum automata has a word $`w`$ for which $`\mathrm{Val}(w)\lambda `$.

## 3. Decidability for strict inequality

We now prove that the problem of determining if a quantum automata has a word of value *strictly* larger than some threshold is decidable. This result points to a difference between quantum and probabilistic automata since for probabilistic automata this problem is known to be undecidable.

Once an automaton is given one can of course always enumerate all possible words $`w`$ and halt as soon as one is found for which $`\mathrm{Val}_A(w)>\lambda `$, and so the problem is clearly semi-decidable. In order to show that it is decidable it remains to exhibit a procedure that halts when $`\mathrm{Val}_A(w)\lambda `$ for all $`w`$.

Let a quantum automata $`A`$ be given by a finite set of $`n\times n`$ unitary transition matrices $`X_i`$, an initial configuration $`s`$ of unit norm, and a projection matrix $`P`$. The value of the word $`w`$ is given by $`\mathrm{Val}_A(w)=sX_wP^2`$. Let $`𝒳`$ be the semigroup generated by the matrices $`X_i`$, $`𝒳=\{X_w:w\mathrm{\Sigma }^{}\}`$, and let $`f:^{n\times n}`$ be the function defined by $`f(X)=sXP^2`$. We have that

$$\mathrm{Val}_A(w)=f(X_w)$$

and the problem is now that of determining if $`f(X)\lambda `$ for all $`X𝒳`$. The function $`f`$ is a (continuous) polynomial map and so this condition is equivalent to $`f(X)\lambda `$ for all $`X\overline{𝒳}`$, where $`\overline{𝒳}`$ is the closure of $`𝒳`$ in $`^{n\times n}`$. The set $`\overline{𝒳}`$ has the interesting property that it is algebraic (see below for a proof), and so there exist polynomials mappings $`f_1,\mathrm{},f_p:^{n\times n}`$, such that $`\overline{𝒳}`$ is exactly the set of common zeroes of $`f_1,\mathrm{},f_p`$. If the polynomials $`f_1,\mathrm{},f_p`$ are known, the problem of determining whether $`f(X)\lambda `$ for all $`X\overline{𝒳}`$ can be written as a quantifier elimination problem

(1)
$$X\left[\left(f_1(X)=0\mathrm{}f_p(X)=0\right)f(X)\lambda \right].$$

This is a first-order formula over the reals, and can be decided effectively by Tarski-Seidenberg elimination methods (see \[Ren92\] for a survey of known algorithms). If we knew how to effectively compute the polynomials $`f_1,\mathrm{},f_p`$ from the matrices $`X_i`$, a decision algorithm would therefore follow immediately. In the following we solve a simpler problem: we effectively compute a sequence of polynomials whose zeroes describe the same set $`\overline{𝒳}`$ after finitely many terms (but we may never know how many). It turns out that this is sufficient for our purposes.

###### Theorem 3.1.

Let $`(X_i)_{i\mathrm{\Sigma }}`$ be unitary matrices of dimension $`n`$ and let $`\overline{𝒳}`$ be the closure of the semigroup $`\{X_w:w\mathrm{\Sigma }^{}\}`$. The set $`\overline{𝒳}`$ is algebraic, and if the $`X_i`$ have rational entries we can effectively compute a sequence of polynomials $`f_1,\mathrm{},f_i,`$ such that

1. If $`X\overline{𝒳}`$, $`f_i(X)=0`$ for all $`i`$;
2. There exists some $`k`$ such that $`\overline{𝒳}=\{X:f_i(X)=0,i=1,\mathrm{},k\}`$.

Proof. We first prove that $`\overline{𝒳}`$ is algebraic. It is known (see, e.g., \[OV90\]) that every compact group of real matrices is algebraic. In fact, the proof of algebraicity in \[OV90\] reveals that any compact group $`G`$ of real matrices of size $`n`$ is the zero set of

$$[X]^G=\{f[X]:f(I)=0\text{ and }f(gX)=f(X)\text{ for all }g\text{ in }G\},$$

i.e., $`G`$ is the zero set of the polynomials in $`n\times n`$ variables which vanish at the identity and are invariant under the action of $`G`$. We will use this property later in the proof.

To show that $`\overline{𝒳}`$ is algebraic, it suffices to show that $`\overline{𝒳}`$ is compact and is a group. The set $`\overline{𝒳}`$ is obviously compact (bounded and closed in a normed vector space of finite dimension). Let us show that it is a group. It is in fact known that every compact subsemigroup of a topological group is a subgroup. Here is a self-contained proof in our setting: for every matrix $`X`$, the sequence $`X^k`$ admits a subsequence that is a Cauchy sequence, by compactness. Hence for every $`ϵ`$ there exists $`k>0`$ and $`l>k+1`$ such that $`X^kX^lϵ`$, that is $`X^1X^{lk1}ϵ`$ (recall that $`AB=B`$ if $`A`$ is unitary, and if $`.`$ is the operator norm associated to the Euclidean norm). Hence, $`X^1`$ is in the set and the first part of the theorem is proved. For notational convenience, we will denote the group $`\overline{𝒳}`$ by $`G`$ in the remainder of the proof.

For the second part of the theorem, we will prove that we can take

$$\{f_i\}=\{f[X]:f(I)=0\text{ and }f(X_jX)=f(X)\text{ for all }j\text{ in }\mathrm{\Sigma }\}$$

In words, this is the set $`[X]^G`$ of rational polynomials which vanish at the identity and are invariant under the action of each matrix $`X_j`$. It is clear that this set is recursively enumerable. We claim that $`G`$ is the zero set of the $`f_i`$’s. By Noetherianity the zero set of the $`f_i`$’s is equal to the zero set of a finite subset of the $`f_i`$’s, so that the theorem follows immediately from this claim. To prove the claim, we will use the fact that $`G`$ is the zero set of $`[X]^G`$. Note that

$$[X]^G=\{f[X]:f(I)=0\text{ and }f(X_jX)=f(X)\text{ for all }j\text{ in }\mathrm{\Sigma }\}$$

(a polynomial is invariant under the action of $`G`$ if and only it is invariant under the action of all the $`X_j`$). This observation implies immediately that each $`f_i`$ is in $`[X]^G`$, so that the zero set of the $`f_i`$’s contains the zero set of $`[X]^G`$. The converse inclusion follows from the fact that any element $`P`$ of $`[X]^G`$ can be written as a linear combination of some $`f_i`$’s. Indeed, let $`d`$ be the degree of $`P`$ and let $`E_d`$ be the set of real polynomials in $`n\times n`$ variables of degree at most $`d`$. The set $`V_d=E_d[X]^G`$ is a linear subspace of $`E_d`$ defined by by a system of linear equations with rational coefficients (those equations are $`f(I)=0`$ and $`f(X_jX)=f(X)`$ for all $`j\mathrm{\Sigma }`$). Hence there exists a basis of $`V_d`$ made up of polynomials with rational coefficients, that is, of elements of $`\{f_i\}`$. This completes the proof of the claim, and of the theorem.

$`\mathrm{}`$

We may now apply this result to quantum automata.

###### Theorem 3.2.

The two following problems are decidable.

* Given a quantum automaton $`A`$ and a threshold $`\lambda `$, decide whether there exists a word $`w`$ such that $`\mathrm{Val}_A(w)>\lambda `$.
* Given a quantum automaton $`A`$ and a threshold $`\lambda `$, decide whether there exists a word $`w`$ such that $`\mathrm{Val}_A(w)<\lambda `$.

Proof. We only show that problem (i) is decidable. The argument for problem (ii) is essentially the same.

As pointed out at the beginning of this section, it suffices to exhibit an algorithm which halts if and only if $`Val_A(w)\lambda `$ for every word $`w`$. Consider the following algorithm:

* enumerate the $`f_i`$’s;
* for every initial segment $`f_1,\mathrm{},f_p`$, decide whether (1) holds, and halt if it does.

It follows from property (1) in Theorem 3.1 that $`Val_A(w)\lambda `$ for every word $`w`$ if the algorithm halts. The converse follows from property (2). $`\mathrm{}`$

Throughout the paper we have assumed that our unitary matrices have rational entries. It is not hard to relax this hypothesis. For instance, it is clear from the proofs that Theorems 3.1 and 3.2 can be generalized to matrices with real algebraic entries.

In the proof of Theorem 3.2 we have bypassed the problem of explicitly computing a finite set of polynomials defining $`\overline{𝒳}`$. It is in fact possible to show that this problem is algorithmically solvable \[DJK03\]. This implies in particular that the following two problems are decidable:

* Decide whether a given treshold is isolated.
* Decide whether a given QFA has an isolated threshold.

A threshold $`\lambda `$ is said to be isolated if:

$$ϵ>0w\mathrm{\Sigma }^{}|\mathrm{Val}_A(w)\lambda |>ϵ.$$

It is known that these two problems are undecidable for probabilistic automata \[Ber75, BMT77, BC03\].

The algorithm of \[DJK03\] for computing $`\overline{𝒳}`$ has also applications to quantum circuits: this algorithm can be used to decide whether a given set of quantum gates is complete (complete means that any unitary transformation can be approximated to any desired accuracy by a quantum circuit made up of gates from the set). Much effort has been devoted to the construction of specific complete sets of gates \[DBE95, BBC+95\], but no general algorithm for deciding whether a given set is complete was known.

Finally, we note that the proof of Theorem 3.2 does not yield any bound on the complexity of problems (i) and (ii). We hope to investigate this question in future work.

## Acknowledgment

P.K. would like to thank Etienne Ghys for pointing out reference \[OV90\].