---
title: Configure noise management with Sampler
description: How to configure noise management with the IBM Quantum Estimator primitive.
source: https://eu-de.quantum.cloud.ibm.com/docs/en/guides/sampler-noise-management
---

# Configure noise management with Sampler

### Package versions

The code on this page was developed using the following requirements.
We recommend using these versions or newer.

```
qiskit-ibm-runtime~=0.47.0
```

There are several ways to manage noise, typically by using various error mitigation and error suppression techniques to avoid errors before they happen.  These techniques usually cause 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.

Sampler supports the following noise management techniques. See [Error mitigation and suppression techniques](/docs/guides/error-mitigation-and-suppression-techniques) for an explanation of each.

- [dynamical decoupling](/docs/api/qiskit-ibm-runtime/options-dynamical-decoupling-options#dynamicaldecouplingoptions)
- [Pauli twirling](/docs/api/qiskit-ibm-runtime/options-twirling-options)

> **Note**
>
> Not all options work together on all types of circuits. See the [feature compatibility table](/docs/guides/sampler-options#options-compatibility-table) guide for full details.

Example

```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"
# Turn on gate twirling. Requires qiskit_ibm_runtime 0.23.0 or later.
sampler.options.twirling.enable_gates = True

print(
    f">>> dynamical decoupling sequence to use: "
    f"{sampler.options.dynamical_decoupling.sequence_type}"
)
print(
    f">>> gate twirling is turned on: {sampler.options.twirling.enable_gates}"
)
```

Output:

```
>>> dynamical decoupling sequence to use: XpXm
>>> gate twirling is turned on: True
```

## Next steps

> **Recommendations**
>
> - Learn more about [error mitigation and error suppression techniques](/docs/guides/error-mitigation-and-suppression-techniques).
> - Explore Sampler [options](/docs/guides/sampler-options).
> - Decide what [execution mode](/docs/guides/execution-modes) to run your job in.
