Solution (source code)

= Solution

Let $| -\rangle=(|0\rangle-|1\rangle)/\sqrt2$. After the Hadamards and the oracle, <Bernstein-Vazirani phase kickback> gives
$$
\boxed{
|\Phi_1\rangle
=\frac1{2^{n/2}}
\sum_{x\in\{0,1\}^n}
(-1)^{a\cdot x\oplus b}|x\rangle| -\rangle}.
$$