# Measuring qubits vs measuring operators

I'm having trouble unifying these two ideas. When I read examples using, say, qiskit, it's typical to measure a qubit, so that to find the probability of measuring a state $$|\psi \rangle$$ in the state $$|x\rangle$$ is $$p(|x \rangle) = (\langle x | \psi \rangle)^2$$.

But when I read quantum computing textbooks, they usually refer to some observable that is getting measured. So what is the operator that gets measured when we "measure a qubit"? Is it the identity operator or something?

"Measure qubit $$q$$" = "Measure the $$Z_q$$ operator"
More generally, "measure the operator $$P$$" can be operationalized as "apply a sequence operations which sends $$P \rightarrow Z_q$$ then measure qubit $$q$$ then undo the operations to restore $$Z_q \rightarrow P$$.
• What exactly is the $Z_q$ operator? The Pauli $Z$ matrix? Aug 17, 2022 at 18:07
• Exactly, measuring a qubit implicitly means measuring the Pauli-$Z$ observable on the $q$th qubit. This is because $Z$ is already diagonal in the computational basis. Aug 17, 2022 at 19:10