Skip to content

Add a Pauli bitmask operations benchmark module - #553

Open
ciaranra wants to merge 1 commit into
devfrom
pauli-ops-benchmark
Open

Add a Pauli bitmask operations benchmark module#553
ciaranra wants to merge 1 commit into
devfrom
pauli-ops-benchmark

Conversation

@ciaranra

Copy link
Copy Markdown
Member

What

crates/benchmarks had no coverage of Pauli bitmask arithmetic at all — the module list carried a // TODO: pub mod pauli_ops; placeholder. This fills it in.

The module measures multiply_with_phase (and phase-free multiply as a reference point) across all three storage backends and the operand shapes that stress different parts of the implementation:

  • dense at 64/128 qubits for every backend, plus 512/1024 for the growable ones;
  • sparse, low-index — a few non-identity sites on a wide register, the shape where a word-parallel implementation is at its worst relative to a per-qubit one;
  • sparse, high-index — a few sites near the top of a wide register;
  • empty times long — identity against a wide operand, in both operand orders, since the two are not symmetric when an implementation walks one operand's length.

Operands are built once outside the timed closure and derived arithmetically from the qubit index, so the inputs are byte-identical across runs and across branches. The module uses only the public pecos_core API, which is what makes it usable as a cross-branch comparison harness.

Why it exists

It was written to substantiate — or refute — a performance claim about the phase computation, and it did both: it confirmed a large speedup on dense and wide-register shapes and exposed a real regression on sparse-low-index operands that had been predicted but never measured. That regression was then fixed before the change shipped.

@ciaranra ciaranra added enhancement New feature or request rust Pull requests that update rust code labels Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request rust Pull requests that update rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant