Skip to content

Fuse charges into MPO and tensor product terms in a LocalOperator - #476

Merged
Yue-Zhengyuan merged 4 commits into
QuantumKitHub:mainfrom
Yue-Zhengyuan:fuse-charge-mpo
Nov 1, 2026
Merged

Yue-Zhengyuan merged 4 commits into
QuantumKitHub:mainfrom
Yue-Zhengyuan:fuse-charge-mpo

Conversation

@Yue-Zhengyuan

Copy link
Copy Markdown
Member

This PR extends add_physical_charge to work with MPOTerm and TensorProductTerm of a LocalOperator introduced in #425.

@codecov

codecov Bot commented Oct 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/operators/localoperator.jl 84.76% <ø> (ø)
src/operators/localoperator/mpo.jl 100.00% <100.00%> (ø)
src/operators/localoperator/tensorproduct.jl 95.65% <100.00%> (-4.35%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@leburgel

Copy link
Copy Markdown
Member

This seems great, I'll have a closer look later today. I did have one question right away.

The MPOTerm _fuse_charge implementation now has a very big overlap with what MPSKit.add_physical_charge does within MPSKit itself. Do you think there's any opportunity to reuse shared functionality from there? We don't have to forcibly fit this into the MPSKit implementation if it doesn't make sense, but since they really do the same thing it might make sense to share core routines.

This can also be done afterwards with some changes on both sides if it's not natural with the current state.

Comment thread src/operators/localoperator/mpo.jl Resolved
@Yue-Zhengyuan
Yue-Zhengyuan enabled auto-merge (squash) November 1, 2026 11:57
@Yue-Zhengyuan
Yue-Zhengyuan merged commit 173bebe into QuantumKitHub:main Nov 1, 2026
31 of 32 checks passed
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