1
$\begingroup$

The following should represent an RZZ gate (source: https://pennylane.ai/qml/demos/tutorial_qaoa_maxcut.html)

enter image description here

How do the CNOT and an RZ compute mathematically to the RZZ?

$$ R_Z(\theta) = \begin{pmatrix} e^{-i\frac{\theta}{2}} & 0 \\ 0 & e^{i\frac{\theta}{2}} \end{pmatrix} $$

$$ CNOT = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0\end{pmatrix} $$

The above circuit, if I understand, should result in the following:

$$ R_{ZZ}(\theta) = \begin{pmatrix} e^{-i\frac{\theta}{2}} & 0 & 0 & 0 \\ 0 & e^{i\frac{\theta}{2}} & 0 & 0 \\ 0 & 0 & e^{i\frac{\theta}{2}} & 0 \\ 0 & 0 & 0& e^{-i\frac{\theta}{2}} \end{pmatrix} $$

$\endgroup$
1
  • $\begingroup$ This technique can actually be extended to any number of qubit interactions. E.g. $Z_1 Z_2 Z_3$ would involve a CNOT from 1 to 3, and 2 to 3, a RZ gate on qubit 3, and then mirror the CNOTs on the other side of the RZ gate. $\endgroup$
    – makansij
    Feb 23, 2023 at 22:10

2 Answers 2

3
$\begingroup$

The $R_Z(\theta)$ operator is in reality the $I \otimes R_Z(\theta)$ operator which makes it $$ \begin{align} I \otimes R_Z(\theta) &= \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} \otimes \begin{pmatrix} e^{-i\frac{\theta}{2}} & 0 \\ 0 & e^{i\frac{\theta}{2}} \end{pmatrix} \\ &= \begin{pmatrix} e^{-i\frac{\theta}{2}} & 0 & 0 & 0 \\ 0 & e^{i\frac{\theta}{2}} & 0 & 0 \\ 0 & 0 & e^{-i\frac{\theta}{2}} & 0 \\ 0 & 0 & 0 & e^{i\frac{\theta}{2}}\end{pmatrix} \end{align} $$ This is because if you have to include the identity operator when looking at the overall 2-qubit system. Now you can perform the matrix multiplication

$$ \begin{align} CNOT\left(I \otimes R_Z(\theta)\right)CNOT &= \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0\end{pmatrix} \begin{pmatrix} e^{-i\frac{\theta}{2}} & 0 & 0 & 0 \\ 0 & e^{i\frac{\theta}{2}} & 0 & 0 \\ 0 & 0 & e^{-i\frac{\theta}{2}} & 0 \\ 0 & 0 & 0 & e^{i\frac{\theta}{2}}\end{pmatrix} \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0\end{pmatrix} \end{align} $$ which will give you the $R_{ZZ}(\theta)$ matrix you have written (up to a global phase).

$\endgroup$
1
  • 1
    $\begingroup$ thanks! I missed the first step :) $\endgroup$ Feb 7, 2023 at 15:28
0
$\begingroup$

It helps to write out the matrix representation of the RXX gate you post in the beginning. First, we can easily see that

$$(I - Z_1Z_2)/2 = \begin{pmatrix} 0&0&0&0\\ 0&1&0&0\\ 0&0&1&0\\ 0&0&0&0 \end{pmatrix}$$ So looking at $R_{ZZ}(\theta) = e^{-i\theta(I-Z_1Z_2)/2}$, we can again easily see that $$ R_{ZZ}(\theta)=\begin{pmatrix} 1&0&0&0\\ 0&e^{-i\theta}&0&0\\ 0&0&e^{-i\theta}&0\\ 0&0&0&1 \end{pmatrix}. $$ Now, you correctly conclude the resulting matrix from the circuit above, getting $$ R_{ZZ}(\theta)=\begin{pmatrix} e^{-i\frac{\theta}{2}}&0&0&0\\ 0&e^{i\frac{\theta}{2}}&0&0\\ 0&0&e^{i\frac{\theta}{2}}&0\\ 0&0&0&e^{-i\frac{\theta}{2}} \end{pmatrix}, $$ which you'll notice we can rewrite as $$ R_{ZZ}(\theta)=e^{-i\frac{\theta}{2}}\begin{pmatrix} 1&0&0&0\\ 0&e^{i\theta}&0&0\\ 0&0&e^{i\theta}&0\\ 0&0&0&1 \end{pmatrix}, $$ Giving us the same matrix as above up to some global phase differences, which we can generally ignore.

$\endgroup$

Your Answer

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

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