Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I generate random commuting hermitian matrices ?

EDIT: Another question: given a certain hermitian matrix, how can I generate a random hermitian matrix which commutes with it?

share|cite|improve this question
The answer to the second question, as hinted out by the answer by drakas is to diagonalize the given matrix and use $U$ in his answer the unitary matrix composed of the eigenvectors. – Tarek Dec 4 '12 at 14:21
up vote 1 down vote accepted

Take $m$ real diagonal matrices $D_m$ with $d_{kk}=\delta_{mk}$ and a unitary matrix $U\in \operatorname{U}(n)$. You'll get a set of $m$ commuting hermitian matrices by: $$ H_m=U^\dagger \cdot D_m \cdot U. $$
This is the maximal abelian subalgebra of the Lie algebra $\mathfrak{ u}(n)$. The centralizer of a maximal toral Lie subalgebra is called the Cartan subalgebra:

A Cartan subalgebra of the Lie algebra of $n×n$ matrices over a field is the algebra of all diagonal matrices.

share|cite|improve this answer
How can I generate a random unitary matrix ? – Tarek Dec 3 '12 at 20:46
Use $\displaystyle U=e^{iH}$, where $H$ is a random hermitian matrix. – draks ... Dec 3 '12 at 20:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.