Skip to content

Fix dropping charges on grouped sites of different dimensions - #781

Merged
Jakob-Unfried merged 3 commits into
tenpy:mainfrom
rpinho:fix-grouped-drop-dimensions
Nov 20, 2026
Merged

Jakob-Unfried merged 3 commits into
tenpy:mainfrom
rpinho:fix-grouped-drop-dimensions

Conversation

@rpinho

@rpinho rpinho commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Grouping a two-state fermion site with a three-state boson site raises an IndexError when charges='drop'. Build each charge-free leg from the corresponding site's physical leg. The test checks the six-dimensional basis and both number operators.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LKxc9GKLwnyeV2jaZBxH9N

@Jakob-Unfried

Jakob-Unfried commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

I assume you are automating these and the following is not much work for:
Could you restructure into to two commits per PR? the first with just the new test, make sure CI runs on it so we see a failure, then the second with the fix.

This makes it easier for me to review the problem you are addressing

@rpinho
rpinho force-pushed the fix-grouped-drop-dimensions branch from edd56f2 to 03dfaf8 Compare November 19, 2026 06:05
@rpinho

rpinho commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

Sure. I changed those.

@Jakob-Unfried

Copy link
Copy Markdown
Member

Changes look good, thanks.
For all your PRs, in the changelog latest, can you summarize the behavior before the fix?
Here this would be something like
This led to an IndexError before.
A quick way for people to see how critical the bug was (eg: clear error < cryptic error < silent wrong behavior)

@Jakob-Unfried
Jakob-Unfried merged commit 6f2a436 into tenpy:main Nov 20, 2026
10 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