haiqu.solve_qubo() API that automatically handles quantum optimization end-to-end.
For a 20-variable 6-regular Max-Cut problem (loaded from a deterministic reference graph), the raw quantum results achieve a suboptimal solution. With built-in post-processing, haiqu.solve_qubo() achieves the optimal solution—no additional quantum circuits required.
Having a bug or an issue?
Submit feedback
haiqu.solve_qubo()
What does it do? Provides a high-level interface for quantum optimization that automatically builds LR-QAOA circuits, runs them on quantum backends, applies post-processing, and calculates relevant metrics. How do I use it? Pass a QUBO problem, select a backend, configure circuit parameters (number of layers, shots), and optionally enable compression. The function returns comprehensive optimization results. What are the options?
device_id – choose backend (simulators or real hardware). p – number of LR-QAOA layers. postprocess_iterations – number of post-processing passes. compression – enable circuit compression.
Which options do you recommend? Start with aer_simulator for quick results. To improve solution quality:
postprocess_iterations (default 5) – increase for better results at the cost of runtime. p (default 10) – adjust the number of LR-QAOA layers to improve solution quality. compression=True – try enabling when running on hardware to reduce circuit depth and see how that improves the solution quality
Initialize the benchmark
Import the necessary libraries, initialize the Haiqu SDK, and create a 20-variable optimization problem. We’ll demonstrate the value of built-in post-processing and CVaR analysis.
haiqu.solve_qubo() once and analyze results with and without post-processing.
haiqu.solve_qubo() function provides comprehensive optimization results. Summary of scenarios: