Skip to content

Fix MPO construction for empty Hamiltonians - #782

Merged
Jakob-Unfried merged 3 commits into
tenpy:mainfrom
rpinho:fix-zero-hamiltonian
Nov 20, 2026
Merged

Jakob-Unfried merged 3 commits into
tenpy:mainfrom
rpinho:fix-zero-hamiltonian

Conversation

@rpinho

@rpinho rpinho commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Constructing a SpinModel with all couplings set to zero raises an error while determining MPO charges. Add a zero-weight edge to connect the identity channels of an empty term graph. The tests check zero expectation values for finite and infinite chains and a zero dense Hamiltonian for the finite chain.

EDIT JU: Adresses #487, but I will keep the issue open for v2

🤖 Generated with Claude Code

https://claude.ai/code/session_01LKxc9GKLwnyeV2jaZBxH9N

@rpinho
rpinho force-pushed the fix-zero-hamiltonian branch from 34adb33 to f2fb749 Compare November 19, 2026 06:05
@Jakob-Unfried

Copy link
Copy Markdown
Member

will merge if tests are green

@Jakob-Unfried
Jakob-Unfried merged commit 42b5e27 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