diff --git a/qiskit_ibm_runtime/options/options.py b/qiskit_ibm_runtime/options/options.py index eb3dd19c2..f00a31e08 100644 --- a/qiskit_ibm_runtime/options/options.py +++ b/qiskit_ibm_runtime/options/options.py @@ -23,6 +23,7 @@ from .transpilation_options import TranspilationOptions from .resilience_options import ResilienceOptions from ..runtime_options import RuntimeOptions +from ..utils.deprecation import issue_deprecation_msg @_flexible @@ -35,7 +36,7 @@ class Options: Higher levels generate more optimized circuits, at the expense of longer transpilation times. This is based on the ``optimization_level`` parameter in qiskit-terra but may include - backend-specific optimization. + backend-specific optimization. Default: 3. * 0: no optimization * 1: light optimization @@ -44,10 +45,19 @@ class Options: resilience_level: How much resilience to build against errors. Higher levels generate more accurate results, - at the expense of longer processing times. + at the expense of longer processing times. Default: 1. - * 0: no resilience - * 1: light resilience + * 0: No mitigation. + * 1: Minimal mitigation costs. Mitigate error associated with readout errors. + * 2: Medium mitigation costs. Typically reduces bias in estimators but + is not guaranteed to be zero bias. Only applies to estimator. + * 3: Heavy mitigation with layer sampling. Theoretically expected to deliver zero + bias estimators. Only applies to estimator. + + Refer to the + `Qiskit Runtime documentation + `_. + for more information about the error mitigation methods used at each level. max_execution_time: Maximum execution time in seconds. If a job exceeds this time limit, it is forcibly cancelled. If ``None``, the @@ -71,8 +81,8 @@ class Options: :class:`SimulatorOptions` for all available options. """ - optimization_level: int = 1 - resilience_level: int = 0 + optimization_level: int = 3 + resilience_level: int = 1 max_execution_time: Optional[int] = None transpilation: Union[TranspilationOptions, Dict] = field( default_factory=TranspilationOptions @@ -121,6 +131,14 @@ def _get_program_inputs(options: dict) -> dict: } ) + for deprecated in ["translation_method", "timing_constraints"]: + if deprecated in inputs["transpilation_settings"]: + issue_deprecation_msg( + msg=f"The {deprecated} transpilation option has been deprecated", + version="0.8", + remedy="", + ) + known_keys = list(Options.__dataclass_fields__.keys()) known_keys.append("image") # Add additional unknown keys. diff --git a/qiskit_ibm_runtime/options/transpilation_options.py b/qiskit_ibm_runtime/options/transpilation_options.py index 657e7d8aa..8a5f295ba 100644 --- a/qiskit_ibm_runtime/options/transpilation_options.py +++ b/qiskit_ibm_runtime/options/transpilation_options.py @@ -12,7 +12,7 @@ """Transpilation options.""" -from typing import Optional, List, Union, Dict +from typing import Optional, List, Union from dataclasses import dataclass from .utils import _flexible @@ -36,39 +36,12 @@ class TranspilationOptions: routing_method: Name of routing pass. One of 'basic', 'lookahead', 'stochastic', 'sabre', 'none'. - translation_method: Name of translation pass. One of 'unroller', 'translator', 'synthesis'. - approximation_degree: heuristic dial used for circuit approximation (1.0=no approximation, 0.0=maximal approximation) - - timing_constraints: An optional control hardware restriction on instruction time - resolution. A quantum computer backend may report a set of restrictions, namely: - - * granularity: An integer value representing minimum pulse gate - resolution in units of ``dt``. A user-defined pulse gate should have - duration of a multiple of this granularity value. - - * min_length: An integer value representing minimum pulse gate - length in units of ``dt``. A user-defined pulse gate should be longer - than this length. - - * pulse_alignment: An integer value representing a time resolution of gate - instruction starting time. Gate instruction should start at time which - is a multiple of the alignment value. - - * acquire_alignment: An integer value representing a time resolution of measure - instruction starting time. Measure instruction should start at time which - is a multiple of the alignment value. - - This information will be provided by the backend configuration. - If the backend doesn't have any restriction on the instruction time allocation, - then ``timing_constraints`` is None and no adjustment will be performed. """ skip_transpilation: bool = False initial_layout: Optional[Union[dict, List]] = None # TODO: Support Layout layout_method: Optional[str] = None routing_method: Optional[str] = None - translation_method: Optional[str] = None approximation_degree: Optional[float] = None - timing_constraints: Optional[Dict[str, int]] = None diff --git a/releasenotes/notes/default-resilience-level-8122033dd1369bc8.yaml b/releasenotes/notes/default-resilience-level-8122033dd1369bc8.yaml new file mode 100644 index 000000000..eab412dfb --- /dev/null +++ b/releasenotes/notes/default-resilience-level-8122033dd1369bc8.yaml @@ -0,0 +1,10 @@ +--- +upgrade: + - | + The default ``resilience_level`` option for has been changed from 0 to 1. + In addition, the default ``optimization_level`` option has been changed + from 1 to 3. +deprecations: + - | + The transpilation options ``translation_method`` and ``timing_constraints`` + have been deprecated.