The HHL algorithm prepares the output state $|x\rangle$. However, we cannot efficiently measure the state directly to get its components. Instead, we can construct an operator $M$ to find $\langle x|M|x\rangle$ (the expectation value of $M$ on $|x\rangle$). There's been some discussion on this site on what information can be extracted from $|x\rangle$ and how the operator $M$ can be constructed so that $\langle x|M|x\rangle$ yields the desired quantity and the operator is measurable.
See
- What useful information can be efficiently extracted from solutions provided by the HHL-algorithm?
- Which observable $M$ provides the Absolute Average of a statevector?
- HHL and choice of observable for calculating the expectation value thereof (with the answer by Adam Zalcman being very insightful)
My question is this:
Can a diagonal matrix $M$ with only one non-zero element (e.g. $1$) be implemented as a measurable observable?
One example of such a matrix would be $$M=\begin{pmatrix}1 & 0 & \cdots & 0 \\ 0 & 0 & \cdots & 0 \\ \vdots & \vdots & \ddots &\vdots \\ 0 & 0 & \cdots & 0 \\ \end{pmatrix}$$
If $M$ is usable as an observable, could we not use that to extract individual components of $|x\rangle$? (Obviously extracting all or linearly many components would destroy the computational speedup of HHL)