Indexing into a Bandstructure to get interpolated eigenpairs #134
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.
Closes #120
This implements
getindex
methods forbs::Bandstructure
, such asbs[(ϕs...), around = 0.0]
that obtains interpolated eigenenergies and eigenvectors at base mesh coordinatesϕs
.EDIT: as explained in the
bandstructure
docstring, to obtain a specific eigenstate/eigenenergy froms
above, one can use destructuringϵ, ψ = s[1]
orψ = s[2].basis
,ϵ = s[2].energy
.The access and interpolation strategy has been reworked to be of
O(1)
complexity. The performance as compared with diagonalization makes it worthwhile even for small systems. The PR also includes an enhancement toDiagonalizer
s, now embedded into bandstructures, that allows re-diagonalizing at any givenϕs
using the unexported interfacebs.diag((ϕs...))
. This is handy for comparisons with the interpolation machinery, and will be crucial to enable bandstructure refinement in the near future.There is a catch, however. This PR includes a broken test where
bs[(ϕs...)]
returns a number of eigenpairs larger than the dimension of the Hamiltonian. The reason is a deep problem of the algorithm introduced in #123, and discovered when deving this PR. #123 follows a band-building strategy whereby the adjacency matrix of band meshes is computed first (based on degenerate subspace overlaps), and then simplices are built from the adjacency matrix in a second step. The first step is fully correct. However, there exist band topologies around high-symmetry points for which not all possible simplices compatible with the adjacency matrix are valid simplices. Since we cannot currently detect these, we can end up with a few simplices too many, which produces the broken test.Fixing the broken test is going to require some serious work, so I release this PR first, and will try to address the problem later.