a dense subset with respect to the Zariski topology: the non-diagonalizable matrices lie inside the vanishing set of the discriminant of the characteristic polynomial, which is a hypersurface. From that follows also density in the usual (strong) topology given by a norm. The same is not true over The Jordan–Chevalley decomposition expresses an operator as the sum of its semisimple (i.e., diagonalizable) part and its nilpotent part. Hence, a matrix is diagonalizable if and only if its nilpotent part is zero. Put in another way, a matrix is diagonalizable if each block in its Jordan form has no nilpotent part; i.e., each "block" is a one-by-one matrix. Diagonalization If a matrix can be diagonalized, that is, then: Writing as a block matrix of its column vectors the above equation can be rewritten as So the column vectors of are right eigenvectors of and the corresponding diagonal entry is the corresponding eigenvalue. The invertibility of also suggests that the eigenvectors are linearly independent and form a basis of This is the necessary and sufficient condition for diagonalizability and the canonical approach of diagonalization. The row vectors of are the left eigenvectors of When a complex matrix is a Hermitian matrix (or more generally a normal matrix), eigenvectors of can be chosen to form an orthonormal basis of and can be chosen to be a unitary matrix. If in addition, is a real symmetric matrix, then its eigenvectors can be chosen to be an orthonormal basis of and can be chosen to be an orthogonal matrix. For most practical work matrices are diagonalized numerically using computer software. Many algorithms exist to accomplish this. Simultaneous diagonalization A set of matrices is said to be simultaneously diagonalizable if there exists a single invertible matrix such that is a diagonal matrix for every in the set. The following theorem characterizes simultaneously diagonalizable matrices: A set of diagonalizable matrices commutes if and only if the set is simultaneously diagonalizable. The set of all diagonalizable matrices (over with is not simultaneously diagonalizable. For instance, the matrices are diagonalizable but not simultaneously diagonalizable because they do not commute. A set consists of commuting normal matrices if and only if it is simultaneously diagonalizable by a unitary matrix; that is, there exists a unitary matrix such that is diagonal for every in the set. In the language of Lie theory, a set of simultaneously diagonalizable matrices generates a toral