Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: bandstructure with correct connectivity around degeneracies #145

Merged
merged 2 commits into from
Dec 10, 2020

Conversation

pablosanjose
Copy link
Owner

@pablosanjose pablosanjose commented Dec 10, 2020

Fixes #135

Fixing #135 required a deep redesign of the bandstructure machinery.

Old version: we sorted base neighbors to each band vertex by their "overlap amplitude", and chose the n of these with highest overlap, where n was the maximum of the source and target degeneracies, essentially. This turned out to be an approximation to the more correct algorithm in this PR

This PR: we build connectivity by choosing neighbors of any given band vertex so that at least one singular value of the projector between source and neighbor has square modulus greater than 1/2.

  • Optimizations are made to avoid needing to compute a singular value decomposition in cases with non-degenerate vertices.
  • The concept of minoverlap as a connectivity tuning parameter is no longer necessary and is removed.
  • We now make sure the bases of degenerate subspaces returned by diagonalization are orthonormalized
  • We make use of the known connectivity and simplices of marching-tetrahedra meshes used over base space to greatly accelerate the collection of simplices. The runtime of the band knitting step is now dominated by BLAS calls to compute overlaps, which makes this step typically much faster than the diagonalization step (unlike in the old version). Hence, bandstructure can now be several times faster than before, depending on the case.
  • The separation of a bandstructure into different subbands is now optional (controlled by the splitbands kwarg in bandstructure). The process can also be performed on a fully formed bandstructure b with the exported function splitbands(b).

Although this refactor should have little impact on a user (apart from the performance improvement), it is a profound change in the internal representation of bandstructures. In particular, we now compute and store the correct interpolating bases within each simplex, in the form of a tuple of projectors ps, stored in b.sbases::Vetctor{NTuple{D+1,Matrix}}. For performance, an empty p is stored in the non-degenerate simplices, since that is a very common trivial case that can be reconstructed easily on the fly. The actual interpolating basis around a simplex vertex n is computed with b.vbases[n] * p, where p is the corresponding projector. This will be crucial to compute Greens functions and for shading bandstructures. It is also used to interpolate bandstructure with the b[(ϕs...)] syntax now. This fixes the formerly broken test in #135. I believe with this PR Quantica can now compute rigorously correct bandstructure interpolations, although real-world testing will be necessary to weed out any bugs, as the PR is quite complex.

yet another bandstructure rewrite

runs

defects

works

fixes

svd for higher-rank projs

svd -> svdvals

subbands sketch for the future

indexing

splitbands

docstring

fixes

orthonormalize subspaces

better progmeter

tests
@codecov-io
Copy link

codecov-io commented Dec 10, 2020

Codecov Report

Merging #145 (b447792) into master (98016ec) will increase coverage by 3.94%.
The diff coverage is 81.98%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #145      +/-   ##
==========================================
+ Coverage   61.03%   64.98%   +3.94%     
==========================================
  Files          16       16              
  Lines        2972     3167     +195     
==========================================
+ Hits         1814     2058     +244     
+ Misses       1158     1109      -49     
Impacted Files Coverage Δ
src/KPM.jl 67.64% <ø> (+2.84%) ⬆️
src/Quantica.jl 100.00% <ø> (ø)
src/lattice.jl 84.70% <ø> (+2.59%) ⬆️
src/model.jl 73.45% <ø> (+0.78%) ⬆️
src/plot_makie.jl 0.00% <0.00%> (ø)
src/plot_vegalite.jl 0.00% <0.00%> (ø)
src/mesh.jl 78.78% <28.57%> (-2.70%) ⬇️
src/hamiltonian.jl 81.80% <68.75%> (+1.50%) ⬆️
src/diagonalizer.jl 60.60% <90.00%> (+6.06%) ⬆️
src/bandstructure.jl 84.85% <90.17%> (+3.06%) ⬆️
... and 14 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d8179f2...b447792. Read the comment docs.

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 88.00000% with 51 lines in your changes missing coverage. Please review.

Project coverage is 64.98%. Comparing base (98016ec) to head (b447792).
Report is 993 commits behind head on master.

Files with missing lines Patch % Lines
src/bandstructure.jl 90.17% 33 Missing ⚠️
src/iterators.jl 83.33% 6 Missing ⚠️
src/mesh.jl 54.54% 5 Missing ⚠️
src/plot_vegalite.jl 0.00% 3 Missing ⚠️
src/plot_makie.jl 0.00% 2 Missing ⚠️
src/diagonalizer.jl 90.00% 1 Missing ⚠️
src/tools.jl 96.29% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #145      +/-   ##
==========================================
+ Coverage   61.03%   64.98%   +3.94%     
==========================================
  Files          16       16              
  Lines        2972     3167     +195     
==========================================
+ Hits         1814     2058     +244     
+ Misses       1158     1109      -49     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong band topology around high-symmetry points
3 participants