The trace of an nxn matrix `A` is the sum of the diagonal entries `A_11 , A_22 , ... , A_(n n)`. So `tr(A)=sum_(i=1)^n A_(ii)`.
For the 3x3 matrix
A = `[[A_11,A_12, A_13],[A_21,A_22,A_23],[A_31,A_32,A_33]]`,
the trace is given by `A_11 +A_22+ A_33`.
The trace of a matrix is useful in determining the eigenvalues (`λ_i`) of the matrix. For any matrix, `sum λ_i = sum A_(ii) = tr(A)`.