Suppose a furniture shop has three jobs and two workbenches. Some jobs get in each other’s way when they share a bench. Can a quantum circuit make a good assignment come up more often? We can test that on a small example where the best split is already known.
Set up a decision you can score
Call the jobs A, B, and C. Give each pair points if you assign the two jobs to different benches. These are sample scores for a workshop exercise.
| Pair separated | Points |
|---|---|
| A and B | 3 |
| A and C | 2 |
| B and C | 1 |
The best split puts A on one bench and B and C on the other. It earns 5 points. Putting B by itself earns 4. Putting C by itself earns 3. Putting everything on one bench earns 0. Swapping bench labels gives a second assignment for each score.
Compare the classical answer and the quantum simulation
| Method | Chance of the best split | Average score |
|---|---|---|
| Check all eight assignments and choose the best | 100% | 5.00 |
| Pick one assignment uniformly at random | 25% | 3.00 |
| Sample the circuit below in an ideal simulation | 50.1% | 4.21 |
The circuit uses one round of a method called QAOA. We calculated its ideal probabilities using a classical statevector simulation. The hardware result is an open comparison you can run yourself. IBM’s quantum optimization guide
Run the workshop circuit on IBM hardware
Use the free IBM setup walkthrough to open Composer. Replace the starter code with the circuit below, select your Open Plan instance, and submit 1,024 shots.
OPENQASM 3.0;
include "stdgates.inc";
qubit[3] q;
bit[3] c;
h q[0];
h q[1];
h q[2];
cx q[0], q[1];
rz(-1.2) q[1];
cx q[0], q[1];
cx q[0], q[2];
rz(-0.8) q[2];
cx q[0], q[2];
cx q[1], q[2];
rz(-0.4) q[2];
cx q[1], q[2];
rx(0.7) q[0];
rx(0.7) q[1];
rx(0.7) q[2];
c[0] = measure q[0];
c[1] = measure q[1];
c[2] = measure q[2];
When the job finishes, add the counts for 001 and 110 and divide by the total shots. These are the two best assignments, with the bench labels swapped. The rightmost bit represents A. Compare your percentage with 25% for a random pick and 50.1% for the ideal circuit.
What would make this useful in a real shop?
For three jobs, checking all eight assignments is fast and guarantees the best score. To model a real shop, also account for due dates, bench capacity, staffing, and setup time. If you tested a larger model, compare the schedule quality, processing time, and cost with a good classical scheduler. This example isolates one question: can the circuit make good assignments more common?
