Improving treatment of leads in flux algorithm
Currently the flux algorithm is limited to leads where a single unit cell is connected. We can this trivially determine if there are any cycles (and hence any gauge contraints imposed by the leads). This limitation is largely due to the fact that we did not do an extensive literature review to see if the problem has a known solution.
A bit of googling revealed this paper: https://dl.acm.org/citation.cfm?id=28401 (Testing for cycles in infinite graphs with periodic structure). I didn't read it yet, but it may provide a satisfactory solution.