I am trying to extend the Harper equation from two dimensional square lattice to monolayer graphene by using mathematica. For square lattice the code is given here "Poor rendering of fractals". The problem while dealing with graphene is that this equation has become matrix inside matrix. This is the eigen value equation that I am trying to plot,
$\begin{bmatrix} 0 & -t \\ -t & 0 \end{bmatrix}\begin{bmatrix}\psi_{m}\\\phi_{m}\end{bmatrix}=\begin{bmatrix}0 & 2*Cos[k-\frac{i\pi p}{q}(m-\frac{1}{6})]\\0&0\end{bmatrix}\begin{bmatrix}\psi_{m-1}\\\phi_{m-1}\end{bmatrix}+\begin{bmatrix}0 & 0\\2*Cos[k-\frac{i\pi p}{q}(m-\frac{5}{6})]&0\end{bmatrix}\begin{bmatrix}\psi_{m+1}\\\phi_{m+1}\end{bmatrix}$
One can take $t=1$ and $k=0$. However $\frac{p}{q}$ can take any rational fraction. Any help will be highly appreciated. This is required to see first the posted version of two dimensional square lattice case to understand this question,"Poor rendering of fractals"(Go for Hofstadter butterfly). Thanks
This is the code for two dimension square lattice copied from https://mathematica.stackexchange.com/questions/2392/poor-rendering-of-fractals
.
ClearAll[matrix];
matrix[p_,q_,nu_:0]:=Module[
{sigma},
sigma=p/q;
N@SparseArray[
{{m_,m_} -> 2Cos[2Pi*m*p/q + nu], {i_,j_}/;Abs[i-j] == 1 -> 1},{q,q}]]
ClearAll[attachsigma]
attachsigma[sigma_,lst_]:={sigma,#}&/@lst
fracs = Table[p/q, {q, 2, 80}, {p, 2, q}] // Flatten //
DeleteDuplicates;
pq = {Numerator@#, Denominator@#} & /@ fracs;
(ens = Eigenvalues[#] & /@ (matrix[#[[1]], #[[2]]] & /@ pq);) // Timing
pts = Flatten[#, 1] &@MapThread[attachsigma, {fracs, ens}];
plot = Graphics[
{PointSize[0.001], Point[pts]},
AspectRatio -> 1,
ImageSize -> Full
]