Repository navigation
fix(tableau): use FoldHashMap for two-qubit rotation coefficients - #268
Merged
Merged
Conversation
rotate_2 accumulated coefficients in a std HashMap, whose random per-process seed made the coefficient order after RXX/RYY/RZZ vary between runs. Use the fixed-seed FoldHashMap already used by the other tableau coefficient maps since #267. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The narrow substitution follows the existing map implementation and has no identified blocking issues.
No open issues 🎉
What changed in this PR
This PR aligns two-qubit rotation coefficient accumulation with the fixed-seed hashing introduced in #267, making coefficient ordering reproducible within a build.
Changes:
- Replaces the standard
HashMapwithppvm_traits::FoldHashMap. - Uses
HashMap::default()to initialize the map without changing rotation logic.
| File | Description |
|---|---|
crates/ppvm-tableau/src/gates/rot2.rs |
Uses fixed-seed hashing for RXX, RYY, and RZZ coefficient accumulation. |
Review effort: Balanced
david-pl
enabled auto-merge (squash)
October 23, 2026 11:57
Contributor
|
Merged
david-pl
pushed a commit
that referenced
this pull request
Oct 23, 2026
## 🤖 New release * `ppvm-traits`: 0.1.0 -> 0.1.1 (✓ API compatible changes) * `ppvm-pauli-word`: 0.1.0 -> 0.1.1 (✓ API compatible changes) * `ppvm-pauli-sum`: 0.1.0 -> 0.1.1 (✓ API compatible changes) * `ppvm-sym`: 0.1.0 -> 0.1.1 (✓ API compatible changes) * `ppvm-tableau`: 0.1.0 -> 0.1.1 (✓ API compatible changes) * `stim-parser`: 0.1.0 -> 0.1.1 (✓ API compatible changes) * `ppvm-stim`: 0.1.0 -> 0.1.1 (✓ API compatible changes) * `ppvm-tableau-sum`: 0.1.0 -> 0.1.1 (✓ API compatible changes) * `vihaco-circuit-isa`: 0.1.0 -> 0.1.1 (✓ API compatible changes) * `ppvm-vihaco`: 0.1.0 -> 0.1.1 (✓ API compatible changes) * `ppvm-tui`: 0.1.0 -> 0.1.1 (✓ API compatible changes) * `ppvm-cli`: 0.1.0 -> 0.1.1 <details><summary><i><b>Changelog</b></i></summary><p> ## `ppvm-cli` <blockquote> ## [0.1.1](v0.1.0...v0.1.1) - 2026-10-23 ### Fixed - *(hash)* spread high-bit keys across buckets in tableau and Pauli-word maps ([#267](#267)) - *(tableau)* use FoldHashMap for two-qubit rotation coefficients ([#268](#268)) ### Other - add crates.io READMEs for the published crates ([#265](#265)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GeneralizedTableau::rotate_2(RXX / RYY / RZZ) accumulated the new coefficients in astd::collections::HashMap. Its SipHash hasher is seeded randomly per process, so the order in which coefficients were written back into the tableau differed from run to run.This switches it to
ppvm_traits::FoldHashMap, the fixed-seed hasher the other tableau coefficient maps have used since #267. That makes the post-rotation coefficient order reproducible within a build, and foldhash is also cheaper than SipHash for integer keys.cargo test -p ppvm-tableaupasses with and without--features rayon, and clippy is clean.🤖 Generated with Claude Code