ข้ามไปยังเนื้อหาหลัก

กำหนดค่า noise management ด้วย Sampler

เวอร์ชันแพ็กเกจ

โค้ดในหน้านี้พัฒนาโดยใช้ requirements ต่อไปนี้ แนะนำให้ใช้เวอร์ชันเหล่านี้หรือใหม่กว่า

qiskit-ibm-runtime~=0.46.1

มีหลายวิธีในการจัดการ noise โดยทั่วไปโดยใช้เทคนิค error mitigation และ error suppression ต่างๆ เพื่อหลีกเลี่ยงข้อผิดพลาดก่อนที่จะเกิดขึ้น เทคนิคเหล่านี้มักทำให้เกิดค่าใช้จ่ายในการประมวลผลล่วงหน้า ดังนั้น จึงสำคัญที่จะต้องหาจุดสมดุลระหว่างการปรับปรุงผลลัพธ์และการทำให้งานเสร็จในเวลาที่เหมาะสม

Sampler รองรับเทคนิค noise management ต่อไปนี้ ดู Error mitigation and suppression techniques สำหรับคำอธิบายของแต่ละเทคนิค

หมายเหตุ

ตัวเลือกทั้งหมดไม่ได้ทำงานร่วมกันบน circuit ทุกประเภท ดูรายละเอียดทั้งหมดที่คู่มือ feature compatibility table

ตัวอย่าง

# 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: "
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

ขั้นตอนถัดไป

คำแนะนำ