85
$\begingroup$

I know that matrix multiplication in general is not commutative. So, in general:

$A, B \in \mathbb{R}^{n \times n}: A \cdot B \neq B \cdot A$

But for some matrices, this equations holds, e.g. A = Identity or A = Null-matrix $\forall B \in \mathbb{R}^{n \times n}$.

I think I remember that a group of special matrices (was it $O(n)$, the group of orthogonal matrices?) exist, for which matrix multiplication is commutative.

For which matrices $A, B \in \mathbb{R}^{n \times n}$ is $A\cdot B = B \cdot A$?

  • 0
    @Aaron thanks for the clarification.2012-07-15

10 Answers 10

68

Two matrices that are simultaneously diagonalizable are always commutative.

Proof: Let $A$, $B$ be two such $n \times n$ matrices over a base field $\mathbb K$, $v_1, \ldots, v_n$ a basis of Eigenvectors for $A$. Since $A$ and $B$ are simultaneously diagonalizable, such a basis exists and is also a basis of Eigenvectors for $B$. Denote the corresponding Eigenvalues of $A$ by $\lambda_1,\ldots\lambda_n$ and those of $B$ by $\mu_1,\ldots,\mu_n$.

Then it is known that there is a matrix $T$ whose columns are $v_1,\ldots,v_n$ such that $T^{-1} A T =: D_A$ and $T^{-1} B T =: D_B$ are diagonal matrices. Since $D_A$ and $D_B$ trivially commute (explicit calculation shows this), we have $AB = T D_A T^{-1} T D_B T^{-1} = T D_A D_B T^{-1} =T D_B D_A T^{-1}= T D_B T^{-1} T D_A T^{-1} = BA.$

  • 0
    The following link might be helpful for the other side: http://math.stackexchange.com/questions/236212/simultaneously-diagonalizable-proof2015-05-19
22

The only matrices that commutes with all other matrices are the multiples of the identity.

  • 1
    @Xam https://math.stackexchange.com/questions/142967/a-be-a-3-times-3-matrix-over-mathbb-r-such-that-ab-ba-for-all-matrices2018-04-10
14

Among the groups of orthogonal matrices $O(n,\mathbb R)$, only the case $n=0$ (the trivial group) and $n=1$ (the two element group) give commutative matrix groups. The group $O(2,\mathbb R)$ consists of plane rotations and reflections, of which the former form an index $2$ commutative subgroup, but reflections do not commute with rotations or among each other in general. The largest commutative subalgebras of square matrices are those which are diagonal on some fixed basis; these subalgebras only have dimension $n$, out of an available $n^2$, so commutation is really quite exceptional among $n\times n$ matrices (at least for $n\geq2$). Nothing very simple can be said that (non-tautologically) characterises all commuting pairs of matrices.

Added. In fact the statement above about the largest commutative subalgebra is false. If you take the set of matrices whose nonzero entries occur only in a block that touches the main diagonal (without containing any diagonal positions) then this is always a commutative subalgebra. And then you can still throw in multiples of the identity matrix. Thus there is for instance a commutative subalgebra of dimension $\lfloor\frac{n^2}4\rfloor+1$ inside $M_n(K)$, for every $n$, and $\lfloor\frac{n^2}4\rfloor+1>n$ for all $n>3$. See here.

5

The orthogonal matrices don't commute, infact there's a subspace of the orthogonals that's non-commutative!

Check that a permutation matrix is an orthogonal matrix (In case you don't know what a permutation matrix is, it's just a matrix $(a_{ij})$ such that a permutation $\sigma$ exists for which $a_{i,\sigma(i)}=1$ and $a_{ij}=0$ for $j\ne\sigma(i)$

Applying to a column vector $x$ the action of the permutation matrices is just permutation of the co-ordinates of $x$. But as we know the symmetry group is non-abelian. So just choose two non-commuting permutations and their corresponding matrices clearly don't commute!

1

A particular case when orthogonal matrices commute.

Orthogonal matrices are used in geometric operations as rotation matrices and therefore if the rotation axes (invariant directions) of the two matrices are equal - the matrices spin the same way - their multiplication is commutative.

Intuitively, if you spin the globe first x degrees and then y degrees around the same axis you and up in the same position as you get by spinning it first y and the x degrees -> The multiplication of the rotation matrices describing the two rotations is commutable, it always yields the combined rotation.

0

If the two matrices have Jordan Normal Forms which have the same block structure. Multiplication of blocks will give diagonal $\lambda_1\lambda_2$, first off-diagonal $\lambda_1 + \lambda_2$ and second off-diagonal $1$ so assuming scalar multiplication and addition is commutative so will the jordan blocks.

  • 0
    Hmm, yes. I was not specific enough. Sorry.2015-08-14
0

All cyclic matrices of the same size n by n commute, each row is a cycle of the previous row.

For two variables, with identity, there are three basic types.

Complex or Elliptic

x y

-y x

Dual (the ring of dual numbers)

x y

0 x

Hyperbolic (also cyclic)

x y

y x

Each can be represented also as a "commutative ring number" x+ty for tt=-1,0,1 respectively...associated with their eigenvalues.

0

for two matrix to show commutativity the necessary and sufficient condition is that they should share all of their eigenvectors, that's it. whether they are diagnolizable or not is immaterial. for example check out following matrices for commutativity and diagnolizabilty. A = [6 -1;1 4] and B = [3 2;-2 7]

both A and B matrices are commutative but they are not diagnalizable however they share their eigenvector.in this case they both have one line of eigenvector

the necessary andsuficient condition which I just mentioned can be proved easily.

  • 2
    You are wrong. $diag(1,-1)$ and $I_2$ commute ; yet, they do not share their eigenvectors.2015-08-13
-7

So there is no group of Matrix pairs that commute. It is $ AB = BA $ if and only if there is a polynomial $ p \in \mathbb{R}[x] $ such that $ p(A)=B. $ This can be proven using Jordan Normalform or by simple computing.

  • 0
    Yet in general this answer is wrong. E.g. see the counterexample composed of nilpotent matrices in [the answer by Marc van Leeuwen](http://math.stackexchange.com/a/331960) in the thread ***"Can commuting matrices X,Y always be written as polynomials of some matrix A?"***2015-02-12