Dear all,

Imagine that I have an external potential in a form of a list of values, corresponding to the site numbers in finalized system (this has appeared from mean-field account of Hubbard interactions). Now I want to feed this back to Kwant to compute the modes.

The standard function to specify the potential has Site as an argument, with no access to its number in the finalized system. Is there a fast way to get the site number?

  I found an old reply of Anton:

/site_numbers = {tuple(site.pos(i)): i for i in
xrange(sys.graph.num_nodes)} />/site_numbers[(1, 1)] # Find the number of the site with coordinates (1, 1). /

but it does not look efficient.

Any suggestions?

Thanks,
Sergey

Reply via email to