trace -package:streamly package:matrix

Sum of the elements in the diagonal. See also getDiag. Example:
( 1 2 3 )
( 4 5 6 )
trace ( 7 8 9 ) = 15