# Writing the transformation matrix for the following in terms of Kronecker products of elementary 2-qubit gates

I have a set of transformations that transforms $$|11001\rangle\to |10101\rangle$$ which is basically keeping the leftmost qubit as it is and then it is just the CNOT between the successive qubits, I have done the circuit construction for this with the steps with the register $$|abcde\rangle$$ $$1.~~ \operatorname{CNOT}|d,e\rangle$$ $$2.~~ \operatorname{CNOT}|c,d\rangle$$ $$3.~~ \operatorname{CNOT}|b,c\rangle$$ $$4.~~ \operatorname{CNOT}|a,b\rangle$$ after these transformations, we get the desired results, but how do I write this whole transformation in Dirac notation or matrix notation. I have figured it myself can somebody just check for the $$1. A=\mathrm{kron}(\mathrm{kron}(\mathrm{kron}(I_2,I_2),I_2),U)$$ $$2. B=\mathrm{kron}(\mathrm{kron}(\mathrm{kron}(I_2,I_2),U),I_2)$$ $$3. C=\mathrm{kron}(\mathrm{kron}(\mathrm{kron}(I_2,U),I_2),I_2)$$ $$4. D=\mathrm{kron}(\mathrm{kron}(\mathrm{kron}(U,I_2),I_2),I_2)$$ where $$U=\begin{bmatrix} 1 &0&0&0\\ 0&1&0&0\\ 0&0&0&1\\ 0&0&1&0 \end{bmatrix}$$ The last step is just to multiply all these matrix so final transformation matrix is $$U_f=ABCD$$ I have the circuit representation for $$8$$-qubits as

Since this is product of unitary of transformations, i need $$6$$ unitary matrices for this. The first of these matrices say $$U_1$$ that i calculated shoyld be $$U_1= I^6\otimes \lbrace{|0\rangle \langle 0|\otimes I+|1\rangle \langle 1|\otimes X\rbrace }$$ similarly for the other $$5$$ matrices just the identity matrix size keeps changing. Is my inference correct, can somebody help?

• I expected some sort of an answer atleast – Upstart Apr 30 '19 at 15:04
• Yes, you are correct. Only thing you need 7 unitaries for 8 qubits not 6. And the identity keeps on changing size but you keep on adding identity to the right. In general $U_j = I^{\otimes (7-j)}\otimes CNOT \otimes I^{\otimes(j-1)}$ . $j$ goes from 1 to 7. Then your full unitary would be $U_7U_6\cdots U_1$ – Hemant May 1 '19 at 5:05
• Also $U_f$ for 5 qubit scenario in the question would be $U_f = DCBA$ – Hemant May 1 '19 at 5:45
• why should it be DCBA? – Upstart May 1 '19 at 6:06
• Your circuit requires $A$ to be applied first. – Hemant May 1 '19 at 6:17