I've seen the uncertainty of $A$ written as $$ (\Delta A)^2 = \big\langle (A - \langle A \rangle)^2 \big\rangle\,. $$ But what does this even mean since $ A $ is an operator and $ \langle A \rangle $ is a scalar? How can we compute the difference of the two?
2 Answers
For any vector $v$ and scalar $\alpha$, we have $\alpha v = \alpha I v$, so multiplication by a scalar $\alpha$ behaves the same way as the linear operator $\alpha I$. Therefore, we interpret $A - \langle A \rangle$ as $A - \langle A \rangle I$.
Note that
$$\big(Z - \langle Z \rangle \big)^2 = Z^2 - 2Z \langle Z \rangle + \langle Z \rangle^2 $$
And therefore $$ \langle \big(Z - \langle Z \rangle \big)^2 \rangle = \langle Z^2 - 2Z \langle Z \rangle + \langle Z \rangle^2 \rangle $$
Then by linearity, we have
\begin{align} \langle Z^2 - 2Z \langle Z \rangle + \langle Z \rangle^2 \rangle &= \langle Z^2 \rangle - \langle 2Z \langle Z \rangle \rangle + \langle \langle Z \rangle^2 \rangle \\ &= \langle Z^2 \rangle - (2\langle Z \rangle) \langle Z \rangle + \langle Z \rangle^2 \\ &= \langle Z^2 \rangle - 2 \langle Z \rangle^2 + \langle Z\rangle^2 \\ &= \langle Z^2 \rangle - \langle Z \rangle^2 \end{align}
So therefore,
$$ (\Delta Z)^2 = \big(Z - \langle Z \rangle \big)^2 = \langle Z^2 \rangle - \langle Z \rangle^2 $$
Which is what you see if you search up Variance