Topics
Let (square matrix), the trace of (sum of diagonal elements) is defined as,
Properties
- Linear mapping
- Invariant under cyclic permutations i.e.
- Invariant under transpose i.e.
- For a symmetric matrix , we have (sum of eigenvalues)
- For a symmetric matrix, by spectral decomposition
- Using the cyclic permutation property of trace, we have:
from numpy import trace
A = np.array([[1,2,3],
[4,5,6],
[7,8,9]])
t = trace(A) # 1 + 5 + 9 = 15