qiskit-documentation/docs/guides/configure-error-suppression...

59 lines
3.4 KiB
Plaintext

---
title: Configure error suppression
description: How to configure error suppression in Qiskit Runtime. (Former title - Runtime compilation)
---
# Configure error suppression
Error suppression refers to techniques where you use knowledge about the undesirable effects to introduce customization that can anticipate and avoid the potential impacts of those effects. These techniques often consist of altering or adding control signals to ensure that the quantum processor returns the desired results. This typically results in quantum pre-processing overhead; therefore, it is important to achieve a balance between perfecting your results and ensuring that your job completes in a reasonable amount of time.
Primitives support a number of error suppression techniques, including [dynamical decoupling](/api/qiskit-ibm-runtime/qiskit_ibm_runtime.options.DynamicalDecouplingOptions#dynamicaldecouplingoptions) and [Pauli twirling](/api/qiskit-ibm-runtime/qiskit_ibm_runtime.options.TwirlingOptions). See [Error mitigation and suppression techniques](error-mitigation-and-suppression-techniques) for an explanation of each. When using primitives, you can turn on or off individual methods. See the [Advanced error suppression options](#transpilation-table) section for details.
Estimator employs error suppression and mitigation by default. If you don't want any processing done to your input circuits, follow the instructions in the [Turn off all error mitigation and error suppression](specify-runtime-options#no-error-mitigation) section.
<span id="transpilation-table"></span>
## Advanced error suppression options
In the primitives, you can explicitly enable and disable individual error mitigation and suppression methods, such as dynamical decoupling.
<Admonition type = "note" title = "Notes">
- Not all options are available for both primitives. See the [available options](runtime-options-overview#options-table) table for the list of available options.
- Not all methods work together on all types of circuits. See the [options compatibility](runtime-options-overview#options-compatibility-table) table for details.
</Admonition>
```python
from qiskit_ibm_runtime import QiskitRuntimeService
from qiskit_ibm_runtime import SamplerV2 as Sampler
service = QiskitRuntimeService()
backend = service.least_busy(operational=True, simulator=False)
sampler = Sampler(backend)
# Turn on dynamical decoupling with sequence XpXm.
sampler.options.dynamical_decoupling.enable = True
sampler.options.dynamical_decoupling.sequence_type = "XpXm"
print(f">>> dynamical decoupling sequence to use: {sampler.options.dynamical_decoupling.sequence_type}")
```
<CodeAssistantAdmonition
tagLine="Can't remember the right attributes? Try asking Qiskit Code Assistant."
prompts={[
"# Enable dynamic decoupling for sampler with the 'XpXm' sequence type"
]}
/>
## Turn off all error suppression
For instructions to turn off all error suppression, see the [Turn off all error suppression and mitigation](specify-runtime-options#no-error-mitigation) section.
## Next steps
<Admonition type="tip" title="Recommendations">
- Learn more about [error mitigation and error suppression techniques.](error-mitigation-and-suppression-techniques)
- [Configure error mitigation.](configure-error-mitigation)
- Explore other [options.](runtime-options-overview)
- Decide what [execution mode](execution-modes) to run your job in.
</Admonition>