Provide a way to "fill" space with builders
The discretizer proposal (!41 (merged)) contains a method build()
that creates a Kwant builder where a specified shape is filled with the model at hand.
Since this functionality is general and not specific to discretizer, I propose to move it into the builder module. In a nutshell, I propose to replace the current
tb.build(shape, (0, 0))
with
tb.build().fill(shape, (0, 0))
.
This looks marginally more complicated, but note that we gain a new concept of "models" that is useful also independently from discretizer.
In particular, I propose:
In builder:
Add a method (tenatitive name: fill
, @slavoutich proposed cut
, any other suggestions?) that returns a new builder that corresponds to the old one. The method must have arguments to specify the shape to be filled, as well as the symmetries that the new expanded system should have. (Note that these don't have to be necessarily a simple subset of the symmetry directions of the source model. For example one might want to crate a lead at 45 degrees.)
In discretizer:
Change the method build()
such that, when run without any arguments, it returns a builder instance that represents the discretized model with all of its spatial symmetries. The method should have one optional argument that allows to specify an alternative site family to be used. I don't see the need for any other args.
@r-j-skolasinski @michaelwimmer @anton-akhmerov @jbweston any comments?