How does the stated Pauli decomposition for $\operatorname{CP\cdot A\cdot CP}$ arise?

I'm having a bit of trouble understand @DaftWullie's answer here.

I understood that the $$4\times 4$$ matrix $$A$$ $$\frac{1}{4} \left[\begin{matrix} 15 & 9 & 5 & -3 \\ 9 & 15 & 3 & -5 \\ 5 & 3 & 15 & -9 \\ -3 & -5 & -9 & 15 \end{matrix}\right]$$

can be decomposed into Pauli matrices as:

$$A=15\mathbb{I}\otimes\mathbb{I}+9Z\otimes X+5X\otimes Z-3Y\otimes Y$$

So far so good.

Then he says:

Now, it is interesting to note that every one of these terms commutes. So, that means that $$e^{iA\theta}=e^{15i\theta}e^{9i\theta Z\otimes X}e^{5i\theta X\otimes Z}e^{-3i\theta Y\otimes Y}.$$ You could work out how to simulate each of these steps individually, but let me make one further observation first: these commuting terms are the stabilizers of the 2-qubit cluster state. That may or may not mean anything to you, but it tells me that a smart thing to do is apply a controlled-phase gate. $$CP\cdot A\cdot CP=15\mathbb{I}\otimes\mathbb{I}+9\mathbb{I}\otimes X+5X\otimes \mathbb{I}-3X\otimes X.$$

Now, I hadn't heard of clusters states before, but Wikipedia gave me some idea (I'll probably need to through it a few more times though).

Anyhow, as far as I know, the controlled phase gate $$CP$$ is basically a controlled-$$R_{\phi}$$ gate where $$R_{\phi}$$ is:

$$\left[\begin{matrix}1 & 0 \\ 0 & e^{i\phi}\end{matrix}\right]$$

So, controlled $$R_{\phi}$$ would be

$$\left[\begin{matrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & e^{i\phi} \end{matrix}\right]$$

This is where I am confused. Shouldn't $$(\text{controlled }R_{\phi})A(\text{controlled }R_{\phi})$$ contain a $$\phi$$ term somewhere? I don't understand how its Pauli decomposition $$15\mathbb{I}\otimes\mathbb{I}+9\mathbb{I}\otimes X+5X\otimes \mathbb{I}-3X\otimes X$$ contains no term containing the phase angle $$\phi$$. Wolfram Alpha also agrees that the matrix multiplication result of $$\operatorname{CP\cdot A\cdot CP}$$ must contain a phase term. So, I'm not quite sure how Pauli decomposition of $$\operatorname{CP\cdot A\cdot CP}$$ as stated by DaftWullie in his answer arises. Am I missing something?

When I talked about a controlled-phase gate, I meant the standard gate that has unitary matrix $$\left(\begin{array}{cccc} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & -1 \end{array}\right)$$

Note that this is related to the controlled-not via the action of a Hadamard on the target qubit. It also satisfies some standard propagation relations on Pauli operations: $$Z_n\mapsto Z_n\qquad X_n\mapsto Z_{3-n}X_n$$ for $$n\in\{1,2\}$$ being the two qubits that the controlled-phase gate acts on.

• Isn't this normally called the controlled-Z gate? It is a special case of the controlled phase shift gates when $\phi = \pi$ as far as I know. Also, if I consider $\phi$ to be $\pi$, then according to Wolfram $CP\cdot A\cdot CP$ should be $\text{diag}(15/4,15/4,15/4,-15/4)$. And for that, this Python script gives me $1.875 (\Bbb I \otimes \Bbb I ) + 1.875( \Bbb I \otimes \sigma_z )+1.875( \sigma_z \otimes I ) -1.875( \sigma_z \otimes \sigma_z )$. – Sanchayan Dutta Oct 19 '18 at 12:24
• Maybe Wolfram is doing the matrix multiplication wrong. I'm checking again – Sanchayan Dutta Oct 19 '18 at 12:25
• @Blue In terms of terminology, I guess you can use controlled-phase to mean arbitrary phase, but it is also used extensively meaning specifically $\phi=\pi$. The top google scholar results for the term all return $\phi=\pi$ instances. – DaftWullie Oct 19 '18 at 12:37
• Thanks, makes sense! I realized that using the term matrix multiply in Wolfram Alpha causes it to multiply the matrices "element-wise", which is why it was giving the incorrect result. This time it looks OK: $$\left[\begin{matrix}15 & 9 & 5 & 3 \\ 9 & 15 & 3 & 5 \\ 5 & 3 & 15 & 9 \\ 3 & 5 & 9 & 15\end{matrix}\right]$$ which decomposes into $$15(I \otimes I)+9( I \otimes X)+5(X \otimes I )+3(X \otimes X )$$ according to the script. So apparently there was a sign error in the last term of Pauli decomposition in the other answer (which you had mentioned the possibility of). – Sanchayan Dutta Oct 19 '18 at 12:55
• This is the link for the matrix multiplication $\text{CP}\cdot A \cdot \text{CP}$. So, if I'm not mistaken, I just need to change $R_x(-3\theta)$ to $R_x(3\theta)$ in the final circuit to correct it, right? – Sanchayan Dutta Oct 19 '18 at 12:58

Yes if you work with general phase shift there would be $$\phi$$ in the final answer. In fact you would be able to take $$\phi=0$$ and just get $$A$$ back. Try $$\phi=\frac{\pi}{4}$$. Looks like notational mismatch of what's called a phase gate/phase shift gate. Whether it means the entire 1 parameter family or just one specific value of $$\phi$$.

EDIT: Incorrect, see comment below.

• Should have checked beforehand instead of guessing the value that is often called phase. – AHusain Oct 19 '18 at 12:31