Average of polynomials over the real sphere In quantum information, much can be done with the averaging formula
$$
\int_{\mathbb{C}P^{n-1}} (zz^*)^{\otimes t} dz = {n + t -1 \choose t}^{-1} \operatorname{\Pi}_{\mathrm{Sym}^t}$$
Here the integral gives an average over all unit vectors $z \in \mathbb{C}^n$ and $\operatorname{\Pi}_{\mathrm{Sym}^t}$ denotes the orthogonal projector onto the totally symmetric subspace of $(\mathbb{C}^n)^{\otimes t}$. This result appears as Lemma 1 in the following paper.
Does this result have an analog for the average over all unit vectors $x \in \mathbb{R}^n$?
$$
\int_{\mathbb{R}P^{n-1}} 
(xx^\top)^{\otimes t} dx = {?}
$$
By direct computations, I see that the first formula does not hold when $\mathbb{C}P$ is replaced by
$\mathbb{R}P$ for $t=2$.
Having a formula for
$\int_{\mathbb{R}P^{n-1}} (xx^\top)^{\otimes t} dx$ (even for $t = 2$) would help with a problem I'm working on, but I have not been able to find a reference for this or discover a formula myself.
 A: Here is a solution for the case $t=2$.
Let $$T= \int_{\mathbb{R}P^{n-1}} 
(xx^\top)\otimes (xx^\top) dx $$
(I'm gonna assume that the integral is normalized so that the measure of $\mathbb{R}P^{n-1}$ is $1$).
As in the complex case, it's easy to see that $T$ has image in the symmetric subspace $\text{Sym}^2 \mathbb{R}^n$ and vanishes on its complement $\bigwedge^2\mathbb{R}^n$. Hence it's enough to understand the action of $T$ on $\text{Sym}^2 \mathbb{R}^n$.
Let $\phi : \text{Sym}^2 \mathbb{R}^n \to \mathbb{R}$ be the linear map defined by $\phi(x\otimes y)=\langle x,y\rangle$ and let $W=\ker \phi$. As a representation of $SO(n)$, $\text{Sym}^2 \mathbb{R}^n$ decomposes into irreducibles as
$$\text{Sym}^2 \mathbb{R}^n = W \oplus \mathbb{R}\omega$$
where $\omega=\sum_{i=1}^n e_i\otimes e_i \in \text{Sym}^2 \mathbb{R}^n$ for any orthogonal basis $(e_i)_{i=1}^n$ of $\mathbb{R}^n$ (and the two summands are still irreducible over $\mathbb{C}$; see https://math.stackexchange.com/questions/4413836/decomposition-of-symmetric-powers-of-the-standard-representation-of-son).
It's easy to see that $T$ commutes with the action of $SO(n)$ on $\text{Sym}^2 \mathbb{R}^n$, so by Schur's lemma it must act by a scalar $\lambda$ on $W$ and by another scalar $\mu$ on $\mathbb{R}\omega$.
To determine $\mu$, we can calculate explicitly
$$T\omega = \int_{\mathbb{R}P^{n-1}} 
\sum_{i=1}^n \langle x, e_i\rangle\>^2 x\otimes x \ dx = \int_{\mathbb{R}P^{n-1}} 
x\otimes x \ dx$$
which is sent under $\phi$ to
$$\int_{\mathbb{R}P^{n-1}} 
1 \ dx = 1$$
On the other hand, note that $\phi(\omega)=n$. Hence we must have $\mu =\frac{1}{n}$.
To determine $\lambda$, note that $xx^\top\otimes xx^\top$ has trace $1$ for every unit vector $x\in \mathbb{R}^n$, so $T$ itself has trace $1$. On the other hand the trace of $T$ is given by
$$\text{Tr}(T)=\lambda \cdot \dim(W) + \mu = \lambda \cdot \frac{n^2+n-2}{2} + \frac{1}{n}=\lambda\cdot\frac{(n-1)(n+2)}{2} + \frac{1}{n}.$$
Solving, for $\lambda$, we find that $\lambda = \frac{2}{n(n+2)}$.
This gives a complete description of the averaged operator $T$ in the case $t=2$. With more work, I think that the same ideas can be extended to arbitrary $t$, using the decomposition of $\text{Sym}^t \mathbb{R}^n$ into $SO(n)$-irreducibles described in the MSE question linked above.
