Skip to content

Add sum products, z-basis projection, and pattern readout to PPVM-pauli-sum-2 - #316

Open
JonhasA wants to merge 2 commits into
trait-2/pauli-sum-2-loss-noisefrom
trait-2/pauli-sum-2-product-readout
Open

JonhasA wants to merge 2 commits into
trait-2/pauli-sum-2-loss-noisefrom
trait-2/pauli-sum-2-product-readout

Conversation

@JonhasA

@JonhasA JonhasA commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Completes products, projection, and readout for ppvm-pauli-sum-2, so the engine
can run full propagation workloads (propagate an observable, then read it out).
Stacked on top of #315.

  • Products: &a * &b is the distributive product
    (Σ aₚP)(Σ b_qQ) = Σ aₚb_q·iᵏ·PQ, with each word product's phase iᵏ absorbed
    into the coefficient. Requires coefficients with an imaginary unit (complex);
    real and lossy sums have no product.
  • Projection: p0/p1 implement Projection as O ↦ PₘOPₘ. On the projected
    qubit, I/Z map to (I ± Z)/2 combinations; X, Y, and lost terms become
    zero.
  • Readout: sum.trace(&pattern) sums the coefficients of matching words.
    A Pattern is one SiteSet (I | X | Y | Z | L | ANY) per site;
    Pattern::zero_state(n) gives ⟨0…0|O|0…0⟩. Apply X first to read other
    basis states.

No regressions in existing gates or channels (within noise, criterion, 16k
terms × 32 qubits). Zero-state trace is 1.9–3× faster than legacy, and p0 is
~10% faster.

@JonhasA
JonhasA requested a review from david-pl November 23, 2026 07:11
@github-actions

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.2

QR code for preview link

🚀 View preview at
https://QuEraComputing.github.io/ppvm/pr-preview/pr-316/

Built to branch gh-pages at 2026-11-23 07:18 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@david-pl
david-pl changed the base branch from trait-2/ppvm-pauli-sum-2 to trait-2/pauli-sum-2-loss-noise November 23, 2026 11:58

@david-pl david-pl left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Did you run some benchmarks on 314-316 comparing against the old version?

/// Multiplies every pair of terms, so this costs `|self| · |rhs|` word products.
/// Order matters, since Pauli words need not commute. Policies may differ; the
/// result keeps the left one. Panics if the widths differ.
impl<S, P, P2> Mul<&Sum<S, P2>> for &Sum<S, P>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a wrapper that also implements the product for owned sums?

This branch has not been deployed

No deployments
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