How to find a symplectic matrix that satisfies an additional condition I have problem how to obtain symplectic $4\times 4$ matrix $T$ with one more condition.  Matrix $H$ is known and I have it in analytical form, but the problem is how to obtain matrix $T$ which is not unique and according to that, I need to find one which satisfy second condition


*

*symplectic condition: $T^T J T=J$

*additional: $T^T H T=\begin{pmatrix}
 \lambda  & 0 \\
 0 & \lambda  \\
\end{pmatrix}_{4*4 }, $
where
$$J=\begin{pmatrix}
 0 & I \\
 -I & 0 \\
\end{pmatrix},\qquad H=\begin{pmatrix}
 H_1 & H_2 \\
 H_3 & H_4 \\
\end{pmatrix}_{4*4 },\qquad \lambda =\begin{pmatrix}
 \lambda _1 & 0 \\
 0 & \lambda _2 \\
\end{pmatrix}_{2*2 },\qquad I=\begin{pmatrix}
 1 & 0 \\
 0 & 1 \\
\end{pmatrix}.$$
I started from condition 2) but system is complex.  Any comment or suggestion what to do?
 A: Your problem is called the Williamson normal form for symplectic matrices. 
It states that any positive definite matrix H (I assume this is given in your case) can be brought to a block diagonal form as you specified it using symplectic transformations. 
There are many proofs of this theorem, but most of them are not constructive (enough) for your case. 
The one constructive proof that I know uses the fact from linear algebra,  that skew-symmetric matrices can be brought to a "nearly diagonal" form orthogonally. More precisely : 
Let $A \in \mathbb{R}^{2n\times 2n}$ be a skew-symmetric matrix. Then $\exists K \in O(2n)$ such that 
$K^TAK =   \begin{pmatrix} 
0 & \Lambda  \\
-\Lambda & 0\end{pmatrix}$
Using this fact it is easy to prove Williamson's theorem, which is stated as follows: 
Let $H \in \mathbb{R}^{2n\times 2n}$ be positive definite. Then there is a symplectic matrix $T\in Sp(2n)$ such that $T^TJ S = \begin{pmatrix} 
\Lambda &  0\\
0 & \Lambda \end{pmatrix} =: D^2$ where $\Lambda$ is a diagonal matrix with positive entries.
Proof: 
Since we are only proving existence we can assume without loss of generality that $ T = H^{-1/2}KD$ for some $K\in O(2n)$. 
Here we are using the positive definiteness of $H$ and $D^2$ to define their square roots.
For $S$ to be symplectic we need $T^TJ S = J $ to hold which using the assumed structure of $T$ leads to \begin{equation}DK^TH^{-1/2}JH^{-1/2}KD = J \end{equation} or equivalently \begin{equation}K^TH^{-1/2}JH^{-1/2}K = D^{-1}J D^{-1} = \begin{pmatrix} 
0 & \Lambda^{-1}  \\
-\Lambda^{-1} & 0\end{pmatrix} \end{equation}
Now noticing that the matrix $H^{-1/2}JH^{-1/2}$ is skew-symmetric you can use the previous statement and be done. 
I hope that this helps you constructing the matrix T, though getting the square root of H might be quite difficult. 
