# Nakafa Learning Content

> For AI agents: use [llms.txt](https://nakafa.com/llms.txt) for the site index. Markdown versions are available by appending `.md` to content URLs or sending `Accept: text/markdown`.

URL: https://nakafa.com/en/subjects/ai-ds/linear-methods/symmetric-hermitian-matrix
Source: https://raw.githubusercontent.com/nakafaai/nakafa.com/refs/heads/main/packages/contents/material/lesson/ai-ds/linear-methods/symmetric-hermitian-matrix/en.mdx

Learn symmetric and Hermitian matrices, including real eigenvalues, orthogonal eigenvectors, quadratic forms, and diagonalization.

---

## Definitions of Symmetric and Hermitian

In linear algebra, we recognize two special types of matrices that have very interesting properties. Imagine a mirror that perfectly reflects objects. Symmetric and Hermitian matrices have a similar mathematical "mirror" property.

A real square matrix $$A \in \mathbb{R}^{n \times n}$$ is called **symmetric** if it equals its transpose:

Visible text: A real square matrix is called **symmetric** if it equals its transpose:

```math
A^T = A
```

Whereas a complex square matrix $$A \in \mathbb{C}^{n \times n}$$ is called **Hermitian** if it equals its adjoint:

Visible text: Whereas a complex square matrix is called **Hermitian** if it equals its adjoint:

```math
A^H = A
```

Let's look at an example to understand this concept more clearly:

```math
A = \begin{pmatrix} 1 & 2 & 3 \\ 2 & 4 & 5 \\ 3 & 5 & 6 \end{pmatrix}
```

Notice that the element at position $$(i,j)$$ is the same as the element at position $$(j,i)$$. For example $$a_{12} = a_{21} = 2$$ and $$a_{13} = a_{31} = 3$$.

Visible text: Notice that the element at position is the same as the element at position . For example and .

## Relationship Between Symmetric and Hermitian

Every real symmetric matrix is actually also a complex Hermitian matrix. Why is that? Because when we consider a real matrix as a complex matrix, the complex conjugate of a real number is the number itself.

> Real symmetric matrices are a special case of complex Hermitian matrices.

This means all properties that apply to Hermitian matrices also apply to symmetric matrices. However, symmetric matrices have the additional advantage that all their elements are real.

## Diagonal of Hermitian Matrices

One interesting property of Hermitian matrices is that all their diagonal elements are always real numbers. Let's see why this happens.

For a Hermitian matrix $$A \in \mathbb{C}^{n \times n}$$, we have $$A^H = A$$. This means for every diagonal element:

Visible text: For a Hermitian matrix , we have . This means for every diagonal element:

```math
a_{ii} = \overline{a_{ii}}
```

Because $$a_{ii} = \overline{a_{ii}}$$, then $$a_{ii} \in \mathbb{R}$$ for all $$i$$.

Visible text: Because , then for all .

So, even though Hermitian matrices can have complex elements off the diagonal, their diagonal elements are definitely real. This is a direct consequence of the Hermitian definition.

## Quadratic Forms

Symmetric and Hermitian matrices have a special feature in terms of quadratic forms. Let's see how they work with vectors.

If we have a symmetric matrix $$A \in \mathbb{R}^{n \times n}$$ and a vector $$x \in \mathbb{R}^n$$, then we can form a quadratic function:

Visible text: If we have a symmetric matrix and a vector , then we can form a quadratic function:

Component: MathContainer
Children:

```math
q : \mathbb{R}^n \to \mathbb{R}
```

```math
q(x) = x^T A x
```

For a Hermitian matrix $$A \in \mathbb{C}^{n \times n}$$, the result $$x^H A x$$ always produces a real number, even though $$A$$ and $$x$$ are complex.

Visible text: For a Hermitian matrix , the result always produces a real number, even though and are complex.

Let's prove why this happens:

Component: MathContainer
Children:

```math
x^H A x = x^H A x
```

```math
= (x^H A x)^H
```

```math
= x^H A^H (x^H)^H
```

```math
= x^H A^H x
```

```math
= x^H A x
```

Because $$x^H A x = (x^H A x)^H$$, then $$x^H A x$$ is a real number.

Visible text: Because , then is a real number.

So we get the quadratic form for the complex case:

Component: MathContainer
Children:

```math
q : \mathbb{C}^n \to \mathbb{R}
```

```math
q(x) = x^H A x
```

## Basic Vector Properties

Before discussing eigenvalues, let's understand the basic properties of vectors that we will use. For a vector $$x \in \mathbb{R}^n$$ or $$x \in \mathbb{C}^n$$, we have:

Visible text: Before discussing eigenvalues, let's understand the basic properties of vectors that we will use. For a vector or , we have:

Component: MathContainer
Children:

```math
x^T x \geq 0 \text{ and } x^H x \geq 0
```

```math
x^T x = 0 \Leftrightarrow x = 0
```

```math
x^H x = 0 \Leftrightarrow x = 0
```

This is because:

Component: MathContainer
Children:

```math
x^T x = \sum_{k=1}^n x_k^2
```

```math
x^H x = \sum_{k=1}^n \overline{x_k} x_k = \sum_{k=1}^n |x_k|^2
```

Both forms are always non-negative and only equal to zero if all vector components are zero.

## Eigenvalues Are Always Real

This is one of the most amazing properties of symmetric and Hermitian matrices. All eigenvalues of symmetric or Hermitian matrices are always real numbers.

Let's look at the proof. Suppose $$A \in \mathbb{C}^{n \times n}$$ is a Hermitian matrix with $$A^H = A$$. If $$A \cdot v = \lambda \cdot v$$ with $$v \neq 0$$, then:

Visible text: Let's look at the proof. Suppose is a Hermitian matrix with . If with , then:

Component: MathContainer
Children:

```math
\lambda \cdot v^H v = v^H (\lambda \cdot v)
```

```math
= v^H (A \cdot v)
```

```math
= v^H A v
```

```math
= v^H A^H v
```

```math
= (A \cdot v)^H v
```

```math
= (\lambda \cdot v)^H v
```

```math
= \overline{\lambda} \cdot v^H v
```

Because $$v^H v \neq 0$$, we can conclude that $$\lambda = \overline{\lambda}$$, so $$\lambda \in \mathbb{R}$$.

Visible text: Because , we can conclude that , so .

For real symmetric matrices, since they are also Hermitian matrices, their eigenvalues are also always real.

## Orthogonality of Eigenvectors

Eigenvectors corresponding to different eigenvalues in symmetric or Hermitian matrices are always orthogonal to each other. This is a very useful property in various applications.

Let's prove this property. Suppose $$A \in \mathbb{C}^{n \times n}$$ is a Hermitian matrix with:

Visible text: Let's prove this property. Suppose is a Hermitian matrix with:

Component: MathContainer
Children:

```math
A v = \lambda v \text{ with } v \neq 0
```

```math
A w = \mu w \text{ with } w \neq 0
```

```math
\lambda \neq \mu
```

We know that $$\overline{\mu} = \mu$$ because eigenvalues are real. Now:

Visible text: We know that because eigenvalues are real. Now:

Component: MathContainer
Children:

```math
\mu (w^H v) = \mu (w^H v)
```

```math
= (\mu w)^H v
```

```math
= (A w)^H v
```

```math
= w^H A^H v
```

```math
= w^H A v
```

```math
= w^H (\lambda v)
```

```math
= \lambda (w^H v)
```

So $$(\mu - \lambda)(w^H v) = 0$$. Because $$\lambda \neq \mu$$, then $$w^H v = 0$$, which means the eigenvectors are orthogonal.

Visible text: So . Because , then , which means the eigenvectors are orthogonal.

For real symmetric matrices, we have $$w^T v = 0$$.

Visible text: For real symmetric matrices, we have .

This orthogonality property allows us to diagonalize symmetric and Hermitian matrices using orthogonal or unitary matrices.