Frobenius Inner Products
The Frobenius inner product multiplies matching entries of equal-shaped matrices and sums the products into one scalar.
On this page 7 sections
01Combine matrix contributions into one number#
The Frobenius inner product multiplies matching entries of equal-shaped matrices and sums the products into one scalar. It is the matrix counterpart of a vector dot product.
The Hadamard product gives the array of individual products. Summing that array produces the inner product. Stopping before the sum returns the wrong kind of object.
02Include every position#
Let have rows and have rows . The entrywise products are . Their sum is .
Only summing the diagonal products would give and miss the off-diagonal contribution of . Every position belongs in the sum, including positions outside the diagonal of a rectangular matrix.
A has rows (1,2),(0,−1); B has rows (3,−1),(4,2). Find their Frobenius inner product.
Show answer and explanation
The products sum to 3−2+0−2=−1.
03A matrix-shaped weighted sum#
If contains sensitivities and contains small changes at matching positions, the inner product combines their signed contributions. For now, treat those matrices as supplied data; the calculus behind that interpretation has its own lesson.
You could list both matrices' entries in the same fixed order and take a vector dot product. The result would be identical. Mixing different entry orders changes the pairings and can change the scalar.
Only B₁₂ increases by 3, and A₁₂=−2. How does their inner product change?
Show answer and explanation
Only one contribution changes, by −2 times 3.
The inputs must have equal shapes. A negative inner product is valid: positive and negative contributions can outweigh one another. It is not a norm or an entrywise matrix output.
Compute the Frobenius inner product of equal-shaped real matrices by summing products of corresponding entries.
- Compute the Frobenius inner product of equal-shaped real matrices by summing products of corresponding entries.
Sources & further reading
- [1]Boyd and Vandenberghe, Introduction to Applied Linear Algebra ↗stanford.edu · Article
- [2]MIT 6.390, Appendix A: Matrix Calculus ↗introml.mit.edu · Article