In mathematics, the Frobenius inner product is a binary operation that takes two matrices and returns a scalar. It is often denoted
\langleA,B\rangleF
Given two complex-number-valued n×m matrices A and B, written explicitly as
A={\begin{pmatrix}A11&A12& … &A1m\\A21&A22& … &A2m\\\vdots&\vdots&\ddots&\vdots\\An1&An2& … &Anm\\\end{pmatrix}}, B={\begin{pmatrix}B11&B12& … &B1m\\B21&B22& … &B2m\\\vdots&\vdots&\ddots&\vdots\\Bn1&Bn2& … &Bnm\\\end{pmatrix}},
the Frobenius inner product is defined as
\langleA,B\rangleF=\sumi,j\overline{Aij
where the overline denotes the complex conjugate, and
\dagger
\begin{align}\langleA,B\rangleF=&\overline{A}11B11+\overline{A}12B12+ … +\overline{A}1mB1m\\ &+\overline{A}21B21+\overline{A}22B22+ … +\overline{A}2mB2m\\ &\vdots\\ &+\overline{A}n1Bn1+\overline{A}n2Bn2+ … +\overline{A}nmBnm\\ \end{align}
The calculation is very similar to the dot product, which in turn is an example of an inner product.
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 "
vec( ⋅ )
vec(A)={\begin{pmatrix}A11\ A12\ \vdots\ A21\ A22\ \vdots\ Anm\end{pmatrix}}, vec(B)={\begin{pmatrix}B11\ B12\ \vdots\ B21\ B22\ \vdots\ Bnm\end{pmatrix}},
\overline{vec(A)}Tvec(B)={\begin{pmatrix}\overline{A}11&\overline{A}12& … &\overline{A}21&\overline{A}22& … &\overline{A}nm\end{pmatrix}}{\begin{pmatrix}B11\ B12\ \vdots\ B21\ B22\ \vdots\ Bnm\end{pmatrix}}
Therefore
\langleA,B\rangleF=\overline{vec(A)}Tvec(B).
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:
\langleaA,bB\rangleF=\overline{a}b\langleA,B\rangleF
\langleA+C,B+D\rangleF=\langleA,B\rangleF+\langleA,D\rangleF+\langleC,B\rangleF+\langleC,D\rangleF
Also, exchanging the matrices amounts to complex conjugation:
\langleB,A\rangleF=\overline{\langleA,B\rangleF
For the same matrix,
\langleA,A\rangleF\geq0
\langleA,A\rangleF=0\LongleftrightarrowA=0
The inner product induces the Frobenius norm
\|A\|F=\sqrt{\langleA,A\rangleF
For two real-valued matrices, if
A=\begin{pmatrix}2&0&6\ 1&-1&2\end{pmatrix}, B=\begin{pmatrix}8&-3&2\ 4&1&-5\end{pmatrix},
then
\begin{align}\langleA,B\rangleF&=2 ⋅ 8+0 ⋅ (-3)+6 ⋅ 2+1 ⋅ 4+(-1) ⋅ 1+2 ⋅ (-5)\\ &=21.\end{align}
For two complex-valued matrices, if
A=\begin{pmatrix}1+i&-2i\ 3&-5\end{pmatrix}, B=\begin{pmatrix}-2&3i\ 4-3i&6\end{pmatrix},
then
\begin{align}\langleA,B\rangleF&=(1-i) ⋅ (-2)+2i ⋅ 3i+3 ⋅ (4-3i)+(-5) ⋅ 6\\ &=-26-7i,\end{align}
while
\begin{align}\langleB,A\rangleF&=(-2) ⋅ (1+i)+(-3i) ⋅ (-2i)+(4+3i) ⋅ 3+6 ⋅ (-5)\\ &=-26+7i.\end{align}
The Frobenius inner products of A with itself, and B with itself, are respectively
\langleA,A\rangleF=2+4+9+25=40
\langleB,B\rangleF=4+9+25+36=74.