linalg(deprecated)/trace - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

# Online Help

###### All Products    Maple    MapleSim

Home : Support : Online Help : linalg(deprecated)/trace

linalg(deprecated)

 trace
 the trace of a matrix

 Calling Sequence trace(A)

Parameters

 A - square matrix

Description

 • Important: The linalg package has been deprecated. Use the superseding command LinearAlgebra[Trace], instead.
 - For information on migrating linalg code to the new packages, see examples/LinearAlgebraMigration.
 • The function trace(A) computes the trace of the matrix A. The trace of a matrix A is defined to be the sum of the diagonal elements of A.
 • The command with(linalg,trace) allows the use of the abbreviated form of this command.

Examples

Important: The linalg package has been deprecated. Use the superseding command LinearAlgebra[Trace], instead.

 > $\mathrm{with}\left(\mathrm{linalg}\right):$
 > $\mathrm{trace}\left(\mathrm{array}\left(\left[\left[1,2\right],\left[1,4\right]\right]\right)\right)$
 ${5}$ (1)
 > $A≔\mathrm{matrix}\left(3,3,\left[a,b,c,d,e,f,g,h,i\right]\right)$
 ${A}{≔}\left[\begin{array}{ccc}{a}& {b}& {c}\\ {d}& {e}& {f}\\ {g}& {h}& {i}\end{array}\right]$ (2)
 > $\mathrm{trace}\left(A\right)$
 ${a}{+}{e}{+}{i}$ (3)

 See Also