Conditions for Existence of a Diagonal Representation for Quantum Mechanical Operators