chern(pval, qval)[source]

Compute Chern numbers using the Diophantine equation.

For a rational flux, the energy gaps in the Hofstadter spectrum are characterized by the integers \(s\) and \(t\), which are related by the following Diophantine equation,

\[r = qs_r + pt_r, \;\;\; |t_r|\leq\frac{q}{2}, \;\;\; s_r,t_r\in\mathbb{Z},\]

where \(r\) denotes the \(r\)-th energy gap and \(t_r=\sum_{i=0}^r C_i\) is the cumulative Chern number or Hall conductivity. [DiColandrea22]

  • pval (int) – The numerator of the flux density.

  • qval (int) – The denominator of the flux density.


  • Chern_list (list) – The list of Chern numbers for each band (length M).

  • tr_list (list) – The list of cumulative Chern numbers for each band gap (length M-1).