I saw that mathematica already had other quantum computer questions here, so I think this is the best stack-exchange to ask it.

Lets say you have two qubits. The first is hadamard transformed and the second is a 0.

When you then do a $CNOT$ transform, you get:

$\begin{bmatrix}1&0&0&0\\ 0&1&0&0\\ 0&0&0&1\\ 0&0&1&0 \end{bmatrix} \begin{bmatrix}\sqrt{\frac 1 2}\\ 0\\ \sqrt{\frac 1 2}\\ 0 \end{bmatrix} = \begin{bmatrix}\sqrt{\frac 1 2}\\ 0\\ 0\\ \sqrt{\frac 1 2} \end{bmatrix} $

Note that the order in the vector from top to bottom is $|00\rangle, |01\rangle, |10\rangle, |11\rangle$

You can clearly see now that both qubits are entangled, since the outcome is either $|00\rangle$ or $|11\rangle$ when reading either qubit and either has a 50% chance to be the outcome.

My question is this: if you now apply a hadamard transform to the second qubit, what would happen to the state of the two qubits? How would you perform such a transformation on entangled qubits?


1 Answer 1


(Cribbing from this answer on physics stackexchange.)

  1. Group the states by the uninvolved qubits.

    $|\psi\rangle = a|00⟩ + b|01⟩ + c|10⟩ + d|11⟩$

    $= \Big(a|0⟩ + c|1⟩\Big)|0⟩ + \Big(b|0⟩ + d|1⟩\Big)|1⟩$

  2. Apply the operation within each group.

    $H_0 |\psi\rangle = \Big(H(a|0⟩ + c|1⟩)\Big)|0⟩ + \Big(H(b|0⟩ + d|1⟩)\Big)|1⟩$

    $= \Big(\frac{a+c}{\sqrt 2}|0⟩ + \frac{a-c}{\sqrt 2}|1⟩\Big)|0⟩ + \Big(\frac{b+d}{\sqrt 2}|0⟩ + \frac{b-d}{\sqrt 2}|1⟩\Big)|1⟩$

  3. Ungroup

    $=\frac{a+c}{\sqrt 2}|00⟩ + \frac{b+d}{\sqrt 2}|01⟩ + \frac{a-c}{\sqrt 2}|10⟩ + \frac{b-d}{\sqrt 2}|11⟩$

In your case, where $a=d=\frac{1}{\sqrt 2}$ and $b=c=0$, the result is

$$\frac{1}{2}|00⟩ + \frac{1}{2}|01⟩ + \frac{1}{2}|10⟩ + \frac{-1}{2}|11⟩ = \frac{1}{2} \begin{bmatrix} 1\\1\\1\\-1 \end{bmatrix}$$

Which is easily confirmed with a circuit simulator:

Simulated circuit


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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