MathOverflow will be down for maintenance for approximately 3 hours, starting Monday evening (06/24/2013) at approximately 9:00 PM Eastern time (UTC-4).

I finally found out the property that resulted in the fact that eigenvalues in my case are independent of $q$. In my case, I found that $Tr((A e^{i q} + A^* e^{-i q})^m)$ is independent on $q$ for any $m$. In which case, it is not difficult to prove that the eigenvalues should be independent on $q$ having $\sum_i \lambda_i^m \frac{\partial \lambda_i }{\partial q}= 0$ for all $m$ we can form a linear combination of these equations such that $\sum_i P(\lambda_i) \frac{\partial \lambda_i }{\partial q}= 0$ where P is some polynomial that we can choose such that $P(\lambda_i) = \frac{\partial \lambda_i }{\partial q}$ given any $q$ and this way we can see that $\frac{\partial \lambda_i }{\partial q}$ vanishes. However, I am still interested to see how such a constraint can be implemented in Denis's David's solution (what does it correspond to regarding F).
I finally found out the property that resulted in the fact that eigenvalues in my case are independent of $q$. In my case, I found that $Tr((A e^{i q} + A^* e^{-i q})^m)$ is independent on $q$ for any $m$. In which case, it is not difficult to prove that the eigenvalues should be independent on $q$ having $\sum_i \lambda_i^m \frac{\partial \lambda_i }{\partial q}= 0$ for all $m$ we can form a linear combination of these equations such that $\sum_i P(\lambda_i) \frac{\partial \lambda_i }{\partial q}= 0$ where P is some polynomial that we can choose such that $P(\lambda_i) = \frac{\partial \lambda_i }{\partial q}$ given any $q$ and this way we can see that $\frac{\partial \lambda_i }{\partial q}$ vanishes. However, I am still interested to see how such a constraint can be implemented in Denis's solution (what does it correspond to regarding F).