Link Search Menu Expand Document

Diagonal of a Matrix / Trace / Triangular Matrix

Table of contents
  1. Principal diagonal
  2. Trace
    1. Invariant under Cyclic Permutation
  3. Diagonal Matrix
    1. Properties of a Diagonal Matrix
  4. Triangular Matrix
    1. Upper Triangular Matrix
    2. Lower Triangular Matrix
  5. Rectangular Diagonal Matrix

Principal diagonal

The principal diagonal of a square matrix is the diagonal from the upper left to the lower right.

{aiji=j}

Also called the main diagonal.

Each element aii is called a principal diagonal element.


Trace

A trace of a square matrix A is the sum of its principal diagonal elements:

tr(A)=i=1naii

For square matrices A and B:

  • tr(A+B)=tr(A)+tr(B)
  • tr(AB)=tr(BA)

    This property also holds for non-square matrices.

  • tr(λA)=λtr(A)
  • tr(In)=n

Invariant under Cyclic Permutation

Coming from the above properties, for matrices A,B,C, whose product is defined but are not necessarily square matrices,

tr(ABC)=tr(BCA)=tr(CAB)


Diagonal Matrix

A diagonal matrix is a square matrix whose non-principal diagonal elements are all zero.

A=[a11000a22000ann]

Often denoted by:

A=diag(a11,a22,,ann)

Properties of a Diagonal Matrix

For diagonal matrices A=diag(a11,ann) and B=diag(b11,bnn):

  • A+B=diag(a11+b11,,ann+bnn)
  • AB=diag(a11b11,,annbnn)

Triangular Matrix

For both upper and lower triangular matrices, if the principal diagonal elements are all 1, then the matrix is called a unit (upper/lower) triangular matrix.

Upper Triangular Matrix

An upper triangular matrix is a square matrix whose non-principal diagonal elements below the principal diagonal are all zero.

Upper triangular matrix, often denoted by Un is:

Un=[uij]n×nwherei>j,uij=0

Example:

[123045006]

Lower Triangular Matrix

An lower triangular matrix is a square matrix whose non-principal diagonal elements above the principal diagonal are all zero.

Lower triangular matrix, often denoted by Ln is:

Ln=[lij]n×nwherei<j,lij=0

Example:

[100230456]

Rectangular Diagonal Matrix

Sometimes you might see people say rectangular diagonal matrix which refers to a non-square matrix that constains a diagonal matrix as a submatrix, and the rest of the elements are all zero.

Suppose ARm×n.

If m>n:

A=[a11000a22000ann000000]

If m<n:

A=[a1100000a2200000amm00]

You’ll see this in the context of singular value decomposition.

aii can be zero.