Repository navigation
feat(tableau): batch Clifford gates with combined bitmask ops - #51
Merged
Merged
Conversation
|
Add batch Clifford gate methods that use combined bitmask operations for significant performance gains on circuits with many same-type gates. ## New APIs ### Combined bitmask single-qubit batches - `sqrt_y_batch`, `sqrt_y_adj_batch`, `sqrt_x_batch`, `sqrt_x_adj_batch`, `h_batch` - Merge N same-word, same-type gates into a single mask swap/XOR + popcount parity for phase — O(1) per word per row regardless of gate count ### CZ block pairs - `cz_block_pairs(base, offset, count)` — constant-offset same-word CZ - `cz_block_pairs_cross_word(word_c, bit_c, word_t, bit_t, count)` — cross-word CZ - Replace N individual CZ calls with single word-level shift+XOR+popcount ### Benchmark - `tableau-msd-fused` benchmark demonstrating batch API usage ## Performance MSD benchmark: **62.9µs vs 122.5µs = 48.7% faster** (From original pre-optimization 181µs: **65.3% total improvement**) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Roger-luo
force-pushed
the
feat/batch-clifford-gates
branch
from
April 12, 2026 03:10
b543197 to
00c67ea
Compare
Verifies that the full MSD circuit using batch methods (sqrt_y_batch, cz_block_pairs, cz_block_pairs_cross_word) produces identical measurement outcomes to the naive individual-gate version across 50 random seeds. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Roger-luo
force-pushed
the
feat/batch-clifford-gates
branch
from
April 12, 2026 03:16
5fddef5 to
7d6489e
Compare
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.
Summary
neonfeature flag with batch Clifford gate methods using combined bitmask operationssqrt_y_batch,sqrt_x_batch, etc.) merge N same-word gates into one mask swap/XOR + popcount parity — O(1) per word per rowcz_block_pairs,cz_block_pairs_cross_word) replace N constant-offset CZ calls with single word-level shift+XOR+popcounttableau-msd-fusedbenchmark demonstrating the batch APIMSD benchmark: 63.4µs vs 125.9µs = 49.6% faster (65% from original 181µs)
Key findings from the autotune experiment
[u64; 2]ops on aarch64 — explicit NEON intrinsics provide no benefitTest plan
neonfeature)🤖 Generated with Claude Code