Proof that certain sums of complex numbers (in a unitary matrix) produce the same constant magnitudes I have a complex unitary matrix $U$, with dimensions $N \times N$, whose elements
are defined as follows:
\begin{equation}
{U_{mk}} = \frac{1}{{\sqrt N }}\exp\left[ {i\frac{{2\pi }}{N}(m - 1)(k - 1)}
\right],{\rm{~}}m = 1, \ldots ,N,{\rm{~}}k = 1, \ldots ,N.
\end{equation}
I would like to prove that, when this kind of matrices are multiplied by an
all-ones vector with just one $-1$ element, then the complex magnitudes (or modulus) of the
elements of the resultant vector are the same no matter where $-1$ is in the
original vector.
For example, for $N = 3$:
$\frac{1}{{\sqrt 3 }}\left( {\begin{array}{*{20}{c}}
1&1&1\\
1&{{{\rm{e}}^{i\frac{{2\pi }}{3}}}}&{{{\rm{e}}^{ - i\frac{{2\pi }}{3}}}}\\
1&{{{\rm{e}}^{ - i\frac{{2\pi }}{3}}}}&{{{\rm{e}}^{i\frac{{2\pi }}{3}}}}
\end{array}} \right) \cdot \left( {\begin{array}{*{20}{c}}
{ - 1}\\
1\\
1
\end{array}} \right)$  produces a vector with complex ${\bf magnitudes}$ $\left(
{\begin{array}{*{20}{c}}
{\frac{1}{{\sqrt 3 }}}&{\frac{2}{{\sqrt 3 }}}&{\frac{2}{{\sqrt 3 }}}
\end{array}} \right)$.$~~$ The same result for the ${\bf magnitudes}$ of the vector elements is obtained if we
multiply by ${\left( {\begin{array}{*{20}{c}}
1&{ - 1}&1
\end{array}} \right)^T}$or by ${\left( {\begin{array}{*{20}{c}}
1&{  1}&-1
\end{array}} \right)^T}$
For $N = 6$:
$\frac{1}{{\sqrt 6 }}\left( {\begin{array}{*{20}{c}}
1&1&1&1&1&1\\
1&{{e^{\frac{{i\pi }}{3}}}}&{{e^{i\frac{{2\pi }}{3}}}}&{ - 1}&{{e^{ -
i\frac{{2\pi }}{3}}}}&{{e^{ - \frac{{i\pi }}{3}}}}\\
1&{{e^{i\frac{{2\pi }}{3}}}}&{{e^{ - i\frac{{2\pi }}{3}}}}&1&{{e^{i\frac{{2\pi
}}{3}}}}&{{e^{ - i\frac{{2\pi }}{3}}}}\\
1&{ - 1}&1&{ - 1}&1&{ - 1}\\
1&{{e^{ - i\frac{{2\pi }}{3}}}}&{{e^{i\frac{{2\pi }}{3}}}}&1&{{e^{ -
i\frac{{2\pi }}{3}}}}&{{e^{i\frac{{2\pi }}{3}}}}\\
1&{{e^{ - \frac{{i\pi }}{3}}}}&{{e^{ - i\frac{{2\pi }}{3}}}}&{ -
1}&{{e^{i\frac{{2\pi }}{3}}}}&{{e^{\frac{{i\pi }}{3}}}}
\end{array}} \right) \cdot \left( {\begin{array}{*{20}{c}}
1\\
1\\
{ - 1}\\
1\\
1\\
1
\end{array}} \right)$  produces a vector with magnitudes $\left(
{\begin{array}{*{20}{c}}
{2\sqrt {\frac{2}{3}} }&{\sqrt {\frac{2}{3}} }&{\sqrt {\frac{2}{3}} }&{\sqrt
{\frac{2}{3}} }&{\sqrt {\frac{2}{3}} }&{\sqrt {\frac{2}{3}} }
\end{array}} \right),$ no matter where $-1$ is in the original vector.
Do you think there is a way to prove that a vector of magnitudes $\left(
{\begin{array}{*{20}{c}}
{\frac{{N - 2}}{{\sqrt N }}}&{\frac{2}{{\sqrt N }}}&{\frac{2}{{\sqrt N }}}&
\ldots &{\frac{2}{{\sqrt N }}}&{\frac{2}{{\sqrt N }}}
\end{array}} \right)$ is obtained [after multiplying by the matrix and then calculating the $\textbf{complex magnitude (modulus)}$ of the elements] in the general case $N \times N$ for any
position of $-1$ in the original vector?
Thank you so much for your answer @fermion Do you know an easy way to see the following conditional equality? (last equation in your answer):
$\sum\limits_{\scriptstyle k = 1,k \ne L\atop
\scriptstyle ~l = 1,l \ne L}^N {\cos \left( {\frac{{2\pi }}{N}(m - 1)(k -
l)} \right)}  - 2\sum\limits_{k \ne L}^N {\cos \left( {\frac{{2\pi }}{N}(m - 1)(k
- L)} \right)}  + 1 = \left\{ \begin{array}{l}
{(N - 2)^2}{\rm{~~if~}}m = 1\\
4{\rm{~~~if~}}m \ne 1
\end{array} \right.$
 A: Let $r_m$ be the $m$th element of the result vector, i.e.
\begin{equation}
  r_m = \sum_k U_{mk} e_k,
\end{equation}
where $U_{mk}=\frac{1}{\sqrt{N}} \exp (i\varphi_{mk})$ and $e_k$ is the $k$th element of a vector with 1 and -1.
Then the square of the complex magnitude of this element is
\begin{align}
  |r_m|^2 &= | \sum_k U_{mk} e_k |^2 = \frac{1}{N} \Big( \sum_{k,l} e_k e_l \cos(\varphi_{mk})\cos(\varphi_{ml})+\sum_{k,l}e_k e_l \sin(\varphi_{mk})\sin(\varphi_{ml})  \Big) \\ &= \frac{1}{N} \sum_{k,l} e_k e_l \cos\Big(\frac{2\pi}{N}(m-1)(k-l) \Big),
\end{align}
where the Euler-formula ($\exp{i\varphi}=\cos(\varphi)+i\sin(\varphi)$), a trig. identity and the form of $\varphi_{mk}$ were used.
Let $e_L=-1$, then the sum (cos is even) is
\begin{equation}
  \sum_{k \ne L, l \ne L} \cos\Big(\frac{2\pi}{N}(m-1)|k-l|\Big) - 2\sum_{k \ne L} \cos\Big(\frac{2\pi}{N}(m-1)|k-L|\Big) + \cos\Big(\frac{2\pi}{N}(m-1)|L-L|\Big)
\end{equation}
from wich one can see that it doesn't matter which $L$ one chooses. To see this, recall that $\cos(\frac{2\pi}{N}(m-1)|k-L|) = \cos(\frac{2\pi}{N}(m-1)(N-|k-L|))$, so e.g. the $\sum_{k \ne L}$ sum contains the same terms, independently from $L$.
