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
Good first steps
- Read
mitiq/pea/pea.py and trace how noise_model is currently used inside construct_circuits to understand what needs to change
- Read
mitiq/pec/representations/ to understand how OperationRepresentation objects are structured and constructed for standard noise models
- 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
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_circuitsaccepts anoise_modelstring 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 mitiqOperationRepresentationobjects — to be passed directly in place ofnoise_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") ofarXiv:2108.02237.
What needs to change
The primary change is in
pea.construct_circuits(and any internal helpers it delegates to). Thenoise_modelparameter should become optional, and a newrepresentationsparameter 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.What
OperationRepresentationisOperationRepresentationis already used extensively inmitiq.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 thenoise_modelstring path can be refactored internally to just call those functions and then follow the newrepresentationscode path. That keeps the logic in one place and preserves backward compatibility.Implementation notes
noise_modelshould be kept for backward compatibility but ideally marked as deprecated in the docstring in favor ofrepresentationspec.construct_circuitsusesrepresentationsas a direct parallel; PEA's usage should be consistent with that interfaceAcceptance criteria
pea.construct_circuitsaccepts arepresentationsparameter takingList[OperationRepresentation]representationsproduces equivalent results tonoise_modelwhen the representations correspond to a standard depolarizing model (use this as a regression test)representationsandnoise_modelraises a clear errornoise_modelcontinues to work unchanged (backward compatibility, but with a deprecation warning)noise_modelas the legacy pathGood first steps
mitiq/pea/pea.pyand trace hownoise_modelis currently used insideconstruct_circuitsto understand what needs to changemitiq/pec/representations/to understand howOperationRepresentationobjects are structured and constructed for standard noise modelsrepresentationspath first against a depolarizing model so you can immediately validate against the existingnoise_modelbehavior, then add the regression test