Differences between revisions 3 and 6 (spanning 3 versions)
Revision 3 as of 2021-09-14 16:43:09
Size: 1407
Comment:
Revision 6 as of 2023-07-03 05:00:32
Size: 1660
Comment:
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:

<<TableOfContents>>

----

Line 5: Line 11:
The '''identity matrix''' multiplied by matrix A returns matrix A. The '''identity matrix''' is a diagonal line of 1s in a matrix of 0s.
Line 7: Line 13:
This matrix is simply a diagonal line of 1s in a matrix of 0s. Any matrix A multiplied by the (appropriately sized) identity matrix returns matrix A.
Line 10: Line 16:
┌ ┐
│ 1 0 0│
│ 0 1 0│
│ 0 0 1│
└ ┘
julia> using LinearAlgebra

julia> Matrix{Int8}(I,3,3)
3×3 Matrix{Int8}:
 1 0 0
 0 1 0
 0 0 1
Line 16: Line 24:

----
Line 19: Line 29:
== Permutation Matrix == == Permutation Matrices ==
Line 21: Line 31:
The '''permutation matrix''' multiplied by matrix A returns matrix C which is a mirrored transformation of A.

This matrix is simply a
diagonal line of 1s in a matrix of 0s, but going the opposite direction as compared to an identity matrix
A '''permutation matrix''' multiplied by matrix A returns a row- or column-exchanged transformation of A, depending on the order of multiplication.
Line 26: Line 34:
┌ ┐
│ 0 0 1│
│ 0 1 0│
│ 1 0 0│
└ ┘
julia> P = Matrix{Int8}(I,3,3)[:,[3,2,1]]
3×3 Matrix{Int8}:
 0 0 1
 0 1 0
 1 0 0

julia> A = [1 2 3; 4 5 6; 7 8 9]
3×3 Matrix{Int64}:
 1 2 3
 4 5 6
 7 8 9

julia> P * A
3×3 Matrix{Int64}:
 7 8 9
 4 5 6
 1 2 3

julia> A * P
3×3 Matrix{Int64}:
 3 2 1
 6 5 4
 9 8 7
Line 33: Line 59:
Note that a permutation matrix can mirror either the rows or columns of matrix A, depending simply on the order. See [[LinearAlgebra/PermutationMatrices|Permutation Matrices]] for more information.
Line 35: Line 61:
{{{
┌ ┐┌ ┐ ┌ ┐
│ 0 1││ 1 2│ │ 3 4│
│ 1 0││ 3 4│=│ 1 2│
└ ┘└ ┘ └ ┘

┌ ┐┌ ┐ ┌ ┐
│ 1 2││ 0 1│ │ 2 1│
| 3 4|│ 1 0│=│ 4 3│
└ ┘└ ┘ └ ┘
}}}
----
Line 51: Line 67:
An '''inverse matrix''' is denoted as A^-1^. If a matrix is multiplied by its inverse matrix, it returns the identity matrix. An '''inverse matrix''' A^-1^ multiplied by matrix A returns the identity matrix.
Line 55: Line 71:
For a square matrix A, the left inverse is the same as the right inverse. AA^-1^ = A^-1^A = I See [[LinearAlgebra/MatrixInversion|Matrix Inversion]] for more information.

----



== Symmetric Matrices ==

A '''symmetric matrix''' is any matrix that is equal to its [[LinearAlgebra/MatrixTransposition|transpose]].

{{{
julia> A = [1 2; 2 1]
2×2 Matrix{Int64}:
 1 2
 2 1

julia> A == A'
true
}}}

See [[LinearAlgebra/MatrixTransposition#SymmetricMatrices|Symmetric Matrices]] for more information.

Special Matrices


Identity Matrix

The identity matrix is a diagonal line of 1s in a matrix of 0s.

Any matrix A multiplied by the (appropriately sized) identity matrix returns matrix A.

julia> using LinearAlgebra

julia> Matrix{Int8}(I,3,3)
3×3 Matrix{Int8}:
 1  0  0
 0  1  0
 0  0  1


Permutation Matrices

A permutation matrix multiplied by matrix A returns a row- or column-exchanged transformation of A, depending on the order of multiplication.

julia> P = Matrix{Int8}(I,3,3)[:,[3,2,1]]
3×3 Matrix{Int8}:
 0  0  1
 0  1  0
 1  0  0

julia> A = [1 2 3; 4 5 6; 7 8 9]
3×3 Matrix{Int64}:
 1  2  3
 4  5  6
 7  8  9

julia> P * A
3×3 Matrix{Int64}:
 7  8  9
 4  5  6
 1  2  3

julia> A * P
3×3 Matrix{Int64}:
 3  2  1
 6  5  4
 9  8  7

See Permutation Matrices for more information.


Inverse Matrices

An inverse matrix A-1 multiplied by matrix A returns the identity matrix.

If A-1 exists, then A is invertible and non-singular. Not all matrices are invertible.

See Matrix Inversion for more information.


Symmetric Matrices

A symmetric matrix is any matrix that is equal to its transpose.

julia> A = [1 2; 2 1]
2×2 Matrix{Int64}:
 1  2
 2  1

julia> A == A'
true

See Symmetric Matrices for more information.


CategoryRicottone

LinearAlgebra/SpecialMatrices (last edited 2025-09-24 17:48:02 by DominicRicottone)