Allow different lattice spacing in each dimension for `kwant.continuum`
Generalize the lattices in kwant.continuum
to rectangular lattices, in 2 dimensions or to a lattices made of rectangular cuboids, in 3 dimensions.
The parameter grid
, can now be a scalar, for which all lattice spacings are equal,
it can be a sequence of scalars, for which each scalar is the lattice spacing in the
appropriate dimension, and it can be a kwant.lattice.Monatomic
, that can be a 1, 2, or 3D
lattice.
In the latter case, grid
should be a lattice with diagonal primitive vectors, but this
is not enforced and does not raise any errors. Although, the diagonal components will be
used as primitive vectors magnitudes in the discretization.
Tests for this feature are yet to be written, and previous tests should pass with no modification.
Fixes #197 (closed)
Merge request reports
Activity
@pablopiskunow Thanks! I will try to help finalising this MR. This should definitely aid at least few simulation cases before the non-uniform meshes will come to exist.
@r-j-skolasinski what is the status of this MR?
How can I help with this MR? Shall I be making PR to Pablo's fork or @pablopiskunow can give me write access to his fork?
Edited by Rafal Skolasinskimentioned in merge request !225 (merged)
added 24 commits
-
28e1e3ee...19c7e943 - 23 commits from branch
kwant:master
- 94169791 - allow different lattice spacing in each dimension
-
28e1e3ee...19c7e943 - 23 commits from branch
added 3 commits
- be7790ac - read properly position of sites from offseted grid, closes #199 (closed)
- e2e8594b - allow different lattice spacing in each dimension
- aa13b7d3 - fix rendering of symbolic discretization + fix existing tests
added 1 commit
- 59eeb6a8 - simplify handling different input types of "grid"
@pablopiskunow I fixed few minor things:
- I rebased on top of issue_199 - it changes logic of reading coordinate to use
.pos
method of sites - Fixed rendering of symbolic discretization
- cleaned part when different types of
grid
input are handled (scalar, seq. of scalar, ...) - adjust existing tests and fixed checking lattice constraints (together with above point)
I think we are only missing a proper tests for new functionality. Once we add those and squash it should be ready for merge.
Edited by Rafal Skolasinski- I rebased on top of issue_199 - it changes logic of reading coordinate to use
added 3 commits
-
646ba2c8...60f02546 - 2 commits from branch
kwant:master
- aa883200 - add support for rectangular discretization grids
-
646ba2c8...60f02546 - 2 commits from branch
- Resolved by Joseph Weston
@pablopiskunow You can remove WIP to signal that it is ready for review by others. I will add tests for new functionality now.