I'm going through a paper that uses quantum amplitude estimation, and one of the ingredients to the algorithms is an operator that flips the sign of a state based on the state of a control qubit. Basically,
$S_\psi |x\rangle = |x\rangle$ if least significant bit of $x$ is 0 and $-|x\rangle$ if it's 1..
Now, naively I would have thought that just applying the $Z$ gate to the qubit that represents the relevant bit of $x$ would achieve that, would it not? If my qubit starts out in state $\alpha |0\rangle + \beta |1\rangle$ then after applying $Z$ it'll be in state $\alpha |0\rangle - \beta |1 \rangle$, which is exactly what I need.
The paper, on the other hand, says we need to include an ancilla bit, use the $X$ gate to prepare it in state $1$, then act on this ancilla qubit with a controlled $Z$ gate (controlled by the qubit representing the lsb of $x$) and then apply another $X$ gate to "uncompute" the ancilla.
But if I follow along with that logic, I'm just left with the ancilla unchanged and essentially $Z$ being applied to my original qubit, just as I had in the "naive" implementation.
Am I missing something subtle here or were the authors of the paper overthinking?
Later on, that whole operation that I just describes needs to be in turn controlled via some other bits, but I don't see how my naive implementation would not be able to be turned into a controlled one...
Reference: Section V in the paper "Credit Risk Analysis Using Quantum Computers". arxiv:19007.03044v1 [quant-ph] 5 Jul 2019 https://arxiv.org/abs/1907.03044