This problem imagined by Simon [Sim1994] demonstrates a quantum algorithm solving a black-box problem exponentially faster than any probabilistic classical algorithm. Contrary to Deutsch–Jozsa algorithm [DeuJoz1992], it is even exponentially faster than probabilistic classical algorithms.
(Simon's problem)
Let be natural numbers and a function. Assume that there is a string such that two distinct have the same image iff . Simon's problem is to determine .
The quantum solution to the problem is to repeat enough time the procedure given by the following circuit:
After applying , we are in the state:
Measuring the second register gives a value and makes the first register collapse to the superposition of its two preimages :
After the second Hadamard gate, the state in the first register is
Performing a standard measurement on the first register yields a random -bits vector such that i.e. in the subspace orthogonal to . Repeating the procedure times gives a set of generators for this subspace with probability exponentially close to 1. Said otherwise, we have a system of equations of rank the dimension of the subspace and unknowns . If , then the rank of the system is , so we get the unique solution . Otherwise and the rank of the system is , so solving the system gives a subspace of dimension , which is simply . In either case, we have obtained as expected. The procedure is repeated times, so a polynomial number of queries to the oracle are used.
What about (probabilistic) classical algorithm? Consider the special case Let's choose randomly to be a permutation () or a two-to-one function (). In the former case, we randomly choose a permutation and in the latter case a nonzero string . Simon proved that a classical algorithm calling no more than times can not determine whether is zero or not with success probability greater than . Hence for a fixed minimal probability of success , no classical algorithm using a polynomial number of queries can solve Simon's problem.
Shor's algorithm [Sho1995] allows to factor an integer in time. No classical algorithm are currently known to run this task in polynomial time. Actually, some cryptographic protocols are based on the assumption that no efficient algorithm exists for integer factoring and hence Shor's algorithm shows that they can be broken by quantum computation.
Shor's algorithm contains classical parts that can be executed in polynomial time and quantum computation is actually only used in a sub-procedure. More precisely, one step is to choose a random integer (which can be assumed to be coprime with ). The function defined on by is -periodic and the problem reduces to find the period . We can restrict our study to the domain for some multiple of the period. Of course, we do not know how to choose precisely but it is possible to find some value for which the approximation does not change the final result. For simplicity, let's assume is an exact multiple of the period. The period-finding submodule can be executed in using the circuit of figure 3.2, which is very similar to the one of Simon's problem. We define the Fourier transform to be the symmetric matrix
It can easily be shown to be unitary and hence a valid quantum operation. We assume that there exists an efficient implementation of elementary gates computing . This implementation uses qubits, so we are working in an Hilbert Space of dimension . Hence some basis states may not be used, they are just unchanged by the gate implementing .
The first call to on returns the first column of i.e. a uniform superposition of basis vectors as in Simon's algorithm. Hence the state after is also
Measuring the second register gives a value and makes the first register collapse to the superposition of the preimages of . If is such an image all the others are obtained by for going from to :
After the second Fourier Transform gate, the state in the first register is
Each sum over is a geometric series of initial term and ratio . So the sum is nonzero (and equal to ) iff iff iff is multiple of . Hence the state can be rewritten:
All the vectors in the sum have same amplitude, so measuring the first register yields a uniformly random multiple of between and . Using trials gives multiples of . One can show that with success probability (see Appendix E of [Lom2004] applied to ) and thus we get .
(discrete logarithm)
Let be a prime number and a generator of . Any can be written uniquely as for some . is called the discrete logarithm of (with respect to ).
Similarly to Shor's algorithm, some cryptographic protocols are based on the difficulty of computing discrete logarithms. In [Sho1995], Shor describes a quantum algorithm to compute these logarithms in polynomial time. So suppose are given and that we want to find .
We first define the function going from to . Each call to is clearly done in time . Note that we can rewrite using the discrete logarithm : . Hence implies . Conversely, if this equality is true, we have and we can take to be the unique element congruent with modulo to recover the previous equality. As a consequence, we can say that is the period of and all the values are obtained when varies from to .
We now define a circuit which is really similar to those we saw earlier. Here, the first register is the tensor product of two -qubits state and the second a -qubits state. On the first register we apply i.e. a Fourier transform on each state of the tensor product:
On the first register applying the first gives, as in Shor's algorithm, a superposition over the whole group
Then, applying the operator gives the superposition
Measuring the second register yields a and makes the first register collapse to the superposition of the preimages. By the discussion above it is:
Now, we apply on the first register, giving the state
which we can further simplify to
The sum over lambda is a geometric series, and its value is nonzero (and of value ) iff . Replacing by in the expression gives the final state:
A measurement in the standard basis gives and modulo . If and are coprime, using the euclidean algorithm we can find such that modulo from the first state. Then, we get modulo from the second state. So we have obtained as expected. Note that u and are coprime with probability so we only need to repeat the procedure about times to ensure a success with high probability.
In this section, we interpret the algorithms seen in previous sections in a common framework. The hope is to find new algorithms exponentially faster than their classical counterparts.
(hidden subgroup problem)
Let be a group and one of its subgroup. Let be any set and a function that distinguishes cosets of i.e. . The hidden subgroup problem (HSP) is to determine the subgroup using calls to .
(interpretation of previous algorithms)
| Problem | Comment | ||||
|---|---|---|---|---|---|
| Simon | Such that two distinct elements have the same image iff . | is any -bits strings. | |||
| Shor's algorithm (order finding subroutine) | is the number to factor, a random integer coprime with , is the order of modulo . Ideally, should be a multiple of but we can choose some giving a good approximation. |
||||
| Discrete logarithm | is prime, a generator of , an element of , the discrete logarithm of . |
In the remaining of this document, we are only considering the case of a finite group . In particular, the set may also be taken to be finite and we may even assume . Consequently, we can formulate the problem in terms of circuits: we encode the elements of the two sets with at most bits and hence can be viewed as a function and represented by a quantum logic gate . A naive algorithm for the hidden subgroup problem is the following:
The runtime complexity of this algorithm is so at least . This is really bad compared with the efficient quantum algorithms previously seen. For instance Shor's algorithm run in i.e. exponentially faster. Hence we are lead to the following definition:
(efficient)
An algorithm for the hidden subgroup problem is said to be efficient iff it returns a generating set of elements of using a complexity polynomial in .
In particular, we have the following requirements for an efficient solution:
Note that not all functions have a polynomial complexity, as indicated in exercise 3.16 of [NieChu2007]. The idea is that there are such functions so one can note encode all of them using only a polynomial number of elementary gates. As a consequence, has to be chosen carefully to satisfy the first property.
The argument given in appendix A.2.1.1 of [NieChu2007] shows that there is a set of size at most that generates . Actually, for any group , if we pick uniformly at random elements of (for some integer ) then the set obtained generates with probability (see Appendix D of [Lom2004]).
Ettinger, Høyer and Knill [EttHøyKni1999] proved that the second requirement can always be satisfied i.e. only a polynomial number of calls to is needed to identify . The idea is to prepare the state
and measure the second register to get a tensor product of coset states (see definition 4.8). Then they apply measurements for each , that check whether . They prove that the answers given by the algorithm are correct with high probability for some . However, the whole algorithm is not since we test elements.
In Simon's problem an efficient algorithm means a (i.e. the number of bits in the strings , ...) complexity and . Here, we measure the complexity using the numbers of queries to the oracle rather than elementary operations (because may not be computed efficiently per comment above).
In Shor's algorithm and the discrete logarithm problem, it means polynomial in the number of bits needed to encode the numbers we work on, i.e. and respectively. uses basic operations on such numbers so has a polynomial complexity. The sizes of the groups we work with are and respectively, so their 's are equivalent to the values we previously used to measure efficiency.
In all cases, there is only one generator to the group , namely and .
In the particular examples of previous sections, there are natural encoding of the elements and algorithm to compute the product of two elements. For instance, for the cyclic HSP the elements are encoded as binary number of length and there are well-known algorithms of complexity polynomial in for the group operations. To study the general HSP, it is often useful to see the group as a black-box where the operations are performed by a group oracle. As in the case of the HSP oracle computing , replacing the group oracles by polynomial-time operations yields an efficient algorithm.
(black-box group, unique encoding, encoding length, input size)
Let and . is called the encoding length and the input size. A black-box group with unique encoding has the following properties:
For a black-box group without unique encoding we replace the point 4 by an oracle performing identity testing (hence equality).