Chagaan Baatar wrote:
I also like to chime in and vote with Anton on this. What I try to do with Kwant is to build nanographene or polycyclic aromatic hydrocarbon (PAH) molecular structures by combining smaller structures/molecules, sometimes in a hierarchical way. With overwrite, when I fuse two benzene rings together I know I’ll get the 10-carbon naphthalene, instead of some 12-carbon beast with overlapping carbon atoms (and their hoppings).
Hi Chagaan, it’s nice to see that you are participating in the discussion! Actually, we have been talking about two things: (1) Whether overwriting existing sites/hoppings of a builder should have a special syntax, so that the current syntax (syst[key] = value) could be reserved for _creating_ new sites/hoppings only. This is the question that I brought up originally. (2) How (and whether) to provide a way in builder to provide multiple values for the same site/hopping. The new low-level systems will allow multiple values for the same site/hopping that will be summed together. This is something that we believe can be useful, and, anyway, it comes naturally with the new format. However, within the current builder, there’s no way to specify an extra value (say, a second value function) for some site/hopping. This is the issue that Anton brought up. As to (1), Anton & Xavier do not like the idea of a special syntax. If I understand them correctly they do not want to solve something that they believe is not a problem. I agree with them that we can wait and see whether the issue that I anticipated ever becomes a problem in practice. Your comment is on (2). I agree with you that if we provide some way to specify additional values for sites and hoppings one has to be careful to preserve the possibility of easily constructing systems. I thought quite a bit about it and I actually wonder now whether it’s really useful to be able to specify multiple values for a single site/hopping on builder level. In a way it’s namely already possible today (and will always be): one can easily make a type that can be used as a builder value and that sums up it’s multiple arguments. It could work like this: syst[a] = Sum(f, g, h) syst[a].append(another_one) Note that this is already possible today, only that Kwant doesn’t provide an implementation of “Sum”. So it’s possible to sum-up multiple values, but with this approach the multiple values will appear as a _single_ one for low-level system. The question is now: do we really need a way to specify multiple low-level system values for the same site/hopping on builder level? I’m not so sure… What do you think? (Note that even if there’s no way to specify multiple values on builder level, the low-level support for multiple values might still be useful. And anyway, as said above, it’s something that comes naturally and it would actually require more effort to disallow it.) Christoph