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

Add vlplot option mindiameter #138

Merged
merged 1 commit into from
Nov 20, 2020
Merged

Add vlplot option mindiameter #138

merged 1 commit into from
Nov 20, 2020

Conversation

pablosanjose
Copy link
Owner

@pablosanjose pablosanjose commented Nov 20, 2020

VegaLite struggles with complex plots. This is a problem when plotting eigenstates of large systems. The situation can be alleviated when the eigenstates have many values very close to zero encoded with sitesize in vlplot that in principle should not be plotted. However, to make vlplot faster it is necessary to explicitly exclude these table entries from the data passed to @vlplot.

This PR allows one to exclude these entries by passing a mindiameter, that is complementary to maxdiameter. For it to be useful for performance it probably needs to be used together with plotlinks = false.

Without mindiameter (slow)

vlplot(h, ψ, sitesize = abs, plotlinks = false)

Screen Shot 2020-11-20 at 12 30 04

With mindiameter (fast)

vlplot(h, ψ, sitesize = abs, plotlinks = false, mindiameter = 1)

Screen Shot 2020-11-20 at 12 30 46

This PR adds an unrelated enhacement that allows to pass ψ as a Subspace (as produced e.g. by spectrum). If the subspace is degenerate, the first component is plotted for the moment. In the future we would need to sum over base components.

It also includes a fix for ArnoldiPackageMethod (blush!)

avoid filling plot table with unnecessary entries

cleanup
@codecov-io
Copy link

codecov-io commented Nov 20, 2020

Codecov Report

Merging #138 (332c73f) into master (7dad499) will decrease coverage by 0.13%.
The diff coverage is 40.62%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #138      +/-   ##
==========================================
- Coverage   61.16%   61.03%   -0.14%     
==========================================
  Files          16       16              
  Lines        2959     2972      +13     
==========================================
+ Hits         1810     1814       +4     
- Misses       1149     1158       +9     
Impacted Files Coverage Δ
src/Quantica.jl 100.00% <ø> (ø)
src/plot_vegalite.jl 0.00% <0.00%> (ø)
src/diagonalizer.jl 54.54% <63.63%> (+2.37%) ⬆️
src/bandstructure.jl 81.79% <100.00%> (-0.15%) ⬇️
src/parametric.jl 77.89% <100.00%> (+0.23%) ⬆️

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 05bf92e...332c73f. Read the comment docs.

@pablosanjose pablosanjose merged commit e7fa28a into master Nov 20, 2020
@pablosanjose pablosanjose deleted the mindiameter branch November 23, 2020 15:27
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.

2 participants