2
$\begingroup$

I was trying to build the Toffoli gate using the following diagram (found in the qiskit textbook): qiskit book toffoli gate diagram

So, I set V := Rx(pi/2) (as shown in the following diagram) (Note: that I am switching now to the little-endian format)

However, the unitary matrix equivalent to the previous was

$$ \begin{pmatrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & -i\\ 0 & 0 & 0 & 0 & 0 & 0 & -i & 0\\ \end{pmatrix} $$

That will lead to a relative phase of $(-i)$ in the states $\lvert 110 \rangle$ and $\lvert 111 \rangle$

What is the reason for that?

$\endgroup$
2
$\begingroup$

$R_x(\pi/2)$ isn't a square root of the X gate. If you square it, you get $-iX$ instead of $X$. That's where the phase is coming from.

$\endgroup$

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.