Let $A$ be a $N \times N$ symmetric positive semi-definite matrix with $N \geq 2$. Let $D$ be a diagonal matrix of dimension $N$. I would like to measure how much $A$ "is far" from $D$, i.e. I am trying to find a way to quantify how $A$ differs from a diagonal matrix. More generally, the aim is to come up with a measure that captures the overall "level of orthogonality" of $A$, such that if I have another positive semi-definite matrix $B$, with the same dimension, I can argue that $A$ is more or less close to being orthogonal than $B$, which means I am interested in a relative statement. To be more explicit: I would like to quantify how $A$ is close to being an orthogonal matrix, and how $B$ is close to being an orthogonal matrix, not how $A$ and $B$ are orthogonal to each other.
Any suggestion (even partial) is welcome



Measuring the "distance" of a matrix from a diagonal matrix
**Q:** *Is there a measure that captures the overall "level of orthogonality" of two matrices $A$ and $B$.*


You can collect the $N^2$ elements of $A$ and $B$ into a pair of vectors $a$, $b$, and then take the inner product $(a,b)=\sum\_{ij}\bar{A}\_{ij}B\_{ij}={\rm tr}\,A^\ast B$. This would generalize the usual measure of orthogonality of pairs of vectors to pairs of matrices.


I understand this to be the motivation for your question of the "distance of a matrix $A$ from a diagonal matrix $D$"; for that distance you could just use the Frobenius norm, ${\rm tr}\,(A-D)(A-D)^\ast$.


