I have a sequence of real numbers. I want to know whether this sequence looks like the traces in the standard representation of a random sequence of elements of $G\_2$. (Here random is according to the Haar measure on the compact form.)


So I want to compare my sequence with the measure on $\mathbb R$ that is the pushforward of the Haar measure along the trace map. Thus I want some description of this measure.


It [seems difficult](https://mathoverflow.net/questions/101587/sato-tate-measure-for-gl3-automorphic-forms) to find an explicit formula for this measure. However, I'd still like a way to estimate it.


For $U\_n, SU\_n$, $USP\_n$, and $O\_n$, [this paper](http://arxiv.org/abs/math-ph/0609050) describes how to generate a random element, and hence how to estimate the Haar measure using Monte Carlo.


One could also compute the moments of the distribution using representation theory, and try to estimate the measure from that, but this seems like a bad idea.



How to estimate the Haar measure on $G_2$
Here's a method that should work...


Step 0: Consider the octonions with basis $1, i,j, ij, \ell, \ell i, \ell j, \ell i j$, where $i,j,\ell$ are imaginary unit octonions, with $ij = - ji$, and $\ell$ orthogonal to $H = R + Ri + Rj + Rij$.


Step 1: Choose a random imaginary unit octonion, i.e. a random point $i'$ on the 6-sphere. The easiest way is probably to sample normal distributions in each of 7 variables then normalize the resulting vector.


(The set of $g \in G\_2$ which send $i$ to $i'$ forms an $SU(3)$-torsor.)


Step 2: Now choose a random imaginary unit octonion $j'$ which is orthogonal to $i'$ (with respect to the form $T(x,y) = Tr(xy)$). This requires sampling from the 5-sphere. The space $H' = R + Ri' + Rj' + Ri'j'$ is isomorphic to the usual quaternions as an $R$-algebra. 


(The set of $g \in G\_2$ which send $i$ to $i'$ and $j$ to $j'$ forms an $SU(2)$-torsor.)


Step 3: Now choose a random imaginary unit octonion $\ell'$ which is orthogonal to the subspace $H'$. This requires sampling from the 3-sphere.


($SU(2)$ acts simply transitively on this set of choices)


(For a sanity check, 6+5+3 = 14 = $dim(G\_2)$)


There is a unique element $g \in G\_2$ which sends $i$ to $i'$ and $j$ to $j'$ and $\ell$ to $\ell'$. Even better, the trace of $g$ under the standard representation should now be pretty easy to compute. 


