summation and bra-ket notation How to obtain the summation expression located at the right side of equation (5.20) ?

 A: I will ignore the factor of $1/2^t$ for convenience.
We begin with the expression
$$
\left(|0\rangle + e^{2 \pi i2^{t-1}\varphi}|1 \rangle\right)
\left(|0\rangle + e^{2 \pi i2^{t-2}\varphi}|1 \rangle\right) \cdots
\left(|0\rangle + e^{2 \pi i2^{t-1}\varphi}|1 \rangle\right).
$$
Denote $\psi = 2 \pi i \varphi$. Rewrite this as
$$
\left(e^{0\cdot 2^{t-1}\psi}|0\rangle + e^{1 \cdot 2^{t-1}\psi}|1 \rangle\right)
\left(e^{0\cdot 2^{t-2}\psi}|0\rangle + e^{1 \cdot 2^{t-2}\psi}|1 \rangle\right) \cdots
\left(e^{0\cdot 2^{0}\psi}|0\rangle + e^{1 \cdot 2^{0}\psi}|1 \rangle\right).
$$
Expanding this product yields one term for each vector $|c_{t-1}\rangle | c_{t-2}\rangle \cdots |c_0\rangle$ with $c_j \in \{0,1\}$, namely the product
$$
\left(e^{c_{t-1}\cdot 2^{t-1}\psi}|c_{t-1}\rangle\right) \cdots \left(e^{c_{0}\cdot 2^{0}\psi}|c_{0}\rangle\right) |c_{t-1}\rangle \cdots |c_0 \rangle =
e^{\sum_{j=0}^{t-1} c_j 2^j \psi} |c_{t-1}\rangle \cdots |c_0 \rangle.
$$
Now, let $k = \sum_{j=0}^{t-1} c_j 2^j$. We can see that $[c_{t-1} c_{t-2}\cdots c_0]_2$ is the binary expression for $k$, which means that $|c_{t-1}\rangle \cdots |c_0\rangle = |k\rangle$. Thus, this term can be written as $e^{k\psi} |k\rangle$.
We stated that the expanded sum contains one term for each combination $c_{t-1},\dots,c_0 \in \{0,1\}$, which is to say that the expanded sum contains one term for each number $k = [c_{t-1}c_{t-2}\cdots c_0]_2$ for $k = 0,\dots,2^t-1$. Thus, we can conclude that the expanded sum can indeed be expressed as
$$
\sum_{k=0}^{2^t - 1} e^{k\psi}|k\rangle,
$$
which is the desired result.
