the quantum world: is $f$ balanced or constant?

57 Views Asked by At

Why here on the page 15, the fact whether $f$ is constant or balanced is derived from the value of $f$ at $0$ only ?

1

There are 1 best solutions below

9
On BEST ANSWER

It's not just $f(0)$, we should also take into account the text before the formulas, telling us that $(3)$ and $(4)$ are for the case of a constant $f$ while $(5)$ and $(6)$ are for a balanced $f$.

We can rewrite slide 15 as follows:

The final state is $\frac12 (-1)^{f(0)}(|0\rangle+(-1)^{f(0)\oplus f(1)}|1\rangle)(|0\rangle-|1\rangle)$ -- this is eq. $(2)$. (Well, not the ultimately final state, but the state right after applying $U_f$.)

Consider 4 possibilities for $f(0)$ and $f(1)$ and substitute these values to eq. $(2)$:

  1. $f$ is constant and $f(0)=0$, so $f(1)=0$; then eq. $(2)$ becomes eq. $(3)$, and the final state is $\frac12 (|0\rangle+|1\rangle)(|0\rangle-|1\rangle)$;
  2. $f$ is constant and $f(0)=1$, so $f(1)=1$; then eq. $(2)$ becomes eq. $(4)$, and the final state is $-\frac12 (|0\rangle+|1\rangle)(|0\rangle-|1\rangle)$;
  3. $f$ is balanced and $f(0)=0$, so $f(1)=1$; then eq. $(2)$ becomes eq. $(5)$, and the final state is $\frac12 (|0\rangle-|1\rangle)(|0\rangle-|1\rangle)$;
  4. $f$ is balanced and $f(0)=1$, so $f(1)=0$; then eq. $(2)$ becomes eq. $(6)$, and the final state is $-\frac12 (|0\rangle-|1\rangle)(|0\rangle-|1\rangle)$.

Note that when we measure the 1st qubit, we don't learn anything about $f(0)$, however we can determine if $f$ is constant (the qubit is in the state $|0'\rangle$, cases $(3)$ and $(4)$) or balanced ($|1'\rangle$, cases $(5)$ and $(6)$).