In the Qiskit textbook, I'm stuck on one of the exercises in section 2.2. The question is:

Write the state: enter image description hereas two separate qubits.

The answer has already been covered in this question here, and is defined as:

enter image description here

This makes sense to me - we're basically factoring out the first qubit. However, for my own benefit, I tried multiplying out the vectors and I get different results:

Using the original form:

enter image description here

Using the answer supplied:

enter image description here

Why don't these give the same values?

n.b. Apologies for the use of images - I only had MS Word at my disposal and couldn't find an easy way to export the equations bar screen-shotting.

  • 2
    $\begingroup$ You do not need additional software to write mathematics on this site, for a quick overview of how to do this please see this page $\endgroup$ – Rammus Feb 21 at 14:38
  • $\begingroup$ Thanks - I already had the equations in Word, so I was trying (unsuccessfully) to convert them without downloading any other tools. Next time, I'll start by writing them directly in the question. $\endgroup$ – David Fulton Feb 21 at 16:43

In your answer you are treating $|xy\rangle$ as a direct sum of vectors $|x\rangle$ and $|y\rangle$. However, $|xy\rangle = |x\rangle \otimes |y\rangle$ is actually shorthand for the tensor (Kronecker) product of $|x\rangle$ and $|y\rangle$ (see wiki for more details on the Kronecker product).

In particular if $|x\rangle = \begin{pmatrix} a \\ b\end{pmatrix}$ and $|y\rangle = \begin{pmatrix} c \\ d \end{pmatrix}$ then $$ |xy\rangle = |x\rangle\otimes |y\rangle = \begin{pmatrix} ac \\ ad \\ bc \\ bd \end{pmatrix}. $$

  • $\begingroup$ Right - so my error is in the first vector calculation and both should be 1/(√2) [1 i 0 0] ? $\endgroup$ – David Fulton Feb 21 at 16:48
  • $\begingroup$ Not sure what you mean by both. $$ |00\rangle = \begin{pmatrix} 1 \\ 0 \end{pmatrix} \otimes \begin{pmatrix} 1 \\ 0 \end{pmatrix} = \begin{pmatrix} 1 \\ 0 \\ 0 \\ 0 \end{pmatrix} $$ and $$ |01\rangle = \begin{pmatrix} 1 \\ 0 \end{pmatrix} \otimes \begin{pmatrix} 0 \\ 1 \end{pmatrix} = \begin{pmatrix} 0 \\ 1 \\ 0 \\ 0 \end{pmatrix} $$ $\endgroup$ – Rammus Feb 21 at 16:57
  • $\begingroup$ By "both", I meant the vector of the factorised answer and the vector from the original question. I think both should have come out as $\frac{1}{\sqrt(2)} \begin {pmatrix} 1 \\ i \\ 0 \\ 0 \end{pmatrix}$ $\endgroup$ – David Fulton Feb 21 at 17:04
  • 1
    $\begingroup$ Ok, yeah, exactly! $\endgroup$ – Rammus Feb 21 at 19:45

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.