# Calculating entanglement with CRZ Gates on non-neighbor qubits

I'm trying to prove that my quantum circuit is behaving the way I want it to, which means I want to calculate its state vector. Until entanglement, I can show it works using the bloch-sphere - after entanglement that option is gone, so I have to go back to good 'ol maths.

This is my circuit (Simplified and made smaller to easen up initial calculations): So these are the steps I have so far:

Initial state $$q_0 =\ q_1 =\ q_2 =\ |0\rangle\\$$

State after RY-Gate $$q_0 =\ q_1 =\ q_2 =\ RY(c_i)|0\rangle =\ \begin{pmatrix} \cos{\frac{c_i}{2}} & -\sin{\frac{c_i}{2}} \\ \sin{\frac{c_i}{2}} & \cos{\frac{c_i}{2}} \end{pmatrix}|0\rangle =\ \begin{pmatrix} \cos{\frac{c_i}{2}}\\ \sin{\frac{c_i}{2}}\\ \end{pmatrix}\\$$

Now before applying the CRZ-Gates we create the tensor product of all qubits

$$q_2 \otimes q_1 \otimes q_0 =\ \begin{pmatrix} \cos{\frac{c0}{2}}\cos{\frac{c1}{2}}\cos{\frac{c2}{2}}\\ \cos{\frac{c1}{2}}\cos{\frac{c2}{2}}\sin{\frac{c0}{2}}\\ \cos{\frac{c0}{2}}\cos{\frac{c2}{2}}\sin{\frac{c1}{2}}\\ \cos{\frac{c2}{2}}\sin{\frac{c0}{2}}\sin{\frac{c1}{2}}\\ \cos{\frac{c0}{2}}\cos{\frac{c1}{2}}\sin{\frac{c2}{2}}\\ \cos{\frac{c1}{2}}\sin{\frac{c0}{2}}\sin{\frac{c2}{2}}\\ \cos{\frac{c0}{2}}\sin{\frac{c1}{2}}\sin{\frac{c2}{2}}\\ \sin{\frac{c0}{2}}\sin{\frac{c1}{2}}\sin{\frac{c2}{2}}\\ \end{pmatrix}$$

The CRZ Gate for s02 has to match the size of the tensor product, but only apply to the qubit 0 and 2. Standard CRZ gate $$\begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & e^{-i\frac{\lambda}{2}} & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & e^{i\frac{\lambda}{2}} \end{pmatrix}$$

Now we make it 8x8 in size. $$CRZ^{8\times 8}_{q_0,q_2} =\ \begin{pmatrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & e^{-i\frac{\lambda}{2}} & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & e^{i\frac{\lambda}{2}}\\ \end{pmatrix}$$

Now, the $$CRZ^{8\times 8}_{q_0,q_2}$$ gate is something I think is correct? I get the tensor product of all qubits, and then I change the $$CRZ$$ gate so that it can be used to calculate, but does not touch the state of $$q_1$$. To be completely honest, I don't know if this works, or is the right approach. Until now, I only calculated entanglement in circular fashion of neighbouring qubits, which is straightforward, but I somehow can't even find much literature on this, which might also be because I'm using the wrong formalism.

Rather than constructing large matrices, you can continue using bra-ket notation with an outer-product representation for the operators. So your standard controlled-Z gate acting on target and control qubits $$q_0$$ and $$q_1$$ respectively would be: $$|00\rangle\langle00|\otimes I + |1\rangle\langle 1| \otimes \big( e^{-\iota \lambda/2}|0\rangle\langle0| + e^{\iota \lambda/2}|1\rangle\langle1| \big)$$ (refer qiskit docs)
Here the term that is being tensored with $$|1\rangle\langle1|$$ is the Rotation-Z Gate. Hope this gave you a different and a neater formalism to continue your understanding of the circuit that you have constructed :)
• What would I have to change for it to be $q_0$ and $q_2$? That's my current problem I can't seem to figure out, nor find any details on. Apr 22 at 13:06
• Since you can't ignore q_1 from the circuit, you will have to add an Identity operation for the same. Apr 24 at 9:10