# What circuit or operation corresponds to the tensor product?

What Clifford gate circuit operating on states $$|\psi_1\rangle$$ and $$|\psi_2\rangle$$ prepares the state $$|\Psi\rangle=|\psi_1\rangle \otimes |\psi_2\rangle$$ ?

I think that you misunderstood the concept of tensor product here. There is no need of a Clifford gate in order to have a multi-qubit system. The fact that a multi-qubit system is described by the tensor produt of their state vectors comes from the fourth postulate of quantum mechanics, refer to the $$94^{th}$$ page of Nielsen and Chuang to see the formulation of this postulate.

Consequently, what I mean here is that if you have two qubits represented by state vectors $$|\psi_1\rangle$$ and $$|\psi_2\rangle$$, the tensor product is the mathematical operation that describes the composite state of the 2-qubit sytem $$|\Psi\rangle$$. This something known by postulates, and so there is no need to use any Clifford gate to obtain that.

Clifford gates for example could be used if you have state $$|\Psi\rangle=|\psi_1\rangle\otimes |\psi_2\rangle$$ and you want to obtain another state $$|\Psi'\rangle$$, then the transformation would be given by some Clifford group unitary so that $$|\Psi'\rangle=U|\Psi\rangle$$. However, in order to calculate such unitary, the initial states should be needed, and so here no more can be said.

There is no circuit operation or Clifford gate! If you have $$|\psi_1\rangle$$ and $$|\psi_2\rangle$$ entering a circuit, then mathematically we say that: $$|\psi_1\rangle \otimes |\psi_2\rangle$$

is entering the circuit.

This means if you represent the whole circuit as a unitary matrix $$U$$, it will have a dimension corresponding to the size of $$|\psi_1\rangle \otimes |\psi_2\rangle$$, not of $$|\psi_1\rangle$$ or $$|\psi_2\rangle$$. Your output is literally the matrix-vector product:

$$U\left(\left|\psi_1\right\rangle \otimes |\psi_2\rangle\right),$$

even without using any extra Clifford gates!

The tensor product is not a gate, but rather a way for us as humans to model the behavior of a quantum system. Whenever we're using multiple qbits, we can look at them in two ways: in their product state (a complex vector of size $$2^n$$ for $$n$$ qbits) or their individual state ($$|\psi_0\rangle \otimes \ldots \otimes |\psi_{n-1}\rangle$$). We can usually switch back and forth between the two representations at will (again, they are two equivalent ways of writing the same quantum state) except for when the qbits become entangled, in which case we cannot factor them back into the individual state (this is roughly the definition of entanglement).

When you're just learning quantum computing and are writing out matrices & vectors explicitly, you usually use the product state to calculate the action of an operator on the quantum state, then factor the result back into the individual state to see the action of that operator on the individual qbits. So for example, if we want to calculate the action of CNOT on $$|10\rangle$$ with leftmost qbit as control:

$$C|10\rangle = C \begin{bmatrix} 0 \\ 1 \end{bmatrix} \otimes \begin{bmatrix} 1 \\ 0 \end{bmatrix} = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \\ \end{bmatrix} \begin{bmatrix} 0 \\ 0 \\ 1 \\ 0 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ 0 \\ 1 \end{bmatrix} = \begin{bmatrix} 0 \\ 1 \end{bmatrix} \otimes \begin{bmatrix} 0 \\ 1 \end{bmatrix} = |11\rangle$$

So we see that CNOT on $$|10\rangle$$ flipped the rightmost qbit to $$|11\rangle$$ as expected, because the control (leftmost) qbit was $$1$$.

Here's an entangled product state which cannot be factored into its individual state:

$$C_{1,0}H_1|00\rangle = \begin{bmatrix} \frac{1}{\sqrt{2}} \\ 0 \\ 0 \\ \frac{1}{\sqrt{2}} \end{bmatrix}$$

If you try to factor that out into the tensor product of two qbits, you will see you cannot.

• To simulate this circuit, it seems that I would need an algorithm for factoring the 2-qbit tensor product into its components. Do you know where can I find a good discussion of this process? Thank you. – Adam Pingel Apr 29 '19 at 4:40

To put another way, the circuit is just As everyone else said, the tensor product is just the way of constructing a composite quantum system from smaller subsystems, and doesn't require gates as such. But ordering is important, $$|\psi_1\rangle\otimes|\psi_2\rangle\neq |\psi_2\rangle\otimes|\psi_1\rangle$$, and there is a standard correspondence in quantum circuits between the first item in the tensor product being on the top wire.

If two qubits are in state $$|\psi_1\rangle$$ and $$|\psi_2\rangle$$ then the combined quantum state of the two qubits is already in the state $$|\psi_1\rangle \otimes |\psi_2\rangle$$, without requiring any gates. We would need to calculate the tensor product classically. If one wants to measure (by sampling) $$n$$ qubits, there are two ways of doing it.

1. Measure each qubit say $$M$$ times and sample the qubit as $$|\psi_i\rangle = \alpha_i|0\rangle + \beta_i|1\rangle$$, for $$i=1,2,\dots n$$. Hence, to obtain the quantum state of all the qubits we require $$n\cdot M$$ measurements. And to obtain the composite quantum state of the $$n$$ qubits, we need to carry out the tensor product $$|\psi_1\rangle \otimes |\psi_2\rangle \otimes |\psi_3\rangle \dots |\psi_n\rangle$$, ourselves.

2. Measure all qubits simultaneously and after each measurement we would get a state $$a_k |k\rangle$$, where $$k=0,1,2,\dots 2^n - 1$$ (the decimal format of the orthogonal basis vectors with $$n$$ qubits) and $$\sum_k a_k^2 = 1$$. However, to sample the complete quantum state we would need some $$2^n\cdot M$$ measurements ($$M$$ being some large number).

As you can see, with only $$n\cdot M$$ measurements we get the independent quantum state of each qubit (without the tensor product of the qubit states). But with $$2^n \cdot M$$ measurements we get the complete quantum state of $$n$$ qubits (tensor producted for us).