Dear Christoph,
Thanks a lot for a very thorough and clear explanation.
I think I even understood most of it. :)
I do not think there is anything wrong with the current treatment
of sublattices, once it is properly understood. It probably boils down
to personal taste. Just like thinking in terms of lattice with polyatomic
basis vs a collection of monoatomic lattices.
Re:
"So what we could do instead is warn whenever a lattice object is created
explicitly that is identical to an already existing one, but unnamed."
Every little helps so why not. On the other hand I suspect the message
itself
will not be sufficiently clear for someone without the good understanding
of how Kwant is representing a physical system/model ... cough ... a
Fortran
programmer like yours truly.
A useful thing would be to actually check for site overlap during
attachment
of the lead but this might violate your philosophy of decoupling site
from its
position. I do see where you are coming from. The TB Hamiltonian is indeed
well described by the graph structure -- set of nodes plus connections
-- with
positions important only in the setup phase. On the other hand lead
attachment
is the setup phase...
I guess it all depends on what would be the wording of the warning. A
simple statement
of there being two identical objects would be sufficient for an
experienced user, who might
not need it anyway, but useless for a newbie. I have to admit I struggle
a bit with
the sophistication and the abstraction level on which Kwant operate. But
then I never
properly learned the whole OO programming paradigm etc...
To summarize a warning would be nice, but perhaps it could point to
specific problems,
at least aas example?
In any case thanks again for your answer. It was certainly helpful for me.
Regards
MZ