สร้าง function template สำหรับ Hamiltonian simulation
template นี้ครอบค ลุม workflow สำหรับจำลองการ time evolution ของ initial state กับ spin-based Hamiltonian ที่ผู้ใช้กำหนด และคืนค่า expectation values ที่ระบุไว้โดยใช้ AQC addon
template นี้มีโครงสร้างเป็น Qiskit pattern ที่มีขั้นตอนดังนี้:
1. รับ input และ map ปัญหา
ส่วนนี้รับ Hamiltonian ที่ต้องการจำลอง, initial state ในรูปแบบ QuantumCircuit, ชุด observables สำหรับประมาณ expectation values และข้อกำหนด options สำหรับ AQC addon ขั้นตอนนี้ตรวจสอบว่า input data ที่จำเป็นทั้งหมดมีอยู่ครบและอยู่ในรูปแบบที่ถูกต้อง
จากนั้น input arguments จะถูกนำไปสร้าง quantum circuits และ operators ที่เกี่ยวข้องสำหรับ workflow โดยจะสร้าง target circuit และหา matrix product state representation ของ circuit นี้โดยใช้ AQC addon หลังจากนั้นจะสร้าง ansatz circuit และปรับให้เหมาะสมด้วย tensor network methods เพื่อผลิต final circuit ที่รัน time evolution ที่เ หลือ
2. เตรียม circuits ที่สร้างขึ้นสำหรับการ execution
circuits ที่สร้างจาก AQC addon จะถูก transpile เพื่อรันบน backend ที่เลือก และสร้าง instance ของ EstimatorV2 ด้วยชุด error mitigation options เริ่มต้นสำหรับจัดการการ execution ของ circuit
3. Execution
สุดท้าย ansatz circuit จะถูก transpile และรันบน QPU พร้อมรวบรวมค่าประมาณสำหรับ expectation values ทั้งหมดที่ระบุไว้ และคืนค่าในรูปแบบที่ serialize ได้เพื่อให้ผู้ใช้เข้าถึงได้