Quantum Modeler · 0/1 Knapsack
Choose what matters. Stay within capacity.
Select items to maximize value without exceeding a weight limit. Translate that decision into a quantum model, explain the mathematics, run a small QAOA circuit, and check the result against an exact classical solution.
The eight-qubit execution limit includes item decisions and capacity slack. Larger targets are projections only. QAOA samples can violate the capacity constraint; those samples are never reported as valid solutions.
Items, value, and capacity
Ready to validate a small selection problem.
Open the simulator to purchase more runs, then return here.
Results and explanation describe the last completed build. Rebuild after changing inputs.
Explain this model
From business interpretation to objective, Hamiltonian, circuit, complexity, and limitations.
Small-instance QAOA
Selection and exact reference
EXECUTED · Feasibility matters
Capacity-feasible means selected item weight ≤ capacity. The penalty equality also requires sampled slack to match the unused capacity. Conditional expected feasible value averages only over feasible probability mass.
A lower penalized energy does not guarantee a better measured selection. Infeasible selections remain visible in the distribution.
Target encoding resources
EXECUTED · Measured candidates
Top 16 sampled bitstrings. Item bits come first; slack bits follow in order 1, 2, 4, … . Value and weight are classically decoded from item bits.
| Bits | Count | Probability | Value | Weight | Capacity | Slack equality |
|---|
Full probability distribution
| Bits | Count | Probability | Value | Weight | Capacity | Slack equality |
|---|
Circuit artifacts
Generated DSL
OpenQASM 2.0
NOT CLAIMED
Encoding evidence, explicit limits
This is an ideal, noiseless simulation on classical hardware. It demonstrates a small formulation and independent verification, not quantum advantage, QPU execution, physical-qubit requirements, fault tolerance, or large-scale performance. No production resource-allocation quality is guaranteed.