# Regrouping the terms in expression 1.31 in Quantum Computing and Quantum Information, Nielsen and Chuang

I'm trying to reproduce the passage from expression 1.31 to 1.32 in the book Quantum Computing and Quantum Information, by Michael Nielsen and Isaac Chuang.

Expression 1.31 is:

$$|\psi_2\rangle = \frac{1}{2}\left[ \alpha(|0\rangle+|1\rangle)(|00\rangle+|11\rangle)+\beta(|0\rangle-|1\rangle)(|10\rangle+|01\rangle) \right].$$

It is said in QCQI that by regrouping the terms you can reach expression 1.32:

$$|\psi_2\rangle = \frac{1}{2}\left[ |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) \right].$$

I have been trying for hours all kinds of algebraic tricks to go from 1.31 to 1.32 without success. By the way, it seems to me impossible to do so, since there is no term with $$+\beta|1\rangle$$ in expression 1.31.

Does anyone have any suggestion on how to make this happen?

First note that, $$(|0\rangle + |1\rangle)(|00\rangle + |11\rangle) = |0\rangle |00\rangle + |0\rangle|11\rangle + |1\rangle |00\rangle + |1\rangle|11\rangle$$
then you can extend this to $$|\psi_2\rangle$$. That is:
\begin{align} |\psi_2\rangle &= \frac{1}{2}\bigg[\alpha(|0\rangle+|1\rangle)(|00\rangle+|11\rangle)+\beta(|0\rangle-|1\rangle)(|10\rangle+|01\rangle) \bigg] \\ &= \frac{1}{2}\bigg[ \alpha\bigg(|0\rangle |00\rangle + |0\rangle |11\rangle + |1\rangle|00\rangle + |1\rangle |11\rangle \bigg) \\ &\hspace{6 cm}+ \beta\bigg(|0\rangle|10\rangle + |0\rangle|01\rangle - |1\rangle|10\rangle -|1\rangle|01\rangle\bigg) \bigg]\\ &= \frac{1}{2}\bigg[ \alpha\bigg(|000\rangle + |011\rangle + |100\rangle + |111\rangle \bigg) + \beta\bigg(|010\rangle + |001\rangle - |110\rangle -|101\rangle\bigg) \bigg]\\ &= \frac{1}{2}\bigg[ \overbrace{\alpha|000\rangle + \beta|001\rangle}^{\alpha|00\rangle|0\rangle + \beta|00\rangle |1\rangle } + \overbrace{\alpha|011\rangle + \beta|010\rangle}^{\alpha|01\rangle|1\rangle + \beta|01\rangle |0\rangle} + \overbrace{\alpha|100\rangle - \beta|101\rangle}^{\alpha|10\rangle|0\rangle - \beta|10\rangle |1\rangle} + \overbrace{\alpha|111\rangle - \beta|110\rangle}^{\alpha|11\rangle|1\rangle -\beta|11\rangle |0\rangle} \bigg]\\ &= \dfrac{1}{2}\bigg[ |00\rangle\bigg(\alpha|0\rangle + \beta|1\rangle\bigg) + |01\rangle\bigg(\alpha|1\rangle + \beta|0\rangle\bigg) + |10\rangle\bigg(\alpha|0\rangle - \beta|1\rangle \bigg) + |11\rangle\bigg(\alpha|1\rangle - \beta|0\rangle \bigg) \bigg] \end{align}