I've started getting into quantum computing in the last few days. As part of the learning, I've figured it would be fun to implement some circuits on IBMQ Experience as I learn. So now I'm stuck with implementing a 2-qubit QFT. My first try was this:

Where in red is my implementation of a controlled-phase rotation by pi. I did it based on some paper I found which explains how to construct a universal controlled gate. On 00 input it gave a 1/4 1/4 1/4 1/4 probability as expected. Then for sanity check, I figured I might try a 'DC' input (hence the Hadamard gates at the start) so the output would be 100% 00 but it failed. After some reading on the internet, I came by this question. The answer there is basically that the 'controlled' phase shift need only use a simple phase rotation on the MSB qubit. His explanation seemed sound and it did work for the 'DC' case. So, my final question is - why my implementation is wrong? I've tried doing the math and it seems ok: when q[2] is 0, q[1] isn't rotated, and when q[2] is 1 q[1] is rotated by pi (+ a global -pi/2 phase).

Can I get some explanation, please? I think I'm missing something.

  • 1
    $\begingroup$ algassert.com/… $\endgroup$ Jun 3, 2019 at 21:30
  • $\begingroup$ Hey craig, I haven't understood what were you trying to show me with that circuit. Do you care to explain? Thanks. $\endgroup$
    – Dan Yaron
    Jun 4, 2019 at 17:34

1 Answer 1


I think my circuit is wrong is as there is indeed a conditional phase shift on q[1], but as I said it also adds to him a 'global' phase which I didn't care for. This 'global' phase isn't actually global for the whole 2-qubits system, as it doesn't affect q[2].

A reminder for me of the necessity to look at the system as a whole when talking about qubits, as opposed to classical bit by bit examination.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.