I have a system with some number of qubits. To make it simple, but non-trivial, let's say that number is 3. I want to know the parity of the system's state (meaning I can assume that each individual qubit is either $|0\rangle$ or $|1\rangle$). In particular, I should do this using a single application of a c-$Z^{\otimes n}$ gate (where in this case $n=3$ and the 'c-' prefix indicates that the gate is 'controlled'). I've looked it up, and the solution appears to be something like this:
I've seen some parity implementations using cascading CNOT
gates on a static $|0\rangle$ input, and that makes perfect sense to me. As you can see by the '?'s in this image, though, I don't get what this circuit is doing at all. The measurement seems to only apply to the bottom wire, but how could this ever output anything but a measurement of $H|+\rangle=|0\rangle$ or $0$ 100% of the time?