Operator functions: why is $f(A)$ uniquely defined? In Nielsen and Chuang, they write: Let $A = \sum_a a|a\rangle \langle a|$ be the spectral decomposition of $A$. Define $f(A) = \sum_a f(a) |a \rangle \langle a|$. Apparently this is uniquely defined. I'm having trouble seeing why this is.
If we used some other orthonormal basis of eigenvectors of $A$, say $A = \sum_b b|b\rangle \langle b|$, then why is $\sum_a f(a)|a\rangle \langle a| = \sum_b f(b)|b\rangle \langle b|$? I think there must be some property about eigenvectors sharing the same eigenvalues, but I'm unsure about what I'm missing.
 A: It's a standard result of linear algebra that the spectral decomposition of an operator is unique (up to a trivial reordering of the eigenvalues/vectors). If you could write $A$ as both $\sum_a a | a \rangle \langle a |$ and $\sum_b b | b \rangle \langle b |$, with the $a$s and $b$s nontrivially related, then this would violate the uniqueness of the eigendecomposition.
If you were to work in an orthonormal basis other than the eigenbasis, then the operator wouldn't be diagonal, but would look like $A = \sum_{n,m} c_{nm} | n \rangle \langle m |$.  You are correct that letting $c_{nm} \to f(c_{nm})$ would be basis-dependent and generally not particularly interesting or meaningful.
A: This stems from a misformulation of the spectral theorem. In a proper mathematical text one never sees it stated using a basis precisely because that is not unique. Physicists often assume "for the sake of simplicity" a nondegenerate spectrum, where every eigenvalue has an algebraic multiplicity of 1, and consider nontrivial multiplicities a degenerate case that can be covered if needed.
The spectral theorem gives a unique decomposition using projectors instead of $|n〉〈n|$, which for finite-dimensional cases looks like
$$A = \sum_{α ∈ σ(A)} α P_α,$$
where $\{P_α\}$ are mutually orthogonal projectors. The application of an analytic function $f$ is then defined as
$$f(A) = \sum_{α ∈ σ(A)} f(α) P_α$$
and the uniqueness naturally follows: indeed, there's no point where this could become non-unique.
If you went one step further and decomposed each of the projectors
$$P_α = \sum_{k=1}^{ν_α} |v_α^{(k)}〉〈v_α^{(k)}|$$
in some orthonormal basis of its range, you'd obtain the decomposition used by Nielsen and Chuang, but as you noted, it would no longer be unique. (The eigenvalues still are, and their ordering does not matter.) The trick why this also works is then to note that if you group the summands putting ones using the same eigenvalue in an inner sum,
$$A = \sum_a a|a〉〈a| = \sum_{α ∈ σ(A)} α \sum_{k=1}^{ν_α} |a_α^{(k)}〉〈a_α^{(k)}|,$$
where $\{|a_α^{(k)}〉\}$ are $ν_α$ of the original eigenvectors $|a〉$ all corresponding to the eigenvalue $α$, then also
$$f(A) = \sum_a f(a)|a〉〈a| = \sum_{α ∈ σ(A)} f(α) \sum_{k=1}^{ν_α} |a_α^{(k)}〉〈a_α^{(k)}|.$$
By obtaining the same $f(a)$ for all $a$ which corresponded to the same eigenvalue $α$, the grouping is not violated, and once we agree that
$$\sum_{k=1}^{ν_α} |a_α^{(k)}〉〈a_α^{(k)}|$$
is the projector $P_α$, then
$$f(A) = \sum_{α ∈ σ(A)} f(α) P(α),$$
which as we know from above is the unambiguous definition.
