TRACE INDEX

TRACE _ _ _ _ _ _ _ _ _ _ _ _ operator

The trace operator finds the trace of its matrix argument.

syntax:

trace(<expression>) or trace <simple\_expression>

<expression> or <simple\_expression> must evaluate to a square matrix.

examples:


matrix a; 

a := mat((x1,y1),(x2,y2))$ 

trace a; 

  X1 + Y2

The trace is the sum of the entries along the diagonal of a square matrix. Given a non-matrix expression, or a non-square matrix, trace returns an error message.