Lewati ke konten utama

Configure noise management with Sampler

Belum diterjemahkan

Halaman ini belum diterjemahkan. Anda sedang melihat versi asli dalam bahasa Inggris.

Package versions

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

qiskit-ibm-runtime~=0.46.1

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 for an explanation of each.

catatan

Not all options work together on all types of circuits. See the feature compatibility table guide for full details.

Example

# Added by doQumentation — required packages for this notebook
!pip install -q qiskit-ibm-runtime
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: {sampler.options.dynamical_decoupling.sequence_type}"
)
print(
f">>> gate twirling is turned on: {sampler.options.twirling.enable_gates}"
)
>>> dynamical decoupling sequence to use: XpXm
>>> gate twirling is turned on: True
Can't remember the right attributes? Try asking Qiskit Code Assistant.

Next steps​

Recommendations