Generalized inner product for matrix
With an inner product structure, we can calculate 'similarity' measures like distances and angles, and define geometric Orthogonality. It is used to measure "distances between matrices" and to calculate gradients in optimization problems using inner products.
Using Matrix Trace
Frobenius norm
Frobenius inner product
In mathematics, the Frobenius inner 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} }}
. 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.
https://en.wikipedia.org/wiki/Frobenius_inner_product

Seonglae Cho