Trace

The two equally useful definitions of the trace of a square matrix \(A \in \mathbb{F}^{n \times n}\) are

\[\mbox{tr}(A) = \sum_{i=0}^{n-1} A(i,i) = \sum_{i=0}^{n-1} \lambda_i,\]

where \(\lambda_i\) is the i’th eigenvalue (counting multiplicity) of \(A\).

Clearly the former equation is easier to compute, but the latter is an important characterization.

Python API

TODO

C++ API

T Trace(const Matrix<T> &A)
T Trace(const AbstractDistMatrix<T> &A)

C API

ElError ElTrace_i(ElConstMatrix_i A, ElInt* trace)
ElError ElTrace_s(ElConstMatrix_s A, float* trace)
ElError ElTrace_d(ElConstMatrix_d A, double* trace)
ElError ElTrace_c(ElConstMatrix_c A, complex_float* trace)
ElError ElTrace_z(ElConstMatrix_z A, complex_double* trace)
ElError ElTraceDist_i(ElConstDistMatrix_i A, ElInt* trace)
ElError ElTraceDist_s(ElConstDistMatrix_s A, float* trace)
ElError ElTraceDist_d(ElConstDistMatrix_d A, double* trace)
ElError ElTraceDist_c(ElConstDistMatrix_c A, complex_float* trace)
ElError ElTraceDist_z(ElConstDistMatrix_z A, complex_double* trace)