pablosanjose / Elsa.jl

Efficient lattice simulation algorithms - a Julia library
Other
18 stars 2 forks source link

The order of the `sublats` kwarg to `Hopping` can be ambiguous #19

Closed pablosanjose closed 5 years ago

pablosanjose commented 5 years ago

It is hard to remember if Hopping(1, sublats = (1,2)) corresponds to hopping from sublat 1 to 2 or the other way round. This could be improved if we change the API to Hopping(1, sublats = 1=>2) and Hopping(1, sublats = (1=>2, 3=>1))

pablosanjose commented 5 years ago

We can leave both possibilities in the API, to emphasize that indices (s_target, s_source) are reversed respect s_source => s_target

pablosanjose commented 5 years ago

Addressed in current master. Note that hopping(1, sublats = 1=>2) corresponds to hopping(1, sublats = (2,1)) (both are allowed), i.e. first sublat index is target, second is source, as is usual in the matrix elements of quantum mechanics