Coupled oscillators in Hamiltonian formalism - problem with diagonalization I have a problem with simple coupled oscillator system. I tried to solve single oscillator with Hamiltonian, and then coupled system of two, but when I try to put coupling constant $k^\prime=0$ in my second solution, I don't get same result. I tried to diagonalize my problem and find solution in new coordinates.
Coupled harmonic oscillator can be described by kinetic energy
\begin{equation}
    T=\frac{p_{i}^{2}+p_{j}^{2}}{2m} \,. \label{eq:CS_kinE}
\end{equation}
and potential energy,
\begin{equation}
    V=\frac{k_{i}+k^{\prime}}{2}\tilde{q}_{i}^{2}+\frac{k_{j}+k^{\prime}}{2}\tilde{q}_{j}^{2}-k^{\prime}\tilde{q}_{i}\tilde{q}_{j} \,, \label{eq:CS_potE}
\end{equation}
The Hamiltonian of coupled harmonic oscillator thus reads as
\begin{equation}
    \mathcal{H}(\tilde{q},\tilde{p})=\frac{\tilde{p}_{i}^{2}+\tilde{p}_{j}^{2}}{2m}+\frac{k_{i}+k^{\prime}}{2}\tilde{q}_{i}^{2}+\frac{k_{j}+k^{\prime}}{2}\tilde{q}_{j}^{2}-k^{\prime}\tilde{q}_{i}\tilde{q}_{j} \,. \label{eq:CS_hamiltonianTilde}
\end{equation}
To make this calculations easier to read, lets asume $k_i=k_j$. Then, with an introduction of new coordinate and momentum
\begin{alignat}{1}
    q_{k}=\sqrt{m\nu_{k}}\tilde{q}_{k} \,, \label{eq:CS_tildeQ} \\
    p_{k}=\frac{\tilde{p}_{k}}{\sqrt{m\nu_{k}}} \,, \label{eq:CS_tildeP}
\end{alignat}
where $\nu$ is frequency of an oscillator spring constant $k+k^\prime$ and mass $m$, so that harmonic oscillator Hamiltonian becomes
\begin{equation}
    \label{eq:CS_hamiltonian}
    \mathcal{H}(q,p)=\frac{\nu_{i}}{2}\left[q_{i}^{2}+p_{i}^{2}\right]+\frac{\nu_{j}}{2}\left[q_{j}^{2}+p_{j}^{2}\right]-\kappa q_{i}q_{j} \,.
\end{equation}
where $\kappa=\frac{k^\prime}{m\sqrt{\nu_{i}\nu_{j}}}$.
From the canonical relations we find that
\begin{alignat}{1}
    \dot{q_{i}}&=\nu_{i} p_{i} \,, \label{eq:HE_motionCoord1} \\
    \dot{p_{i}}&=-\nu_{i} q_{i}+\kappa q_{j} \,, \label{eq:HE_motionMom1} \\
    \dot{q_{j}}&=\nu_{j} p_{j} \,, \label{eq:HE_motionCoord2} \\
    \dot{p_{j}}&=-\nu_{j} q_{j}+\kappa q_{i} \,. \label{eq:HE_motionMom2}
\end{alignat}
We can represent this set of equations in matrix form as
$$
    \dot{\mathbf{x}}=C\mathbf{x}
$$
\begin{equation}
    \frac{d}{dt}
    \begin{pmatrix} 
    q_{i}\\
    p_{i}\\
    q_{j}\\
    p_{j}
    \end{pmatrix}
    =
    \begin{pmatrix} 
    0 & \nu_{i} & 0 & 0\\
    -\nu_{i} & 0 & \kappa & 0\\
    0 & 0 & 0 & \nu_{j}\\
    \kappa & 0 & -\nu_{j} & 0
    \end{pmatrix}
    \begin{pmatrix} 
    q_{i}\\
    p_{i}\\
    q_{j}\\
    p_{j}
    \end{pmatrix}
    \label{eq:HE_motionMatrix}
\end{equation}
We can factorize matrix C as
\begin{equation}
    R^{-1}\dot{\mathbf{x}}=DR^{-1}\mathbf{x} \,, \label{eq:HE_diagMot}
\end{equation}
where
\begin{equation}
    \label{eq:HE_eigenvectors}
    R=\frac{1}{2}
    \begin{pmatrix}
    i\sqrt{\frac{\nu}{\nu-\kappa}}&-i\sqrt{\frac{\nu}{\nu-\kappa}}&-i\sqrt{\frac{\nu}{\nu+\kappa}}&i\sqrt{\frac{\nu}{\nu+\kappa}}\\
    1&1&-1&-1\\
    i\sqrt{\frac{\nu}{\nu-\kappa}}&-i\sqrt{\frac{\nu}{\nu-\kappa}}&i\sqrt{\frac{\nu}{\nu+\kappa}}&-i\sqrt{\frac{\nu}{\nu+\kappa}}\\
    1&1&1&1
    \end{pmatrix} \,,
\end{equation}
is the matrix whose columns are the eigenvector of C, and
\begin{equation}
    \label{eq:HE_eigenvalues}
    D=
    \begin{pmatrix}
    -i\sqrt{\nu^2-\kappa\nu}&0&0&0\\
    0&i\sqrt{\nu^2-\kappa\nu}&0&0\\
    0&0&-i\sqrt{\nu^2+\kappa\nu}&0\\
    0&0&0&i\sqrt{\nu^2+\kappa\nu}
    \end{pmatrix}
    %=
    %\begin{pmatrix}
    %-i\nu\sqrt{1-\frac{\kappa}{\nu}}&0&0&0\\
    %0&i\nu\sqrt{1-\frac{\kappa}{\nu}}&0&0\\
    %0&0&-i\nu\sqrt{1+\frac{\kappa}{\nu}}&0\\
    %0&0&0&i\nu\sqrt{1+\frac{\kappa}{\nu}}
    %\end{pmatrix} 
    \,,
\end{equation}
is the diagonal matrix whose diagonal elements are the corresponding eigenvalues.
\begin{equation}
    \label{eq:HE_eigenvectorsT}
    R^{-1}=                    
    \frac{1}{2}
    \begin{pmatrix}
    -i\sqrt{\frac{\nu-\kappa}{\nu}}&1&-i\sqrt{\frac{\nu-\kappa}{\nu}}&1\\
    i\sqrt{\frac{\nu-\kappa}{\nu}}&1&i\sqrt{\frac{\nu-\kappa}{\nu}}&1\\
    i\sqrt{\frac{\nu+\kappa}{\nu}}&-1&-i\sqrt{\frac{\nu+\kappa}{\nu}}&1\\
    -i\sqrt{\frac{\nu+\kappa}{\nu}}&-1&i\sqrt{\frac{\nu+\kappa}{\nu}}&1
    \end{pmatrix} \,.  
\end{equation}
With an introduction of new quantities $\xi$ defined as
$$
    R^{-1}\mathbf{x}=\Xi
$$
$$
    \begin{pmatrix}
    \xi_{I}\\
    \xi_{II}\\
    \xi_{III}\\
    \xi_{IV}
    \end{pmatrix}
    =\frac{1}{2}
    \begin{pmatrix}
    -i\sqrt{\frac{\nu-\kappa}{\nu}}q_{i}-i\sqrt{\frac{\nu-\kappa}{\nu}}q_{j}+p_{i}+p_{j}\\
    i\sqrt{\frac{\nu-\kappa}{\nu}}q_{i}+i\sqrt{\frac{\nu-\kappa}{\nu}}q_{j}+p_{i}+p_{j}\\
    i\sqrt{\frac{\nu+\kappa}{\nu}}q_{i}-i\sqrt{\frac{\nu+\kappa}{\nu}}q_{j}-p_{i}+p_{j}\\
    -i\sqrt{\frac{\nu+\kappa}{\nu}}q_{i}+i\sqrt{\frac{\nu+\kappa}{\nu}}q_{j}-p_{i}+p_{j}
    \end{pmatrix}
$$
which are complexly conjugated, so that
\begin{alignat*}{4}
    \xi_{i}&=\xi_{I} \hspace{0.25cm}&\text{and,}\hspace{0.25cm} &\xi_{i}^{\ast}&=\xi_{II}\,,\\
    \xi_{j}&=\xi_{III} \hspace{0.25cm}&\text{and,}\hspace{0.25cm} &\xi_{j}^{\ast}&=\xi_{IV}\,,    
\end{alignat*}
our equations of motions become
\begin{alignat}{1}
    \label{eq:HE_motXi1}
    \dot{\xi}_{i}&=-i\sqrt{\nu^2-\kappa\nu}\xi_{i} \,, \\
    \label{eq:HE_motXi1Ast}
    \dot{\xi}_{i}^{\ast}&=i\sqrt{\nu^2-\kappa\nu}\xi_{i}^{\ast} \,, \\
    \label{eq:HE_motXi2}
    \dot{\xi}_{j}&=-i\sqrt{\nu^2+\kappa\nu}\xi_{j} \,, \\
    \label{eq:HE_motXi2Ast}
    \dot{\xi}_{j}^{\ast}&=i\sqrt{\nu^2+\kappa\nu}\xi_{j}^{\ast} \,.
\end{alignat}
which can be easily solved. We can represent our coordinates and momentum with newly established quantities as
$$
    \mathbf{x}=R\Xi \,,
$$
which now reads as
\begin{alignat}{1}
    q_{i}&=\frac{i}{2}\left[\sqrt{\frac{\nu}{\nu-\kappa}}(\xi_{i}-\xi_{i}^\ast)-\sqrt{\frac{\nu}{\nu+\kappa}}(\xi_{j}-\xi_{j}^\ast)\right] \,, \label{eq:HE_MotCoord1nsSol}\\
    q_{j}&=\frac{i}{2}\left[\sqrt{\frac{\nu}{\nu-\kappa}}(\xi_{i}-\xi_{i}^\ast)+\sqrt{\frac{\nu}{\nu+\kappa}}(\xi_{j}-\xi_{j}^\ast)\right] \,, \label{eq:HE_MotCoord2nsSol}\\
    p_i&=\xi_i+\xi_{i}^\ast-(\xi_j+\xi_{j}^\ast) \,, \label{eq:HE_MotMom1nsSol}\\
    p_j&=\xi_i+\xi_{i}^\ast+\xi_j+\xi_{j}^\ast \,. \label{eq:HE_MotMom2nsSol}
\end{alignat}
The main problem is that solution of single oscilator gives me 
\begin{alignat}{1}
    q_{j}&=\frac{1}{\sqrt{2}}\left[\xi_{j}+\xi_{j}^{\ast}\right] \,, \label{eq:S_coordXi}\\
    p_j&=\frac{i}{\sqrt{2}}\left[\xi_{j}-\xi_{j}^{\ast}\right] \,, \label{eq:S_momXi}
\end{alignat}
which are with $k^\prime=0$ diferent solutions in signs and complexity. And I am desperately trying to find a mistake. Thanks in advance to everyone.
 A: with:
$$A=\left[ \begin {array}{cccc} 0&\vartheta &0&0\\ -
\vartheta &0&\kappa&0\\ 0&0&0&\vartheta 
\\\kappa&0&-\vartheta &0\end {array} \right] 
$$
I get:
$$D= \left[ \begin {array}{c} i\sqrt {\vartheta }\sqrt {\vartheta +\kappa}
\\  -i\sqrt {\vartheta }\sqrt {\vartheta +\kappa}
\\  \sqrt {\vartheta }\sqrt {-\vartheta +\kappa}
\\  -\sqrt {\vartheta }\sqrt {-\vartheta +\kappa}
\end {array} \right]
$$
 and
$$R= \left[ \begin {array}{cccc} -1/2\,{\frac {\sqrt {2}\sqrt {\vartheta }
}{\sqrt {2\,\vartheta +\kappa}}}&-1/2\,{\frac {\sqrt {2}\sqrt {
\vartheta }}{\sqrt {2\,\vartheta +\kappa}}}&1/2\,{\frac {\sqrt {2}
\sqrt {\vartheta }}{\sqrt {\kappa}}}&1/2\,{\frac {\sqrt {2}\sqrt {
\vartheta }}{\sqrt {\kappa}}}\\  {\frac {-1/2\,i
\sqrt {2}\sqrt {\vartheta +\kappa}}{\sqrt {2\,\vartheta +\kappa}}}&{
\frac {1/2\,i\sqrt {2}\sqrt {\vartheta +\kappa}}{\sqrt {2\,\vartheta +
\kappa}}}&1/2\,{\frac {\sqrt {2}\sqrt {-\vartheta +\kappa}}{\sqrt {
\kappa}}}&-1/2\,{\frac {\sqrt {2}\sqrt {-\vartheta +\kappa}}{\sqrt {
\kappa}}}\\  1/2\,{\frac {\sqrt {2}\sqrt {\vartheta }
}{\sqrt {2\,\vartheta +\kappa}}}&1/2\,{\frac {\sqrt {2}\sqrt {
\vartheta }}{\sqrt {2\,\vartheta +\kappa}}}&1/2\,{\frac {\sqrt {2}
\sqrt {\vartheta }}{\sqrt {\kappa}}}&1/2\,{\frac {\sqrt {2}\sqrt {
\vartheta }}{\sqrt {\kappa}}}\\  {\frac {1/2\,i\sqrt
{2}\sqrt {\vartheta +\kappa}}{\sqrt {2\,\vartheta +\kappa}}}&{\frac {-
1/2\,i\sqrt {2}\sqrt {\vartheta +\kappa}}{\sqrt {2\,\vartheta +\kappa}
}}&1/2\,{\frac {\sqrt {2}\sqrt {-\vartheta +\kappa}}{\sqrt {\kappa}}}&
-1/2\,{\frac {\sqrt {2}\sqrt {-\vartheta +\kappa}}{\sqrt {\kappa}}}
\end {array} \right]
$$
so $$R^{-1}\,A\,R=D$$
