The following should represent an RZZ gate (source: https://pennylane.ai/qml/demos/tutorial_qaoa_maxcut.html)
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} $$