TITLE: Can this determinant ever vanish?
QUESTION [13 upvotes]: Let $a_j=1 +2\cos\left(\frac{2\pi j}q\right)$ for $j=1,\dots,q$. Then consider the Hermitian matrix:
$$A_q = \begin{pmatrix} 
           a_1 &      1 &      0 &      0 & \ldots &       0 & 1 \\ 
             1 &    a_2 &      1 &      0 & \ldots &       0 & 0 \\ 
             0 &      1 &    a_3 &      1 & \ldots &       0 & 0 \\
             0 &      0 &      1 &    a_4 & \ldots &       0 & 0 \\ 
        \vdots & \vdots & \vdots & \vdots & \ddots &  \vdots & \vdots \\
             0 &      0 &      0 &      0 & \ldots & a_{q-1} & 1 \\ 
             1 &      0 &      0 &      0 & \ldots &       1 & a_q
        \end{pmatrix}$$
Using Mathematica, I find:
$$\begin{align}
\det(A_2)&=-4\\
\det(A_3)&=-1\\
\det(A_4)&=-7\\
\det(A_5)&=-\frac52(-5+\sqrt5)
\end{align}$$
Is there any general formula that describes this determinant? And, more importantly, can the determinant ever be zero? The one answer I got so far, suggests no, but it is of course not a proof.
This problem is motivated by a quantum mechanics problem, where the Hermitian matrix describes an observable in QM. In particular, it originates from the study of an electron on a lattice in a commensurable magnetic field.

REPLY [2 votes]: Just some thoughts:
Assume that $q\ge 5$ is a prime number. Then
$$\det A_q = \sum_{m=0}^{\frac{q - 1}{2}} a_i \cos \frac{2\pi m}{q}$$
where $a_i$'s are all integers.
Fact 1: Let $m$ be a positive integer
such that $2m$ is square-free. Then
$\{\sin \frac{k\pi}{m} : ~ 1\le k \le \frac{m}{2}, \, (k, m) = 1\}$
is linearly independent over the rationals.
See: https://mathoverflow.net/questions/244558/linear-independence-of-sink-pi-m
By Fact 1, we conclude that
$\det A_q = 0$ if and only if
$a_0 = a_1 = \cdots = a_{\frac{q - 1}{2}} = 0$.
Can we prove this is impossible?