I would like to create a random matrix with the constraint that the matrix must be normal, i.e. the matrix and its Hermitian conjugate must commute. I would create a random matrix "without constraints" as


But I have no idea how I can implement the constraint, that the matrix must be normal.

  • 2
    $\begingroup$ Your problem is under-specified, because complex n x n matrix has 2 n^2 degrees of freedom. Hermiticity provides n^2 constraints, but you still have n^2 independent real numbers. These can be distributed however you like, and you will get very different behavior of matrix ensembles depending on their distributions. In Random Matrix Theory, for example, gaussian ensembles are frequently studied, where matrix entries are independent normally distributed (complex) numbers, subject to some symmetry constraints (Hermiticity for example) - and this is a well-specified problem. $\endgroup$ Sep 25, 2012 at 13:20
  • $\begingroup$ I don't know if I understand your point. Do you want me to say something like: Let P(M)dM=k*exp[-Tr[w[M]]]dM be a probability measure, where dM is the measure on the space of normal matrices induced by the Euclidean metric on all complex matrices, w is a potential function, and k is a factor of normalization. How do I generate a random matrix from this ensemble? $\endgroup$ Sep 25, 2012 at 14:06
  • $\begingroup$ Yes, my point was only that in your formulation, there is not enough information. If you specify the probability (as you did, for example), and then w[M] as well, then your problem is well-specified. How to generate such a matrix (if it is subject to non-trivial symmetry constraints) is another matter. Random Matrix Theory is a general field which studies such random matrix ensembles. In particular, some of its most powerful results are universality statements, which state that eigenvalue statistics may be independent of the exact form of potential w, but depend on the symmetries only. $\endgroup$ Sep 25, 2012 at 14:21
  • $\begingroup$ In my book, I gave an example of how one can construct a random Wishart matrix, which has a more complex symmetry than e.g. Hermitian. Your constraint seems more involved. You may want to look at research literature on random normal matrices for the algorithms of their generation. But, to re-iterate, first you should define your probability measure. Then, if your potential w is not simple, I would look at whether or not any universality holds, because it may seriously simplify it. $\endgroup$ Sep 25, 2012 at 14:28
  • 1
    $\begingroup$ @LeonidShifrin I don't know if it was available in v6, when you wrote the book, but as of v8, you can load the MultivariateStatistics package and use WishartDistribution. For example, RandomVariate[ WishartDistribution [ IdentityMatrix@10, 20 ], 1] $\endgroup$
    – rm -rf
    Sep 25, 2012 at 16:10

1 Answer 1


Why not start with an eigendecomposition?

n = (* desired dimension *);
(* random unitary matrix *)
q = Orthogonalize[RandomVariate[NormalDistribution[], {n, n}] +
                  I RandomVariate[NormalDistribution[], {n, n}]]
(* random normal matrix *)
mat = q.DiagonalMatrix[RandomVariate[NormalDistribution[], n] +
                       I RandomVariate[NormalDistribution[], n]].ConjugateTranspose[q]

You can check the normality of mat with mat.ConjugateTranspose[mat] - ConjugateTranspose[mat].mat // Chop; it should return an array of 0s.

I'm not entirely sure of what distribution a matrix generated in this manner follows, though.

  • $\begingroup$ Yes, it was something like that I had in mind. The main problem with this approach is that one is not looking random matrix (meaning that entries are chosen according to some distribution), but rather at random distributed eigenvalues. $\endgroup$ Sep 25, 2012 at 13:03
  • $\begingroup$ I don't understand your objection. I did concede that I don't know the distribution being followed by the matrix generated in this manner, but I'm not sure about your entries are chosen according to some distribution; certainly, the entries of a matrix generated in this way will follow a distribution of some sort. $\endgroup$ Sep 25, 2012 at 13:15
  • $\begingroup$ You're of course right; the entries do follow some distribution(s). Please disregard my last comment. I found your answer very informative, and think I can use it solve original problem. $\endgroup$ Sep 25, 2012 at 13:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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