# Is the measurement of the second register in Simon's algorithm superfluous?

I often see Simon's algorithm with two $$n$$-ary measurement gates for the two computations (Hadamard in upper part, $$f$$ in lower part). For example, this image taken from wikipedia. In the same article, the explanation states that the state immediatly before the measurement is $$\sum_{y \in \{0,1\}^n} \left( \lvert y \rangle \otimes \left( \frac{1}{2^n} \sum_{x \in \{0,1\}^n} ((-1)^{x\cdot y} \lvert f(x) \rangle ) \right) \right)$$ and the article proceeds to evaluate $$\left( \frac{1}{2^n} \sum_{x \in \{0,1\}^n} ((-1)^{x\cdot y} \lvert f(x) \rangle ) \right)$$ to determine the probability of measuring one particular value for $$y$$.

I am wondering, the evaluation seems to imply that the second measurement, i.e., on the bottom wire, is actually superfluous. In fact, what I am wondering is that I suspect it would be rather dumb to do it that way, because then we have to take care of the probability to measure one particular value of $$f(x)$$, i.e., a combined state $$\lvert y \rangle \otimes \lvert f(x) \rangle$$, where we have $$2^n$$ ($$s$$ is zero) or $$2^{n-1}$$ ($$s$$ is non-zero) different values for $$f(x)$$. And doing so, i.e., reading out $$f(x)$$ would give us a rather high chance to measure two values for $$y$$ in a row (which we want to avoid, as at the end we want to have $$n-1$$ independent values $$y$$) as many different values of $$f(x)$$ share the same $$y$$ value in the first register.

Am I correct? And if so, why the second measurement gate then? Is there any reason?

• Sorry, still a beginner here. But what I was asking more specifically, if I measure each wire I get a state $\lvert y \rangle \otimes \lvert f(x) \rangle$ at the end with probabilty $1/2^{n-1} 1/2^{n-1}$ ($s$ non-zero). However, I am only interested in the $y$'s and with measuring $f(x)$ I might get two times the same $y$ with probability $2^{n-1}$ if I measure the whole state. But if I only measure $y$, I get a single $y$ with probability $1/2^{n-1}$. Is this not an improvement "probablity-wise"? Is it clear what I am asking... Jan 1 at 20:37
• So then, what is the problem with the reasoning that I have to make more calls to the procedure if I measure $f(x)$? Jan 1 at 21:10