adding error class for failed diagonalization
throw NoDiagonalizationError if diagonalization failed