Skip to content

Comments

Fix MPOHamiltonian constructors for adding multiple terms on the same site#235

Merged
lkdvos merged 4 commits intomasterfrom
fix-operators
Jan 23, 2025
Merged

Fix MPOHamiltonian constructors for adding multiple terms on the same site#235
lkdvos merged 4 commits intomasterfrom
fix-operators

Conversation

@lkdvos
Copy link
Member

@lkdvos lkdvos commented Jan 23, 2025

This fixes an issue where operators that had repeating terms were wrongly discarded:

H = FiniteMPOHamiltonian(fill(ComplexSpace(2), 2), 1 => O1, 1 => O2)

would previously overwrite O1 with O2 instead of adding the two.

First caught in QuantumKitHub/MPSKitModels.jl#43

@codecov
Copy link

codecov bot commented Jan 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
src/operators/mpohamiltonian.jl 89.23% <100.00%> (ø)

... and 2 files with indirect coverage changes

@lkdvos lkdvos merged commit 05651fe into master Jan 23, 2025
28 checks passed
@lkdvos lkdvos deleted the fix-operators branch January 23, 2025 18:44
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.

1 participant