Given a $2n\times 2n$ real, symmetric, Hamiltonian matrix $W$ (anticommutes with the symplectic metric), is there an orthogonal, symplectic matrix $R$ such that $R^\top WR$ is block-diagonal?
Being symmetric, for sure one can diagonalize $W$ by an orthogonal matrix. However, we only want block-diagonalization. This relaxation may let me make $R$ symplectic. I am looking for an explicit construction of $R$ in terms of i.e., SVD's of $W$'s blocks.
Let $J$ be the symplectic form $$ J= \left(\begin{array}{cc} 0&1\\\ -1&0 \end{array}\right). $$
Given that $W$ is symmetric ($W^\top=W$) and Hamiltonian ($WJ=-JW$), it has block form $$ W=\left(\begin{array}{cc} x&y\\\ y&-x \end{array}\right) $$ with $x=x^\top$ and $y=y^\top$. $R$ can be parametrized as $$ R=\left(\begin{array}{cc} c&s\\\ -s&c \end{array}\right) $$ both the symplectic and orthogonal conditions boil down to $cc^\top+ss^\top=I$ and $cs^\top-sc^\top=0$.
I am looking for $c$ and $s$ such that $$ R^\top W R=D $$ where $$ D=\left(\begin{array}{cc}d&0\\\ 0&-d \end{array}\right). $$
Hint: Writing $WR=RD$ yields equations \begin{align} xc-ys&=cd\\\ xs+yc&=-sd \end{align} Defining $t=sc^{-1}$ and equating the $d$'s in previous equations one can write (assuming $c$ is nonsingular!) $$ t y t-tx-xt-y=0. $$ This is a particular form of the Riccati equation. It admits a "simple" solution if $y\geq0$ and $y+xy^{-1}x\geq0$ and from here one may be able to find a solution. Unfortunately I cannot assume these.
Note: Numerical tests suggest that this is always possible. Namely, for any $W$ that I generate, it seems that given the orthogonal diagonalization $W=O^\top D O$ there is always a permutation matrix $P$ such that $OP$ is symplectic. Furthermore, the resulting diagonalization is always strictly diagonal, not only block-diagonal.