# Calculate percentage of symmetry of a given matrix

Is it possible to calculate a percentage that quantifies how symmetric a given matrix is?

For example, even if a given matrix is not symmetric, instead of just classifying it as "not symmetric", one can say that it's "$80\%$ symmetric".

My overall goal is to get a kind of a "symmetry score" adding up values of different kinds of symmetry (e.g., translational, rotational). I appreciate any help. Thanks!

• thanks @CarloBeenakker! But that would be about rotational symmetry, no? What about pointsymmetry? My application if this is that I want to measure how symmetric a concrete Web Layout is, based on the grid distribution of the elements. – lydiaP Aug 7 '18 at 12:21

This reference could be what you are looking for:

We introduce a metric – the largest singular value $\delta$ of $(\Gamma − \Gamma^T )/2$, where $\Gamma$ is the Laplacian of a directed graph – to quantify and measure the degree of asymmetry in the graph. The degree of asymmetry captures the overall "directedness" of the graph.

• Wouldn't you want some sort of normalization to answer the question? By that I mean that, given a matrix $A$ ( I guess some $n \times n$ real matrix is intended), the "percentage" (sic) of how symmetric $A$ is should remain unchanged if we replace $A$ by a non-zero scalar multiple. – Geoff Robinson Aug 7 '18 at 13:07
• That is also what I was wondering, that if I have higher values in a Matrix A than in a Matrix B but the "symmetry" is the same, then A will have a higher degree of asymmetry even it should be the same value, right? So dividing maybe the range by the largest value of the matrix? – lydiaP Aug 7 '18 at 13:17
• @GeoffRobinson, why the 'sic' on '"percentage"'? – LSpice Aug 7 '18 at 13:33
• @LSpice : Because I was using the OP's terminology rather than my own. – Geoff Robinson Aug 7 '18 at 14:25

Consider the following $2 \times 2$ matrix and its decomposition in a "natural" orthonormal basis.

$$\begin{bmatrix} 1 & 1\\ 0 & 1\end{bmatrix} = \begin{bmatrix} 1 & 0\\ 0 & 0\end{bmatrix} + \begin{bmatrix} 0 & 0\\ 0 & 1\end{bmatrix} + \frac{1}{\sqrt 2} \left( \frac{1}{\sqrt 2} \begin{bmatrix} 0 & 1\\ 1 & 0\end{bmatrix} \right) + \frac{1}{\sqrt 2} \left( \frac{1}{\sqrt 2} \begin{bmatrix} 0 & 1\\ -1 & 0\end{bmatrix} \right)$$

Let us use the squared Frobenius norm to measure energy. The total energy of the matrix is the sum of the squared coefficients

$$1^2 + 1^2 + \left(\frac{1}{\sqrt 2}\right)^2 + \left(\frac{1}{\sqrt 2}\right)^2 = 3$$

while the energy of the skew-symmetric part is $\left(1/\sqrt 2\right)^2 = 0.5$. Hence, the fraction of total energy that is not skew-symmetric is

$$1 - \frac{0.5}{3} = \frac 56 \approx 83.3 \%$$

However, neglecting the entries on the main diagonal, the fraction of the total off-diagonal energy that is symmetric is (only) $50\%$.

More generally, given a matrix $\rm A$, the fraction of total energy that is not skew-symmetric is

$$1 - \frac{\left\| \frac{\rm A - A^\top}{2} \right\|_{\text{F}}^2}{\| \rm A \|_{\text{F}}^2} = 1 - \left( \frac 12 \cdot\frac{\| \rm A - A^\top \|_{\text{F}}}{\| \rm A \|_{\text{F}}} \right)^2$$