# 2-qubit QFT in IBMQ: controlled phase rotation

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.

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