# How is the grouping of terms done in the calculations for the teleportation circuit?

I have a CS background and am studying quantum computing by myself. Struggling at the moment with the Dirac notation for the teleportation circuit. Here we go:

The circuit starts with the EPR pair between Alice and Bob (qubits entangled):

Then the $$CNOT$$ is applied (so far so good):

But then, the terms are regrouped in order to get the equation below, but I couldn't figure out how that was done.

For instance, I can't figure out how $$\beta|1\rangle$$ can possibly be multiplying $$|00\rangle$$ as $$\beta$$ is only multiplying the terms $$|01\rangle$$ and $$|10\rangle$$ part of the equation.

I checked Thomas Wong's book as well as Nielsen and Chuang, but they don't really detail this part at all.

Consider the following equivalency:

$$|xy\rangle = |x\rangle|y\rangle = |x\rangle \otimes |y\rangle$$

While $$\otimes$$ is a notation for the Kronecker product. Take a look there at the properties of the Kronecker product, but in particular and regarding your question, it's important to understand that the Kronecker product is bilinear, associative and non-commutative.

In light of these properties we can write:

$$|\psi\rangle = \frac{1}{2} \big[\alpha(|0\rangle + |1\rangle)(|00\rangle + |11\rangle) + \beta(|0\rangle - |1\rangle)(|10\rangle + |01\rangle) \big] = \\ \ \frac{1}{2}(\alpha|000\rangle + \alpha|011\rangle + \alpha|100\rangle + \alpha|111\rangle + \beta|010\rangle + \beta|001\rangle - \beta|110\rangle - \beta|101\rangle) = \\ \ \frac{1}{2}\big[ |00\rangle(\alpha|0\rangle + \beta|1\rangle) + |01\rangle(\alpha|1\rangle + \beta|0\rangle) + |10\rangle(\alpha|0\rangle - \beta|1\rangle) + |11\rangle(\alpha|1\rangle - \beta|0\rangle) \big]$$

• thank you for the detailed answer and for fixing the issues in the question as well. This is really helpful and makes this community quite welcoming to newbies like me. Sep 11 at 8:50

In their notation, $$|ab\rangle|c \rangle$$ is the same thing as $$|a \rangle |bc \rangle$$.

They’re not moving the first qubit around, they’re regrouping the qubits.