Quadratic form reduction on the $n$-dimensional complex space $\mathbb{C}^n$ How to reduce the quadratic form
$$\sum_{1 \leq k &lt; l \leq n}(k + il)x_kx_l$$
to the canonical form on the $n$-dimensional complex space $\mathbb{C}^n$?
I started with its symmetric matrix
\begin{align*}
S = \frac{1}{2}\begin{pmatrix}
0 &amp; 1 + 2i &amp; 1 + 3i &amp; \cdots &amp; 1 + ni \\
1 + 2i &amp; 0 &amp; 2 + 3i &amp; \cdots &amp; 2 + ni \\
1 + 3i &amp; 2 + 3i &amp; 0 &amp; \cdots &amp; 3 + n i \\
\vdots &amp; \vdots &amp; \vdots &amp; \ddots &amp; \vdots \\
1 + ni &amp; 2 + ni &amp; 3 + ni &amp; \cdots &amp; 0
\end{pmatrix},
\end{align*}
and then tried to reduce it to the diagonal matrix following the algorithmic recipe, i.e., tried reducing it by eliminating the off diagonal elements row/column after row/column: the first step is to clear the first two rows/columns by calculating $P^TSP$, where
\begin{align*}
P = \begin{pmatrix}
1 &amp; -1 &amp; 0 &amp; \cdots &amp; 0 \\
1 &amp;  1 &amp; 0 &amp; \cdots &amp; 0 \\
0 &amp;  0 &amp; 1 &amp; \cdots &amp; 0 \\
\vdots &amp; \vdots &amp; \vdots &amp; \ddots &amp; \vdots \\
0 &amp;  0 &amp; 0 &amp; \cdots &amp; 1
\end{pmatrix}
\begin{pmatrix}
1 &amp;  0 &amp; -\frac{1 + 3i}{1 + 2i} &amp; \cdots &amp; -\frac{1 + ni}{1 + 2i} \\
0 &amp;  1 &amp; \frac{1}{2(1 + 2i)} &amp; \cdots &amp; \frac{1}{2(1 + 2i)} \\
0 &amp;  0 &amp; 1 &amp; \cdots &amp; 0 \\
\vdots &amp; \vdots &amp; \vdots &amp; \ddots &amp; \vdots \\
0 &amp;  0 &amp; 0 &amp; \cdots &amp; 1
\end{pmatrix}.
\end{align*}
The resultant matrix $P^TSP := (s_{ij})$ has already quite complicated entries:
\begin{align*}
&amp; s_{kk} = \frac{k^2 - 2 - 3ki}{1 + 2i}, \; k = 3, 4, \ldots, n; \\
&amp; s_{kl} = \frac{k - 2l + 2kl - 4 - li}{2(1 + 2i)}, \; l &gt; k,
\end{align*}
making the subsequent calculation notoriously nasty, so I am still inconclusive.
Is my attempt on the right track to solve this problem? I think there probably should be a better and cleaner way.
This might be helpful
If we define
$$
\Phi_1:=\sum_{1\leq k&lt;l\leq n}(k+il)x_kx_l
$$
and
$$
\epsilon_{k,l}=\left\{\begin{array}{cc}
1\textrm{ , if }k&lt;l\\
i\textrm{ , if }k&gt;l\\
0\textrm{ , else }
\end{array}\right\}\textrm{, }i=\sqrt{-1}
$$
then
$$
\Phi_1=\sum^{n}_{k,l=1}\epsilon_{kl}kx_kx_l=\frac{1+i}{1-i}\sum_{k&lt;l}(k+l)x_kx_l-\frac{2i}{1-i}\sum^{n}_{k&lt;l}kx_kx_l
$$
This might be helpful
If we define
$$
\Phi_1:=\sum_{1\leq k&lt;l\leq n}(k+il)x_kx_l
$$
and
$$
\epsilon_{k,l}=\left\{\begin{array}{cc}
1\textrm{ , if }k&lt;l\\
i\textrm{ , if }k&gt;l\\
0\textrm{ , else }
\end{array}\right\}\textrm{, }i=\sqrt{-1}
$$
then
$$
\Phi_1=\sum^{n}_{k,l=1}\epsilon_{kl}kx_kx_l=\frac{1+i}{1-i}\sum_{k&lt;l}(k+l)x_kx_l-\frac{2i}{1-i}\sum^{n}_{k&lt;l}kx_kx_l
$$