5

Background

I came across a Javascript quantum simulator and was trying to write the code (i.e. the quantum circuit) to implement a 3 qbit Quantum Fourier transform.

The closest I could get is shown below: QFT result

This is based on the chapter on the QFT from "Quantum Computation and Quantum Information" by Nielsen and Chuang. (The Conditional NOT gates at the end of the circuit are intended to swap the output bits into the correct order - the QFT reverses the order of the bits.)

I also tried a circuit based on the wikipedia QFT article, but got no closer to the answer.

Question

Can anyone help correct my algorithm to compute the QFT?

(I think it is most likely that the bug is in my circuit, but I guess it is also possible that there is an error in the underlying Javascript implementation?)

Floern
  • 33,559
  • 24
  • 104
  • 119
Peter de Rivaz
  • 33,126
  • 4
  • 46
  • 75

1 Answers1

3

The reason the circuit from wikipedia isn't working is because the provided phase gates are turning clockwise instead of counter-clockwise (e.g. -45 degrees instead of +45 degrees). The circuit on Wikipedia (and probably the text book too) is using an R_(pi/2) gate, but you have an R_(-pi/2) gate.

There are several ways to deal with the issue:

  • Simulate the +45 degree gate using a Z (-180), -90, and -45. Similar idea for the +90.
  • Turn the circuit upside down, so the gates on wire 1 now are on wire 3 after, and vice versa.
  • Move the swapping part (the last three X gates) from the end to the start
  • Reverse the order of all the gates except for the three Xs at the end.
  • (I think) Apply exactly three of the above.
  • Probably a bunch more ways. Figuring out why each one works is interesting.

Sorry the backwards phases were confusing. (It's actually my circuit simulator, which I wrote for a blog post that includes a solution.)

Craig Gidney
  • 17,763
  • 5
  • 68
  • 136
  • So many ways to fix it, thanks! Now I can see what the intermediate results should look like with the correct circuit it begins to make a lot more sense. I'm trying to build up a better intuition so I can decide whether I believe in a many worlds interpretation or not - thanks again! – Peter de Rivaz May 07 '14 at 20:52