Matricu reizināšana ir bināra operācija , kurā tiek reizināts matricu pāris, šīs operācijas rezultātā tiek iegūta jauna matrica. Skaitļi (piemēram, reāli , kompleksi skaitļi) var tikt reizināti kā elementārajā aritmētikā .
Pastāv vairāki veidi, kā reizināt matricas, no kuriem vienkāršākais ir reizināšana ar skaitli. Matricu reizināšana nav komutatīva , kas nozīmē, ka A · B ≠ B · A . Ja tiek reizināta matrica A (n × m matrica) un B (m × p matrica), tad reizināšanas rezultāts AB ir n × p matrica.
Vienkāršākā reizināšana ar matricām ir matricas reizināšana ar skaitli.
Skaitļa λ reizinājums ar matricu A ir matrica λ A , kuras izmērs ir tāds pats, kā matricai A . Matricas λ A locekļus definē kā
(
λ
A
)
i
j
=
λ
(
A
)
i
j
,
{\displaystyle (\lambda \mathbf {A} )_{ij}=\lambda \left(\mathbf {A} \right)_{ij}\,,}
kas izvērstā pierakstā izskatās šādi:
λ
A
=
λ
(
A
11
A
12
⋯
A
1
m
A
21
A
22
⋯
A
2
m
⋮
⋮
⋱
⋮
A
n
1
A
n
2
⋯
A
n
m
)
=
(
λ
A
11
λ
A
12
⋯
λ
A
1
m
λ
A
21
λ
A
22
⋯
λ
A
2
m
⋮
⋮
⋱
⋮
λ
A
n
1
λ
A
n
2
⋯
λ
A
n
m
)
.
{\displaystyle \lambda \mathbf {A} =\lambda {\begin{pmatrix}A_{11}&A_{12}&\cdots &A_{1m}\\A_{21}&A_{22}&\cdots &A_{2m}\\\vdots &\vdots &\ddots &\vdots \\A_{n1}&A_{n2}&\cdots &A_{nm}\\\end{pmatrix}}={\begin{pmatrix}\lambda A_{11}&\lambda A_{12}&\cdots &\lambda A_{1m}\\\lambda A_{21}&\lambda A_{22}&\cdots &\lambda A_{2m}\\\vdots &\vdots &\ddots &\vdots \\\lambda A_{n1}&\lambda A_{n2}&\cdots &\lambda A_{nm}\\\end{pmatrix}}\,.}
Līdzīgi tiek definēts matricas A reizinājums ar skaitli λ
(
A
λ
)
i
j
=
(
A
)
i
j
λ
,
{\displaystyle (\mathbf {A} \lambda )_{ij}=\left(\mathbf {A} \right)_{ij}\lambda \,,}
kas izvērstā pierakstā izskatās šādi:
A
λ
=
(
A
11
A
12
⋯
A
1
m
A
21
A
22
⋯
A
2
m
⋮
⋮
⋱
⋮
A
n
1
A
n
2
⋯
A
n
m
)
λ
=
(
A
11
λ
A
12
λ
⋯
A
1
m
λ
A
21
λ
A
22
λ
⋯
A
2
m
λ
⋮
⋮
⋱
⋮
A
n
1
λ
A
n
2
λ
⋯
A
n
m
λ
)
.
{\displaystyle \mathbf {A} \lambda ={\begin{pmatrix}A_{11}&A_{12}&\cdots &A_{1m}\\A_{21}&A_{22}&\cdots &A_{2m}\\\vdots &\vdots &\ddots &\vdots \\A_{n1}&A_{n2}&\cdots &A_{nm}\\\end{pmatrix}}\lambda ={\begin{pmatrix}A_{11}\lambda &A_{12}\lambda &\cdots &A_{1m}\lambda \\A_{21}\lambda &A_{22}\lambda &\cdots &A_{2m}\lambda \\\vdots &\vdots &\ddots &\vdots \\A_{n1}\lambda &A_{n2}\lambda &\cdots &A_{nm}\lambda \\\end{pmatrix}}\,.}
Piemērs ar reālu skaitli un matricu:
λ
=
2
,
A
=
(
a
b
c
d
)
{\displaystyle \lambda =2,\quad \mathbf {A} ={\begin{pmatrix}a&b\\c&d\\\end{pmatrix}}}
2
A
=
2
(
a
b
c
d
)
=
(
2
⋅
a
2
⋅
b
2
⋅
c
2
⋅
d
)
=
(
a
⋅
2
b
⋅
2
c
⋅
2
d
⋅
2
)
=
(
a
b
c
d
)
2
=
A
2.
{\displaystyle 2\mathbf {A} =2{\begin{pmatrix}a&b\\c&d\\\end{pmatrix}}={\begin{pmatrix}2\!\cdot \!a&2\!\cdot \!b\\2\!\cdot \!c&2\!\cdot \!d\\\end{pmatrix}}={\begin{pmatrix}a\!\cdot \!2&b\!\cdot \!2\\c\!\cdot \!2&d\!\cdot \!2\\\end{pmatrix}}={\begin{pmatrix}a&b\\c&d\\\end{pmatrix}}2=\mathbf {A} 2.}
Ja A ir n × m matrica un B ir m × p matrica,
A
=
(
A
11
A
12
⋯
A
1
m
A
21
A
22
⋯
A
2
m
⋮
⋮
⋱
⋮
A
n
1
A
n
2
⋯
A
n
m
)
,
B
=
(
B
11
B
12
⋯
B
1
p
B
21
B
22
⋯
B
2
p
⋮
⋮
⋱
⋮
B
m
1
B
m
2
⋯
B
m
p
)
{\displaystyle \mathbf {A} ={\begin{pmatrix}A_{11}&A_{12}&\cdots &A_{1m}\\A_{21}&A_{22}&\cdots &A_{2m}\\\vdots &\vdots &\ddots &\vdots \\A_{n1}&A_{n2}&\cdots &A_{nm}\\\end{pmatrix}},\quad \mathbf {B} ={\begin{pmatrix}B_{11}&B_{12}&\cdots &B_{1p}\\B_{21}&B_{22}&\cdots &B_{2p}\\\vdots &\vdots &\ddots &\vdots \\B_{m1}&B_{m2}&\cdots &B_{mp}\\\end{pmatrix}}}
tad matricu reizinājums AB (kas tiek apzīmēts bez kaut kādām reizinājuma zīmēm vai punktiem) ir n × p matrica[ 1] [ 2] [ 3] [ 4]
A
B
=
(
(
A
B
)
11
(
A
B
)
12
⋯
(
A
B
)
1
p
(
A
B
)
21
(
A
B
)
22
⋯
(
A
B
)
2
p
⋮
⋮
⋱
⋮
(
A
B
)
n
1
(
A
B
)
n
2
⋯
(
A
B
)
n
p
)
{\displaystyle \mathbf {A} \mathbf {B} ={\begin{pmatrix}\left(\mathbf {AB} \right)_{11}&\left(\mathbf {AB} \right)_{12}&\cdots &\left(\mathbf {AB} \right)_{1p}\\\left(\mathbf {AB} \right)_{21}&\left(\mathbf {AB} \right)_{22}&\cdots &\left(\mathbf {AB} \right)_{2p}\\\vdots &\vdots &\ddots &\vdots \\\left(\mathbf {AB} \right)_{n1}&\left(\mathbf {AB} \right)_{n2}&\cdots &\left(\mathbf {AB} \right)_{np}\\\end{pmatrix}}}
kur katrs i, j loceklis ir iegūts, reizinot Aik elementu ar Bkj elementu, kur k = 1, 2, ..., m un tiek saskaitīti rezultāti līdz k :
(
A
B
)
i
j
=
∑
k
=
1
m
A
i
k
B
k
j
.
{\displaystyle (\mathbf {A} \mathbf {B} )_{ij}=\sum _{k=1}^{m}A_{ik}B_{kj}\,.}
Tas nozīmē, ka reizinājums AB ir definēts, ja kolonnu skaits A matricā sakrīt ar rindu skaitu B matricā. Reizinājuma rezultāta matricā rindu skaits ir vienāds ar A rindu skaitu, savukārt kolonnu skaits — ar B kolonnu skaitu.
[
a
11
a
12
⋅
⋅
a
31
a
32
⋅
⋅
]
4
×
2
matrica
[
⋅
b
12
b
13
⋅
b
22
b
23
]
2
×
3
matrica
=
[
⋅
x
12
x
13
⋅
⋅
⋅
⋅
x
32
x
33
⋅
⋅
⋅
]
4
×
3
matrica
{\displaystyle {\overset {4\times 2{\text{ matrica}}}{\begin{bmatrix}{\color {Brown}{a_{11}}}&{\color {Brown}{a_{12}}}\\\cdot &\cdot \\{\color {Orange}{a_{31}}}&{\color {Orange}{a_{32}}}\\\cdot &\cdot \\\end{bmatrix}}}{\overset {2\times 3{\text{ matrica}}}{\begin{bmatrix}\cdot &{\color {Plum}{b_{12}}}&{\color {Violet}{b_{13}}}\\\cdot &{\color {Plum}{b_{22}}}&{\color {Violet}{b_{23}}}\\\end{bmatrix}}}={\overset {4\times 3{\text{ matrica}}}{\begin{bmatrix}\cdot &x_{12}&x_{13}\\\cdot &\cdot &\cdot \\\cdot &x_{32}&x_{33}\\\cdot &\cdot &\cdot \\\end{bmatrix}}}}
Vērtības krustpunktos ir iegūstamas ar šādām darbībām:
x
12
=
a
11
b
12
+
a
12
b
22
x
13
=
a
11
b
13
+
a
12
b
23
x
32
=
a
31
b
12
+
a
32
b
22
x
33
=
a
31
b
13
+
a
32
b
23
{\displaystyle {\begin{aligned}x_{12}&={\color {Brown}{a_{11}}}{\color {Plum}{b_{12}}}+{\color {Brown}{a_{12}}}{\color {Plum}{b_{22}}}\\x_{13}&={\color {Brown}{a_{11}}}{\color {Violet}{b_{13}}}+{\color {Brown}{a_{12}}}{\color {Violet}{b_{23}}}\\x_{32}&={\color {Orange}{a_{31}}}{\color {Plum}{b_{12}}}+{\color {Orange}{a_{32}}}{\color {Plum}{b_{22}}}\\x_{33}&={\color {Orange}{a_{31}}}{\color {Violet}{b_{13}}}+{\color {Orange}{a_{32}}}{\color {Violet}{b_{23}}}\end{aligned}}}
Rindas matrica un kolonnas matrica
Ja
A
=
(
a
b
c
)
,
B
=
(
x
y
z
)
,
{\displaystyle \mathbf {A} ={\begin{pmatrix}a&b&c\end{pmatrix}}\,,\quad \mathbf {B} ={\begin{pmatrix}x\\y\\z\end{pmatrix}}\,,}
tad matricu reizināšanas rezultāts ir:
A
B
=
(
a
b
c
)
(
x
y
z
)
=
a
x
+
b
y
+
c
z
,
{\displaystyle \mathbf {AB} ={\begin{pmatrix}a&b&c\end{pmatrix}}{\begin{pmatrix}x\\y\\z\end{pmatrix}}=ax+by+cz\,,}
un
B
A
=
(
x
y
z
)
(
a
b
c
)
=
(
x
a
x
b
x
c
y
a
y
b
y
c
z
a
z
b
z
c
)
.
{\displaystyle \mathbf {BA} ={\begin{pmatrix}x\\y\\z\end{pmatrix}}{\begin{pmatrix}a&b&c\end{pmatrix}}={\begin{pmatrix}xa&xb&xc\\ya&yb&yc\\za&zb&zc\end{pmatrix}}\,.}
Jāievēro, ka AB un BA ir divas dažādas matricas. Pirmā ir 1 × 1 matrica, bet otrā — 3 × 3 matrica.
Kvadrātiska matrica un kolonnas matrica
Ja
A
=
(
a
b
c
p
q
r
u
v
w
)
,
B
=
(
x
y
z
)
,
{\displaystyle \mathbf {A} ={\begin{pmatrix}a&b&c\\p&q&r\\u&v&w\end{pmatrix}},\quad \mathbf {B} ={\begin{pmatrix}x\\y\\z\end{pmatrix}}\,,}
tad matricu reizināšanas rezultāts ir:
A
B
=
(
a
b
c
p
q
r
u
v
w
)
(
x
y
z
)
=
(
a
x
+
b
y
+
c
z
p
x
+
q
y
+
r
z
u
x
+
v
y
+
w
z
)
,
{\displaystyle \mathbf {AB} ={\begin{pmatrix}a&b&c\\p&q&r\\u&v&w\end{pmatrix}}{\begin{pmatrix}x\\y\\z\end{pmatrix}}={\begin{pmatrix}ax+by+cz\\px+qy+rz\\ux+vy+wz\end{pmatrix}}\,,}
savukārt BA nav definēts.
Kvadrātiskas matricas
Ja
A
=
(
a
b
c
p
q
r
u
v
w
)
,
B
=
(
α
β
γ
λ
μ
ν
ρ
σ
τ
)
,
{\displaystyle \mathbf {A} ={\begin{pmatrix}a&b&c\\p&q&r\\u&v&w\end{pmatrix}},\quad \mathbf {B} ={\begin{pmatrix}\alpha &\beta &\gamma \\\lambda &\mu &\nu \\\rho &\sigma &\tau \\\end{pmatrix}}\,,}
tad matricu reizināšanas rezultāts ir:
A
B
=
(
a
b
c
p
q
r
u
v
w
)
(
α
β
γ
λ
μ
ν
ρ
σ
τ
)
=
(
a
α
+
b
λ
+
c
ρ
a
β
+
b
μ
+
c
σ
a
γ
+
b
ν
+
c
τ
p
α
+
q
λ
+
r
ρ
p
β
+
q
μ
+
r
σ
p
γ
+
q
ν
+
r
τ
u
α
+
v
λ
+
w
ρ
u
β
+
v
μ
+
w
σ
u
γ
+
v
ν
+
w
τ
)
,
{\displaystyle \mathbf {AB} ={\begin{pmatrix}a&b&c\\p&q&r\\u&v&w\end{pmatrix}}{\begin{pmatrix}\alpha &\beta &\gamma \\\lambda &\mu &\nu \\\rho &\sigma &\tau \\\end{pmatrix}}={\begin{pmatrix}a\alpha +b\lambda +c\rho &a\beta +b\mu +c\sigma &a\gamma +b\nu +c\tau \\p\alpha +q\lambda +r\rho &p\beta +q\mu +r\sigma &p\gamma +q\nu +r\tau \\u\alpha +v\lambda +w\rho &u\beta +v\mu +w\sigma &u\gamma +v\nu +w\tau \end{pmatrix}}\,,}
un
B
A
=
(
α
β
γ
λ
μ
ν
ρ
σ
τ
)
(
a
b
c
p
q
r
u
v
w
)
=
(
α
a
+
β
p
+
γ
u
α
b
+
β
q
+
γ
v
α
c
+
β
r
+
γ
w
λ
a
+
μ
p
+
ν
u
λ
b
+
μ
q
+
ν
v
λ
c
+
μ
r
+
ν
w
ρ
a
+
σ
p
+
τ
u
ρ
b
+
σ
q
+
τ
v
ρ
c
+
σ
r
+
τ
w
)
.
{\displaystyle \mathbf {BA} ={\begin{pmatrix}\alpha &\beta &\gamma \\\lambda &\mu &\nu \\\rho &\sigma &\tau \\\end{pmatrix}}{\begin{pmatrix}a&b&c\\p&q&r\\u&v&w\end{pmatrix}}={\begin{pmatrix}\alpha a+\beta p+\gamma u&\alpha b+\beta q+\gamma v&\alpha c+\beta r+\gamma w\\\lambda a+\mu p+\nu u&\lambda b+\mu q+\nu v&\lambda c+\mu r+\nu w\\\rho a+\sigma p+\tau u&\rho b+\sigma q+\tau v&\rho c+\sigma r+\tau w\end{pmatrix}}\,.}
Rindas matrica, kvadrātiska matrica un kolonnas matrica
Ja
A
=
(
a
b
c
)
,
B
=
(
α
β
γ
λ
μ
ν
ρ
σ
τ
)
,
C
=
(
x
y
z
)
,
{\displaystyle \mathbf {A} ={\begin{pmatrix}a&b&c\end{pmatrix}}\,,\quad \mathbf {B} ={\begin{pmatrix}\alpha &\beta &\gamma \\\lambda &\mu &\nu \\\rho &\sigma &\tau \\\end{pmatrix}}\,,\quad \mathbf {C} ={\begin{pmatrix}x\\y\\z\end{pmatrix}}\,,}
tad matricu reizināšanas rezultāts ir:
A
B
C
=
(
a
b
c
)
[
(
α
β
γ
λ
μ
ν
ρ
σ
τ
)
(
x
y
z
)
]
=
[
(
a
b
c
)
(
α
β
γ
λ
μ
ν
ρ
σ
τ
)
]
(
x
y
z
)
=
(
a
b
c
)
(
α
x
+
β
y
+
γ
z
λ
x
+
μ
y
+
ν
z
ρ
x
+
σ
y
+
τ
z
)
=
(
a
α
+
b
λ
+
c
ρ
a
β
+
b
μ
+
c
σ
a
γ
+
b
ν
+
c
τ
)
(
x
y
z
)
=
a
α
x
+
b
λ
x
+
c
ρ
x
+
a
β
y
+
b
μ
y
+
c
σ
y
+
a
γ
z
+
b
ν
z
+
c
τ
z
,
{\displaystyle {\begin{aligned}\mathbf {ABC} &={\begin{pmatrix}a&b&c\end{pmatrix}}\left[{\begin{pmatrix}\alpha &\beta &\gamma \\\lambda &\mu &\nu \\\rho &\sigma &\tau \\\end{pmatrix}}{\begin{pmatrix}x\\y\\z\end{pmatrix}}\right]=\left[{\begin{pmatrix}a&b&c\end{pmatrix}}{\begin{pmatrix}\alpha &\beta &\gamma \\\lambda &\mu &\nu \\\rho &\sigma &\tau \\\end{pmatrix}}\right]{\begin{pmatrix}x\\y\\z\end{pmatrix}}\\&={\begin{pmatrix}a&b&c\end{pmatrix}}{\begin{pmatrix}\alpha x+\beta y+\gamma z\\\lambda x+\mu y+\nu z\\\rho x+\sigma y+\tau z\\\end{pmatrix}}={\begin{pmatrix}a\alpha +b\lambda +c\rho &a\beta +b\mu +c\sigma &a\gamma +b\nu +c\tau \end{pmatrix}}{\begin{pmatrix}x\\y\\z\end{pmatrix}}\\&=a\alpha x+b\lambda x+c\rho x+a\beta y+b\mu y+c\sigma y+a\gamma z+b\nu z+c\tau z\,,\end{aligned}}}
CBA nav definēts. Jāievēro, ka A (BC ) = (AB )C , kas ir viena no matricu reizināšanas īpašībām.
Taisnstūrveida matricas
Ja
A
=
(
a
b
c
x
y
z
)
,
B
=
(
α
ρ
β
σ
γ
τ
)
,
{\displaystyle \mathbf {A} ={\begin{pmatrix}a&b&c\\x&y&z\end{pmatrix}}\,,\quad \mathbf {B} ={\begin{pmatrix}\alpha &\rho \\\beta &\sigma \\\gamma &\tau \\\end{pmatrix}}\,,}
tad matricu reizināšanas rezultāts ir:
A
B
=
(
a
b
c
x
y
z
)
(
α
ρ
β
σ
γ
τ
)
=
(
a
α
+
b
β
+
c
γ
a
ρ
+
b
σ
+
c
τ
x
α
+
y
β
+
z
γ
x
ρ
+
y
σ
+
z
τ
)
,
{\displaystyle \mathbf {A} \mathbf {B} ={\begin{pmatrix}a&b&c\\x&y&z\end{pmatrix}}{\begin{pmatrix}\alpha &\rho \\\beta &\sigma \\\gamma &\tau \\\end{pmatrix}}={\begin{pmatrix}a\alpha +b\beta +c\gamma &a\rho +b\sigma +c\tau \\x\alpha +y\beta +z\gamma &x\rho +y\sigma +z\tau \\\end{pmatrix}}\,,}
un
B
A
=
(
α
ρ
β
σ
γ
τ
)
(
a
b
c
x
y
z
)
=
(
α
a
+
ρ
x
α
b
+
ρ
y
α
c
+
ρ
z
β
a
+
σ
x
β
b
+
σ
y
β
c
+
σ
z
γ
a
+
τ
x
γ
b
+
τ
y
γ
c
+
τ
z
)
.
{\displaystyle \mathbf {B} \mathbf {A} ={\begin{pmatrix}\alpha &\rho \\\beta &\sigma \\\gamma &\tau \\\end{pmatrix}}{\begin{pmatrix}a&b&c\\x&y&z\end{pmatrix}}={\begin{pmatrix}\alpha a+\rho x&\alpha b+\rho y&\alpha c+\rho z\\\beta a+\sigma x&\beta b+\sigma y&\beta c+\sigma z\\\gamma a+\tau x&\gamma b+\tau y&\gamma c+\tau z\end{pmatrix}}\,.}
Piemērs, kas parāda, ka matricu reizināšana nav komutatīva.
A
=
(
0
1
0
0
)
,
B
=
(
0
0
0
1
)
,
{\displaystyle A={\bigl (}{\begin{smallmatrix}0&1\\0&0\end{smallmatrix}}{\bigr )},\,B={\bigl (}{\begin{smallmatrix}0&0\\0&1\end{smallmatrix}}{\bigr )},}
A
⋅
B
=
(
0
1
0
0
)
⋅
(
0
0
0
1
)
=
(
0
1
0
0
)
,
B
⋅
A
=
(
0
0
0
1
)
⋅
(
0
1
0
0
)
=
(
0
0
0
0
)
.
{\displaystyle {\begin{aligned}A\cdot B&={\bigl (}{\begin{smallmatrix}0&1\\0&0\end{smallmatrix}}{\bigr )}\cdot {\bigl (}{\begin{smallmatrix}0&0\\0&1\end{smallmatrix}}{\bigr )}={\bigl (}{\begin{smallmatrix}0&1\\0&0\end{smallmatrix}}{\bigr )},\\B\cdot A&={\bigl (}{\begin{smallmatrix}0&0\\0&1\end{smallmatrix}}{\bigr )}\cdot {\bigl (}{\begin{smallmatrix}0&1\\0&0\end{smallmatrix}}{\bigr )}={\bigl (}{\begin{smallmatrix}0&0\\0&0\end{smallmatrix}}{\bigr )}.\end{aligned}}}