logo

대각합 📂Matrix Algebra

대각합

Definition

Let n×nn\times n be a matrix given as follows.

A=[a11a12a1na21a22a2nan1an2ann] A= \begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{n1} & a_{n2} & \cdots & a_{nn} \end{bmatrix}

The sum of the diagonal elements of AA is defined as the trace of AA and is denoted as follows.

tr(A)=Tr(A)=a11+a22++ann=i=1naii \text{tr}(A)=\text{Tr}(A)=a_{11}+a_{22}+\cdots + a_{nn}=\sum \limits_{i=1}^{n} a_{ii}

Explanation

The trace can also be considered a function. Let Mn×n(R)M_{n\times n}(\mathbb{R}) be the set of n×nn\times n matrices with real number components. Then Tr\text{Tr} is a function defined as follows.

Tr:Mn×n(R)R,Tr(A)=i=1naii \text{Tr} : M_{n\times n} (\mathbb{R}) \to \mathbb{R},\quad \text{Tr}(A)=\sum \limits_{i=1}^{n} a_{ii}

If the trace is a function, there’s nothing to stop us from differentiating it.

Properties

Let A=[aij]A = [a_{ij}], B=[bij]B=[b_{ij}], CC be n×nn \times n matrices, and let kk be a constant.

(a) The trace of a scalar multiple and the scalar multiple of a trace are equal.

Tr(kA)=kTr(A) \text{Tr}(kA)= k\text{Tr}(A)

(b) The trace of a sum and the sum of traces are equal.

Tr(A+B)=Tr(A)+Tr(B) \text{Tr}(A+B)=\text{Tr}(A)+\text{Tr}(B)

(a)+(b) The trace is linear.

Tr(kA+B)=kTr(A)+Tr(B) \text{Tr}(kA+B)=k\text{Tr}(A)+\text{Tr}(B)

(c) The traces of ABAB and BABA are equal.

Tr(AB)=Tr(BA) \text{Tr}(AB) = \text{Tr}(BA)

  • (c’) Cyclic Property: From this fact, we can see that the following equation holds.

Tr(ABC)=Tr(BCA)=Tr(CAB) \text{Tr}(ABC) = \text{Tr}(BCA) = \text{Tr}(CAB)

  • (c") In fact, this also holds for any ARn×kA \in \mathbb{R}^{n \times k} and BRk×nB \in \mathbb{R}^{k \times n}.

(d) The traces of AA and its transpose matrix ATA^{\mathsf{T}} are equal.

Tr(A)=Tr(AT) \text{Tr}(A) = \text{Tr}(A^{T})

(e) The following holds.

i,kaikbki=Tr(AB)=Tr(BTAT) \sum\limits_{i,k} a_{ik}b_{ki} = \text{Tr}(AB) = \text{Tr}(B^{\mathsf{T}} A^{\mathsf{T}})

i,kaikbik=Tr(ABT)=Tr(ATB) \sum\limits_{i,k} a_{ik}b_{ik} = \text{Tr}(AB^{\mathsf{T}}) = \text{Tr}(A^{\mathsf{T}} B)

Proof

(e)

The (i,j)(i,j) component of the product of matrices AA, BB can be expressed as follows.

[AB]ij=kaikbkj [AB]_{ij} = \sum\limits_{k} a_{ik}b_{kj}

Since the trace is the sum of components where i=ji=j,

Tr(AB)=i,kaikbki \Tr(AB) = \sum\limits_{i,k} a_{ik}b_{ki}