Given a dimension $n$, the space of curvature operators is the space $S^2_B(\Lambda^2\mathbb{R}^n)$ of symmetric endomorphisms $R$ of $\Lambda^2\mathbb{R}^n$ which satisfy the first Bianchi identity :

Given $x,y,z,t\in\mathbb{R}^n$, $\langle R(x\wedge y),z\wedge t\rangle+\langle R(y\wedge z),x\wedge t\rangle+\langle R(z\wedge x),y\wedge t\rangle=0$

This the space where the curvature tensor of a Riemannian manifold lives.

It is naturally equipped with the following action of $O(n,\mathbb{R})$ :

$\langle g.R(x\wedge y),z\wedge t\rangle =\langle R(gx\wedge gy),gz\wedge gt\rangle$

which splits into irreducible components :

$S^2_B(\Lambda^2\mathbb{R}^n)=\mathbb{R}Id_{\Lambda^2\mathbb{R^n}}\oplus S^2_0\mathbb{R}^n\wedge id_{\mathbb{R}^n} \oplus \mathcal{W}$

where $\wedge$ is the Kulkarni-Nomizu product and $\mathcal{W}$ is the space of Weyl tensors, that is tensors in $S^2_B(\Lambda^2\mathbb{R}^n)$ whose traces are all zero.

In my research on Ricci flow, I am investigating Hamilton's ODE, which is ODE on $S^2_B(\Lambda^2\mathbb{R}^n)$. I am currently doing some numerical exploration, and haven't come with a good way of getting a "random" initial condition. I would like this choice to be invariant under the action of $O(n,\mathbb{R})$. This implies that we can treat each component of the previous decomposition separately. My question then splits in two subquestions :

Q1:To treat the first two parts of the decomposition, I just need to generate a random symmetric matrix on $\mathbb{R}^n$ in an $O(n,\mathbb{R})$ invariant way. I believe this is classic "random matrix theory", but I am unfortunately totally ignorant about this field. What would be an efficient algorithm to solve this problem ?Q2:How to treat the Weyl part ? Can we design an efficient algorithm for generating a Weyl tensor ?

PS: I know that the first question must be already treated somewhere, but while googling "random symmetric matrix" gave me interesting information, I wasn't able to recover an algorithm from that.

PS2: If that helps, the software I'm using is FreeMat, an open source clone of matlab.