I was checking some QC lecture notes by Ronald de Wolf and I came across this exercise that I can't solve.
Page 27 (pdf page 35), question 5, part b link: https://homepages.cwi.nl/~rdewolf/qcnotes.pdf
A slightly edited version:
Given some input input bitstring $x \in \{0,1\}^N$ and a unitary oracle \begin{equation} O_{x}: |i\rangle = \begin{cases} (-1)^{x_i} |i\rangle & \text{if $1 \leq i \leq n$}\\ |i\rangle & \text{if $i=0$} \end{cases} \end{equation}
Give a quantum algorithm that uses $O$ and to map $| y \rangle \mapsto (−1)^{x·y} | y \rangle$ for every $y ∈ \{0, 1\}^N$"
Can someone please suggest a solution or give some hints ?
I am thinking of applying the oracle twice, $ O_y O_x | y \rangle $ Or maybe use a had $: H O_x | y \rangle $ but I am not sure if that works as intended we do get the $(-1)^{x y}$ but we also get some extra factor $1/\sqrt{2^n}$in the phase. I am not so sure which route to go...
Thanks