In a derivation I encountered the following problem: Let $\mathbf{U}$ be an orthogonal matrix and $\mathbf{D}$ be a diagonal matrix with pairwise different, strictly positive elements, both of dimension $n$. An orthogonal similarity transformation $\mathbf{U^T} \mathbf{D} \mathbf{U} = \mathbf{M}$ turns $\mathbf{D}$ into a matrix $\mathbf{M}$ which has diagonal elements that are identical to each other (but is not necessarily a diagonal matrix [actually there would be no solution for diagonal $\mathbf{M}$]).
How can I determine an orthogonal matrix $\mathbf{U}$ which fulfills this condition?
Is it always possible to find such a matrix $\mathbf{U}$, regardless of the dimension $n$ and regardless of the choice of diagonal elements in $\mathbf{D}$?
There is a related question, but it only concerns $2 \times 2$ matrices: Is there a similarity transformation rendering all diagonal elements of a matrix equal?
Any ideas on this one? Thank you!
in the complex/unitary case, consider setting
$\mathbf U := \mathbf F$
where $\mathbf F$ is the Discrete Fourier Transform matrix, which is unitary. (The conventions vary -- sometimes people write $\frac{1}{\sqrt{n}}\mathbf F$ as being unitary.) Then $\mathbf {FDF}^*$ is a circulant matrix and has constant elements on the diagonal.
in particular check, using associativity and outerproduct interpretation of matrix multiplication:
$\mathbf {FDF}^* =\big(\mathbf {FD}\big)\mathbf F^* = \sum_{j=1}^n \lambda_j\cdot \mathbf f_j \mathbf f_j^* $
and the diagonal of each $\mathbf f_j \mathbf f_j^*$ is constant. Using the Hadamard product this is written as :
$\mathbf I\circ\big(\mathbf f_j \mathbf f_j^*\big)=\frac{1}{n}\mathbf I$
which gives the result.