1
$\begingroup$

enter image description here

In the case 1 in the picture, it is easy to perform matrix calculations concerning the circuit to obtain a final state.

In case 2 however, I am wondering what is a general procedure to calculate it with matrices? None of tensor products of gates seems right. A decomposition of the CNOT gate into two matrices and sandwiching the Hadamard with them seems to be the only option but it is impossible to do it.

Can you help me?

$\endgroup$
1
  • $\begingroup$ I don't understand: Is the Hadamard also conditioned? Or is it just "in the middle"? In the latter case, why don't you just permute $|\psi_1\rangle$ and $|\psi_2\rangle$? Then it's the second. $\endgroup$
    – Martin
    Apr 13, 2015 at 20:26

1 Answer 1

1
$\begingroup$

The basic approach is to break independent operations to different gates and then calculate the gate operation on all the basis vectors (it's not very pleasant but always work). At your case the representation matrix is -

$ G=(\mathbb{I} \otimes \mathbb{H} \otimes \mathbb{I})(C_{1,3}) $

$ C_{1,3}=\begin{pmatrix} 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 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ \end{pmatrix} $

at basis -

$|\psi_1\psi_2\psi_3\rangle \rightarrow \begin{pmatrix} |000 \rangle \\ |001 \rangle \\ |010 \rangle \\ |011 \rangle \\ |100 \rangle \\ |101 \rangle \\ |110 \rangle \\ |111 \rangle \\ \end{pmatrix} $

Notice the locations of the $ \mathbb{X} $ (NOT operator) in the $C_{1,3} $. Essentialy this is a $ \mathbb{CX} $ gate, on those qubits, and you can make it a $ \mathbb{CU} $ gate ( $ \mathbb{U} $ any unitary matrix ) by replacing $ \mathbb{X} $ with $ \mathbb{U} $ in the matrix.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.