Closed fernandopenaranda closed 4 years ago
I think this could be a nice addition.
Since the Selector
s for hoppings and onsites are different, we would need a slight variation of this. The natural API would be
onsiteselector!(model; kw...)
hoppingselector!(model; kw...)
Both would produce a new model
with kw
s applied to the onsiteselector
/hoppingselector
in each term of model
, respectively. The possible kw
would include not only region
but also dn
, sublats
, etc, as applicable. Only specified kw
s would be overwritten, the rest would be preserved (a merge of selectors, in a way)
Generalising this functionality to the rest of availablekw
s sounds great to me!
I wonder whether the capability to redefine the onsiteselectors and hoppingselectors of a given
Tightbindingmodel
made out of several hopping and onsite terms could be useful or not. I was thinking about a new function:modifierfunc!(model, region = ...)
wheremodel = onsite_1 + ... + onsite_N+ hopping_1 + ... +hopping_M
and onsite_x (hopping_x) are arbitrary onsite(hopping) terms. This new functionality would enable us to initially write region-independent TBmodels. This may reduce the code complexity when building: a complex heterostructure or different heterostructures out of the same model, since the model is created only once. For instance, if we want to build the hamiltonians corresponding to two SNS junctions (1 and 2) with different geometries using the same model for the normal(N) and superconducting (S) regions, we could simply do: