In mathematics, the Frobenius inner product (also known as the Double-dot product) is a binary operation that takes two matrices and returns a scalar. It is often denoted
⟨
A
,
B
⟩
F
{\displaystyle \langle \mathbf {A} ,\mathbf {B} \rangle _{\mathrm {F} }}
or
A
:
B
{\displaystyle {\rm {A:{\rm {B}}}}}
. The operation is a component-wise inner product of two matrices as though they are vectors, and satisfies the axioms for an inner product. The two matrices must have the same dimension—same number of rows and columns—but are not restricted to be square matrices.
It is named after Ferdinand Georg Frobenius.
Definition
Given two complex-number-valued n×m matrices A and B, written explicitly as
-
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
m
B
21
B
22
⋯
B
2
m
⋮
⋮
⋱
⋮
B
n
1
B
n
2
⋯
B
n
m
)
,
{\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_{1m}\\B_{21}&B_{22}&\cdots &B_{2m}\\\vdots &\vdots &\ddots &\vdots \\B_{n1}&B_{n2}&\cdots &B_{nm}\\\end{pmatrix}},}
the Frobenius inner product is defined as
-
⟨
A
,
B
⟩
F
=
∑
i
,
j
A
i
j
¯
B
i
j
=
T
r
(
A
T
¯
B
)
≡
T
r
(
A
†
B
)
,
{\displaystyle \langle \mathbf {A} ,\mathbf {B} \rangle _{\mathrm {F} }=\sum _{i,j}{\overline {A_{ij}}}B_{ij}\,=\mathrm {Tr} \left({\overline {\mathbf {A} ^{T}}}\mathbf {B} \right)\equiv \mathrm {Tr} \left(\mathbf {A} ^{\!\dagger }\mathbf {B} \right),}
where the overline denotes the complex conjugate, and
†
{\displaystyle \dagger }
denotes the Hermitian conjugate.[1] Explicitly, this sum is
-
⟨
A
,
B
⟩
F
=
A
¯
11
B
11
+
A
¯
12
B
12
+
⋯
+
A
¯
1
m
B
1
m
+
A
¯
21
B
21
+
A
¯
22
B
22
+
⋯
+
A
¯
2
m
B
2
m
⋮
+
A
¯
n
1
B
n
1
+
A
¯
n
2
B
n
2
+
⋯
+
A
¯
n
m
B
n
m
{\displaystyle {\begin{aligned}\langle \mathbf {A} ,\mathbf {B} \rangle _{\mathrm {F} }=&{\overline {A}}_{11}B_{11}+{\overline {A}}_{12}B_{12}+\cdots +{\overline {A}}_{1m}B_{1m}\\&+{\overline {A}}_{21}B_{21}+{\overline {A}}_{22}B_{22}+\cdots +{\overline {A}}_{2m}B_{2m}\\&\vdots \\&+{\overline {A}}_{n1}B_{n1}+{\overline {A}}_{n2}B_{n2}+\cdots +{\overline {A}}_{nm}B_{nm}\\\end{aligned}}}
The calculation is very similar to the dot product of two vectors, which in turn is an example of an inner product.
Relation to other products
If A and B are each real-valued matrices, then the Frobenius inner product is the sum of the entries of the Hadamard product. If the matrices are vectorized (i.e., converted into column vectors, denoted by "
v
e
c
(
⋅
)
{\displaystyle \mathrm {vec} (\cdot )}
"), then
-
v
e
c
(
A
)
=
(
A
11
A
12
⋮
A
21
A
22
⋮
A
n
m
)
,
v
e
c
(
B
)
=
(
B
11
B
12
⋮
B
21
B
22
⋮
B
n
m
)
,
{\displaystyle \mathrm {vec} (\mathbf {A} )={\begin{pmatrix}A_{11}\\A_{12}\\\vdots \\A_{21}\\A_{22}\\\vdots \\A_{nm}\end{pmatrix}},\quad \mathrm {vec} (\mathbf {B} )={\begin{pmatrix}B_{11}\\B_{12}\\\vdots \\B_{21}\\B_{22}\\\vdots \\B_{nm}\end{pmatrix}}\,,}
v e c ( A ) ¯ T v e c ( B ) = ( A ¯ 11 A ¯ 12 ⋯ A ¯ 21 A ¯ 22 ⋯ A ¯ n m ) ( B 11 B 12 ⋮ B 21 B 22 ⋮ B n m ) {\displaystyle \quad {\overline {\mathrm {vec} (\mathbf {A} )}}^{T}\mathrm {vec} (\mathbf {B} )={\begin{pmatrix}{\overline {A}}_{11}&{\overline {A}}_{12}&\cdots &{\overline {A}}_{21}&{\overline {A}}_{22}&\cdots &{\overline {A}}_{nm}\end{pmatrix}}{\begin{pmatrix}B_{11}\\B_{12}\\\vdots \\B_{21}\\B_{22}\\\vdots \\B_{nm}\end{pmatrix}}}
Therefore
-
⟨
A
,
B
⟩
F
=
v
e
c
(
A
)
¯
T
v
e
c
(
B
)
.
{\displaystyle \langle \mathbf {A} ,\mathbf {B} \rangle _{\mathrm {F} }={\overline {\mathrm {vec} (\mathbf {A} )}}^{T}\mathrm {vec} (\mathbf {B} )\,.}
Properties
Like any inner product, it is a sesquilinear form, for four complex-valued matrices A, B, C, D, and two complex numbers a and b:
-
⟨
a
A
,
b
B
⟩
F
=
a
¯
b
⟨
A
,
B
⟩
F
{\displaystyle \langle a\mathbf {A} ,b\mathbf {B} \rangle _{\mathrm {F} }={\overline {a}}b\langle \mathbf {A} ,\mathbf {B} \rangle _{\mathrm {F} }}
-
⟨
A
+
C
,
B
+
D
⟩
F
=
⟨
A
,
B
⟩
F
+
⟨
A
,
D
⟩
F
+
⟨
C
,
B
⟩
F
+
⟨
C
,
D
⟩
F
{\displaystyle \langle \mathbf {A} +\mathbf {C} ,\mathbf {B} +\mathbf {D} \rangle _{\mathrm {F} }=\langle \mathbf {A} ,\mathbf {B} \rangle _{\mathrm {F} }+\langle \mathbf {A} ,\mathbf {D} \rangle _{\mathrm {F} }+\langle \mathbf {C} ,\mathbf {B} \rangle _{\mathrm {F} }+\langle \mathbf {C} ,\mathbf {D} \rangle _{\mathrm {F} }}
Also, exchanging the matrices amounts to complex conjugation:
-
⟨
B
,
A
⟩
F
=
⟨
A
,
B
⟩
F
¯
{\displaystyle \langle \mathbf {B} ,\mathbf {A} \rangle _{\mathrm {F} }={\overline {\langle \mathbf {A} ,\mathbf {B} \rangle _{\mathrm {F} }}}}
For the same matrix, the inner product induces the Frobenius norm
-
⟨
A
,
A
⟩
F
=
‖
A
‖
F
2
≥
0
{\displaystyle \langle \mathbf {A} ,\mathbf {A} \rangle _{\mathrm {F} }=\|\mathbf {A} \|_{\mathrm {F} }^{2}\geq 0}
,[1]
and is zero for a zero matrix,
-
⟨
A
,
A
⟩
F
=
0
⟺
A
=
0
{\displaystyle \langle \mathbf {A} ,\mathbf {A} \rangle _{\mathrm {F} }=0\Longleftrightarrow \mathbf {A} =\mathbf {0} }
.
Examples
Real-valued matrices
For two real-valued matrices, if
-
A
=
(
2
0
6
1
−
1
2
)
,
B
=
(
8
−
3
2
4
1
−
5
)
,
{\displaystyle \mathbf {A} ={\begin{pmatrix}2&0&6\\1&-1&2\end{pmatrix}}\,,\quad \mathbf {B} ={\begin{pmatrix}8&-3&2\\4&1&-5\end{pmatrix}},}
then
-
⟨
A
,
B
⟩
F
=
2
⋅
8
+
0
⋅
(
−
3
)
+
6
⋅
2
+
1
⋅
4
+
(
−
1
)
⋅
1
+
2
⋅
(
−
5
)
=
21.
{\displaystyle {\begin{aligned}\langle \mathbf {A} ,\mathbf {B} \rangle _{\mathrm {F} }&=2\cdot 8+0\cdot (-3)+6\cdot 2+1\cdot 4+(-1)\cdot 1+2\cdot (-5)\\&=21.\end{aligned}}}
Complex-valued matrices
For two complex-valued matrices, if
-
A
=
(
1
+
i
−
2
i
3
−
5
)
,
B
=
(
−
2
3
i
4
−
3
i
6
)
,
{\displaystyle \mathbf {A} ={\begin{pmatrix}1+i&-2i\\3&-5\end{pmatrix}}\,,\quad \mathbf {B} ={\begin{pmatrix}-2&3i\\4-3i&6\end{pmatrix}},}
then
-
⟨
A
,
B
⟩
F
=
(
1
−
i
)
⋅
(
−
2
)
+
(
2
i
)
⋅
3
i
+
3
⋅
(
4
−
3
i
)
+
(
−
5
)
⋅
6
=
−
26
−
7
i
,
{\displaystyle {\begin{aligned}\langle \mathbf {A} ,\mathbf {B} \rangle _{\mathrm {F} }&=(1-i)\cdot (-2)+(2i)\cdot 3i+3\cdot (4-3i)+(-5)\cdot 6\\&=-26-7i,\end{aligned}}}
while
-
⟨
B
,
A
⟩
F
=
(
−
2
)
⋅
(
1
+
i
)
+
(
−
3
i
)
⋅
(
−
2
i
)
+
(
4
+
3
i
)
⋅
3
+
6
⋅
(
−
5
)
=
−
26
+
7
i
.
{\displaystyle {\begin{aligned}\langle \mathbf {B} ,\mathbf {A} \rangle _{\mathrm {F} }&=(-2)\cdot (1+i)+(-3i)\cdot (-2i)+(4+3i)\cdot 3+6\cdot (-5)\\&=-26+7i.\end{aligned}}}
The Frobenius inner products of A with itself, and B with itself, are respectively
-
⟨
A
,
A
⟩
F
=
2
+
4
+
9
+
25
=
40
{\displaystyle \langle \mathbf {A} ,\mathbf {A} \rangle _{\mathrm {F} }=2+4+9+25=40}
⟨ B , B ⟩ F = 4 + 9 + 25 + 36 = 74. {\displaystyle \qquad \langle \mathbf {B} ,\mathbf {B} \rangle _{\mathrm {F} }=4+9+25+36=74.}
See also
- Hadamard product (matrices)
- Hilbert–Schmidt inner product
- Kronecker product
- Matrix multiplication
- Tensor product of Hilbert spaces – the Frobenius inner product is the special case where the vector spaces are finite-dimensional real or complex vector spaces with the usual Euclidean inner product
References
- Horn, R.A.; Johnson., C. R. (2012). Matrix Analysis (2nd ed.). Cambridge: Cambridge University Press. p. 321. ISBN 978-0-521-83940-2.