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

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

Merged
merged 4 commits into from
Jan 23, 2025

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

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