Skip to content

fuse_charge for adding charges to operators - #60

Merged
Yue-Zhengyuan merged 2 commits into
mainfrom
add-charge
Sep 2, 2026
Merged

Yue-Zhengyuan merged 2 commits into
mainfrom
add-charge

Conversation

@Yue-Zhengyuan

@Yue-Zhengyuan Yue-Zhengyuan commented Aug 18, 2026 •

Copy link
Copy Markdown
Member

This PR exports one more utility function fuse_charge to add charges to operators.

(It can replace _fuse_ids currently in PEPSKit.)

@codecov

codecov Bot commented Aug 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/TensorKitTensors.jl 100.00% <ø> (ø)
src/tjoperators.jl 97.91% <100.00%> (-0.05%) ⬇️
src/utils.jl 93.75% <100.00%> (+0.56%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Yue-Zhengyuan
Yue-Zhengyuan requested a review from lkdvos August 18, 2026 08:49
@lkdvos

lkdvos commented Aug 19, 2026

Copy link
Copy Markdown
Member

Definitely looks reasonable to me, maybe we can just brainstorm slightly about the name?

@Yue-Zhengyuan

Copy link
Copy Markdown
Member Author

First I deliberately avoided add_physical_charge that are already in MPSKit. fuse_ids is not descriptive enough to me, which has no information on which space the id acts on.

To make hybrids, add_charge or fuse_charge both work for me.

@lkdvos lkdvos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just getting some opinions here, I have a slight preference to avoid add and use fuse to stick a bit more to the categorical language, especially since adding really only makes sense in our particular parametrization of ZNIrrep or U1Irrep. shift also seems like a good candidate, since that is typically the purpose? In principle I'm also okay with migrating the MPSKit function here and then simply overloading it in MPSKit, but I do agree that is a bit more annoying to orchestrate.

@Yue-Zhengyuan

Copy link
Copy Markdown
Member Author

@lkdvos How about you listing a few options and then we vote by emoji reactions? I now prefer fuse after reading your comment, since this it literally what we are actually doing.

@leburgel

Copy link
Copy Markdown
Member

I like fuse_charge the best, in the generic case fusing in a sector doesn't necessarily add nor shift in a clear way. I like this better than the name of the original MPSKit method even.

@Yue-Zhengyuan Yue-Zhengyuan changed the title add_charge for adding charges to operators fuse_charge for adding charges to operators Sep 2, 2026
@Yue-Zhengyuan
Yue-Zhengyuan merged commit 2d07aab into main Sep 2, 2026
9 checks passed
@Yue-Zhengyuan
Yue-Zhengyuan deleted the add-charge branch September 2, 2026 07:31
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.

3 participants