דלג לתוכן הראשי
פרויקט זה בשלב בטא. מצאת באג? פתח issue ב-GitHub. יש שאלה או רעיון? שאל ב-Discussions — נשמח לשמוע ממך!
מה איכות התרגום בדף זה?

הגדרת ניהול רעש עם Sampler

גרסאות חבילות

הקוד בעמוד זה פותח באמצעות הדרישות הבאות. אנחנו ממליצים להשתמש בגרסאות אלו או חדשות יותר.

qiskit-ibm-runtime~=0.47.0

ישנן מספר דרכים לנהל רעש, בדרך כלל באמצעות טכניקות שונות של הפחתת שגיאות ודיכוי שגיאות כדי למנוע שגיאות לפני שהן מתרחשות. טכניקות אלה בדרך כלל גורמות לתקורת עיבוד מקדים. לכן, חשוב להשיג איזון בין שכלול התוצאות שלכם לבין הבטחה שה-job שלכם יושלם בפרק זמן סביר.

Sampler תומך בטכניקות ניהול הרעש הבאות. ראו טכניקות הפחתה ודיכוי שגיאות להסבר על כל אחת.

הערה

לא כל האפשרויות עובדות יחד על כל סוגי ה-Circuit. ראו טבלת תאימות האפשרויות לפרטים מלאים.

דוגמה

# Added by doQumentation — installs the packages this notebook needs if they are missing
import importlib.util

_needed = {"qiskit_ibm_runtime": "qiskit-ibm-runtime"}
_missing = [pip for module, pip in _needed.items()
if importlib.util.find_spec(module) is None]
# One at a time, so a package that fails to install does not block the others
for _pip in _missing:
%pip install -q {_pip}
if not _missing:
print("\u2713 All required packages are installed")
from qiskit_ibm_runtime import QiskitRuntimeService

# Legacy server-side primitive before qiskit-ibm-runtime 0.50.0
# from qiskit_ibm_runtime import Sampler

# Client-side primitive introduced in qiskit-ibm-runtime 0.50.0
from qiskit_ibm_runtime.executor_sampler import 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}"
)
>>> dynamical decoupling sequence to use: XpXm
>>> gate twirling is turned on: True

הצעדים הבאים​

המלצות