Description
Right now, for more complicated site types, there is a bit of an explosion of keyword arguments for choosing what QNs get conserved. Here is a proposal for an improved interface:
siteinds("Electron", conserve_qns = ("Sz", "Nf", "NfParity"))
instead of the current:
siteinds("Electron", conserve_sz = true, conserve_nf = true, conserve_nfparity = true)
Setting conserve_qns = true
would select a preset choice that we consider to be the most common combination.
Additionally, if someone wants custom names for the QNs, we could have a syntax like the following:
siteinds("Electron", conserve_qns = ("Sz" => "SzA", "Nf" => "NfA", "NfParity" => "NfPA))
which is useful if there are lattices with mixed site types.
Finally, it would be nice to think about a system for providing custom QNs to an existing site type. An example is adding momentum conservation to the Electron site type. This could be done with a QNType
, analogous to the SiteType
, where a user overloads a function like:
qn(::SiteType"Electron", ::QNType"Sz") = [("Sz", 0) => 1, ("Sz",+1) => 1, ("Sz",-1) => 1, ("Sz", 0) => 1]
This system could also make the implementation of the space
function easier, where the specified conserved QNs are looped over and appended to the space (instead of the current system with many if-statements). We would need nice functions for this which are fast and deal with the case of mismatched blocks.