trace(A)
Returns the trace of matrix A.
See also rank nullity
Example
a = ( 1, 3 ; 5, 2 )
1 3
5 2
trace( a )
3