1
$\begingroup$

I am quite new to Quantum Computing. If we have an input-state $|00⟩$. How could you transform it into the state $$\frac{1}{2}(|00⟩ + |01⟩ + |10⟩ + |11⟩)$$

$\endgroup$

1 Answer 1

11
$\begingroup$

Consider the state $\frac{1}{2}(|00⟩ + |01⟩ + |10⟩ + |11⟩)$. This admits a factorisation $$\begin{align*}\frac{1}{2}(|00⟩ + |01⟩ + |10⟩ + |11⟩)&=\frac12\{|0\rangle\otimes(|0\rangle+|1\rangle)+|1\rangle\otimes(|0\rangle+|1\rangle)\}\\&=\frac12\{(|0\rangle+|1\rangle)\otimes(|0\rangle+|1\rangle)\}\\&=\left(\frac{|0\rangle+|1\rangle}{\sqrt2}\right)\otimes \left(\frac{|0\rangle+|1\rangle}{\sqrt2}\right)\\&=H|0\rangle\otimes H|0\rangle\end{align*}$$ where $H$ is the Hadamard gate and $\otimes$ is the tensor product.

Thus all you have to do is apply parallel Hadamard gates to two copies of $|0\rangle$ and the resulting state is the one you desire.

More compactly $$H(|0\rangle)\otimes H(|0\rangle)=(H\otimes H)(|0\rangle\otimes|0\rangle)=H_2|00\rangle$$ where $$H_2=H \otimes H = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix} \otimes \frac{1}{\sqrt{2}} \begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix} = \frac{1}{2} \begin{bmatrix} 1 & 1 & 1 & 1 \\ 1 & -1 & 1 & -1 \\ 1 & 1 & -1 & -1 \\ 1 & -1 & -1 & 1 \end{bmatrix}$$

$\endgroup$
2
  • $\begingroup$ Thanks for the answer. Do you know how I do it on OpenQASM? $\endgroup$
    – Annonymus
    Apr 26, 2020 at 17:42
  • $\begingroup$ you'd just apply Hadamard to each qubit. something like: h q[0]; h q[1]; $\endgroup$ May 16, 2020 at 1:16

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.