Why Are Swap Gates Used in Quantum Fourier Transform Circuits?

Join the discussion
Registration is free. Start your own thread to ask a follow-up.
4 replies · 3K views
jimmycricket
Messages
115
Reaction score
2
I'm currently working through Nielsen & Chuang's section on the circuit design for implementing the QFT. I'm confused as to why swap gates are used in the model to swap the order of qubits. Heres what I'm looking at http://www.johnboccio.com/research/quantum/notes/QC10th.pdf page 247 figure 5.1
Can anybody help?
 
Last edited by a moderator:
Physics news on Phys.org
jimmycricket said:
I'm currently working through Nielsen & Chuang's section on the circuit design for implementing the QFT. I'm confused as to why swap gates are used in the model to swap the order of qubits. Heres what I'm looking at http://www.johnboccio.com/research/quantum/notes/QC10th.pdf page 247 figure 5.1
Can anybody help?

Here's a blog post about the QFT with some puzzles in a circuit simulator.

The basic reason is that the QFT's output has the qubits in the reverse order of what you typically want. It switches you from big-endian bits to little-endian bits (or vice versa), so that the amplitude of the state 10010 corresponds to the 7/N frequency instead of the 18/N frequency (or vice-versa).

You don't have to swap them back into the right order, it just makes it easier to think about the QFT when used as a tool because you're keeping the endian-ness consistent. It makes the result match the usual definition of the discrete Fourier transform, where F(1) corresponds to the lowest non-zero frequency (instead of what F(N-1) corresponds to).
 
Last edited by a moderator:
  • Like
Likes   Reactions: jimmycricket
Strilanc said:
Here's a blog post about the QFT with some puzzles in a circuit simulator.

The basic reason is that the QFT's output has the qubits in the reverse order of what you typically want. It switches you from big-endian bits to little-endian bits (or vice versa), so that the amplitude of the state 10010 corresponds to the 7/N frequency instead of the 18/N frequency (or vice-versa).

You don't have to swap them back into the right order, it just makes it easier to think about the QFT when used as a tool because you're keeping the endian-ness consistent. It makes the result match the usual definition of the discrete Fourier transform, where F(1) corresponds to the lowest non-zero frequency (instead of what F(N-1) corresponds to).

Thats cleared that up, Thanks
 
Strilanc said:
Here's a blog post about the QFT with some puzzles in a circuit simulator.

The basic reason is that the QFT's output has the qubits in the reverse order of what you typically want. It switches you from big-endian bits to little-endian bits (or vice versa), so that the amplitude of the state 10010 corresponds to the 7/N frequency instead of the 18/N frequency (or vice-versa).
Do you mean the 9/N frequency not 7/N. Am I right in saying the qubits in your example reversed would read 01001=9?
 
jimmycricket said:
Do you mean the 9/N frequency not 7/N. Am I right in saying the qubits in your example reversed would read 01001=9?

Yeah, my mistake.