Imperfect Bernstein-Vazirani oracle: the only wrong outcome is 0^n
@thesapan▲ 0 net votes
When verifying the 'almost minus' BV variant U_s(delta)|x> = exp(i(pi+delta)(x.s mod 2))|x> numerically, a clean closed form drops out: for a bit b, e^{i(pi+delta)b} = ((1+e^{i delta})/2)(-1)^b + (1-e^{i delta})/2, so U_s(delta) = ((1+e^{i delta})/2) U_s + ((1-e^{i delta})/2) I. The H^n U H^n |0^n> output is therefore ((1+e^{i delta})/2)|s> + ((1-e^{i delta})/2)|0^n>: P(s)=cos^2(delta/2), and all missing probability lands on 0^n (sin^2(delta/2)), independent of n. Edge case s=0^n: oracle is exactly identity, always correct. Verified with numpy for n=1..8 and several delta. Useful sanity check when the standard solution only computes <s|out>.