Skip to content

add inverse of `sites` mapping to finalized builders

Joseph Weston requested to merge jbweston/kwant:feature/id-by-site into master

The inverse map is created during finalization anyway, now we just save it along with the sites map.

This will be needed for the forthcoming "local observables" feature, where the alternative was to create and store such a map for each observable, which is clearly dumb as it is a property of the system.

Just saving the map was preferred over an O(log N) search over sorted sites (also a forthcoming feature!), as the map is in any case constructed during finalization; there didn't appear to be any advantage in not just saving it.

Merge request reports