Skip to content

Avoid adding adding exact zeros in TaylorCluster implementation#229

Merged
lkdvos merged 1 commit intomasterfrom
lb/avoid_slices
Jan 20, 2025
Merged

Avoid adding adding exact zeros in TaylorCluster implementation#229
lkdvos merged 1 commit intomasterfrom
lb/avoid_slices

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.

@codecov
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