What are all invariant polynomials on the space of algebraic curvature tensors? Let $V = (\mathbb{R}^n, g)$, where $g$ is the Euclidean inner product on $V$. Denote by $G$ the orthogonal group $O(V) = O(n)$ and by $\mathfrak{g}$ the Lie algebra of $G$.
Let $W \subset \Lambda^2V^* \odot \Lambda^2V^*$ be the subset satisfying the algebraic Bianchi identity. More precisely, let $R(v_1,v_2,v_3,v_4)$ denote an element of $\Lambda^2V^* \odot \Lambda^2V^*$. Thus $R$ is skew-symmetric in $v_1$ and $v_2$ and it is also skew-symmetric in $v_3$ and $v_4$. Moreover
$$ R(v_3,v_4,v_1,v_2) = R(v_1,v_2,v_3,v_4). $$
Then $R \in W$ if and only if, in addition to the conditions above, $R$ also satisfies the following identity (known as the algebraic Bianchi identity):
$$ R(v_1,v_2,v_3,v_4) + R(v_2,v_3,v_1,v_4) + R(v_3,v_1,v_2,v_4) = 0. $$
Now my question can be formulated. What is an explicit description of the ring $\mathbb{C}^G[W]$ of $G$-invariant polynomials on $W$ (with $W$ being the space of algebraic curvature tensors, if I may call it so) and $G$ acting on $W$ by restricting its natural action on $\Lambda^2V^* \odot \Lambda^2V^*$.
Also, if one fixes a degree $d > 0$, what is an explicit description of the space of $G$-invariant homogeneous polynomials in $W$ of degree $d$?
I was thinking at first about the Chern-Weil homomorphism, but I think this only gives a proper subspace of $G$-invariant polynomials on $W$, and not all of them (I am not a 100% sure). This has probably been studied in the literature. I don't have access to MathSciNet anymore though (due to some budget cuts by my University).
Edit 1: I notice some overlap with the post Invariant polynomials in curvature tensor vs. characteristic classes, but the posts are sufficiently different.
 A: I think this is unlikely to have a very nice answer.  When $n=2$ and $n=3$, the answer is simple, but, already for $n=4$, it's not likely to be easy to give a set of generators and relations for the $\mathrm{O}(n)$-invariant polynomials on the vector space $\mathcal{R}_n$ of algebraic curvature tensors in dimension $n$.  (I'm avoiding the OP's notation of $W$ for this space because it doesn't explicitly reference the dimension $n$ and I don't want to confuse it with the space of Weyl curvature tensors.)
Since $\mathcal{R}_n$ has dimension $\tfrac1{12}n^2(n^2-1)$ and since, for $n>2$ the generic element of $\mathcal{R}_n$ has only a finite stabilizer in $\mathrm{O}(n)$, the dimension of the ring of $\mathrm{O}(n)$-invariant polynomials on $\mathcal{R}_n$ will be
$$
\frac1{12}n^2(n^2-1) - \frac12n(n-1) = \frac1{12}(n+3)n(n-1)(n-2),
$$
so there will always be at least that many independent generators and, when $n>3$, many more, plus a bunch of relations, since the quotient space will not be 'smooth' near the origin.
Once one gets above the low degrees when $n>3$, to compute the dimensions of the graded pieces of this ring will be complicated (essentially, one is asking for the Hilbert series of the ring of invariants).  (However, the dimension of the grade 1 piece is 1, and the dimension of the grade $2$ piece is $2$ for $n=3$ and $3$ for $n>3$.  If one were using $\mathrm{SO}(4)$ for $n=4$, the dimension of the grade $2$ piece would be $4$.)
I imagine that the answers for $n=4$ are known (though I don't know them) since it is, in principle, just a representation-theoretic computation.
A: I am not sure that this has a "nice" answer. Your question can be reformulated as follows. Let $\mathcal{A}_n$ be the space of algebraic curvature tensors on $\mathbb{R}^n$. A homogenous polynomial $P$ on $\mathcal{A}_n$ is the same as an element of $S^k\mathcal{A}_n$, the $k$-th symmetric tensor power of $\mathcal{A}_n$. Now if $H_k$ is the space of homogeneous polynomials of degree $k$ on $\mathcal{A}_n$, then $H_k \subset S^k \mathcal{A}_n$ is a subrepresentation of $G$.
In other words, a recipe to obtain an answer to your question for specific $k$, $n$, is the following. Decompose the $G$-representation $S^k \mathcal{A}_n$ into irreducible $G$-representations and count the number of trivial representations among those. This can be done for low $k$, $n$ using software such as LiE.
Note that as a $G$-representation, the space $\mathcal{A}_n$  splits into the direct sum of three irreducible representations:
$$ \mathcal{A}_n = \mathbb{R} \oplus S^2_0(\mathbb{R}^n) \oplus \mathcal{W},$$
where $\mathcal{W}$ is the space of Weyl curvature tensors (i.e. those curvature tensors that are additionally entirely trace-free).
A quick check on LiE shows that there are plenty such polynomials: For example, looking for polynomials that depend on the Weyl part alone and $n$ large, there is one of degree 2 and four of degree 3. I doubt there is a good general answer.
