ppvm_tableau::measure
measure¶
ppvm_tableau::measure
Z-basis measurement, including loss-aware variants.
classMeasureScratch¶source
ppvm_tableau::measure::MeasureScratch
Bases: Clone, Default
Rust struct. Per-measurement scratch buffers, reused across qubits within a single `measure_all` invocation — and, when threaded through [`measure_all_with_scratch`](GeneralizedTableau::measure_all_with_scratch), across many shots of a sampler too. Reusing one scratch keeps the case-a HashMap and the b-entries Vec out of the per-shot allocator churn.
pub struct MeasureScratch<I, R>Fields
| Name | Type | Description |
|---|---|---|
odd_phase_mask | Option<I> | |
coeff_map | FxHashMap<I, Complex<R>> | |
b_entries | Vec<(I, Complex<R>)> |
- `odd_phase_mask` is lazily computed and cached until the destabilizers change (i.e. until a case-a measurement runs `update_tableau_according_to_outcome`).
- `coeff_map` is the case-a HashMap holding `(idx → amplitude)` between the overlap, partition, and merge passes.
- `b_entries` is the case-a partition’s “k-bit = 1” scratch Vec.
Construct one per active sampling thread; the type is not meant to be shared across threads concurrently.
sourcemethodnew¶source
ppvm_tableau::measure::MeasureScratch::new