- #1
Emil_M
- 46
- 2
Homework Statement
Consider a general function ##f:\{0,1\}^n \rightarrow \{0,1\}## (not necessarily constant or balanced). The function gives ##f(x)=0## for a portion##z## of the different possible inputs ##x\in\{0,1\}^n##, and ##f(x)=1## for the rest of the inputs. Consider that we construct the Deutsch-Josza algorithm for this function. Calculate the probability, that the algorithm gives the answer "The function is constant" and the probability that it gives "The function is balanced".
##f(x)## is balanced= the number of inputs for which the function takes values ##0## and ##1## are the same .
##f(x)## is balanced= ##f(x)=0## for all inputs or ##f(x)=1## for all inputs.
Homework Equations
At the end of the Deutsch-Josza algorithm, the wave function is in the sate
[tex]
|\psi\rangle=\sum_{y\in \{0,1\}^n} \left( \frac{1}{2^n} \sum_{x\in \{0,1\}^n} (-1)^{f(x)+x\cdot y} \right)
[/tex]
where ##x\cdot y= \sum_{k=1}^n x_k y_k \;(\mod 2)##
The Attempt at a Solution
The amplitude associated with the classical state ##|0^n\rangle## is
[tex]
\alpha=\frac{1}{2^n}\sum_{x\in \{0,1\}^n} (-1)^{f(x)}
[/tex]
Thus
[tex]\begin{align*}
P(constant)&=\lvert \frac{1}{2^n} \sum_{x\in \{0,1\}^n, i=1}^z (-1)^{f_0(x)}+\frac{1}{2^n} \sum_{x\in \{0,1\}^n, j=1}^{2^n-z} (-1)^{f_1(x)}\rvert^2\\
&=\lvert \frac{1}{2^n} \left(z-2^n+z\right)\rvert^2=\lvert\frac{2z-2^n}{2^n}\rvert^2
\end{align*}
[/tex]However, I struggle finding the expression for ##P(balanced)##.
My attempt is finding the classical state ##|1^n\rangle##:
[tex]\begin{align*}
P(balanced)&= \lvert( \frac{1}{2^n} \sum_{x\in \{0,1\}^n} (-1)^{f(x)+\sum_{k=1}^n x_k}\rvert^2\\
&=\lvert \frac{1}{2^n}\sum_{x\in \{0,1\}^n, i=1}^z (-1)^{\sum_{ k=1}^n x_k} + \frac{1}{2^n}\sum_{x\in \{0,1\}^n, j=1}^{2^n-z} (-1)^{1+\sum_{k=1}^n x_k}\rvert^2
\end{align*}[/tex]
This should be ##1## for ##z=\frac{2^n}{n}## and ##0## for ##z=2^n##. However, I don't think this result is correct.
Thank you so much!