Sum of the entries on the diagonal.

Using eigenvalues

For distinct eigenvalues.