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

[ITensors] Fix checkflux for QN ITensor with no blocks #1210

Merged
merged 4 commits into from
Oct 6, 2023

Conversation

emstoudenmire
Copy link
Collaborator

@emstoudenmire emstoudenmire commented Oct 5, 2023

Fixes #1209 by allowing checkflux to work when block-sparse ITensors are created which have no blocks.

The bug was coming from correlation_matrix due to user-specific operators whose onsite product turned out to be numerically zero (zero matrix), leading to no blocks. This is ok, but the checkflux function was assuming at least one non-zero block and failing in the case of zero blocks.

@codecov-commenter
Copy link

codecov-commenter commented Oct 5, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (15decbd) 85.40% compared to head (198af47) 67.31%.

❗ Current head 198af47 differs from pull request most recent head ca60941. Consider uploading reports for the commit ca60941 to get more accurate results

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

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1210       +/-   ##
===========================================
- Coverage   85.40%   67.31%   -18.09%     
===========================================
  Files          88       87        -1     
  Lines        8426     8378       -48     
===========================================
- Hits         7196     5640     -1556     
- Misses       1230     2738     +1508     
Files Coverage Δ
src/qn/flux.jl 78.57% <66.66%> (-13.10%) ⬇️

... and 36 files with indirect coverage changes

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

src/qn/flux.jl Outdated Show resolved Hide resolved
@mtfishman mtfishman changed the title Allow no blocks in checkflux (issue 1209) [ITensors] Allow no blocks in checkflux Oct 6, 2023
@mtfishman mtfishman changed the title [ITensors] Allow no blocks in checkflux [ITensors] Fix checkflux for QN ITensor with no blocks Oct 6, 2023
@mtfishman
Copy link
Member

Looks good from my end, ready to merge?

@emstoudenmire
Copy link
Collaborator Author

Just missed your comment. Thanks for reviewing. I'll merge.

@emstoudenmire emstoudenmire merged commit 81568ad into main Oct 6, 2023
7 checks passed
@emstoudenmire emstoudenmire deleted the 1209_correlation_flux_bug branch October 6, 2023 22:05
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.

[ITensors] [BUG] QN correlation matrix not working since #1178
3 participants