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

[NDTensors] Fix output type of Empty BlockSparse contraction #1135

Merged
merged 4 commits into from
Jun 21, 2023

Conversation

mtfishman
Copy link
Member

@mtfishman mtfishman commented Jun 20, 2023

The output type of Empty BlockSparse contraction was a bit off, and not adjusting for the dimensions of the output tensor. That caused some subtle bugs in other operations that were expecting the types to be the same, see:

ITensor/ITensorInfiniteMPS.jl#77 (comment)

EDIT: This also adds a definition for Base.zero(T::ITensor), which makes it so that operations like Matrix{ITensor} * Matrix{ITensor} work (as matrix multiplication where the elements are ITensors that get contracted). That's helpful for MPO formats that are matrices of ITensors.

@LHerviou @kmp5VT

@mtfishman
Copy link
Member Author

Closes #1127 by marking that test as broken for Julia versions 1.9 and above. @kmp5VT I know you also addressed that one in #1097 so your fix can be reverted.

@codecov-commenter
Copy link

codecov-commenter commented Jun 21, 2023

Codecov Report

Merging #1135 (a70f612) into main (dc92810) will decrease coverage by 5.51%.
The diff coverage is 88.88%.

❗ Current head a70f612 differs from pull request most recent head 3a3023a. Consider uploading reports for the commit 3a3023a to get more accurate results

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##             main    #1135      +/-   ##
==========================================
- Coverage   59.61%   54.10%   -5.51%     
==========================================
  Files          87       86       -1     
  Lines        8325     8280      -45     
==========================================
- Hits         4963     4480     -483     
- Misses       3362     3800     +438     
Impacted Files Coverage Δ
src/indexset.jl 81.47% <ø> (+21.47%) ⬆️
src/tensor_operations/tensor_algebra.jl 88.26% <66.66%> (+40.30%) ⬆️
src/broadcast.jl 86.88% <100.00%> (+59.01%) ⬆️
src/itensor.jl 80.07% <100.00%> (+31.00%) ⬆️

... and 68 files with indirect coverage changes

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