I am trying to understand Shor's algorithm for a personal research project. I am currently going through quantum phase estimation, and have came accross something I'm struggling to understand in the Qiskit textbook. Specifically the following step of the application of controlled unitary operators:
$$ |\psi_2⟩=\frac{1}{2^{\frac{n}{2}}}(|0⟩+e^{2i \pi\theta2^{n-1}}|1⟩)\otimes\cdots\otimes(|0⟩+e^{2i \pi\theta2^0}|1⟩)\otimes|\psi⟩=\frac{1}{2^{\frac{n}{2}}}\sum_{k=0}^{2^n-1}e^{2i\pi\theta k}|k⟩\otimes|\psi⟩ $$ where k denotes the integer representation of n-bit binary numbers. I'm generally not having too much trouble understanding things so far, however something about this is confusing me a lot. Can anyone explain how this simplification is being done? I'm sure it's something small I'm overlooking but any help is appreciated.