The Classification of almost complex structures (almost) tamed by a quadratic form Preamble
I am currently dealing with the almost complex structures associated with a non-degenerate quadratic form. In particular, I am interested the size of the almost complex structures as a homogeneous space (if not, as a topological space) that is "compatible" with the quadratic form $Q$. For the sake of simplicity, we assume the base space is $\mathbb{R}^{2n}$ associated with a quadratic form $Q$ of signature $(+1, +1, ..., -1, -1)$ ($p$ positive signatures and $q$ negative signatures).
Key Question
How many almost complex structures $J\in GL_{2n}(\mathbb{R})$ satisfy $J^TQJ=Q$ (where $\cdot^T$ denotes transpose)? Also, when $\omega$ is a symplectic form, how many almost complex structures that $K^T\omega K=\omega$.
Current Progress
When $J$ is one such almost complex structure, $J^TQJ=Q\iff QJ$ is a symplectic form. So it is also to find how many $J$ that make $QJ$ a symplectic form.
As for the second part of this problem, this problem is well-studied when we imposed the restriction that $QJK$ is positive-definite. The reader may refer to Chapter II of Holomorphic curves in symplectic geometry by Michele Audin and Jacques Lafontaine. Yet when this restriction is lifted, I do not know how to handle this problem.
 A: First, note that if a nondegenerate bilinear quadratic form is compatible with a complex structure, then the components $(p, q)$ of the signature must both be even, so we'll write $p = 2 p'$, $q = 2 q'$.
Now, the special orthogonal group $SO(Q) \cong SO(2p', 2q')$ of orientation-preserving orthogonal transformations preserving a quadratic form $Q$ on $\Bbb R^{2n}$ acts transitively on the set $C$ of complex structures $J$ compatible with $Q$ (one can show this readily by picking, for any two such complex structures $J, K$, bases of $\Bbb R^{2n}$ similarly adapted to $(Q, J)$ and $(Q, K)$).
Now, if we pick a compatible complex structure $J$ and write it in a convenient basis, it's easy to compute explicitly the subgroup of $SO(Q)$ that preserves $J$, called the unitary group, and we usually denote this group $U(p'
, q')$. (It's also a standard exercise to show that $\dim U(p', q') = n^2$.) So, the homogeneous space of complex structures compatible with $Q$ is
$$SO(2p, 2q) / U(p, q),$$
which has dimension
$$\dim SO(2n) - \dim U(n) = \frac{1}{2}(2n)(2n - 1) - n^2 = n (n - 1).$$
This is not only a homogeneous space, but a symmetric space (this series of such spaces is denoted type DIII); it is compact iff $Q$ is definite.
