Quadratic Unconstrained Binary Optimization (QUBO)
Overview
Quadratic Unconstrained Binary Optimization (QUBO)
This PennyLane demo provides an end-to-end walkthrough of solving a real optimization problem by casting it as a Quadratic Unconstrained Binary Optimization (QUBO) problem and tackling it with a quantum algorithm. QUBO is the canonical form for combinatorial optimization on quantum hardware: an objective quadratic in binary variables with no explicit constraints, which maps directly onto the ground-state problem of an Ising Hamiltonian. The tutorial takes a concrete, relatable example (such as a knapsack-style or assignment problem), shows how to translate its objective and constraints into QUBO form by folding the constraints into the objective as penalty terms, and then converts the QUBO into the corresponding Ising Hamiltonian. It then solves the problem with QAOA in PennyLane, building the cost and mixer layers, optimizing the variational parameters, and decoding the measured bitstring back into a solution of the original problem. Along the way it explains the modeling choices, such as how penalty weights enforce constraints and how the encoding affects qubit count. By covering the full pipeline from a worded problem to a quantum solution, the demo is a practical bridge from real optimization problems to quantum solvers in PennyLane.
Run it
pip install -r requirements.txt
python demo.py
Source and license
Imported from demonstrations_v2/tutorial_QUBO/demo.py in PennyLaneAI/demos at c52c0abeb5122218aa96b38eea848864cce7323f, under the Apache License 2.0. Original authors: Xanadu and the PennyLane community. The upstream LICENSE is included alongside this example.
This entry was created automatically from publicly available records. QCR links to public sources and only stores repository content where the license permits redistribution.
Versions
Cite all versions? Use the base QCR ID to always reference the latest version of this entry.
Join the Discussion
Comments (0)
No comments yet. Be the first to share your thoughts!