When does a Hermitian operator have real matrix elements? I will use braket-notation, but my question is not specific to quantum mechanics. Instead, I would be interested in a general answer for operators in some Hilbert space. Let $H$ be a Hermitian operator with eigenstates $|i\rangle$, so that $H |i\rangle = E_i |i\rangle$, where some eigenvalues may possibly be degenerate. Now consider another Hermitian operator $A$. This operator can be represented as a matrix in the basis $\{|i\rangle\}$ of the eigenvectors of $H$, with elements
$$
A_{ij} = \langle i|A|j \rangle
$$
Hermiticity of $A$ then requires $A_{ji} = A_{ij}^*$. In general, however, these matrix elements may be complex. My question is the following: Is it possible to formulate a condition on $A$, probably in relation to $H$, such that the matrix elements of $A$ in the basis formed by the eigenvectors of $H$ are real, $A_{ji} = A_{ij}$, if this condition is satisfied?
I think in some situations a simple multiplication by a phase factor may be sufficient. Assuming the $A_{ij}$ are complex, one may write
$$
A_{ij} = |A_{ij}| \, e^{i \phi_{ij}}
$$
Now consider transforming to new basis vectors given by $|i'\rangle = e^{i \nu_i} |i\rangle$. These are still eigenstates of $H$ and the matrix elements of $A$ in this new basis are given by
$$
A_{ij}' = |A_{ij}| \, e^{i (\phi_{ij} + \nu_j - \nu_i)}
$$
So if there is a solution for the $\nu_i$ to the set of $n^2$ equations (where $n$ is number of eigenstates of $H$, so dimension of Hilbert space) given by
$$
\phi_{ij} + \nu_j - \nu_i = 0,
$$
then the operator $A$ can be represented by a real matrix in that basis. I believe that such a solution exists in the case when the phases satisfy the relation $\phi_{ij} + \phi_{jk} = \phi_{ik}$. However, I don't think the phases of a general operator $A$ necessarily satisfy this condition. If they do not, there may not be a solution to the system of equations since there are $n^2$ constraints, but only $n$ variables $\nu_i$ to solve for.
Is there a general relation between $A$ and $H$ that leads to a representation of $A$ in terms of a matrix with real elements?
 A: I don't think you will get $n^2$ unique equations, since only off-diagonal elements can be complex. Further you need to only consider the upper off-diagonal ones since the bottom off-diagonals are just their complex conjugates. That leaves you with a total set of $\frac{n(n-1)}{2}$ phases $\phi_{ij}$. Rescaling the $n$ basis vectors by an arbitrary phase also gives you $\frac{n(n-1)}{2}$ possibilities for the differences $\nu_i - \nu_j$.
For example, take the case $n=3$. We have the phases $\phi_{12}, \phi_{13}, \phi_{23}$ for the upper off-diagonal elements and minus those for the lower off-diagonal elements. Rescaling the basis elements, we have
$$
\phi_{12} = \nu_1 - \nu_2,\\
\phi_{13} = \nu_1 - \nu_3, \\
\phi_{23} = \nu_2 - \nu_3.
$$
EDIT:
As user @Dvij D.C. pointed out, this case works since $\frac{n(n-1)}{2}=n$ has a solution when $n=3$, i.e. the number of independent variables is equal to the number of equations for the differences. In higher dimensions, the number of equations will be more than the number of independent variables and so in general this will not be possible unless the phases are chosen in a specific way.
