# How can I generate (suitably random) symplectic matrices?

I would like to write a computer script to generate a lot of symplectic matrices. How can I do this? Is there a parameterization of all symplectic matrices?

-

http://www-stat.stanford.edu/~cgates/PERSI/papers/what-is.pdf

-

Choose a subgroup that is easy to generate, say $Sp(2)$, and pick a random pair of coordinates $i < j$ and a random element in $Sp(2)$ spanning the subspace spanned by those two coordinates. This gives a markov chain analogous to the Kac random walk. It is known that this procedure converges. In fact if it measures the convergence rate in the transportation distance, then the rate is $n^2 \log n$.

-

Pick a random element of the Lie algebra of the symplectic group (this you can find explicitly described in Fulton and Harris), and exponentiate it.

-
I think he/she might be looking for a Haar measure sampling. Does this procedure sample from Haar? I seem to recall that it doesn't. –  Steve Flammia Nov 17 '09 at 17:45
The post doesn't ask for that...you're right that the probably of choosing a particular element will be a bit funny, but if you just want a bunch of elements of the symplectic group quickly, I think this is the easiest way to do it. –  Ben Webster Nov 17 '09 at 22:27