Skip to content

Support representations directly in PEA #2936

@natestemen

Description

@natestemen

Background

Probabilistic Error Amplification (PEA) is a noise scaling technique used alongside ZNE that amplifies errors in a principled way using quasi-probability representations, rather than cruder methods like circuit folding. Currently, pea.construct_circuits accepts a noise_model string enum ("local_depolarizing" or "global_depolarizing") to determine how to amplify noise. This limits PEA to analytically tractable noise models and makes it unusable on real hardware, where the actual noise is neither of those.

The fix is to allow representations — a list of mitiq OperationRepresentation objects — to be passed directly in place of noise_model. These representations can be learned from hardware characterization data, making PEA hardware-agnostic. The math for how to use a quasi-representation to scale noise is described in Section D ("Canonical noise scaling") of
arXiv:2108.02237.

What needs to change

The primary change is in pea.construct_circuits (and any internal helpers it delegates to). The noise_model parameter should become optional, and a new representations parameter should be accepted as an alternative. The two should be mutually exclusive — passing both is an error, and passing neither should raise a clear message.

# BEFORE
pea.construct_circuits(
    circuit,
    scale_factors=[1.0, 1.2, 1.6],
    noise_model="local_depolarizing",
    epsilon=0.01,
    precision=0.2,
    random_state=1,
)

# AFTER
reps = ...  # List[OperationRepresentation] from hardware characterization
pea.construct_circuits(
    circuit,
    scale_factors=[1.0, 1.2, 1.6],
    representations=reps,
    epsilon=0.01,
    precision=0.2,
    random_state=1,
)

What OperationRepresentation is

OperationRepresentation is already used extensively in mitiq.pec. It represents a gate as a linear combination of implementable noisy operations (a quasi-probability decomposition). PEC uses these to cancel errors; PEA uses the same structure to amplify them in a controlled way.

Look at mitiq/pec/representations/ for existing functions that generate representations for standard noise models — these are a useful reference for understanding the data structure, and conveniently mean that the noise_model string path can be refactored internally to just call those functions and then follow the new representations code path. That keeps the logic in one place and preserves backward compatibility.

Implementation notes

  • noise_model should be kept for backward compatibility but ideally marked as deprecated in the docstring in favor of representations
  • Look at how pec.construct_circuits uses representations as a direct parallel; PEA's usage should be consistent with that interface

Acceptance criteria

  • pea.construct_circuits accepts a representations parameter taking List[OperationRepresentation]
  • Passing representations produces equivalent results to noise_model when the representations correspond to a standard depolarizing model (use this as a regression test)
  • Passing both representations and noise_model raises a clear error
  • noise_model continues to work unchanged (backward compatibility, but with a deprecation warning)
  • Unit tests cover the new parameter pathway
  • Docstring updated to reflect the new parameter and note noise_model as the legacy path

Good first steps

  1. Read mitiq/pea/pea.py and trace how noise_model is currently used inside construct_circuits to understand what needs to change
  2. Read mitiq/pec/representations/ to understand how OperationRepresentation objects are structured and constructed for standard noise models
  3. Write the refactored representations path first against a depolarizing model so you can immediately validate against the existing noise_model behavior, then add the regression test

Metadata

Metadata

Assignees

No one assigned

    Labels

    peaProbabilistic error amplificationpriority/midShould be fixed by the next 1-2 milestones.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions