{'fraction_non_alphanumeric': 0.04140976503916014, 'fraction_numerical': 0.01158140309948342, 'mean_word_length': 4.390747810464855, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Perfect Computational Equivalence between Quantum Turing Machines and Finitely Generated Uniform Quantum Circuit Families

In order to establish the computational equivalence between quantum Turing machines (QTMs) and quantum circuit families (QCFs) using Yao's quantum circuit simulation of QTMs, we previously introduced the class of uniform QCFs based on an infinite set of elementary gates, which has been shown to be computationally equivalent to the polynomial-time QTMs (with appropriate restriction of amplitudes) up to bounded error simulation. This result implies that the complexity class BQP introduced by Bernstein and Vazirani for QTMs equals its counterpart for uniform QCFs. However, the complexity classes ZQP and EQP for QTMs do not appear to equal their counterparts for uniform QCFs. In this paper, we introduce a subclass of uniform QCFs, the finitely generated uniform QCFs, based on finite number of elementary gates and show that the class of finitely generated uniform QCFs is perfectly equivalent to the class of polynomial-time QTMs; they can exactly simulate each other. This naturally implies that BQP as well as ZQP and EQP equal the corresponding complexity classes of the finitely generated uniform QCFs.


Introduction
In computational complexity theory, Turing machines and Boolean circuits are commonly used as mathematical models of computation. A Turing machine has tapes of infinitelength to treat the inputs of any length. On the other hand, a Boolean circuit can only process the inputs of a fixed length since its size is finite. To represent an algorithm carried out on inputs of any length, we need to consider a family of Boolean circuits whose n-th circuit handles the inputs of length n. In addition, to keep the computational power consistent with the Church-Turing thesis, we need the notion of uniformity of circuit families, first proposed by Borodin [6]. Roughly speaking, the uniformity of a circuit family requires that there exists a computationally simple rule for constructing all circuits in the family. It is well-known that the polynomial-time Turing machine and the polynomial-size uniform circuit family can exactly simulate each other (see, for instance, Theorem 11.5 in [22, p. 269]). We say that two classes A and B of computational models, such as the class of polynomial-time Turing machines and the class of polynomialsize uniform circuit families, are perfectly equivalent if any element of A can be exactly simulated by an element of B in a sense appropriately defined thereon, and vise versa. Thus, the class of polynomial-time Turing machines is perfectly equivalent to the class of polynomial-size uniform circuit families.
In the mid-1980s, Deutsch proposed a new parallel computing paradigm, quantum computing, which utilizes the superposition principle of quantum mechanics. As mathematical models of quantum computing, he introduced the quantum versions of Turing machines and Boolean circuits, called quantum Turing machines (QTMs) and quantum circuits [7,8]. In 1993, Bernstein and Vazirani [4] and Yao [27] reformulated Deutsch's QTM model and quantum circuit model in the form suitable for computational complexity theory. Bernstein and Vazirani introduced the complexity classes BQP, ZQP, and EQP that represent the bounded-error, zero-error, and exact quantum algorithms to set the grounds for quantum complexity theory. As the first relation between QTMs and quantum circuits, Yao showed that, for any QTM M and T > 0, there is a quantum circuit of size O(T 2 ) that simulates M for T steps. This result was often mentioned to directly mean that QTMs and quantum circuit families (QCFs) are equivalent by a simple analogy with the equivalence between classical Turing machines and classical circuit families. After a few years, the notion of uniformity of QCFs was shortly mentioned in [9,24]. In particular, Shor [24] pointed out (after his private communication with R. Solovay) that uniform QCFs should satisfy a requirement, which is absent in the standard uniformity requirement, that the entries of elementary gates be polynomial-time computable. In tandem, Adleman and collaborators [1] showed that a polynomial-time QTM with amplitudes from the whole complex number field can compute even a non-recursive function. In the journal version [5] of [4], Bernstein and Vazirani defined the complexity classes BQP, ZQP, and EQP based on the polynomial-time QTM with amplitudes from the polynomial-time computable numbers.
In our previous investigation [19], we instituted the complexity theory of uniform QCFs . For this purpose, we rigorously introduced the notion of uniformity of QCFs and based on that we defined the complexity classes, what we called BUPQC, ZUPQC, and EUPQC, which correspond to BQP, ZQP, and EQP, respectively. Using this formulation and Yao's quantum circuit construction for simulation of QTMs, we showed the following results on the computational equivalence between QTMs and uniform QCFs: [19] (QTMs and uniform QCFs are computationally equivalent in the bounded-error setting). (ii) ZQP ⊆ ZUPQC and EQP ⊆ EUPQC while the simulation does not work to show the converse [19,20] (the computational equivalence between the two models are open in the zero-error and exact setting). Thus, the following question still remained: In the zero-error and exact setting, what restriction for the uniform QCF guarantees the computational equivalence between the two models? Kitaev and Watrous [14] introduced the notion of uniformly generated QCFs based on Shor basis [25]. The class of uniformly generated QCFs is computationally equivalent to the class of our uniform QCFs up to bounded error simulation, and it has been used for the study of quantum interactive proof systems. However, this notion does not provide a solution to question (ii) above.
In this paper, we give a complete answer to the above question. To this end, we introduce the notion of finitely generated uniform QCFs based on finite sets of elementary gates, which is a subclass of the uniform QCFs. In [19], we briefly mentioned the notion of semi-uniform QCFs, which is also based on finite sets of elementary gates. Finitely generated uniform QCFs are regarded as those semi-uniform QCFs whose amplitudes are taken from polynomial-time computable numbers. We show that the class of finitely generated uniform QCFs is perfectly equivalent to the class of polynomial-time QTMs with amplitudes from polynomial-time computable numbers. This implies that these two models can simulate each other without error, and hence not only BQP but also ZQP and EQP coincide with the corresponding classes defined through finitely generated uniform QCFs. The proof requires more minute arguments than that of the computational equivalence up to bounded error simulation. For the proof, we revisit properties of polynomial-time computable numbers, which was implicitly used in [19], and Yao's quantum circuit construction. We combine them with the exact decomposition of unitary matrices.

Finitely Generated QCFs
In this section, we give a formal definition of finitely generated QCFs. For the definition of QCFs, see [19]. For convenience, we usually identify quantum gates or circuits with the unitary matrices representing them in the computational basis. For other fundamental notions of quantum computation, we refer to Gruska [11] and to Nielsen and Chuang [17]. For classical complexity theory, we refer, for example, to Papadimitriou [22]. In what follows, let N and C denote the sets of natural numbers and complex numbers, respectively. Let PC denote the set of polynomial-time computable complex numbers [12]. (Informally speaking, a complex number r is polynomial-time computable if its real and imaginary parts can be approximated with accuracy of 1/2 n in time polynomial in n. See Ko [13] for its formal definition.) For two integers m and n with m < n, let [m, n] Z denote {m, m + 1, . . . , n}.
The precise formulation of the uniformity of QCFs was introduced in our previous work [19]. Let G u be the set of quantum gates such that where Λ 1 (N) is a controlled-not gate, R(θ) is a rotation gate by angle θ, and P (θ ′ ) is a phase shift gate by angle θ ′ . All the gates in G u can be encoded by binary strings, using the codes of polynomial-time computable numbers. Here, the code of a polynomialtime computable number r is an appropriate encoding of a deterministic Turing machine (DTM) that approximates r within 2 −n in time polynomial in n. We can then give the code Code(C) of a quantum circuit C based on G u . We say that a QCF C = {C n } based on G u is polynomial-size uniform, or uniform for short, if the function 1 n → Code(C n ) is computable by a DTM in time polynomial in n. Uniform QCFs are very suitable to represent important quantum algorithms such as the quantum Fourier transform and the amplitude amplification. However, uniform QCFs cannot be exactly simulated by any QTM [19] (even with zero-error [20].) Thus, it is questionable whether the class of languages recognized by uniform QCFs with certainty (resp. with zero-error) coincides with the class EQP (resp. ZQP) of polynomial-time QTMs.
By analogy with the uniformity of classical circuits, we may imagine a "uniform" QCF based on a fixed finite set of elementary gates. For example, Kitaev and Watrous [14] introduced polynomial-time uniformly generated QCFs to define verifiers of quantum interactive proof systems: A QCF C = {C x } 1 is polynomial-time uniformly generated if there exists a deterministic procedure that, on input x, outputs a description of C x and runs in time polynomial in |x|. Although they used Shor's basis [25] as their set of elementary gates, in the bounded-error setting, any other universal set of elementary gates is available without changing the computational power of polynomial-time uniformly generated QCFs. However, for exact (or zero-error) algorithms, fixing a set of elementary gates may seriously reduce the computational power of "uniform" QCFs. For instance, the class of languages recognized with bounded-error by polynomial-time uniformly generated QCFs based on a universal set G 4/5 = {Λ 1 (N), R(θ), P (θ)| cos θ = 4/5} coincides with the class BQP [1], while the class of languages recognized with certainty by polynomial-time uniformly generated QCFs based on G 4/5 coincides with the class P [18], instead of the class EQP.
We now introduced a class of QCFs, called finitely generated QCFs, an intermediate class between uniform QCFs and polynomial-time uniformly generated QCFs. A uniform QCF C is said to be finitely generated if there is a finite subset G of G u such that C is based on G. By definition, any polynomial-time uniformly generated QCF is finitely generated, and any finitely generated uniform QCF is uniform. Finitely generated uniform QCFs have two nice properties: (i) The finitely generated uniform QCF is based on finite sets of elementary gates, different from the uniform QCF; and (ii) The definition of the finitely generated uniform QCF is independent of the choice of universal sets, different from the polynomial-time uniformly generated QCF. In [19], we provided a similar notion, called semi-uniform QCFs. A finitely generated uniform QCF can be regarded as a semi-uniform QCF such that all the components representing matrices of elementary gates are restricted to PC. An analogous concept to finitely generated uniform QCFs was also mentioned by Green, Homer, Moore, and Pollett [10] in their study of shallow quantum circuits.

Proof of the Perfect Equivalence
In this section, we establish the perfect equivalence between the finitely generated uniform QCF and the polynomial-time QTM with amplitudes from PC. See [5,19,21,26] for the definition of QTMs.
First, we recall two elementary properties on polynomial-time computable numbers given by Ko and Friedman [12]. Loosely speaking, a real function f is said to be polynomial-time computable if for any real x, the value f (x) can be approximated with accuracy of 1/2 n in time polynomial in n using x as an "oracle" to obtain any required bits of x. (See [13] for its formal definition.) (ii) PC is an algebraically closed field.
Second, we provide a standard exact decomposition of finite dimensional unitary matrices [2] with an argument on polynomial-time computable entries of matrices. 2 To this end, we use the terminology of the approximate decomposition algorithm of unitary matrices given in [5]. Although this exact decomposition is not algorithmic, it is sufficient for our purpose. Let e j be the m-dimensional unit column vector whose j-th component is 1. We denote by Near m (j, θ) an m-dimensional unitary matrix satisfying We denote by Near m (i, j, θ) an m-dimensional unitary matrix satisfying These two types of matrices are called near-trivial [5]. We show that any unitary matrix whose components are in PC can be decomposed into near-trivial matrices whose components are also in PC. Proof. (i) Let U be an N-dimensional unitary matrix. We can show that there is a product A of 2N − 1 near-trivial matrices such that AU (1) = e 1 , where U (1) denotes the first column vector of U. Actually, we show that for any N-dimensional unit column vector v, there is a product A of 2N − 1 near-trivial matrices such that Av = e 1 . Let v i denote the i-th coordinate of v. First, we use N near-trivial matrices to map v into the N-dimensional real space.
Then, P 1 · · · P N v is the vector with i-th coordinate |v i |. Second, we use N − 1 near-trivial matrices to move all of the weight of the vector into dimension 1.
Here, diag(A 1 , . . . , A n ) denotes the block-diagonal square matrix composed of square matrices A 1 , . . . , A n along the diagonal and 0's everywhere else. By induction, we can verify that there is the product C of O(N 2 ) near-trivial matrices satisfying CU = I. Thus, U can be represented by the product of O(N 2 ) near-trivial matrices.
(ii) In the case where all the entries in U are in PC, we should note that the above decomposition uses only four arithmetic operations, the function x → √ x, the trigonometric functions and their inverse functions for each real parts and imaginary parts. Therefore, each near-trivial matrix composing U has the entries in PC by Theorem 3.1. QED As seen in [2], any 2 n -dimensional near-trivial unitary matrix U can be decomposed into O(n 3 ) quantum gates in G u as follows: (i) Using an idea from the grey code, U can be decomposed into O(n) controlled (n−1) -phase shifts or rotation gates; (ii) Any controlled (n−1) -phase shift (or rotation gate) can be decomposed into O(n 2 ) quantum gates in G u (Corollary 7.6 in [2]). Moreover, by carefully checking the argument leading to obtain Corollary 7.6 in [2], we can see that those O(n 3 ) quantum gates have their entries in PC provided that all the entries in U are in PC. Thus, we obtain the following exact decomposition of unitary matrices. (ii) Moreover, if all the entries in U are in PC, each of the quantum gates that decomposes U has its entries in PC.
Third, we provide the exact simulation of QTMs by finitely generated uniform QCFs, combining Yao's idea for the simulation of a QTM by a quantum circuit [27] and Proposition 3.3. We briefly recall the definition of the simulation of QTMs by finitely generated uniform QCFs. See [19] for the detail. A quantum circuit C is said to exactly t-simulate a QTM M if the following two probability distributions D x and D ′ x are equal for any string x: (i) the probability distribution D x of the outcomes of the simultaneous measurement of the tape cells from cell −t to cell t after t steps of M for input state |q 0 , tape[x], 0 , where tape[x] represents the tape configuration such that x is written from cell 0 to cell |x| − 1; and (ii) the probability distribution D ′ x of the string obtained by decoding the output of C for the input of the binary string obtained by encoding x. A finitely generated uniform QCF {C n } is said to exactly simulate a polynomial-time QTM M if C n t(n)-simulates M, where a polynomial t(n) is the computation time of M on input of length n. Proof. The basic line of this proof is in accordance with the proof in [19,Theorem 4.3], which is based on Yao's construction. For our exact simulation, we argue the decomposition of Yao's construction into elementary gates in detail. We refer to [19,Section 4] for the terminology of quantum circuits.
Let C G be the quantum circuit based on G = {G 1 , G 2 } constructed as follows. First, 2t − 1 G 1 's are connected in such a way that, for j ∈ [1, 2t − 1] Z , the j-th G 1 is connected with cells j − t − 1, j − t and j − t + 1. The (l 0 + (2t + 1)l)-qubit circuit constructed from these G 1 's is called C 1 . Lastly, G 2 is connected with cells −t, −t + 1, . . . , t. The (l 0 + (2t + 1)l)-qubit circuit constructed from this G 2 is called C 2 . Let C G be (C 2 • C 1 ) t , i.e., the t concatenations of the circuit C 2 • C 1 obtained by connecting C 2 into C 1 . The quantum circuit C 2 • C 1 is illustrated in Figure 1. By the definitions of G 1 and G 2 , it can be verified that C 2 • C 1 carries out the operation corresponding to one step of M. (See [19] for the verification.) Hence, C G simulates t steps of M exactly.
The (l 0 + 3l)-qubit gate G 1 can be exactly decomposed by a finite number of one-qubit gates G 11 , . . . , G 1α and Λ 1 (N) from Proposition 3.3(i). Note that all the components of G 11 , . . . , G 1α , Λ 1 (N) are in PC by Proposition 3.3(ii) since the QTM M has transition amplitudes in PC. By definition, the quantum gate G 2 can be implemented by swapping two qubits of each s i , which can be implemented by the concatenation of three controllednot gates. Thus, there are an (l 0 + 3l)-qubit quantum circuit C u,1 of size O(1) and an (l 0 +(2t+1)l)-bit quantum circuit C u,2 of size 3(2t+1) based on G u such that the quantum gates determined by them are G 1 and G 2 , respectively. Now, let C a be an (l 0 + (2t + 1)l)qubit quantum circuit obtained by decomposing each G 1 in C 1 into O(1) gates using a cell P Figure 1: The quantum circuit C 2 • C 1 based on the set G = {G 1 , G 2 } of quantum gates. This circuit simulates one step of a QTM M with amplitudes from PC.
is a quantum circuit based on G M of size O(t 2 ) that exactly t-simulates M. The codes of C u,2 and C a can be computed by a DTM in time polynomial in n from their constructions (note that the codes of polynomial-time computable numbers used in C u,2 and C a can be stored in the processor of the DTM since they are finite). Moreover, the code of C is also computed in time polynomial in n since C is simply the concatenation of t(n) circuits C u,2 • C a . Noting that the set G M of elementary gates is fixed with respect to n, we can verify that M is exactly simulated by a finitely generated uniform QCF {C n }, where C n is the above quantum circuit that exactly t(n)-simulates M. This completes the proof. QED Finally, we can exactly simulate any given finitely generated uniform QCF {C n } by a polynomial-time QTM M with amplitudes from PC (see Lemma 5.1 in [19]) because the set of elementary gates for C n is finite and the quantum transition function of M can represent all the operations induced by the elementary gates. Combining this fact with Theorem 3.4, we obtain the perfect equivalence between the classes of polynomial-time QTMs with amplitudes from PC and finitely generated uniform QCFs.
Theorem 3.5 The class of polynomial-time QTMs with amplitudes from PC is perfectly equivalent to the class of finitely generated uniform QCFs.
The following corollary directly comes from Theorem 3.5.
Corollary 3.6 The class of languages recognized with certainty (resp. with zero-error and bounded-error) by finitely generated QCFs coincide with the corresponding complexity class EQP (resp. ZQP and BQP) for polynomial-time QTMs.

Concluding Remarks
We introduced a subclass of uniform QCFs, finitely generated uniform QCFs, and showed that this subclass is perfectly equivalent to the class of polynomial-time QTMs with ampli-tudes from polynomial-time computable numbers. Here, we shortly point out relationships among uniformity notions under other conditions. Complexity of coding: In the theory of circuit complexity, a number of uniformity notions (say, [6,3,23]) were proposed according to machines for constructing circuit families. We use polynomial-time DTMs as machines for computing the codes of QCFs. Although we could take polynomial-time QTMs with amplitudes from PC, instead of polynomial-time DTMs, the resulting class of uniform QCFs does not change. This is because such polynomial-time QTMs can be exactly simulated by QCFs whose coding functions are deterministically polynomial-time computable by using Yao's construction. Furthermore, we can restrict machines for computing the codes of QCFs to logspace DTMs without changing the resulting class of uniform QCFs since, in the proof of Theorem 3.4, the code of C is computed by an O(log n)-space DTM. This means that the finitely generated "logspace-uniform" QCF is perfectly equivalent to the finitely generated "Puniform" (and even "EQP-uniform") QCF, like the classical case.
Parameter of uniform QCFs: In [14], the binary string x ∈ {0, 1} * was used as the parameter of uniform QCFs instead of the number n ∈ N. That is, a QCF {C x } is uniform if there is a DTM M that on input x, produces a description of C x in time polynomial in |x|. However, as mentioned in [14], this variation does not change the resulting class of uniform QCFs. Actually, all the C x 's with |x| = n can be simulated by only one quantum circuit C ′ n , which implements C x on the target part of C ′ n when x is provided to the controlled part of C ′ n . It is easy to check that {C ′ n } is a uniform QCF in the regular meaning.
Size of elementary gates: It is well-known that any one-qubit gates whose components are in PC and the controlled-not gate are sufficient [2] to represent any uniform QCF exactly. Therefore, uniform QCFs defined under elementary gates of larger size more than two are perfectly equivalent to our uniform QCFs.
Restriction of transition amplitudes: In [19], we showed the perfect equivalence between semi-uniform QCFs and polynomial-time QTMs without any restriction of amplitudes. In Theorem 3.4, we also have shown that both models are perfectly equivalent if their transition amplitudes are restricted to PC. However, if we restrict their transition amplitudes to other subsets of C, there is no guarantee that two models are still perfectly equivalent. This is because, in the proof of Theorem 3.4, we use the square root operation and the root of a function generated by trigonometric functions as well as the addition, the subtraction, the multiplication, and the division. By checking carefully the proof of Theorem 3.4, we can establish the perfect equivalence between two models with amplitudes from the set of algebraic numbers, provided that the size of elementary gates is allowed to be any number fixed with respect to the input length. The case of the rational number field is open since Yao's construction needs the square root operation.
In [20], the following related results on the power of finitely generated uniform QCFs have been reported by comparing it with that of uniform QCFs: (i) The quantum Fourier transform (QFT) of any order cannot be implemented with zero error by any finitely generated uniform QCF, while it can be exactly implemented by a uniform QCF by the result by Mosca and Zalka [15]. (ii) If a permutation M f : |x → |f (x) can be implemented with zero error by a uniform QCF, then both f and f −1 can be exactly computed by uniform QCFs. The first result implies that uniform QCFs cannot always be simulated with zero error by finitely generated uniform QCFs. 3 The second result suggests that uniform QCFs are more useful for constructing exact quantum algorithm than finitely generated QCFs.