TITLE: How to quantify noncommutativity?
QUESTION [40 upvotes]: If I have two operators or finite-dimensional matrices $A$ and $B$, how can I quantify the amount to which they commute or don't commute? (I would consider it a big plus if it is computable easily for finite complex-valued matrices $A, B \in \mathbb C^{n\times n}$.) 
Let me try the obvious thing here: by definition if $A$ and $B$ commute, then the commutator $[A, B] = AB-BA = 0$. Naively would use some sort of functional like an operator norm to reduce this to a number that could potentially behave like a metric. The first thing I thought of was the trace, but clearly that doesn't work since $\mathrm{tr } [A, B] =\mathrm{tr } (AB-BA) = \mathrm{tr }AB - \mathrm{tr }AB = 0$ always. One could then turn to, say, the Frobenius norm of $[A, B]$. What is known about the maximal (or supremal) value of such norms?
Are there quantifiers of noncommutativity that can also account for higher-order effects, e.g.  cases where $[A, B] \ne 0$ but $[A, [A,B]] = 0$? This should be "less" non-commuting than if $[A, B] \ne 0$ and $[A, [A,B]] \ne 0$ and $[B, [A,B]] \ne 0$ but, say, $[A, [B, [A, B]]] = 0$.
For those who prefer a free algebraic setting, the question can be framed as: how free is a non-free algebra? Is there a sensible way to measure proximity to a free algebra? What if I had an algebra where $AB=BA$ is the only one relation that makes it not a free algebra; is there a sense it is "less free" or "more free" than an algebra where $ABABAB=BAA$ is the only such relation, or example.
Motivation: it is sometimes said that free probability is the study of "maximally" non-commuting objects. I would like to know if this statement can be made precise in the sense of how one can define "maximally non-commuting" in a sensible fashion.

REPLY [2 votes]: A good way to quantify the non-commutativity of $A,B$ is to compare their flows, e.g. to compare the solutions of
$
\dot u=Au,\quad\dot v=Bv
$
with same initial datum. A complete answer is given by the Campbell-Hausdorff formula
$$
\exp{tA}\  \exp{tB}=\exp{\bigl(t(A+B)+\frac{t^2}{2}[A,B]+\frac{t^3}{12}([A,[A,B]]+[B,[B,A]])+\dots\bigr)}.
$$
In the exponent are appearing successively the first bracket and the iterated brackets.

REPLY [2 votes]: One very algebraic way to approach it (alas not that easily approached computationally) - somewhat related to David Jordan's answer - would be to look at the Lie subalgebra generated by $A$ and $B$ in the algebra of matrices (that is, the linear span of all commutator words in $A$ and $B$) and impose one or another condition relaxing commutativity, e.g. say that it is nilpotent of degree $k$ or solvable of degree $k$. In that case, $k$ will of course somewhat quantify the magnitude of noncommutativity $A$ and $B$ share.