QuEPP¶
- class QuEPP(truncation_order=2, coefficient_threshold=None, sampling='montecarlo', n_samples=200, seed=None, n_twirls=10)[source]¶
Bases:
QEMProtocolQuantum Enhanced Pauli Propagation (QuEPP) error mitigation.
Decomposes the target circuit into Clifford + non-Clifford parts via Clifford Perturbation Theory (CPT), classically simulates the low-order Pauli paths, and uses noisy quantum execution to correct the truncation bias through an empirical rescaling factor η.
- Parameters:
truncation_order (
int) – Maximum number of sine branches in the CPT expansion (K_T). Higher values reduce bias at the cost of more auxiliary circuits. Used bysampling="exhaustive"and by the montecarlo fallback on symbolic circuits (seesampling).coefficient_threshold (
float|None) – Prune paths whose absolute weight falls below this value during DFS enumeration. Only used withsampling="exhaustive"(disabled on symbolic circuits, whose angle magnitudes are unknown).sampling (
Literal['montecarlo','exhaustive']) – Path selection strategy."exhaustive"enumerates paths up totruncation_order."montecarlo"(default) drawsn_samplesrandom paths, but only on concrete (parameter-bound) circuits; on a symbolic circuit — which is what variational programs present at mitigation time, before parameter binding — it warns and falls back to exhaustive enumeration, son_sampleshas no effect there.n_samples (
int) – Number of Monte Carlo path samples (default 200); applies only to the concrete-circuit montecarlo path.seed (
int|None) – RNG seed for Monte Carlo reproducibility.n_twirls (
int) – Number of Pauli twirling samples. When non-zero, the pipeline builder appends aPauliTwirlStage. Default10.
Attributes Summary
Methods Summary
applies_to(result_format)Whether this protocol is applicable to
result_format(Truefor every format by default; protocols meaningful only for some override).compute_eta(classical_values, ensemble_noisy)Compute the rescaling factor η from noisy/ideal ratios.
dry_expand(dag[, observable])Analytic path: emit
1 + n_pathsplaceholder DAGs, no Clifford sim.evaluate_symbolic_weights(per_obs_entry, ...)Substitute concrete parameter values into symbolic weight expressions.
expand(dag[, observable])Build path DAGs and per-observable classical context.
post_reduce(contexts)Hook called after all per-group
reducecalls in an evaluation.reduce(quantum_results, context)Combine quantum results with per-observable classical context(s) into a list of mitigated expectation values.
Attributes Documentation
- name¶
Methods Documentation
- applies_to(result_format)[source]¶
Whether this protocol is applicable to
result_format(Truefor every format by default; protocols meaningful only for some override).Applicability is distinct from doing work: a no-op protocol is vacuously applicable, while pipeline assembly decides whether a protocol requires a QEM stage.
- Return type:
- static compute_eta(classical_values, ensemble_noisy, min_eta=0.1)[source]¶
Compute the rescaling factor η from noisy/ideal ratios.
- dry_expand(dag, observable=None)[source]¶
Analytic path: emit
1 + n_pathsplaceholder DAGs, no Clifford sim.Runs the same preprocessing + per-observable path enumeration as
expand()to get an accurate fan-out factor, then skips the per-path DAG surgery and Clifford ensemble simulation — the two dominant costs — and reuses the inputdagas a placeholder for every emitted slot.n_pathsreflects the deduplicated count across all observables.- Return type:
tuple[tuple[DAGCircuit,...],dict]
- static evaluate_symbolic_weights(per_obs_entry, symbols, param_values)[source]¶
Substitute concrete parameter values into symbolic weight expressions.
Operates on a single
per_obsslot. symbols are the QiskitParameterobjects referenced by the weight expressions; param_values are their numeric values in the same positional order.- Return type:
- expand(dag, observable=None)[source]¶
Build path DAGs and per-observable classical context.
Preprocessing and Clifford tableau construction run once; path enumeration and classical simulation run per observable. Paths sharing a
branchestuple produce the same Clifford circuit and are deduped across observables.- Return type:
tuple[tuple[DAGCircuit,...],dict]
- post_reduce(contexts)[source]¶
Hook called after all per-group
reducecalls in an evaluation.Protocols can override this to inspect the collected contexts and emit summary diagnostics (e.g. signal-destruction warnings).
- Return type:
- reduce(quantum_results, context)[source]¶
Combine quantum results with per-observable classical context(s) into a list of mitigated expectation values.
The context’s
per_obslist carries one entry per observable; each entry has its owndag_indicesslicingquantum_results, its ownclassical_valuesandweights, and produces one mitigated value via the QuEPP η formula.