Skip to content

Fix joint probabilities in MPS.sample_measurements - #780

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

Jakob-Unfried merged 3 commits into
tenpy:mainfrom
rpinho:fix-sampling-probability

Conversation

@rpinho

@rpinho rpinho commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Sampling a range of sites with complex_amplitude=False squares the running weight after each site. For a six-site state with two singlets, the returned probability differs from the Born probability of one quarter. Square the accumulated amplitude after the measurement loop. The test checks single-site, partial, and full-chain probabilities with the same sampled outcomes in both return modes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LKxc9GKLwnyeV2jaZBxH9N

@rpinho
rpinho force-pushed the fix-sampling-probability branch from 05a03b2 to 22c6687 Compare November 19, 2026 06:05
@Jakob-Unfried

Jakob-Unfried commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

thanks. I will finish this.
left to do:

  • discuss implications of the bug in changelog
  • fix in v2

@rpinho

rpinho commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for looking into this.

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