Skip to main content
haiqu.run() This notebook demonstrates how to use haiqu.run() to execute your circuits on quantum hardware or simulators. Haiqu SDK currently supports devices available via IBM Quantum and AWS Braket. It is also possible to simulate quantum circuits using noisy simulators of some IBM devices and Qiskit Aer simulator Having a bug or an issue? Submit feedback haiqu.run() What does it do? This function does exactly what you’d expect: it runs your quantum circuits on available quantum hardware or simulators. How do I use it? Pass a quantum circuit along with necessary parameters (like the device and the number of shots) to haiqu.run() to create a run job, then retrieve results with job.result(). What are the options? Optional parameters include observables, parameters, options, and use_mitigation for enabling quantum error mitigation. Which option do you recommend? Start with running single circuits, then explore measuring observables, using parameterized circuits, and enabling error mitigation as needed. Initialize the example Import the necessary libraries, initialize the Haiqu SDK, and create an adder circuit to demonstrate circuit execution. The adder circuit adds two integers m and k.
Execute the quantum circuit First, we will list available devices, then run the adder circuit on a selected device using haiqu.run(). Finally, we will retrieve and display the results.
To run on a particular quantum device, we need to specify our credentials in the options parameter of the haiqu.run() function. We will use fake_torino as a device for demonstration purposes, but you can replace it with the real ibm_torino from the list obtained earlier, as long as you have access to it.
You can visualize the circuit using Haiqu’s Drawer utility. In the plot, you can hover over individual bins to see the exact value and the bitstring associated with it.
💡 Good to Know: Instead of using device_id it is possible to pass a device parameter, for instance if you already have a device object from haiqu.get_device(). Get in Touch Documentation portal docs.haiqu.ai Contact Support feedback.haiqu.ai Follow Us on LinkedIn latest news on LinkedIn Visit Our Website Learn more about Haiqu Inc. on haiqu.ai Business Inquiries Contact us at info@haiqu.ai