I've checked through the answer above and it's really a good one especially for newbies! Truth be told, it's my first time to learn about other applications of Quantum Fourier Transform (QFT) rather than Shor's algorithm alone. I mean, addition and multiplication.
Well, the answer above has already established basic mathematics about QFT. Here, I'd like present a visual and down-to-earth way to introduce QFT as well as its results.
Once again, I want appreciate the introductory circuit built by Ben McDonough. Thus I hope you can open that webpage while reading my answer.
By direct observation of the results in that page, one can easily see all five vectors on Bloch spheres are rotating! Besides, all of them lie straightly on the X-Y plane. Does this apparent fact remind you of something? Maybe you are wearing THAT THING right on your wrist, by which I mean a watch.
The vectors lying on X-Y plane resemble hour hand, minute hand, second hand in your watch. So, with the help of this analogy, you can explain QFT program as translating seconds into "Hour-Minute-Second" format.
Let me give you two little example.
First one, we have 18160 seconds and want to translate it into "Hour-Minute-Second" format. As we all know, 1 hour = 3600 seconds and 1 minute = 60 seconds and 1 second = 1 second. So what we need to do is simply calculate as follows:
$Hour = 18160 // 3600 = 5$
$Minute = (18160 - 3600 * 5) // 60 = 2$
$Second = 18160 - 3600 * 5 - 60 * 2 = 40$
Finally, we have 18160 seconds = 5 hours 2 minutes 40 seconds
Second example is similar to the first one. However, we no longer use period T = 60. Instead we use T = 1 / 2.
Suppose we have a binary string 10100 leaving the first qubit as 0(numbering backwards). And we want to perform QFT on it. Since the length of it is 5, we need 5 qubits and 5 clocks with different periods (just like hour hand is different from minute hand).
Clock number |
Clock 1 |
Clock 2 |
Clock 3 |
Clock 4 |
Clock 5 |
Angular velocity |
1 / 2 |
1 / 4 |
1 / 8 |
1 / 16 |
1 / 32 |
(For simplicity, we transform 10100 from binary one to decimal one in advance, which is $2^4 + 2 ^2 = 16 + 4=20$)
Thus, the first clock need to rotate $20 \times 1 / 2 = 10$ times = $0$ time, the second one $20 \times 1 / 4 = 5$ times = $0$ time, the third is $20 \times 1 / 8 = 5 / 2$ times = $1 / 2$ time, the fourth is $5 / 4 = 1 / 4$ time and the fifth is $5 / 8$ time. This fact implies every single clock recorded the same data! Even though they hold completely different period.
If you really draw a big clock with 5 hands, you can visually and easily see what the "time" is right now.
But how has the Quantum Circuit done this job? (Sorry, Ben. Let me borrow your pic for a moment.)
Let the first qubit in. And it will encounter an H gate which turn it into a |+> state (parallel to X-axis) which means the hand of the first clock doesn't rotate at all!
Then the second qubit comes in. Old school. We have to put it on X-Y plane. That's why we need an H gate. But what's the use of S gate, which would rotate a vector by the half of the phase of an H gate? Well, since the second clock has exactly half of the angular velocity of H gate, when the first clock rotates ( if the 1st qubit is 1), it has to rotate 90° instead of 180° by H gate. However, the first qubit is 0, we don't have to rotate the second clock.
To save time, we just skip to the fifth clock and check how it rotates. First, since the 5th qubit is 1, the 5th clock now reads 6 o'clock (180° = 360° / 2 for the sake of H gate). Notice that the 3rd qubit is 1, too! So it has to rotate another 360° / 8. Add them up we get $360° \times (1 / 2 + 1 / 8) = 360° \times 5 / 8 = 5 / 8$ times!
Conclusion: QFT turns a binary data into indications of clocks. No matter which way you choose to express your data, they are actually the same thing. Someone may argue that the hour hand only tells us HOURs, it can't tell us MINUTEs and SECONDs. Well, that depends on how your watch rotates, discretely or continuously. For continuous one, the introduction above explains well.