Reputation: 33499
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:
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.
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?)
Upvotes: 5
Views: 933
Reputation: 18266
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:
Sorry the backwards phases were confusing. (It's actually my circuit simulator, which I wrote for a blog post that includes a solution.)
Upvotes: 3