Decompose a Hermitian Operator into Eigenvalues and Projectors Quantum Computing - A Gentle Introduction by Eleanor Rieffell and Wolfgang Polak states on p57 :

Any Hermitian operator $O$ with eigenvalues $\lambda_j$ can be written as $O = \sum_j \lambda_j P_j$ where $P_j$ are the projectors for the $\lambda_j$-eigenspaces of $O$

An example operator is:
$\begin{pmatrix}0 & 0 & 0 & 0\\0 & 1 & 0 & 0 \\0 & 0 & 2 & 0\\0 & 0 & 0 & 3\end{pmatrix}$
which can be considered as split into eigenvalues and projectors:


*

*0 $|00\rangle\langle00|$

*1 $|01\rangle\langle01|$

*2 $|10\rangle\langle10|$

*3 $|11\rangle\langle11|$


Is there a mathematical procedure (and a corresponding Mathematica function) which can be used to transform the Operator into the set of Projectors? The Eigensystem function will provide the eigenvalues and eigenvectors, but it's not clear to me how that result is related to the required Projectors (which in the example I've given are 4-by-4 matrices). My overall objective is that, given an Operator, I can determine which states a system may end up in after a measurement and what the classical probability of each result is.
 A: This is a great deal simpler than you think. I think you're probably just having one of those bad days where you forget a very basic fact.
Let $X$ be any vector written as a column, here one of the eigenvectors. Then the projector onto its direction is $\hat{X} \otimes \hat{X}^* = \hat{X}\,\hat{X}^\dagger$, where $\dagger$ is the complex conjugate transpose and $\hat{X} = X / \|X\|$ is the unit vector. This operator acts from the left on a state $Y$, so that the whole operation is 
$$Y\mapsto (\hat{X}\,\hat{X}^\dagger)\,Y = \hat{X}\,(\hat{X}^\dagger\,Y)$$
So $\hat{X}^\dagger\,Y$ is a scalar: the projection of $Y$ onto the unit eigenvector. This multiplies $ \hat{X}$ to give an eigenvector with the length of the projection.
Mathematica is a bit quirky here: If you write the vector $X$ as an array $X = \{x1,x2,x3\};$ then you'll either need to call 
$$\mathrm{TensorProduct}[X,\mathrm{Conjugate}[X]]/(X.\mathrm{Conjugate}[X])$$
(which makes perfect sense) or (the weird one) to use the conjugate transpose, you need to write $X$ as $X = \{\{x1\},\{x2\},\{x3\}\}$ and then the function $\mathrm{ConjugateTranspose}$ will work and your projector is 
$$X.\mathrm{ConjugateTranspose}[X]/(X.\mathrm{Conjugate}[X])$$ 
(you need to write $X$ as an array of one-element rows so that $\mathrm{ConjugateTranspose}$ can work)
