[Scientific / technical calculation by Python] List of matrices that appear in Hinpan in numerical linear algebra

Introduction

Numerical linear algebra comes up with different types of matrices. While reading the documentation for linear algebra libraries (such as LAPACK), you may inadvertently forget the matrix definitions written there. Also, although I somehow remember the definition, I often want to imagine a concrete matrix shape. From time to time, you may also want to know how to read English. It takes a surprising amount of time to look up them in reference books and on the Internet. ** **

** Therefore, in this article, we have listed the definitions and concrete examples of matrices that frequently appear in linear algebra by calculation. ** ** I hope you can save the above-mentioned trouble as much as possible.

If you point out any deficiencies or deficiencies due to my lack of study, I will revise it, so please contact me in that case.


Sparse matrix (sparse matrix)

A matrix with most of its components zero.

M=
\begin{pmatrix}
 1 & 2 & 0 & 0\\
 0 & 4 & 0 & 0\\
 0 & 0 & 7 &0\\
 0 & 3 & 0 &0\\
\end{pmatrix}

Dense matrix (dense matrix)

A matrix with few zero element components.

M=
\begin{pmatrix}
 1 & 4 & 6 & 0\\
 0 & 4 & 3 & 2\\
 5 & 1 & 7 &3\\
 5 & 3 & 6 &1\\
\end{pmatrix}

Upper triangular matrix (Kamisan Kakugyoretsu, upper triangular matrix)

A square matrix with $ a_ {ij} = 0 \ (i = 2, ..., n; j = 1, .., i-1) $ with all other non-zero elements.


M=
\begin{pmatrix}
 1 & 2 & 5 & 5\\
 0 & 4 & 4 & 2\\
 0 & 0 & 7 &11 \\
 0 & 0 & 0 &1\\
\end{pmatrix}

Lower triangular matrix (Shimosankakugyoretsu, lower triangular matrix)

A square matrix with $ a_ {ij} = 0 \ (i = 2, ..., n-1; j = i + 1, ..., n) $ with all other non-zero elements.


M=
\begin{pmatrix}
 1 & 0 & 0 & 0\\
 3 & 4 & 0 & 0\\
 5 & 5 & 2 &0 \\
 6 & 2 & 9 &10\\
\end{pmatrix}

Diagonal matrix

Only the diagonal component of the square matrix is non-zero and the off-diagonal component is zero.


M=
\begin{pmatrix}
 1 & 0 & 0 & 0\\
 0 & 4 & 0 & 0\\
 0 & 0 & 6 &0 \\
 0 & 0 & 0 &10\\
\end{pmatrix}

Band matrix (Obigyoretsu, band matrix)

Non-zero components are concentrated near the diagonal.


M=
\begin{pmatrix}
 1 & 2 & 0 & 0 &0 \\
 2 & 4 & 5 & 0 &0\\
 0 & 3 & 6 &1 &0\\
 0 & 0 & 2 &5 &4\\
0 & 0 & 0 &1 &9\\
\end{pmatrix}

Tridiagonal matrix

In a square matrix, all diagonal elements and diagonal elements adjacent to them are not zero, and all other elements are zero.


M=
\begin{pmatrix}
 1 & 2 & 0 & 0\\
 3 & 4 & 8 & 0\\
 0 & 5 & 6 &9\\
 0 & 0 & 1 &10\\
\end{pmatrix}

Upper Hessenberg matrix (Kami Hessenberg matrix)

In a square matrix, $ a_ {ij} = 0 \ (i = 3,4, ..., n; j = 1, 2, ..., i-2) $, and the other components are non-zero.


M=
\begin{pmatrix}
 1 & 2 & 8 & 20 & 6\\
 3 & 4 & 8 & 2 & 4\\
 0 & 5 & 6 &9 & 1 \\
 0 & 0 & 6 &2 & 5\\
 0 & 0 & 0 &3 & 10\\
\end{pmatrix}

Lower Hessenberg matrix (lower Hessenberg matrix)

In a square matrix $ a_ {ij} = 0 \ (i = 1,2, ..., n-2; j = i + 2, i + 3, ..., n) $, other components are non-zero Zero thing.


M=
\begin{pmatrix}
 1 & 2 & 0 & 0 & 0\\
 3 & 4 & 8 & 0 & 0\\
 2 & 5 & 6 &4 & 0 \\
 7 & 4 & 6 &2 & 5\\
 9 & 5 & 3 &3 & 10\\
\end{pmatrix}

Companion matrix (Dohangyoretsu, Companion Gyoretsu, companion matrix)

The expansion of the characteristic polynomial (characteristic equation) $ det (A -tI) $ is when $ A $ is a $ nxn $ matrix.

P(t) = t^n+c_1t^{n-1}+c_2t^{n-2}+...+c_{n-1}t^1+c_n

Will be. Now consider n = 5 as an example.

At this time, the ** companion matrix of matrix A ** has the following form.


C =
\begin{pmatrix}
 0 & 0 & 0 & 0 & -c_5\\
 1 & 0 & 0 & 0 & -c_4\\\
 0 & 1 & 0 & 0 & -c_3 \\
 0 & 0 & 1 & 0 &-c_2\\
 0 & 0 & 0 & 1 & -c_1\\
\end{pmatrix}

Identity matrix (identity matrix)

A square matrix whose diagonal component is 1 and the others are zero. Represented as the symbols $ I $ and $ E $.


I =
\begin{pmatrix}
 1 & 0 & 0 & 0 & 0\\
 0 & 1 & 0 & 0 & 0\\
 0 & 0 & 1 & 0& 0 \\
 0 & 0 & 0 &1 & 0\\
 0 & 0 & 0 &0 & 1\\
\end{pmatrix}

Zero matrix (Zero matrix, null matrix)

A matrix in which all genders are zero. Represented by the symbol $ O $.


O =
\begin{pmatrix}
 0 & 0 & 0 & 0 & 0\\
 0 & 0 & 0 & 0 & 0\\
 0 & 0 & 0 & 0& 0 \\
 0 & 0 & 0 & 0 & 0\\
 0 & 0 & 0 &0 & 0\\
\end{pmatrix}

Symmetric matrix (symmetric matrix)

The relationship of $ a_ {ij} = a_ {ji} $.

M=
\begin{pmatrix}
 1 & 2 & 9 & 3\\
 2 & 4 & 2 & 0\\
 9 & 2 & 7 &3\\
 3 & 0 & 3 & 10\\
\end{pmatrix}

Skew-symmetric matrix (alternative matrix) or antisymmetric matrix (antisymmetric matrix)

A square matrix with a diagonal component of zero and an off-diagonal component of $ a_ {ij} =-a_ {ji} $.

M=
\begin{pmatrix}
 0 & 2 & 9 & -3\\
 -2 & 0 & 2 & 0\\
 -9 & -2 & 0 &-3\\
 3 & 0 & 3 & 0\\
\end{pmatrix}

Hermitian matrix (Hermitian matrix)

In the transposed complex conjugate $ H ^ \ dagger $ of the square matrix $ H $,

A matrix that satisfies $ H ^ \ dagger = H $.

H=
\begin{pmatrix}
 5 & 2+i & 9 & 3+i\\
 2-i & 0 & -2-4i & 7-6i\\
 9 & -2+4i & 4 &3\\
 3-i & 7+6i  & 3 & 4i\\
\end{pmatrix}

Unitary matrix (Unitary matrix)

Between the square matrix $ U $ and its transposed complex conjugate $ U ^ \ dagger $,

UU^\dagger = U^\dagger U = I

A matrix with the relationship. $ I $ is the identity matrix.

M=
\begin{pmatrix}
 1 & i \\
 -i & 2 \\
\end{pmatrix}

Transposed matrix (transposed matrix)

The transposed matrix $ B $ of the matrix $ A $ has the relation of $ b_ {ij} = a_ {ji} $.

Put $ B $ in $ A ^ T $.

Orthogonal matrix (Orthogonal matrix)

Between the square matrix M and its transposed matrix $ M ^ T $,

The relationship of $ M M ^ T = M ^ T M = I $ holds.

M=
\begin{pmatrix}
 0 & 1 \\
 1 & 0 \\
\end{pmatrix}

References

The following books have been helpful in writing this article.

[1] Gilbert Strang, ["World Standard MIT Textbook Strang: Linear Algebra Introduction"](https://www.amazon.co.jp/%E4%B8%96%E7%95%8C%E6%A8%99 % E6% BA% 96MIT% E6% 95% 99% E7% A7% 91% E6% 9B% B8-% E3% 82% B9% E3% 83% 88% E3% 83% A9% E3% 83% B3% E3% 82% B0-% E7% B7% 9A% E5% BD% A2% E4% BB% A3% E6% 95% B0% E3% 82% A4% E3% 83% B3% E3% 83% 88% E3 % 83% AD% E3% 83% 80% E3% 82% AF% E3% 82% B7% E3% 83% A7% E3% 83% B3-% E3% 82% AE% E3% 83% AB% E3% 83% 90% E3% 83% BC% E3% 83% 88 / dp / 4764904055 / ref = pd_lpo_sbs_14_t_0? _ Encoding = UTF8 & psc = 1 & refRID = 9817PCQXDR5497M5GPS2), Modern Science, 2015.

Recommended Posts

[Scientific / technical calculation by Python] List of matrices that appear in Hinpan in numerical linear algebra
[Scientific / technical calculation by Python] Numerical solution of eigenvalue problem of matrix by power method, numerical linear algebra
[Scientific / technical calculation by Python] Sum calculation, numerical calculation
[Scientific / technical calculation by Python] List of usage of (special) functions used in physics by using scipy
[Scientific / technical calculation by Python] Lagrange interpolation, numerical calculation
[Scientific / technical calculation by Python] Numerical calculation to find the value of derivative (differential)
[Scientific / technical calculation by Python] Solving the boundary value problem of ordinary differential equations in matrix format, numerical calculation
[Scientific / technical calculation by Python] Basic operation of arrays, numpy
[Scientific / technical calculation by Python] Monte Carlo integration, numerical calculation, numpy
[Scientific / technical calculation by Python] Numerical solution of second-order ordinary differential equations, initial value problem, numerical calculation
[Scientific / technical calculation by Python] Numerical solution of one-dimensional harmonic oscillator problem by velocity Verlet method
[Scientific / technical calculation by Python] Numerical integration, trapezoidal / Simpson law, numerical calculation, scipy
[Scientific / technical calculation by Python] 2D random walk (drunk walk problem), numerical calculation
[Scientific / technical calculation by Python] Calculation of matrix product by @ operator, python3.5 or later, numpy
[Scientific / technical calculation by Python] Histogram, visualization, matplotlib
[Scientific / technical calculation by Python] Drawing animation of parabolic motion with locus, matplotlib
[Scientific / technical calculation by Python] Solving second-order ordinary differential equations by Numerov method, numerical calculation
[Scientific / technical calculation by Python] Analytical solution to find the solution of equation sympy
[Scientific / technical calculation by Python] Drawing of 3D curved surface, surface, wireframe, visualization, matplotlib
[Scientific / technical calculation by Python] Logarithmic graph, visualization, matplotlib
[Scientific / technical calculation by Python] Polar graph, visualization, matplotlib
Group by consecutive elements of a list in Python
[Scientific / technical calculation by Python] Plot, visualization, matplotlib of 2D data read from file
[Scientific / technical calculation by Python] Drawing, visualization, matplotlib of 2D (color) contour lines, etc.
[Scientific / technical calculation by Python] Numerical solution of one-dimensional and two-dimensional wave equations by FTCS method (explicit method), hyperbolic partial differential equations
[Scientific / technical calculation by Python] 3rd order spline interpolation, scipy
[Science / technical calculation by Python] Numerical solution of first-order ordinary differential equations, initial value problem, numerical calculation
[Scientific and technical calculation by Python] Drawing of fractal figures [Sierpinski triangle, Bernsley fern, fractal tree]
[Scientific / technical calculation by Python] Monte Carlo simulation of thermodynamics of 2D Ising spin system by Metropolis method
[Scientific / technical calculation by Python] Vector field visualization example, electrostatic field, matplotlib
[Scientific / technical calculation by Python] 1D-3D discrete fast Fourier transform, scipy
List of Linear Programming (LP) solvers and modelers available in Python
[Scientific / technical calculation by Python] Numerical solution of two-dimensional Laplace-Poisson equation by Jacobi method for electrostatic potential, elliptic partial differential equation, boundary value problem
[Scientific / technical calculation by Python] Numerical solution of one-dimensional unsteady heat conduction equation by Crank-Nicholson method (implicit method) and FTCS method (positive solution method), parabolic partial differential equation
[Scientific / technical calculation by Python] Derivation of analytical solutions for quadratic and cubic equations, mathematical formulas, sympy
[Scientific / technical calculation by Python] Solving ordinary differential equations, mathematical formulas, sympy
Basic Linear Algebra Learned in Python (Part 1)
Eigenvalues and eigenvectors: Linear algebra in Python <7>
Display a list of alphabets in Python 3
Linear Independence and Basis: Linear Algebra in Python <6>
Summary of built-in methods in Python list
[Scientific / technical calculation by Python] Solving one-dimensional Schrodinger equation in stationary state by shooting method (1), well-type potential, quantum mechanics
Introduction to Vectors: Linear Algebra in Python <1>
[Scientific / technical calculation by Python] Solving (generalized) eigenvalue problem using numpy / scipy, using library
[Scientific / technical calculation by Python] Plot, visualize, matplotlib 2D data with error bars
[Scientific / technical calculation by Python] Solving one-dimensional Newton equation by the 4th-order Runge-Kutta method
[Scientific / technical calculation by Python] Generation of non-uniform random numbers giving a given probability density function, Monte Carlo simulation
[Scientific / technical calculation by Python] Solving one-dimensional Schrodinger equation in stationary state by shooting method (2), harmonic oscillator potential, quantum mechanics
Draw contour lines that appear in textbooks (Python)
[Python] Sort the list of pathlib.Path in natural sort
Make a copy of the list in Python
Calculation of technical indicators by TA-Lib and pandas
Search by the value of the instance in the list
Identity matrix and inverse matrix: Linear algebra in Python <4>
Inner product and vector: Linear algebra in Python <2>
Formulas that appear in Doing Math with Python
Matrix Calculations and Linear Equations: Linear Algebra in Python <3>
Sort tuple list in Python by specifying the ascending / descending order of multiple keys
[Introduction to Python] Summary of functions and methods that frequently appear in Python [Problem format]
I investigated the calculation time of "X in list" (linear search / binary search) and "X in set"
[Python] Numerical calculation of two-dimensional thermal diffusion equation by ADI method (alternate direction implicit method)