# Pourquoi la transformée de Fourier discrète peut-elle être mise en œuvre efficacement en tant que circuit quantique?

17

C'est un résultat bien connu que la Transformée de Fourier Discrète (DFT) de $N={2}^{n}$$N=2^n$ nombres a la complexité $\mathcal{O}\left(n{2}^{n}\right)$$\mathcal O(n2^n)$ avec le meilleur algorithme connu , tout en effectuant la transformée de Fourier des amplitudes d'un état quantique, avec le classique L'algorithme QFT ne nécessite que des portes élémentaires $\mathcal{O}\left({n}^{2}\right)$$\mathcal O(n^2)$ .

Y a-t-il une raison connue pour laquelle c'est le cas? J'entends par là s'il existe des caractéristiques connues de la DFT qui permettent d'en implémenter une "version quantique" efficace.

En effet, une DFT sur des vecteurs à $N$$N$ dimensions peut être considérée comme l'opération linéaire

$\stackrel{\to }{y}=\mathrm{DFT}\stackrel{\to }{x},\phantom{\rule{2em}{0ex}}{\text{DFT}}_{jk}\equiv \frac{1}{\sqrt{N}}\mathrm{exp}\left(\frac{2\pi i}{N}jk\right).$

La "version quantique" de ce problème est la tâche de, étant donné un état quantique $|\mathbit{x}⟩\equiv \sum _{k=1}^{N}{x}_{k}|k⟩$$|\boldsymbol x\rangle\equiv\sum_{k=1}^N x_k|k\rangle$ , l' obtention de l'état de sortie $|\mathbit{y}⟩\equiv \sum _{k=1}^{N}{y}_{k}|k⟩$$|\boldsymbol y\rangle\equiv\sum_{k=1}^N y_k |k\rangle$ telle que

$|\mathbit{y}⟩=\mathrm{DFT}|\mathbit{x}⟩=\mathrm{QFT}|\mathbit{x}⟩.$
1. Une première simplification semble venir du fait que, du fait de la linéarité de QM, on peut se concentrer sur les états de base $|j⟩,\phantom{\rule{thinmathspace}{0ex}}\phantom{\rule{thinmathspace}{0ex}}j=1,...,N$$|j\rangle, \,\,j=1,...,N$ , avec l'évolution des vecteurs généraux$|\mathbit{x}⟩$$|\boldsymbol x\rangle$ venir alors gratuitement.
2. Si $N={2}^{n}$$N=2^n$ , on peut exprimer $|j⟩$$|j\rangle$ en base deux, ayant $|j⟩=|{j}_{1},...,{j}_{n}⟩$$|j\rangle=|j_1,...,j_n\rangle$ .
3. Dans l'algorithme QFT standard, on exploite alors le fait que la transformation peut s'écrire
$|{j}_{1},...,{j}_{n}⟩\to {2}^{-n/2}\underset{l=1}{\overset{n}{⨂}}\left[|0⟩+\mathrm{exp}\left(2\pi i\left(0.{j}_{n-l+1}\cdots {j}_{n}\right)\right)|1⟩\right],$
qui peut ensuite être implémenté comme un circuit quantique de la forme est mis en oeuvre avec
$\mathrm{QFT}|{j}_{1},...,{j}_{n}⟩=\left(\prod _{k=1}^{n}{\mathcal{U}}_{k}\right)|{j}_{1},...,{j}_{n}⟩,$
${\mathcal{U}}_{k}$$\mathcal U_k$$\mathcal{O}\left(n\right)$$\mathcal O(n)$ Les portes élémentaires.

Supposons que nous ayons maintenant une transformation unitaire , et que nous voulons trouver un circuit implémentant efficacement la transformation quantique équivalente Les deux premières astuces mentionnées ci-dessus peuvent toujours être appliquées, mais il n'est alors pas trivial quand et comment l'autre point peut être utilisé pour obtenir des résultats d'efficacité comme nous l'avons fait pour le QFT.$A$$A$

$|\mathbit{y}⟩=A|\mathbit{x}⟩.$

Existe-t-il des critères connus pour que cela soit vrai? Ou en d'autres termes, est-il possible de déterminer précisément quelles sont les caractéristiques de la DFT qui permettent de mettre en œuvre efficacement la transformation quantique associée?

1
The recursive structure of the QFT with number of qubits seems to contribute to that efficiency.
AHusain

Réponses:

12

## Introduction to the Classical Discrete Fourier transform:

La DFT transforme une suite de nombres complexes dans une autre séquence de nombres complexes qui est défini par $N$$N$$\left\{{\mathbf{x}}_{n}\right\}:={x}_{0},{x}_{1},{x}_{2},...,{x}_{N-1}$$\{\mathbf{x}_n\}:=x_0,x_1,x_2,...,x_{N-1}$$\left\{{\mathbf{X}}_{k}\right\}:={X}_{0},{X}_{1},{X}_{2},...$$\{\mathbf{X}_k\}:=X_0,X_1,X_2,...$ Nous pourrions multiplier par des constantes de normalisation appropriées si nécessaire. De plus, que nous prenions le signe plus ou moins dans la formule dépend de la convention que nous choisissons.

${X}_{k}=\sum _{n=0}^{N-1}{x}_{n}.{e}^{±\frac{2\pi ikn}{N}}$

Supposons qu'il soit donné que et .$N=4$$N=4$$\mathbf{x}=\left(\begin{array}{c}1\\ 2-i\\ -i\\ -1+2i\end{array}\right)$$\mathbf{x}=\begin{pmatrix} 1 \\ 2-i \\ -i \\ -1+2i \end{pmatrix}$

We need to find the column vector $\mathbf{X}$$\mathbf{X}$. The general method is already shown on the Wikipedia page. But we will develop a matrix notation for the same. $\mathbf{X}$$\mathbf{X}$ can be easily obtained by pre multiplying $\mathbf{x}$$\mathbf{x}$ by the matrix:

$M=\frac{1}{\sqrt{N}}\left(\begin{array}{cccc}1& 1& 1& 1\\ 1& w& {w}^{2}& {w}^{3}\\ 1& {w}^{2}& {w}^{4}& {w}^{6}\\ 1& {w}^{3}& {w}^{6}& {w}^{9}\end{array}\right)$

where $w$$w$ is ${e}^{\frac{-2\pi i}{N}}$$e^{\frac{-2\pi i}{N}}$. Each element of the matrix is basically ${w}^{ij}$$w^{ij}$. $\frac{1}{\sqrt{N}}$$\frac{1}{\sqrt{N}}$ is simply a normalization constant.

Finally, $\mathbf{X}$$\mathbf{X}$ turns out to be: $\frac{1}{2}\left(\begin{array}{c}2\\ -2-2i\\ -2i\\ 4+4i\end{array}\right)$$\frac{1}{2}\begin{pmatrix} 2 \\ -2-2i \\ -2i \\ 4+4i \end{pmatrix}$.

Now, sit back for a while and notice a few important properties:

• All the columns of the matrix $M$$M$ are orthogonal to each other.
• All the columns of $M$$M$ have magnitude $1$$1$.
• If you post multiply $M$$M$ with a column vector having lots of zeroes (large spread) you'll end up with a column vector with only a few zeroes (narrow spread). The converse also holds true. (Check!)

It can be very simply noticed that the classical DFT has a time complexity $\mathcal{O}\left({N}^{2}\right)$$\mathcal O(N^2)$. That is because for obtaining every row of $\mathbf{X}$$\mathbf{X}$, $N$$N$ operations need to be performed. And there are $N$$N$ rows in $\mathbf{X}$$\mathbf{X}$.

## The Fast fourier transform:

Now, let us look at the Fast fourier transform. The fast Fourier transform uses the symmetry of the Fourier transform to reduce the computation time. Simply put, we rewrite the Fourier transform of size $N$$N$ as two Fourier transforms of size $N/2$$N/2$ - the odd and the even terms. We then repeat this over and over again to exponentially reduce the time. To see how this works in detail, we turn to the matrix of the Fourier transform. While we go through this, it might be helpful to have ${\text{DFT}}_{8}$$\text{DFT}_8$ in front of you to take a look at. Note that the exponents have been written modulo $8$$8$, since ${w}^{8}=1$$w^8 = 1$. Notice how row $j$$j$ is very similar to row $j+4$$j + 4$. Also, notice how column $j$$j$ is very similar to column $j+4$$j + 4$. Motivated by this, we are going to split the Fourier transform up into its even and odd columns. In the first frame, we have represented the whole Fourier transform matrix by describing the $j$$j$th row and $k$$k$th column: ${w}^{jk}$$w^{jk}$. In the next frame, we separate the odd and even columns, and similarly separate the vector that is to be transformed. You should convince yourself that the first equality really is an equality. In the third frame, we add a little symmetry by noticing that ${w}^{j+N/2}=-{w}^{j}$$w^{j+N/2} = −w^j$ (since ${w}^{n/2}=-1$$w^{n/2} = −1$).

Notice that both the odd side and even side contain the term ${w}^{2jk}$$w^{2jk}$. But if $w$$w$ is the primitive Nth root of unity, then ${w}^{2}$$w^2$ is the primitive $N/2$$N/2$ nd root of unity. Therefore, the matrices whose $j$$j$, $k$$k$th entry is ${w}^{2jk}$$w^{2jk}$ are really just ${\text{DFT}}_{\left(N/2\right)}$$\text{DFT}_{(N/2)}$! Now we can write ${\text{DFT}}_{N}$$\text{DFT}_N$ in a new way: Now suppose we are calculating the Fourier transform of the function $f\left(x\right)$$f(x)$. We can write the above manipulations as an equation that computes the jth term $\stackrel{^}{f}\left(j\right)$$\hat{f}(j)$. Note: QFT in the image just stands for DFT in this context. Also, M refers to what we are calling N.

This turns our calculation of ${\text{DFT}}_{N}$$\text{DFT}_N$ into two applications of ${\text{DFT}}_{\left(N/2\right)}$$\text{DFT}_{(N/2)}$. We can turn this into four applications of ${\text{DFT}}_{\left(N/4\right)}$$\text{DFT}_{(N/4)}$, and so forth. As long as $N=2n$$N = 2n$ for some $n$$n$, we can break down our calculation of ${\text{DFT}}_{N}$$\text{DFT}_N$ into $N$$N$ calculations of ${\text{DFT}}_{1}=1$$\text{DFT}_1 = 1$. This greatly simplifies our calculation.

In case of the Fast fourier transform the time complexity reduces to $\mathcal{O}\left(N\mathrm{log}\left(N\right)\right)$$\mathcal{O}(N\log(N))$ (try proving this yourself). This is a huge improvement over the classical DFT and pretty much the state-of-the-art algorithm used in modern day music systems like your iPod!

## The Quantum Fourier transform with quantum gates:

The strength of the FFT is that we are able to use the symmetry of the discrete Fourier transform to our advantage. The circuit application of QFT uses the same principle, but because of the power of superposition QFT is even faster.

The QFT is motivated by the FFT so we will follow the same steps, but because this is a quantum algorithm the implementation of the steps will be different. That is, we first take the Fourier transform of the odd and even parts, then multiply the odd terms by the phase ${w}^{j}$$w^{j}$.

In a quantum algorithm, the first step is fairly simple. The odd and even terms are together in superposition: the odd terms are those whose least significant bit is $1$$1$, and the even with $0$$0$. Therefore, we can apply ${\text{QFT}}_{\left(N/2\right)}$$\text{QFT}_{(N/2)}$ to both the odd and even terms together. We do this by applying we will simply apply ${\text{QFT}}_{\left(N/2\right)}$$\text{QFT}_{(N/2)}$ to the $n-1$$n-1$ most significant bits, and recombine the odd and even appropriately by applying the Hadamard to the least significant bit.

Now to carry out the phase multiplication, we need to multiply each odd term $j$$j$ by the phase ${w}^{j}$$w^{j}$ . But remember, an odd number in binary ends with a $1$$1$ while an even ends with a $0$$0$. Thus we can use the controlled phase shift, where the least significant bit is the control, to multiply only the odd terms by the phase without doing anything to the even terms. Recall that the controlled phase shift is similar to the CNOT gate in that it only applies a phase to the target if the control bit is one. Note: In the image M refers to what we are calling N.

The phase associated with each controlled phase shift should be equal to ${w}^{j}$$w^{j}$ where $j$$j$ is associated to the $k$$k$-th bit by $j=2k$$j = 2k$. Thus, apply the controlled phase shift to each of the first $n-1$$n − 1$ qubits, with the least significant bit as the control. With the controlled phase shift and the Hadamard transform, ${\text{QFT}}_{N}$$\text{QFT}_N$ has been reduced to ${\text{QFT}}_{\left(N/2\right)}$$\text{QFT}_{(N/2)}$. Note: In the image, M refers to what we are calling N.

Example:

Lets construct ${\text{QFT}}_{3}$$\text{QFT}_3$. Following the algorithm, we will turn ${\text{QFT}}_{3}$$\text{QFT}_3$ into ${\text{QFT}}_{2}$$\text{QFT}_2$ and a few quantum gates. Then continuing on this way we turn ${\text{QFT}}_{2}$$\text{QFT}_2$ into ${\text{QFT}}_{1}$$\text{QFT}_1$ (which is just a Hadamard gate) and another few gates. Controlled phase gates will be represented by ${R}_{\varphi }$$R_\phi$. Then run through another iteration to get rid of ${\text{QFT}}_{2}$$\text{QFT}_2$. You should now be able to visualize the circuit for $\text{QFT}$$\text{QFT}$ on more qubits easily. Furthermore, you can see that the number of gates necessary to carry out ${\text{QFT}}_{N}$$\text{QFT}_N$ it takes is exactly

$\sum _{i=1}^{\mathrm{log}\left(N\right)}i=\mathrm{log}\left(N\right)\left(\mathrm{log}\left(N\right)+1\right)/2=\mathcal{O}\left({\mathrm{log}}^{2}N\right)$

## Sources:

P.S: This answer is in its preliminary version. As @DaftWillie mentions in the comments, it doesn't go much into "any insight that might give some guidance with regards to other possible algorithms". I encourage alternate answers to the original question. I personally need to do a bit of reading and resource-digging so that I can answer that aspect of the question.

Regarding the recursive structure: one might take that more or less by definition. If you want to talk about the scaling of an algorithm, you need a family of circuits for different sized inputs. The way this is typically done is to build the circuit for size n+1 out of the circuit for size n.What I'm not really seeing here is any insight that might give some guidance with regards to other possible algorithms (not that I claim that's an easy thing to do)
DaftWullie

@DaftWullie "What I'm not really seeing here is any insight that might give some guidance with regards to other possible algorithms (not that I claim that's an easy thing to do)" Well, yes! I have been thinking about that too. This is more of a preliminary answer. I will add more to it when I get about learning a bit more (and when I get more free time). I would be very glad to see alternate answers to this question. :-)
Sanchayan Dutta

Just because you have a sequence of problems, does not mean one gives the algorithm for the next (let alone a good one). It is typical because we typically think of nice functions. Being recursive in such a simple way is a property of a sequence of problems. Here what I mean is there exists a factorization ${U}_{n}={U}_{n-1}x$$U_n=U_{n-1} x$. Using this question to diagnose whether a sequence ${U}_{\bullet }$$U_{\bullet}$ has the same efficency properties.
AHusain

Hi, in QFT is it implicitly assumed that a, say 8 x 1, input vector x_classical is amplitude encoded with 3-qubits? Then the QFT operations are done on the encoded qubits? Also, can you please elaborate on "...and recombine the odd and even appropriately by applying the Hadamard to the least significant bit."?
Abdullah Ash- Saki

10

One possible answer as to why we can realise the QFT efficiently is down to the structure of its coefficients. To be precise, we can represent it easily as a quadratic form expansion, which is a sum over paths which have phases given by a quadratic function:

${F}_{{2}^{n}}=\frac{1}{\sqrt{{2}^{n}}}\sum _{k,x\in \left\{0,1{\right\}}^{n}}\mathrm{exp}\left(iQ\left(k,x\right)\right)\phantom{\rule{thickmathspace}{0ex}}|k⟩\phantom{\rule{negativethinmathspace}{0ex}}⟨x|,$
where $Q\left(z\right)=\sum _{1⩽j⩽k⩽2n}{\theta }_{j,k}{z}_{j}{z}_{k}$$Q(z) = \sum_{1 \leqslant j \leqslant k \leqslant 2n} \theta_{j,k} z_j z_k$ is a quadratic form defined on $2n$$2n$-bit strings. The quantum Fourier transform in particular involves a quadratic form whose angles are given by
The structure of these angles has an important feature, which allows the QFT to be easily realised as a unitary circuit:
1. There is a function $f:\left\{1,2,\dots ,n\right\}\to \left\{n+1,n+2,\dots ,2n\right\}$$f: \{1,2,\ldots,n\} \to \{n{+}1,n{+}2,\ldots,2n\}$ such that ${\theta }_{j,k}=\pi$$\theta_{j,k} = \pi$ for each $1⩽j⩽n$$1 \leqslant j \leqslant n$ (where $f\left(j\right)=2n-j+1$$f(j) = 2n-j+1$ in the case of the QFT);
2. For any $1⩽h,j⩽n$$1 \leqslant h,j \leqslant n$ for which ${\theta }_{h,\phantom{\rule{thinmathspace}{0ex}}f\left(j\right)}\ne 0$$\theta_{h,\,f(j)} \ne 0$, we have ${\theta }_{j,\phantom{\rule{thinmathspace}{0ex}}f\left(h\right)}=0$$\theta_{j,\,f(h)} = 0$.

We may think of the indices of $z=\left(k,x\right)\in \left\{0,1{\right\}}^{2n}$$z = (k,x) \in \{0,1\}^{2n}$ as input and output wires of a quantum circuit, where our task is to show what the circuit in the middle is which shows how the inputs connect to the outputs. The function $f$$f$ above allows us to see the association of output wires to input wires, that in each case there is a Hadamard gate which connects the two ends together, and that apart from the Hadamards (and SWAP gates which accounts for the reversal of in the order of the indices between $\left(1,2,\dots ,n\right)$$(1,2,\ldots,n)$ and $\left(f\left(1\right),f\left(2\right),\dots ,f\left(n\right)\right)$$(f(1), f(2), \ldots, f(n))$), all of the other operations are two-qubit controlled-phase gates for relative phases of $\mathrm{exp}\left(i{\theta }_{j,k}\right)$$\exp(i \theta_{j,k})$. The second condition on $f$$f$ serves to ensure that these controlled-phase gates can be given a well-defined time ordering.

There are more general conditions which one could describe for when a quadratic form expansion gives rise to a realisable circuit, along similar lines. The above describes one of the simplest cases, in which there are no indices in the sum except for those for the standard basis of the input and output states (in which case the coefficients of the associated unitary all have the same magnitude).

I am not sure I fully understand. Are you saying that any evolution represented as a quadratic form expansion with a quadratic form satisfying those two conditions can be efficiently implemented? Very interesting
glS

@gIS: yes, and furthermore the structure is essentially the same as the Coppersmith QFT circuit (or rather, the fact that the QFT has that form is why the Coppersmith circuit structure suffices to realise the QFT).
Niel de Beaudrap

8

Cela s'écarte un peu de la question initiale, mais j'espère qu'elle donne un peu plus d'informations qui pourraient être pertinentes pour d'autres problèmes.

On pourrait se demander "qu'en est-il de la recherche d'ordres qui se prête à une implémentation efficace sur un ordinateur quantique?". La recherche d'ordres est le composant principal des algorithmes de factorisation et inclut la transformée de Fourier en tant que partie de celle-ci.

La chose intéressante est que vous pouvez mettre des choses comme la recherche d'ordres et le problème de Simon, dans un contexte général appelé «problème de sous-groupe caché» .

Prenons un groupe $g$$G$, avec des éléments indexés par $g$$g$, et une opération de groupe »$\oplus$$\oplus$'. On nous donne un oracle qui évalue la fonction$F\left(g\right)$$f(g)$, et nous sommes assurés qu'il existe un sous-groupe, $K$$K$, de $g$$G$ avec des éléments $k$$k$ de telle sorte que pour tous $g\in g$$g\in G$ et $k\in K$$k\in K$, $f\left(g\right)=f\left(g\oplus k\right)$$f(g)=f(g\oplus k)$. It is our task to uncover the generators of the subgroup $K$$K$. For example, in the case of Simon's problem, the group $G$$G$ is all $n$$n$-bit numbers, and the subgroup $K$$K$ is a pair of elements $\left\{0,s\right\}$$\{0,s\}$. The group operation is bitwise addition.

Efficient solutions (that scale as a polynomial of $\mathrm{log}|G|$$\log|G|$) exist if the group $G$$G$ is Abelian, i.e. if the operation $\oplus$$\oplus$ is commutative, making use of the Fourier Transform over the relevant group. There are well-established links between the group structure (e.g. $\left\{0,1{\right\}}^{n},\oplus$$\{0,1\}^n,\oplus$) and the problem that can be solved efficiently (e.g. Simon's problem). For example, if we could solve the Hidden Subgroup Problem for the symmetric group, it would help with the solution of the graph isomorphism problem. In this particular case, how to perform the Fourier Transform is known, although this in itself is not sufficient for creating an algorithm, in part because there is some additional post-processing that is required. For example, in the case of Simon's Problem, we required multiple runs to find enough linearly independent vectors to determine $s$$s$. In the case of factoring, we were required to run a continued fractions algorithm on the output. So, there's still some classical post-processing that has to be done efficiently, even once the appropriate Fourier transform can be implemented.

## Some more details

In principle, the Hidden Subgroup Problem for Abelian groups is solved as follows. We start with two registers, $|0⟩|0⟩$$|0\rangle|0\rangle$, and prepare the first in a uniform superposition of all group elements,

$\frac{1}{\sqrt{|G|}}\sum _{g\in G}|g⟩|0⟩,$
and perform the function evaluation
$\frac{1}{\sqrt{|G|}}\sum _{g}|g⟩|f\left(g\right)⟩=\frac{1}{\sqrt{|G|}}\sum _{g\in {K}^{\perp }}\sum _{k\in K}|g\oplus k⟩|f\left(g\right)⟩,$
where ${K}^{\perp }$$K^\perp$ is defined such that by taking each element and combining with the members of $K$$K$ yields the whole group $G$$G$ (i.e. each member of ${K}^{\perp }$$K^\perp$ creates a different coset, yielding distinct values of $f\left(g\right)$$f(g)$), and is known as the orthogonal subgroup. Tracing over the second register,
$\frac{1}{|K|}\sum _{g\in {K}^{\perp }}\sum _{k,{k}^{\prime }\in K}|g\oplus k⟩⟨g\oplus {k}^{\prime }|.$
Now we perform the Fourier Transform over the group $G$$G$, giving the output state
$\frac{|K|}{|G|}\sum _{g\in {K}^{\perp }}|g⟩⟨g|.$
Each of the vectors $|g\in {K}^{\perp }⟩$$|g\in K^\perp\rangle$ has a probability of $|K|/|G|$$|K|/|G|$ of being found, and all others have 0 probability. Once the generators of ${K}^{\perp }$$K^\perp$ have been determined, we can figure out the generators of $K$$K$ via some linear algebra.

3

One of many possible constructions that gives some insight into this question, at least to me, is as follows. Using the CSD (cosine-sine decomposition), you can expand any unitary operator into a product of efficient gates V that fit nicely into a binary tree pattern. In the case of the QFT, that binary tree collapses to a single branch of the tree, all the V not in the branch are 1.

intéressant, merci. Pourriez-vous inclure un croquis de l'argument dans la réponse, si possible?
glS

1
Ce que j'ai déjà présenté, c'est ma version d'un "sketch". Si vous voulez approfondir, avec des équations et des images, il est préférable d'aller à la référence arxiv donnée à la fin
rrtucci
En utilisant notre site, vous reconnaissez avoir lu et compris notre politique liée aux cookies et notre politique de confidentialité.