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

Avoid adding adding exact zeros in TaylorCluster implementation #229

Merged
merged 1 commit into from
Jan 20, 2025

Conversation

leburgel
Copy link
Member

The addition of SparseBlockTensorMap slices in the TaylorCluster implementation lead to the explicit instantiation and subsequent purging of explicit zero blocks due to the getindex-setindex! interplay in expressions like slice[linds[s_c], 1, 1, :] += slice[c_lin, 1, 1, :]. This PR circumvents this by explicitly restricting to the nonzero keys of the right hand side. It's not the cleanest solution, but it gives a big performance increase for Hamiltonians with a lot of channels.

Copy link

codecov bot commented Jan 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
src/algorithms/timestep/timeevmpo.jl 84.66% <100.00%> (+0.68%) ⬆️

Copy link
Member

@lkdvos lkdvos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test failures seem unrelated, merging this.

@lkdvos lkdvos merged commit 8decd8c into master Jan 20, 2025
18 of 28 checks passed
@lkdvos lkdvos deleted the lb/avoid_slices branch January 20, 2025 20:42
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