I have recently started with quantum computing, and I've found great book about it - Learn Quantum Computing with IBM Quantum Experience, which explains a lot of things in quite a simple language. There is a section on multi-qubit systems that explains a tensor product and gives few examples.

The book states that:

$$|\Psi\rangle= |\psi\rangle \otimes|\phi\rangle = (\alpha_0 |0\rangle+\alpha_1 |1\rangle)\otimes(\beta_0 |0\rangle+\beta_1 |1\rangle) $$

This operation results in the vector: $$\begin{pmatrix}\alpha_0\beta_0\\ \alpha_0\beta_1\\ \alpha_1\beta_0\\ \alpha_1\beta_1\\\end{pmatrix}$$

Finally, another way to state multi-qubits by their tensor product is by representing them with their product state. We'll use the same two-vector example described previously. The first is the $|00\rangle$ state:

$$|00\rangle = \begin{pmatrix}1\\0\end{pmatrix}\otimes\begin{pmatrix}1\\0\end{pmatrix} = \begin{pmatrix}1\\0\\0\\0\end{pmatrix}$$

Now it is the last equation I've a problem with. When I looked up tensor product on the Internet, everywhere it is showed that if we "tensor-multiply" 2 vectors of length $m$ and $n$, then we get a matrix of size $m \times n$, but I am getting a vector of size $4\times1$ . Am I interpreting the result wrongly, in the sense that it is not the tensor product, or that the tensor product can have different meanings or definitions?

  • 1
    $\begingroup$ You're confusing your notation for sizes of matrices and sizes of vectors. Given an $m\times 1$ vector and an $n\times 1$ vector, the outcome of the tensor product will be a $nm\times 1$ vector. $\endgroup$
    – DaftWullie
    Aug 17 '21 at 7:19
  • $\begingroup$ Yeah, I got it now! Thanks :D $\endgroup$
    – Aman Kumar
    Aug 17 '21 at 11:49

In general given two matrices $A \in \mathbb{R}^{m_A \times n_A}$ and $B \in \mathbb{R}^{m_B \times n_B}$ for the matrix $C=A \otimes B$, we have its dimensions given by $C \in \mathbb{R}^{m_Am_B \times n_An_B}$

The size of the row space is the product of the two row spaces, and the size of the column space is the size of the product of the two column spaces. In the case of taking the outer product between two vectors each with dimensions $2 \times 1$ the result will have dimensions $4 \times 1$.

The result you showed is totally consistent and in fact intuitive because if each qubit has 2 basis states, then 2 qubits will have 4 basis states, 3 qubits will have 8 basis states, $n$ qubits will have $2^n$ basis states.

An intuitive way to remember outer products is the following, especially if you are a visual thinker:

$$A \otimes B = \begin{pmatrix}a_{11}B & \dots & a_{1n}B \\ \vdots & \ddots & \vdots \\ a_{m1}B & \dots & a_{mn}B\end{pmatrix}$$

This should make the dimensions obvious.

  • $\begingroup$ I understood your point, but according to the example given on Wikipedia, shouldn't the answer be $\begin{pmatrix}1\ 0\\ 0\ 0\end{pmatrix}$, that is, a 2*2 matrix? $\endgroup$
    – Aman Kumar
    Aug 17 '21 at 6:28
  • 1
    $\begingroup$ @ProfessorofStupidity I think the superscripted dimensions they used in their answer are harder to read, but their answer is the same as mine. The two state vectors are $2\times1$, so the output is $(2*2) \times (1*1) = 4 \times 1$. Also, the Wikipedia page for tensor products references the Kronecker product but appears to use it incorrectly. However, if you click through to the Kronecker product page on Wiki the dimensions of the result are given correctly. $\endgroup$
    – 0x90h
    Aug 17 '21 at 15:31

The Kronecker product of a matrix of size $m \times n$ and a matrix of size $p \times q$ will be a new matrix that is of size $mp \times nq$.

So, $$\begin{bmatrix}a\\b\end{bmatrix} \otimes \begin{bmatrix}c\\d\end{bmatrix} = \begin{bmatrix}a\begin{bmatrix}c\\d\end{bmatrix}\\b\begin{bmatrix}c\\d\end{bmatrix}\end{bmatrix} = \begin{bmatrix}ac\\ad\\bc\\bd\end{bmatrix}$$

A couple of useful references:


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.