QPRIMORA · QUANTUM COMPUTING DEMO

Travelling Salesman Problem

Travelling Salesman Problem · TSP

If you must visit every city once and return to the starting point, how can you find the shortest total route?

This demo shows how QPRIMORA transforms a real-world optimization problem into a representation that can be mapped toward quantum computation.
01 · YOUR PROBLEM

Set the problem size

6

The cities are generated automatically. Change the number or regenerate the map to create another problem.

Problem map
02 · QPRIMORA TRANSFORMATION

How QPRIMORA transforms the problem

The important layer is the transformation between a user's objective and the computation executed by a quantum processor.

REAL-WORLD PROBLEM Visit all cities with minimum distance
↓
DECISION VARIABLES x(i,t) Is city i visited at step t?
↓
CONSTRAINTS One city per step · each city once
↓
OBJECTIVE Min Σ distance(i,j)
↓
REPRESENTATION QUBO Quadratic Unconstrained Binary Optimization
↓
QPRIMORA PRIMITIVE Combinatorial Optimization
QPRIMORA · INSIDE THE TRANSFORMATION

See how the problem is transformed step by step

Open each layer to see how a route-planning request becomes a mathematical optimization model and then a quantum-computing representation.

A
DECISION VARIABLES How do we describe a route with binary variables?
+

For every city i and every visiting position t, QPRIMORA introduces one binary decision variable:

xi,t ∈ {0,1}

xi,t = 1 means city i is visited at position t. Otherwise it is 0.

Current problem 6 cities
↓
36 binary variables
n × n
B
CONSTRAINTS What makes a binary string a valid route?
+
CONSTRAINT 1 Each city appears exactly once
Σt xi,t = 1

For every city i, exactly one visiting position must be selected.

CONSTRAINT 2 Each route position contains one city
Σi xi,t = 1

At every route position t, exactly one city must be selected.

Binary variables + Constraints → Valid tour
C
OBJECTIVE FUNCTION How do we tell the computer what “better” means?
+

Among all valid routes, the objective is to minimize the total distance between consecutive cities.

min   Σi,j,t di,j xi,t xj,t+1
di,j distance between city i and city j
x route decision variables
D
QUBO Combine objective and constraints into one optimization model
+

The route distance and the constraint penalties can be combined into a Quadratic Unconstrained Binary Optimization model:

E(x) = Distance(x) + A · ConstraintPenalty(x)
INPUT x ∈ {0,1}n²
→
QUBO xᵀQx
→
GOAL min E(x)

Q contains both route-distance information and penalties for invalid routes.

E
COST HAMILTONIAN How does QUBO enter the quantum-computing layer?
+

A binary variable can be mapped to a qubit operator:

xi = (1 − Zi) / 2

After substitution, the QUBO objective becomes a Cost Hamiltonian HC. Low-energy quantum states correspond to better candidate routes.

QUBO → Ising form → HC → Low-energy states
F
QAOA + VIRTUAL QPU How does the quantum path produce candidate routes?
+
1 Prepare quantum state
→
2 Apply Cost / Mixer layers
→
3 Adjust parameters
→
4 Measure repeatedly
→
5 Candidate distribution
Key idea

The quantum optimization path does not simply “calculate the route”. It attempts to reshape the probability distribution so that better solutions are measured more frequently.

03 · TWO COMPUTATION PATHS

Compare two ways to solve the same problem

CLASSICAL

Conventional Computing

City coordinates ↓ Enumerate routes ↓ Calculate route distances ↓ Select shortest route
QUANTUM PATH

Virtual QPU

QUBO ↓ Cost Hamiltonian ↓ QAOA ↓ Virtual QPU ↓ Measurement ↓ Candidate route
04 · WHY SCALE MATTERS

Why does this problem become difficult?

The number of possible tours grows extremely quickly. The values below show permutations before removing equivalent rotations and reversed routes.

5 cities 120
10 cities 3,628,800
15 cities 1.31 × 10¹²
20 cities 2.43 × 10¹⁸
Scientific interpretation

The Virtual QPU on this website is simulated on classical hardware. Its measured runtime therefore does not demonstrate a quantum hardware speed advantage. This demo illustrates problem representation, primitive mapping and the quantum optimization computation path. QAOA does not currently have an established general practical speedup for TSP.

QPRIMORA ARCHITECTURE

From real-world intent to QPU execution

Problem → Representation → Primitive → Algorithm → Compiler → Virtual QPU → Real QPU

QPRIMORA's objective is to make users describe what they want to solve, rather than how a QPU should execute it.