Volume 3, Issue 6 e1120
SPECIAL ISSUE PAPER
Full Access

An explanation of the Bernstein-Vazirani and Deustch-Josza algorithms with the quantum stabilizer formalism

Elías F. Combarro

Corresponding Author

Elías F. Combarro

Computer Science Department, University of Oviedo, Spain

Correspondence Elías F. Combarro, Computer Science Department, University of Oviedo.

Email: [email protected]

Search for more papers by this author
Alejandro Piñera-Nicolás

Alejandro Piñera-Nicolás

Mathematics Department, University of Oviedo, Spain

Search for more papers by this author
José Ranilla

José Ranilla

Computer Science Department, University of Oviedo, Spain

Search for more papers by this author
Ignacio F. Rúa

Ignacio F. Rúa

Mathematics Department, University of Oviedo, Spain

Search for more papers by this author
First published: 26 July 2020
Citations: 1

Funding information: Gobierno del Principado de Asturias, FC-GRUPIN-IDI/2018/000193; FC-GRUPIN-IDI/2018/000226; Ministerio de Ciencia e Innovación, RTI2018-098085-B-C44; Ministerio de Economía, Industria y Competitividad, Gobierno de España, MTM-2017-83506-C2-2-P; Secretaría de Estado de Investigación, Desarrollo e Innovación, MINECO-16-TEC2015-67387-C4-3-R

Abstract

The standard description of a quantum algorithm consists in three steps. First, encoding the data in a suitable initial quantum state. Second, driving such a state by a convenient sequence of unitary transformations until a final quantum state is reached. Third, measuring the final state and use such a measurement to solve the problem the quantum algorithm was designed for. An alternative description is provided by the stabilizer formalism, which was originally introduced in connection with quantum error correcting codes. In this paradigm, the focus is on the subgroup of elements of the Pauli group stabilizing the initial quantum state, and the transformations that such a subgroup experiments along the algorithm. In this work, we provide an explanation of two foundational quantum algorithms (Bernstein-Vazinari and Deustch-Josza) based on such a quantum stabilizer formalism. Doing so, we provide a better understanding and insight into both procedures which yield to see Bernstein-Vazirani as a particular case of Deustch-Josza, and to introduce a generalized version of Deustch-Josza algorithm.

1 INTRODUCTION

The standard description of a quantum algorithm (following the seminal ideas of References 1-4) consists in three steps. First, encoding the data in a suitable initial quantum state. Second, driving such a state by a convenient sequence of unitary transformations until a final quantum state is reached (that can be implemented by quantum gates, resembling the microdesign of classical algorithms from logical states5). Third, measuring the final state and use such a measurement to solve the problem the quantum algorithm was designed for. For instance, in Grover6 and Shor7 algorithms (the most well-known quantum algorithms), the initial state is a uniform superposition of computational basis states. It encodes the elements of the unsorted database to look for, in the first case, and a representation of an approximation to the inverse of the period of an element in the residual group of units mod N, where N is the integer to factor, in the second case. The sequence of unitary transformations in those algorithms is an iterative composition of the oracle function (which encodes the elements of the data base to be found) and the diffusion operator (Grover's algorithm), or a sequence of controlled powers of a unitary operator (which encodes the modular multiplication by the element of the residual of units mod N) followed by an inverse quantum Fourier transform (Shor's algorithm). The measurement of the final state of Grover's algorithm provides (with probability approaching to one as the size of the database increases) a desired element in the database, whereas the measurement of the final state of Shor's algorithm can be used to approximate the order on an invertible element mod N, which can be used to factor N (under certain circumstances).

An alternative description of quantum algorithms is provided by the stabilizer formalism.5 In this paradigm, the focus is on the subgroup of elements of the Pauli group stabilizing the initial quantum state, and the transformations that such a subgroup experiments along the algorithm. Originally introduced in connection with quantum error correcting codes,8, 9 it can be also used to provide alternative description and understanding of some quantum algorithms.

In this work, we provide an explanation of two classical quantum algorithms (Bernstein-Vazinari (BV)10 and Deutsch-Josza (DJ)4) based on such a quantum stabilizer formalism. Doing so, we provide a better understanding and insight into both procedures which yield to see BV as a particular case of DJ, and to introduce a generalized version of DJ algorithm.

The outline of this article is as follows. Preliminaries on the quantum stabilizer formalism are collected in Section 2. Section 3 is devoted to the explanation of the BV and DJ algorithms under the quantum stabilizer formalism. In Section 4, we consider a possible extension of these problems, based on the understanding provided by the stabilizer paradigm. Finally, conclusions and future directions of research can be found in Section 5.

2 THE STABILIZER FORMALISM

In this preliminary section, we introduce notation, and collect well-known facts of quantum computing.

2.1 Computational quantum states

In this article, ( 2 ) n 2 n will be a 2n−dimensional Hilbert space of n ≥ 1 qubits, with a computational basis B = { | i : i 𝔽 2 n } (here 𝔽 2 denotes the Galois field of two elements / 2 = { 0 , 1 } 11). Elements in ( 2 ) n , written |x⟩, are given by the -linear combinations of the elements in B, that is, | x = i 𝔽 2 n λ i | i . The coefficients λ i are called “amplitudes,” and the element is assumed to be normalized, that is, of complex norm equal to one: x = x | x (here ⟨x| denotes the transpose conjugate of the element x, that is, x | = i 𝔽 2 n λ i | i T ). Normalized quantum states are the states used in quantum computation.

2.2 Evolution of the quantum states

A complex 2n × 2n−invertible matrix U = ( U k l ) 1 k , l n G L ( 2 n , ) will be called “unitary” if U · U = U · U = I 2 n , where U = ( U l k ) 1 k , l n denotes its conjugate transposed matrix. These matrices represent the set of possible transformations that can be driven by a quantum computation, which has a group structure under multiplication, denoted U(2n) and called “unitary group.” Another important class of matrices is given by the Hermitian ones, that is, those H ∈ U(2n) such that H = H. The set of Hermitian matrices is a 2 n ( 2 n + 1 ) 2 dimensional complex vector space, which is related to the unitary group via the Schrödinger equation H ( t ) | x ( t ) = i d d t | x ( t ) , where H(t) denotes the Hamiltonian driving the time-dependent quantum state |x(t)⟩, i is the complex unity, and is Planck reduced constant (see 2.2.2 of Reference 5). Such a Hamiltonian is given by a Hermitian matrix, and the solution to such an equation is U(t) |x(0)⟩, where U ( t ) = e i H ( t ) is a unitary matrix.

2.3 Measurements

Measures of a quantum state |x⟩ are given by a set of “measurement operators” { M m } m μ 2 n ( ) , where μ , satisfying the “completeness equation” I 2 n = m μ M m M m . The output of such a measure on |x⟩ is probabilistically the vector Mm|x⟩, suitably normalized by the square of p(m) = ⟨x|Mm|x⟩ (ie, ⟨x|Mm · x⟩). The number p(m) represents the actual probability of such a measure. Usually, measures are carried over the computational state basis, and so the measurement operators are { | i i | } i 𝔽 2 n . In this case, the probability of obtaining |i⟩ after measurement of the quantum state i 𝔽 2 n λ i | i is | λ i | 2 = λ i · λ i .

2.4 The Pauli group

A particular important set of 2 × 2−matrices, both unitary and Hermitian, are the Pauli matrices:
X = 0 1 1 0 , Y = 0 i i 0 , Z = 1 0 0 1 ,
The subgroup G1 of U(2) generated by such matrices has 16 elements, and can be written as
G 1 = { i k X a Z b | 0 k 3 , a , b 𝔽 2 } .
Because XZ = −iY, the set {I2 , X , Z , XZ} is a basis of 2 ( ) . The nth tensor product of G1 is known as the Pauli Group Gn, that can be written as
G n = { i k X ( a ) Z ( b ) | 0 k 3 , a , b 𝔽 2 n } U ( 2 n ) ,
where X ( a ) = X 1 a 1 X n a n = l = 1 n X l a l , and Z ( b ) = Z 1 b 1 Z n b n = l = 1 n Z l b l . This subgroup has order 22n + 2, and the subfamily B = { X ( a ) Z ( b ) | a , b 𝔽 2 n } of elements with trivial global phase (ie, with k = 0), is a complex basis of the vector space 2 n ( ) . Moreover, such a basis is orthonormal with respect to the Hermitian inner product A | B = 1 2 n Tr ( A · B ) , for all A , B 2 n ( ) ( Tr : 2 n ( ) denotes the trace function, that is, the sum of elements on the main diagonal of matrix).

2.5 Centralizer of subgroups of the Pauli group

If for any U = ikX(a)Z(b) ∈ Gn, we denote w ( U ) = ( a | b ) 𝔽 2 2 n , then the group commutator [ikX(a)Z(b) , ilX(c)Z(d)] is equal to ( I 2 n ) ( a | b ) ( c | d ) , where (a|b) ⋆ (c|d) = a · d + b · c is a nondegenerate bilinear symplectic form on 𝔽 2 2 n (here · denotes the standard inner product in 𝔽 2 n ). This means that:
  • ⋆ is linear in both arguments: ( λ 1 a 1 + λ 2 a 2 | λ 1 b 1 + λ 2 b 2 ) ( c | d ) = λ 1 ( ( a 1 | b 1 ) ( c | d ) ) + λ 2 ( ( a 2 | b 2 ) ( c | d ) ) , and ( a | b ) ( λ 1 c 1 + λ 2 c 2 | λ 1 d 1 + λ 2 d 2 ) = λ 1 ( ( a | b ) ( c 1 | d 1 ) ) + λ 2 ( ( a | b ) ( c 2 | d 2 ) ) , for all λ 1 , λ 2 𝔽 2 , a 1 , a 2 , a , b 1 , b 2 , b , c 1 , c 2 , c , d 1 , d 2 , d 𝔽 2 n );
  • (a|b) ⋆ (a|b) = 0, for all a , b 𝔽 2 n ;
  • For all nonzero ( a | b ) 𝔽 2 2 n , there exists ( c | d ) 𝔽 2 2 n such that (a|b) ⋆ (c|d) ≠ 0.

From here, it follows that if S is a nonempty subset of Gn, then its centralizer C G n ( S ) is equal to {U ∈ Gn | w(U) ⊥ w(T), for all T ∈ S}. It will be denoted by S. In particular, the center of Gn is Z ( G n ) = { i k I 2 n | 0 k 3 } , a cyclic group of order 4, and w : G n / Z ( G n ) 𝔽 2 2 n is a well-defined group isomorphism (from a multiplicative group to an additive group). The “quantum weight” of an element U ∈ Gn, is defined as the number of 1 ≤ i ≤ n such that ai ≠ 0 or bi ≠ 0, where w(U) = (a|b).

2.6 The main theorem of the stabilizer formalism

The following result is the fundamental basis of the stabilizer formalism.

Theorem 1.Let S be a subgroup of Gn. Then, the set VS = {|x⟩ | U|x⟩ = |x⟩ , ∀U ∈ S} is nonzero if and only if I 2 n S . In such a case:

  • 1.

    The map w | S : S 𝔽 2 2 n is a group monomorphism.

  • 2.

    S is an elementary abelian 2−subgroup of dimension 1 ≤ n − k ≤ n (ie, S isomorphic to the additive group 𝔽 2 n k ) and, correspondingly, w(S) is a totally isotropic subspace of ( 𝔽 2 2 n , ) (ie, (a|b) ⋆ (c|d) = 0, for all (a|b),(c|d) ∈ w(S)).

  • 3.

    n can be decomposed in 2n − k eigenspaces of dimension 2k, which can be indexed by the multiplicative characters of S according to the map

    { multiplicative characters of S } 𝒮 = { eigenspaces of 2 n } χ J χ = { | x | U | x = χ ( U ) | x , U S } ,
    so that VS is indexed by the trivial character.

  • 4.

    If T ∈ U(2n), then (TST)(T|x⟩) = T|x, for all | x ( 2 ) n . In particular, if Cn denotes the normalizer of Gn in U(2n) (ie, the “Clifford group”), then T | x V T S T , for all |x⟩ ∈ VS and T ∈ Cn.

  • 5.

    More generally, Gn acts on the set 𝒮 (via T · J χ = { T | x | | x J χ } ), so that the stabilizer subgroup of VS (ie, the elements T of Gn such that T · VS = VS) is S, and S is the subgroup of Gn stabilizing VS elementwise.

Proof.It can be found in 10.5 of Reference 5 and Reference 12, but we stated it here for completeness. The condition I 2 n S is clearly necessary (as such an operator does not fix any quantum state). Let us now assume that I 2 n S . We shall verify items 1 to 5 while proving that VS ≠ 0.

  • Items 1 and 2: Since I 2 n S , then any nonidentity element in Gn has order 2. This is because ( ( i k ) X ( a ) Z ( b ) ) 4 = I n 2 , and so the possible orders for nonidentity elements are 2 or 4. But, ( ( i k ) X ( a ) Z ( b ) ) 2 = i 2 k I n 2 , which is I n 2 , unless k = 0,2, that is, unless the element has order 2. Now, S must be abelian, because all the elements in S are self-invertible (they are either the identity, or they have order 2), and so for all U,T ∈ S, we have

    S T = S T · S T · T S = ( S T ) 2 · ( T S ) = I n 2 · ( T S ) = T S .
    Incidentally, this proves the first part of item 2, for some dimension 0 ≤ n − k ≤ n. Moreover, because of the hypothesis, the restriction w|S is clearly a group monomorphism, since in S there can only exist at most one represent of each class of Gn/Z(Gn) (namely, Z(a)Z(b)), and the map is straightforwardly an homomorphism. This proves item 1, and also gives us the second part of item 2, because of the relation between the commutator of two operators, and the corresponding bilinear form ⋆.

  • Items 3, 4, and 5: Now, assuming that S1, … , Sn − k is a 𝔽 2 basis of S, we shall see item 3, by induction on n − k. As a consequence, we deduce VS ≠ 0.

    – The case n − k = 1 is straightforward, since S1 has order 2, which forces its eigenvalues to be ±1, and its trace to be zero. This makes 2n − 1 eigenvalues equal to 1, and 2n − 1 eigenvalues equal to −1, which is the base case of induction (there are two 2n − 1−dimensional eigensubspaces, indexed by the trivial character and its opposite).

    – Now, assume that the case n − k − 1 is true, and let us prove the case n − k. By induction, ⟨S1, … , Sn − k − 1⟩ decomposes (C2)n in 2n − k − 1 eigenspaces of dimension 2k + 1, indexed by the multiplicative characters of ⟨S1, … , Sn − k − 1⟩, with V S 1 , , S n k 1 indexed by the trivial character. Let J η be one of such eigenspaces indexed by the character η of ⟨S1, … , Sn − k − 1⟩. Let us prove that Sn − k leaves invariant J η .

    Namely, for all | x J η , and for all U ∈ ⟨S1, … , Sn − k − 1⟩, since Sn − k commutes with S1, … , Sn − k − 1, it commutes with ⟨S1, … , Sn − k − 1⟩, and so

    U S n k | x = S n k U | x = S n k η ( U ) | x = η ( U ) S n k | x .
    Observe that η ( U ) , because S in an abelian group. This means that S n k | J η : J η J η is an isomorphism of vector spaces.

    Now, since w | S : S 𝔽 2 2 n is a monomorphism, and ⋆ is nondegenerate, there exists T ∈ Gn such that w ( T ) w ( S i ) = δ i , n k , that is, such that T anticommutes with Sn − k, and commutes with the other Si. Therefore, for all | x J η , we have

    S i T | x = ( T S i T ) T | x = T S i | x = T η ( S i ) | x = η ( S i ) T | x ,
    for all 1 ≤ i ≤ n − k − 1, that is, T | x J η , observe that the same technique can be used to prove items 4 and 5.

    Now, if | x J η is an eigenvector of Sn − k with eigenvalue λ , then

    S n k T | x = ( T S n k T ) T | x = T S n k | x = T λ | x = λ T | x ,
    that is, T | x J η is an eigenvector of Sn − k with eigenvalue λ . So, the eigenvalues of S n k | J η come in pairs {1, − 1} (one corresponding to an eigenvector |x⟩, the other one corresponding to the eigenvector T|x⟩), and so each J η is decomposed as two eigenspaces of dimension 2k: J η + , and J η .

    The set of 2n − k eigenspaces of dimension 2k, is indexed by the multiplicative characters of ⟨S1, … , Sn − k⟩, namely J χ = J χ S 1 , , S n k 1 χ ( S n k ) (ie, the multiplicative character χ is equal to η , when restricted to ⟨S1, … , Sn − k − 1⟩, and it is χ ( S n k ) = ± 1 ). The trivial character clearly indexes V S 1 , , S n k , which is so nonzero.

This theorem states that, up to a global phase, there is a correspondence between certain quantum states of ( 2 ) n and elementary abelian 2-subgroups of Gn of dimension n. Moreover, any quantum computation carried out by operators of the Clifford group on one of those states is directly translated into a conjugation operation in the Pauli group. So, certain quantum algorithms that involve circuits containing quantum gates from the Clifford group can be classically simulated (efficiently) by tracking conjugates of n elements of the Clifford group. This fact, along with the corresponding efficiency in the measures described in 10.5.3 of Reference 5, is known as the “Gottesman-Knil theorem.”13

Example

Let us illustrate the stabilizer paradigm with the circuit of Figure 1.

Details are in the caption following the image
Example quantum circuit

The initial state is |φ0⟩ = |0⟩ ⊗ |0⟩, with stabilizer subgroup S0 generated by Z1 = I ⊗ Z, and Z2 = Z ⊗ I. Application of the Hadamard gate in the first qubit transforms |φ0⟩ into | φ 1 = | 0 + | 1 2 | 0 . The corresponding subgroup is obtained by conjugation of ⟨Z1,Z2⟩ by the element H ⊗ I, that is, it is S1 = ⟨X1 = X ⊗ I,Z2⟩. The control NOT gate yields the (Bell) state | φ 2 = | 0 | 0 + | 1 | 1 2 , and the corresponding stabilizer subgroup S2 = ⟨X1 ⊗ X2,Z1 ⊗ Z2⟩. Right before the measurement, we have the quantum state | φ 3 = | 0 | 0 | 1 | 1 2 (another Bell state), whose stabilizer group is S3 = ⟨− X1 ⊗ X2,Z1 ⊗ Z2⟩. Table 1 contains a summary of the quantum states and the stabilizer subgroups corresponding to the circuit of Figure 1.

TABLE 1. Quantum states and stablizer subgroups in the example
Stage Quantum state Stabilizer subgroup
0 |0⟩ ⊗ |0⟩ Z1,Z2
1 | 0 + | 1 2 | 0 X1,Z2
2 | 0 | 0 + | 1 | 1 2 X1 ⊗ X2,Z1 ⊗ Z2
3 | 0 | 0 | 1 | 1 2 ⟨− X1 ⊗ X2,Z1 ⊗ Z2

This formalism explains straighforwardly the familiy of quantum error correcting codes known as “stabilizer codes” (see 10.5.5 of Reference 5). In this context, certain 2k-dimensional quantum error correcting codes VS are described by the corresponding elementary abelian 2-subgroups S of Gn of dimension n − k, known as “error group.” The errors with no effect on the quantum state are those effected by elements of S, where as the undetectable errors are those in S ∖ S, since they transform the quantum state in another one belonging to the code. The correctable errors are subsets E of Gn such that whenever T,U ∈ E, then T−1U ∉ S ∖ S. This set is usually taken as those elements of the Pauli group of quantum weight not greater than d 1 2 , where d is minimum quantum weight of the elements in S ∖ S.12

3 BV AND DJ ALGORITHMS

In this section, we explain BV and DJ algorithms with the stabilizer formalism introduced above. Both algorithms have quantum access to a binary function f : 𝔽 2 n 𝔽 2 by an oracle O : ( 2 ) ( n + 1 ) ( 2 ) ( n + 1 ) , in the standard way O(|x⟩ |y⟩) = |x⟩ |x ⊕ f(y)⟩, where | x ( 2 ) n , and | y 2 . As usual, this oracle is managed in its phase oracle version, that is, since O(|x⟩ |−⟩) = (− 1)f (x)|x⟩ |−⟩, for the single qubit element | = | 0 | 1 2 , the auxiliary last qubit is dropped and the corresponding oracle is Of|x⟩ = (− 1)f (x)|x⟩, for all | x ( 2 ) n .

3.1 BV

The goal of the BV algorithm is to determine a linear function f : 𝔽 2 n 𝔽 2 from its evaluations. That is, a certain function f is given under the promise that f(x) = x · s, for some binary unknown array s 𝔽 2 n (here again · denotes the standard inner product in 𝔽 2 n ). Clasically, this problem requires O(n) evaluations of f (that yield the solution of the corresponding linear system of equations). However, BZ only uses a single (quantum query) evaluation of f. The algorithm, whose quantum circuit can be found in Figure 2, is as follows.

BV algorithm

INPUT: A linear function f : 𝔽 2 n 𝔽 2 , with f(x) = x · s, for all x 𝔽 2 n
OUTPUT: A vector s
Set the initial quantum state |0n
Apply the Walsh-Hadamard transform [ 5, 1.4.2] Hn, where H = 1 2 1 1 1 1 is the Hadamard gate
Apply the phase oracle Of
Apply the Walsh-Hadamard transform Hn
If the measurement of the final state in the computational basis is |s⟩, RETURN “s

Details are in the caption following the image
Quantum circuit of the BV algorithm

It can be proved that, with probability one, the final measurent gives the quantum state |s⟩, for the desired unknown value s. Let us prove this fact under the stabilizer formalism, in a straightforward way.

Since |0⟩ is an eigenvector of the Pauli matrix Z (with eigenvalue 1), it is clear that the initial sate |0n⟩ is stabilized by any matrix of the form Z(ei), where e i = ( 0 0 1 ( i 0 0 ) is an element in the standard basis of 𝔽 2 n . The subgroup S of Gn generated by those n matrices is abelian, since the elements { e i } i = 1 n are pairwise orthogonal, with respect to the bilinear form ⋆ (ie, 𝔽 2 n × { 0 } is a totally isotropic subspace of ( 𝔽 2 2 n , ) ).

Since HZH = X, we have that application of the Walsh-Hadamard transform Hn on the initial state is equivalent to applying the conjugation by Hn on each of the matrices Z(ei), and so the stabilizer subgroup is generated by the n matrices { X ( e i ) } i = 1 n .

Now, it follows the application of the phase oracle Of. Observe that, for all 1 ≤ i ≤ n, and s i 𝔽 2 , the operator Z i s i transforms the quantum state |x⟩ of the computational basis, into ( 1 ) s i · x i | x (when xi = 0, the state remains the same, and it takes an opposite global phase when xi = 1). Therefore, because of linearity O f | x = ( 1 ) f ( x ) | x = ( 1 ) x · s | x = ( 1 ) x 1 · s 1 · · ( 1 ) x n · s n | x = Z ( s ) | x , for all | x n . Hence, the action of the phase oracle on the quantum state is translated into conjugation by the element Z(s), that is, since ZXZ = −X, those 1 ≤ i ≤ n with si = 0 have an unmodified X(ei) as generator of the stabilizer subgroup, whereas those with si = 1 provide by conjugation the generator −X(ei). Summarizing, the stabilizer subgroup is generated by { ( 1 ) s i X ( e i ) } i = 1 n . Incidentally, notice that the oracle Of, is an element of the Pauli group (and so in particular of the Clifford group), so the algorithm can be efficiently realised via the Gottesman-Knill theorem.

A second application of the operator Hn, because of the relation HXH = Z, yields that the stabilizer subgroup finally achieved is generated by the n matrices { ( 1 ) s i Z ( e i ) } i = 1 n .

Since the Z matrix stabilizes the qubit |0⟩, and −Z stabilizes the qubit |1⟩, we have that, for all 1 ≤ i ≤ n, and a 𝔽 2 , the matrix (− 1)aZ stabilizes the quantum state |a⟩. Therefore, the state stabilized by the last subgroup is exactly |s⟩, and so the final measure of the algorithm gives |s⟩ with probability one. A summary of the quantum states and the stabilizer subgroups corresponding to BV algorithm can be found in Table 2.

TABLE 2. Quantum states and stablizer subgroups in the BV algorithm
Stage Quantum state Stabilizer subgroup
0 |0n Z1, … , Zn
1 1 2 n x 𝔽 2 n | x X1, … , Xn
2 1 2 n x 𝔽 2 n ( 1 ) s · x | x ( 1 ) s 1 X 1 , , ( 1 ) s n X n
3 |s ( 1 ) s 1 Z 1 , , ( 1 ) s n Z n

3.2 DJ

The goal of the DJ algorithm is to determine if a function f : 𝔽 2 n 𝔽 2 is constant or balanced. That is, a certain function f is given under the promise that it is constant (ie, f = 0 or f = 1) or balanced (ie, M = # { x 𝔽 2 n | f ( x ) = 1 } = 2 n 1 . Clasically, this problem requires O(2n − 1) evaluations of f (half plus one evaluations are needed in the worst case to distinguish a constant or balanced function). However, DJ only uses a single (quantum query) evaluation of f. The algorithm, whose quantum circuit can be found in Figure 3, is as follows. Observe that, except for the decision taken after the final measurement, the steps of the BV and DJ algorithms are the same. This explains why Figures 2 and 3 are the same.

Deutsch-Josza algorithm

INPUT: A boolean function f : 𝔽 2 n 𝔽 2 , promised to be either constant or balanced
OUTPUT: “f CONSTANT” or “f BALANCED”
Set the initial quantum state |0n
Apply the Walsh-Hadamard transform Hn, where H = 1 2 1 1 1 1 is the Hadamard gate
Apply the phase oracle Of
Apply the Walsh-Hadamard transform Hn
If the measurement of the final state in the computational basis is |0n⟩, RETURN “f CONSTANT”.
Else, RETURN “f BALANCED”

Details are in the caption following the image
Quantum circuit of the DJ algorithm

It can be proved that, with probability one, the final measurement gives the quantum state |0n⟩ if and only if f is constant. When f is balanced, it gives other element of the computational basis. The first two steps in DJ are those of BV, and so the stabilizer subgroup is generated by the n matrices { X ( e i ) } i = 1 n after them.

Observe that the quantum circuit of DJ is just like that of BV.

Now, it follows the application of the phase oracle Of. An alternative formulation of this operator is the following one: O f = I 2 n 2 x M | x x | , because Of|x⟩ = |x⟩ if and only if x ∉ M (ie, iff f(x) = 0), and Of|x⟩ = − |x⟩, when x ∈ M. Because B = { X ( a ) Z ( b ) | a , b 𝔽 2 n } is is an orthonormal basis of 2 n ( ) with respect to A | B = 1 2 n Tr ( A · B ) , it is straightforward to write Of as a linear combination of the elements in B (the coefficients are given by ⟨Of|X(a)Z(b)⟩, for all a , b 𝔽 2 n ). When f is constant, then O f = ± I n 2 , and so Of = ±X(0n)Z(0n), where 0n is the zero vector of 𝔽 2 n . When f is balanced, notice first that, for all a 𝔽 2 , X | a = | a (here a is the complement of a mod 2), that I 2 n | a = ± Z | a = | a . Also, observe that Tr(X) = Tr(XZ) = 0, so consequently Tr(X(a)Z(b)) = 0 if a ≠ 0n. Hence, for all a , b 𝔽 2 n ,
2 n · O f | X ( a ) Z ( b ) = Tr ( O f · X ( a ) Z ( b ) ) = Tr I n 2 2 x M | x x | · X ( a ) Z ( b ) = Tr X ( a ) Z ( b ) 2 x M | x x | X ( a ) Z ( b ) = Tr ( X ( a ) Z ( b ) ) 2 x M Tr ( | x x | X ( a ) Z ( b ) ) = Tr ( X ( a ) Z ( b ) ) 2 x M x | X ( a ) Z ( b ) | x ,
and we have two particular cases:
  • a = b = 0n, where 2 n · O f | X ( 0 n ) Z ( 0 n ) = Tr ( I n 2 ) 2 x M x | x = 2 n 2 · x M 1 = 0 ;
  • a ≠ 0n, where 2 n · O f | X ( a ) Z ( b ) = Tr ( X ( a ) Z ( b ) ) 2 x M x | X ( a ) Z ( b ) | x = 0 2 · x M 0 = 0 .

Hence, Of can be expressed as a nontrivial complex linear combination of the elements in the set { Z ( b ) | b 𝔽 2 n { 0 n } } . Remember, from the analysis of BV, that the elements in this set correspond to phase oracles of nonzero linear functions. However, unlike BV, this oracle might not correspond to an element of the Clifford group (and as a consequence the algorithm might not be efficiently realisable via the Gottesman-Knill theorem). A measurement of the realizability of the algorithm is the “stabilizer rank,”14 which in this case is upper bounded by the number of nonzero coefficients of Of as a linear combination of the elements in the set { Z ( b ) | b 𝔽 2 n { 0 n } } .

Coming back to the stabilizer formalism analysis of DJ, we have that O f = ± I n 2 , when f is constant, and that O f = b 𝔽 2 n λ b Z ( b ) , for certain complex numbers λ b = O f | Z ( b ) (with λ 0 n = 0 ), when f is balanced. Hence, the action of the phase oracle on the third step of DJ, is translated into conjugation by either ± I n 2 , or by a nontrivial linear combination of operators Z(b), with b ≠ 0. In the first case, the stabilizer group after this step is again the one generated by { X ( e i ) } i = 1 n . In the second case, since Z ( b ) X ( e i ) Z ( b ) = ( 1 ) b i X ( e i ) Z ( b b ) , the stabilizer subgroup is O f X ( e 1 ) , , X ( e n ) O f = X ( e i ) b , b 𝔽 2 n λ b λ b ( 1 ) b i Z ( b b ) i = 1 n (where ⊕ denotes addition in 𝔽 2 n ).

The second application of the operator Hn, yields in the first case a stabilizer subgroup generated by the n matrices { Z ( e i ) } i = 1 n , and the corresponding stabilized state is |0n⟩, which is to be measured with probability one. In the second case, the n elements generating the stabilizer subgroup are H n O f X ( e 1 ) , , X ( e n ) O f H n = Z ( e i ) b , b 𝔽 2 n λ b λ b ( 1 ) b i X ( b b ) i = 1 n . This subgroup stabilizes the quantum state b 𝔽 2 n λ b | b , because
H n b 𝔽 2 n λ b | b = b 𝔽 2 n λ b H n | b = b 𝔽 2 n λ b x 𝔽 2 n ( 1 ) x · b 2 n | x = b 𝔽 2 n λ b x 𝔽 2 n Z ( b ) 2 n | x = b 𝔽 2 n λ b Z ( b ) x 𝔽 2 n | x 2 n = O f H n | 0 n ,
and so H n O f H n | 0 n = b 𝔽 2 n λ b | b . The result is derived from Theorem 1 (item 4).

Finally, since λ 0 = 0 , the measurement yields with probability one |0n⟩ if and only if f is constant. A summary of the quantum states and the stabilizer subgroups corresponding to DJ algorithm, can be found in Table 3.

TABLE 3. Quantum states and stablizer subgroups in the DJ algorithm
Quantum state Stabilizer subgroup
Stage f constant f balanced f constant f balanced
0 |0n Z1, … , Zn
1 1 2 n x 𝔽 2 n | x X1, … , Xn
2 ± 1 2 n x 𝔽 2 n | x ± 1 2 n x 𝔽 2 n ( 1 ) f ( x ) | x X1, … , Xn O f X 1 , , X n O f
3 ± |0n b 𝔽 2 n λ b | b Z1, … , Zn H n O f X 1 , , X n O f H n

4 BEYOND THE KNOWN ALGORITHMS: GENERALIZED DJ

In this section, we consider a possible extension of the BV and DJ algorithms, based on the understanding provided by the stabilizer paradigm of the previous section. First, we remark is that the BV algorithm can be seen (except by its output), as a particular case of the DJ algorithm. Namely, in both algorithms, all the steps except for the last one are exactly the same. Moreover, being linear any promised function for the BV algorithm, such a function must be either f = 0 or balanced (the set 𝔽 2 n { x 𝔽 2 n | f ( x ) = 1 } is the kernel of the 𝔽 2 -linear function f, and so its cardinality is 2 n 2 , because its image is 𝔽 2 ). Therefore, when measured with probability one, the output state |0n⟩ occurs if and only if f is constant (ie, f = 0). In any other case, the function is balanced. Moreover, in the case n = 1, the two balanced functions are the only nonzero linear ones (with oracle Of = Z(1)), and its complementary function (with oracle Of = −Z(1)). So, BV is exactly the same as DJ (which in this case is called “Deutsch Algorithm”15). Second, we want to remark on the nature of the DJ oracle, that is expressed as b 𝔽 2 n λ b Z ( b ) . This expression is not exclusive of the oracle of balanced or constant functions, but of any arbitrary boolean function, too. If we consider the analysis of the DJ algorithm, the condition “f balanced” is only used to deduce that λ 0 n = 0 , so such an expression is valid for any function f : 𝔽 2 n 𝔽 2 . So, if we apply any of the two algorithms to an arbitrary boolean function f, the final measurement would be |b⟩, one of the states of the computational basis that appears in the description of the corresponding oracle Of. The probability of such a measurement is exactly 1 2 n Tr ( O f · Z ( b ) ) 2 .

Finally, from the point of view of the connections with quantum error correcting codes and the stabilizer formalism, we can “see” BV and DJ as the decoding procedure of errors introduced by the “perturbations” Z(b) involved in the linear combination of the oracle Of. The measurement |s⟩ is, therefore, one of the possible syndromes induced by such perturbations. This lead us to introduced a generalization of the DJ problem, for each possible syndrome s 𝔽 2 n .

Generalized DJ problem:

Given a vector s 𝔽 2 n , and a Boolean function f : 𝔽 2 n 𝔽 2 , with the promise that the function f ⊕ s
is either constant or balanced, determine which is the case.

A solution of this problem is given by the:

Generalized DJ algorithm:

INPUT: A vector s 𝔽 2 n , and a boolean function f : 𝔽 2 n 𝔽 2 , with the promise that the function g = f ⊕ s is either constant or balanced
OUTPUT: “g CONSTANT” or “g BALANCED”
Set the initial quantum state |0n
Apply the Walsh-Hadamard transform Hn, where H = 1 2 1 1 1 1 is the Hadamard gate
Apply the phase oracle Of
Apply the Walsh-Hadamard transform Hn
If the measurement of the final state in the computational basis is |s⟩, RETURN “g CONSTANT”.
Else, RETURN “g BALANCED”

This algorithm gives the right answer to the Generalized DJ problem, with probability one. The reason is that, since for all x 𝔽 2 n , we have Og|x⟩ = (− 1)g(x)|x⟩ = (− 1)s · x(− 1)f (x)|x⟩ = (− 1)s · xOf|x⟩ = Of(− 1)s · x|x⟩ = OfZ(s) |x⟩. Therefore, the algorithm returns “g BALANCED” if and only if the final measurement is not |s⟩, if and only if 1 2 n Tr ( O f · Z ( s ) ) is zero, if and only if Tr ( O g ) = 0 , if and only if g is really balanced (because g = 0 b 𝔽 2 n μ b Z ( b ) , with μ b = Tr ( O g · Z ( b ) ) , since μ 0 n = 0 ).

5 CONCLUSIONS AND FUTURE WORK

In this article, we have presented an explanation of the correctness of the BV and DJ algorithms based on the stabilizer formalism. This paradigm was initially introduced in connection to quantum error correcting codes, but it is useful to provide a better understanding of other techniques in quantum computation, like the ones considered here. Inspired by this link, we have introduced a generalised version of the DJ problem, and the corresponding algorithm that solves it. In the process, we have seen that the phase oracle of any boolean function can be expressed as a linear combination of tensor products of Z gates. And that the probability of measurement of a certain element in the computational basis, by the algorithms under study, is directly related to the coefficients of such a linear combination. Further inspired by this facts, we intend to explore a family of problems, that we call “quantum exact promise problems,” in which a certain subset of boolean functions is partitioned into a collection of subsets which have to be distinguished from each other.

ACKNOWLEDGEMENTS

This work was supported in part by the Ministry of Economy and Competitiveness (“Ministerio de Economía y Competitividad”) from Spain/FEDER under grant MINECO-16-TEC2015-67387-C4-3-R, by the Ministry of Economy, Industry and Competitiveness (“Ministerio de Economía, Industria y Competitividad”) from Spain/FEDER under grant MTM-2017-83506-C2-2-P, by Ministry of Science and Innovation (“Ministerio de Ciencia e Innovación”) from Spain/FEDER under grant RTI2018-098085-B-C44, and by he Regional Ministry of the Principality of Asturias (“Consejería de Empleo, Industria y Turismo del Principado de Asturias”) under grants FC-GRUPIN-IDI/2018/000193 and FC-GRUPIN-IDI/2018/000226.

    CONFLICT OF INTEREST

    The authors declare no potential conflict of interests.

    Biographies

    • Elías F. Combarro is an Associated Professor at Universidad de Oviedo (Spain). He holds degrees in both Mathematics (1997) and Computer Science (2002) and a PhD in Mathematics (2001). He is the author of more than thirty research papers in topics such as Computability Theory, Theory of Fuzzy Measures, Computational Classification of Semifields and Quantum Computing. Currently, his main research interest is Quantum Computing.

    • Alejandro Piñera-Nicolás received the Ph.D. in Algebra in 2007 from Universidad de Oviedo (Spain). His studies include Applied Mathematics and Differential Equations, while his research interests also include Representation Theory, Coding Theory and Non-Associative Algebra. He teaches Mathematics in the Universidad de Oviedo (Spain).

    • José Ranilla is a Professor at Universidad de Oviedo (Spain). He holds degrees in Computer Science (1987 and 1993) and a PhD in Computer Science (1998). He is the author of more than eighty research papers in topics such as High-Performance and Parallel Computing, Design of Energy-Efficient Computing solutions and Text Categorization. His current research interests also include Quantum Computing.

    • Ignacio Fernández Rúa is an Associated Professor at Universidad de Oviedo (Spain). Graduated in Mathematics in 1999, he received his Ph.D. in 2004. Research fellow of the Spanish “Juan de la Cierva” program at Universidad de Cantabria (Spain), from 2004 to 2007. Coauthor of some thirty research papers on non-associative finite rings, and their applications to coding theory and cryptography. His current research interests include also computer algebra and quantum computing.

      The full text of this article hosted at iucr.org is unavailable due to technical difficulties.