2
$\begingroup$

The Question

How do I prove that the equation on the right is $CX$ and $CZ$ gate? I don't think that reaching the matrix of the CX or CZ is possible with the given equation.

For (b) I keep getting $I \otimes I$ while on (c), I keep getting crazy matrix after evaluation.

I have tried to substitute the equation provided, used the tensor product, and then multiply them all together.

$\endgroup$
3
  • $\begingroup$ Welcome to the community! Please edit the title to a more informative and concrete one, explain in which context the question arose, and what kind of calculations you have tried for other users to provide more meaningful answers. $\endgroup$
    – 이희원
    Oct 4 at 1:48
  • $\begingroup$ Please refrain from posting scans or pictures of formulas. Use MathJax instead. This helps others to find relevant questions with searching engines. $\endgroup$ Oct 4 at 7:17
  • $\begingroup$ Okay, I will keep that in mind next time. $\endgroup$
    – seopr
    Oct 4 at 22:25

2 Answers 2

2
$\begingroup$

Did you account for the $i$ factors?

I am going to drop the tensor product sign, and write $P \otimes Q$ as PQ.

From the identity provided, we compute that $$ e^{i (\pi/4) ZI} = (II + iZI)/\sqrt{2}, \\ e^{i (\pi/4) IX} = (II + iIX)/\sqrt{2}, \\ e^{-i (\pi/4) ZX} = (II - iZX)/\sqrt{2}. $$

Computing the RHS of the first equation $$ e^{-i (\pi/4)}(II + iZI)(II + iIX)(II - iZX) = (II + iZI)(II - iZX + iIX + ZI)/2\sqrt{2}, \\ = e^{-i (\pi/4)}(II - iZX + iIX + ZI + iZI + IX - ZX + iII)/2\sqrt{2}, \\ = e^{-i (\pi/4)}[(1+i)II - (1+i)ZX + (1+i)IX + (1+i)ZI]/2\sqrt{2}, \\ = (II + IX + ZI - ZX)/2. $$ Using the computer to evaluate this, we get $$ \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \\ \end{pmatrix}, $$ which is indeed the matrix for $CX$.

I will let you do the other one.

$\endgroup$
3
  • $\begingroup$ Why on the third line do 1+i disappear? Can this also work on any i value? $\endgroup$
    – seopr
    Oct 5 at 1:58
  • $\begingroup$ @seopr Remember that $e^{i\pi/4} = (1 - i)/\sqrt{2}$. That cancels the $(1+i)/\sqrt{2}$ factor by multiplication. $\endgroup$ Oct 5 at 2:08
  • $\begingroup$ There is a minus sign missing above in the exponential. $e^{-i\pi/4} = (1-i)/\sqrt{2}$. $\endgroup$ Oct 5 at 17:17
1
$\begingroup$

I realise this isn't the way you were told to do it, but one way to go about it is to recognise that all the exponentiated terms commute with each other. Thus, they have simultaneous eigenvectors. In the first case, the eigenvectors are $$ |0\rangle|+\rangle,|0\rangle|-\rangle,|1\rangle|+\rangle,|1\rangle|-\rangle. $$ Now you can take the provided operator and see how it acts on each eigenstate. For example, $$ e^{-i\pi/4}e^{i\pi Z\otimes I/4}e^{i\pi I\otimes X/4}e^{-i\pi Z\otimes X/4}|1-\rangle=e^{-i\pi/4}e^{-i\pi/4}e^{-i\pi/4}e^{-i\pi/4}|1-\rangle=-|1-\rangle. $$ All the others are (or at least should be, I haven't actually checked) +1 eigenvalues. This means that you can write the operation as $$ |0+\rangle\langle 0+|+|0-\rangle\langle 0-|+|1+\rangle\langle 1+|-|1-\rangle\langle 1-| $$ which is the same as $$ I-2|1-\rangle\langle 1-|, $$ which you can check is the same as controlled-not.

Yet another way, in recognising the commutation, is to group everything together: \begin{align*} e^{-i\pi/4}e^{i\pi Z\otimes I/4}e^{i\pi I\otimes X/4}e^{-i\pi Z\otimes X/4}&=e^{-i\pi(I-Z\otimes I-I\otimes X+Z\otimes X)/4} \\ &=e^{-i\pi(I-Z\otimes I)(I-I\otimes X)/4}\\ &=e^{-i\pi(|1\rangle\langle 1|\otimes I)(I\otimes |-\rangle\langle -|)} \\ &=e^{-i\pi|1\rangle\langle 1|\otimes |-\rangle\langle -|} \\ &=I-2|1\rangle\langle 1|\otimes |-\rangle\langle -|, \end{align*} as before.

Also, for (c), you shouldn't need to repeat the whole calculation. See if you can find a unitary transformation back to (b)!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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