I am a bit stuck in decomposing these gates in single qubit gates, in the Cirq documentation it is written, for example that XX is for example the tensor product of Rx gates. But when I calculate these, I get terms with sin*cos where they write a 0. Is there any trick/explanation for this?
1 Answer
XXPow isn't a tensor product of Rx gates. It raises the matrix resulting from such a tensor product to a power, but the result is not expressible as a tensor product anymore.
If you want to decompose into CNOT gates, the key thing you need to know is that you can change the observable being exponentiated by conjugating it with Clifford operations. For example, if you conjugate XX with CNOTs, the result is a single X on the control. Meaning you can decompose $(X \otimes X)^t$ into this:
You can decompose the other ones similarly. Cirq can perform this decomposition for you, although it outputs CZ gates instead of CNOTs, via cirq.two_qubit_matrix_to_operations
.
-
$\begingroup$ Thank you! This is what I was looking for! $\endgroup$ Commented Apr 9, 2021 at 23:10