I have a symmetric positive semi definite matrix K. The question is, is the decomposition U and D unique? Where $K=UDU^T$ and $D=diag(\lambda_1, \lambda_2,...,\lambda_n)$ where the lambdas are ordered.
Or more to the point is there a different eigen vector space (matrix U) that will give a different diagonal matrix D.
Ignoring the permutations, your decomposition will still not be unique if there is more then one zero eigenvalue. Let
$$U = \begin{bmatrix} U_1 & U_0 \end{bmatrix}, \quad D = \operatorname{diag}(D_1, 0),$$
such that $D_1$ is nonsingular diagonal matrix of order $r$ (as in rank), and $U_1$ has $r$ columns. Then
$$U D U^T = \begin{bmatrix} U_1 & U_0 \end{bmatrix} \operatorname{diag}(D_1, 0) \begin{bmatrix} U_1^T \\ U_0^T \end{bmatrix} = U_1 D_1 U_1^T.$$
In other words, the columns of $U_0$ can be any set of orthonormal vectors that are also orthogonal to the columns of $U_1$.
A similar thing happens if some other eigenvalues is repeated (think of the identity matrix as the simplest example), but I'll leave that case to you.
However, the diagonal factor $D$ will always be the same, as its elements form the set of the matrix' eigenvalues (ordered), which is an invariant of a similarity.