Quadratic Boolean phase cancellation (source code)

= Quadratic Boolean phase cancellation
{title2=$C_Z^a(-1)^{axy+bx+cy+d}=(-1)^{bx+cy+d}$}

For a two-variable <Boolean quantum oracle>, <quantum phase kickback> produces the phase $(-1)^{axy+bx+cy+d}$ on $|xy\rangle$. If the quadratic coefficient $a$ is known, apply the <Controlled-Z gate> to the power $a$: its phase $(-1)^{axy}$ cancels the quadratic term. A <Walsh-Hadamard transform> then maps the remaining phase state to $(-1)^d|bc\rangle$. The constant term is only a <global phase>, and both linear coefficients are read in one <quantum measurement in the computational basis>.