Unitcell stress test: coordination should not change with full-rank supercells #117
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the result of a stress test on the unitcell routines to catch edge cases. We want to guarantee that any
unitcell(h, sc)
with any full-ranksc
does not change the coordination of the resulting Hamiltonian. To achieve that we needed to correct some bugs and edge cases. Long story short, we were assuming supercell definitions that were slightly different when building the superlattice and the Hamiltonian (position-based vs dn-based). Now both should be consistent (position-based). We also need to be strict about which sites end up in the final lattice: they should be only those within the bounds of the supercell, no hanging sites. Also, we needed to be a little more conservative in the scan of dn space when building the supercell.Now tests over a full range of full-rank supercells generate the correct lattices, with identical coordination.