Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add resilience.zne.amplifier to EstimatorV2 options #1679

Merged
merged 4 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions qiskit_ibm_runtime/options/zne_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ class ZneOptions:
"""Zero noise extrapolation mitigation options.

Args:
amplifier: Which technique to use for amplifying noise. One of:

* `"gate_folding"` (default) uses 2-qubit gate folding to amplify noise. If the noise
factor requires amplifying only a subset of the gates, then these gates are chosen
randomly.
* `"gate_folding_front"` uses 2-qubit gate folding to amplify noise. If the noise
factor requires amplifying only a subset of the gates, then these gates are selected
from the front of the topologically ordered DAG circuit.
* `"gate_folding_back"` uses 2-qubit gate folding to amplify noise. If the noise
factor requires amplifying only a subset of the gates, then these gates are selected
from the back of the topologically ordered DAG circuit.

noise_factors: Noise factors to use for noise amplification. Default: (1, 3, 5).

extrapolator: Extrapolator(s) to try (in order) for extrapolating to zero noise.
Expand All @@ -50,6 +62,9 @@ class ZneOptions:
Default: ("exponential", "linear").
"""

amplifier: Union[
UnsetType, Literal["gate_folding", "gate_folding_front", "gate_folding_back"]
] = Unset
noise_factors: Union[UnsetType, Sequence[float]] = Unset
extrapolator: Union[UnsetType, ExtrapolatorType, Sequence[ExtrapolatorType]] = Unset

Expand Down
11 changes: 11 additions & 0 deletions release-notes/unreleased/1679.feat.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
The `ZneOptions.amplifier` option was added, which can be one of these strings:

* `"gate_folding"` (default) uses 2-qubit gate folding to amplify noise. If the noise
factor requires amplifying only a subset of the gates, then these gates are chosen
randomly.
* `"gate_folding_front"` uses 2-qubit gate folding to amplify noise. If the noise
factor requires amplifying only a subset of the gates, then these gates are selected
from the front of the topologically ordered DAG circuit.
* `"gate_folding_back"` uses 2-qubit gate folding to amplify noise. If the noise
factor requires amplifying only a subset of the gates, then these gates are selected
from the back of the topologically ordered DAG circuit.
1 change: 1 addition & 0 deletions test/integration/test_estimator_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def test_estimator_v2_options(self, service):
estimator.options.seed_estimator = 42
estimator.options.resilience.measure_mitigation = True
estimator.options.resilience.zne_mitigation = True
estimator.options.resilienc.zne.amplifier = "gate_folding_back"
estimator.options.resilience.zne.noise_factors = [3, 5]
estimator.options.resilience.zne.extrapolator = "linear"
estimator.options.resilience.pec_mitigation = False
Expand Down