Quantum Solar Optimization

Hands-on guide

How to run your own circuits on a real quantum computer

You do not need a lab or a physics degree. IBM lets anyone send a small job to a real quantum computer for free, and this page walks through the whole thing from zero: what you are actually doing, how to sign up (with the catches), and how to run something and read what comes back.

Part 1

What you are actually doing

A qubit is not quite a bit

A normal computer bit is a light switch: it is either 0 or 1, off or on. A quantum bit, a qubit, is more like a dimmer dial that can sit part-way, holding a mix of 0 and 1 at the same time. The catch is that the moment you actually look at it, the dial snaps to one end: you read back a plain 0 or 1, never the in-between.

A quantum circuit is a recipe

Despite the name, a quantum circuit is not wires and resistors. It is a recipe: a list of steps applied to the qubits in order, like a short dance routine. Each step is called a gate, and a gate is just one instructed operation, for example “flip this qubit” or “link these two together.” You build the recipe, then run it.

Superposition and interference

Superposition is holding many possibilities at once, like a map with every route lit up at the same time. Interference is arranging those possibilities so the good answers reinforce each other and the bad ones cancel out. Here is the catch: when you look, you still get back only one possibility. So the entire trick is to shape the circuit so that the one answer you want is the one most likely to come up.

Layers and shots

Two words show up in the results, so they are worth knowing. A layer is one round of the shaping recipe. More layers can sharpen the answer, but each one adds more settings to tune and, on a real machine, more noise. A shot is one run-and-measure of the circuit. Because each shot gives just one answer, you fire the circuit many times to build up statistics; I used 4,096 shots.

Why a real machine and not a simulator

A normal computer can imitate a quantum one exactly, but the work doubles with every qubit, so it hits a wall around 30 qubits. A real quantum chip does not pay that cost, because its qubits are the physical thing the simulator was struggling to track. That is the whole reason to use real hardware. I explain this more fully on the technical page.

Part 2

Signing up

The quantum part is free. The account part takes some patience, so here is what to expect.

The service is IBM Quantum, at quantum.cloud.ibm.com. The free tier is called the Open Plan: about 10 minutes of real quantum-computer time each month. That budget resets monthly; it does not stack up, so unused minutes do not roll over.

The catch about 'free'

Even though running is free, creating an account that can submit jobs requires a credit card for identity verification. It is not charged for free-tier use. I used my mom's card, with her agreement.

Setup can be bumpy. Creating an instance can error out temporarily; I hit a “failed to retrieve broker” error that cleared on its own after about a day, so if something fails, wait and retry.

On the signup screens, some checkboxes and buttons did not respond to clicks in Chrome. Switching to Edge fixed it. If a control seems dead, try a different browser.

Once the account works, you create an instance (a free Open Plan one, in the us-east region) and then create an API key.

Screenshot of the IBM Quantum Platform Instances dashboard showing one Open Plan instance named open-instance with 3 QPUs, 7 seconds total used, 9 minutes 53 seconds remaining, and 10 minutes total available for the cycle.
What an instance looks like once it is set up. The Open Plan gives 10 minutes of quantum-computer time per cycle; my whole four-circuit run used 7 seconds, leaving 9 minutes 53 seconds.

Protect your API key

Treat the API key like a password. Never paste it into a chat or commit it to a public repository; keep it on your own machine.

Part 3

Running something

The short version. The full, working code is in my repo.

Install the two libraries you need:

terminal

pip install qiskit qiskit-ibm-runtime

Save your account once, so your computer remembers it. The exact channel and instance settings are in my repo's README:

python (one time)

from qiskit_ibm_runtime import QiskitRuntimeService

QiskitRuntimeService.save_account(token="YOUR_API_KEY", overwrite=True)

List the machines you can use. This is free and costs no quantum time. When I did this I saw ibm_fez, ibm_marrakesh, and ibm_kingston, all 156-qubit machines:

python

service = QiskitRuntimeService()

for backend in service.backends():
    print(backend.name, backend.num_qubits)
# ibm_fez 156
# ibm_marrakesh 156
# ibm_kingston 156

The discipline that protects your 10 minutes

Do all of your tuning and testing on the free simulator, and only send the final, ready circuit to the real machine. Listing machines and building circuits cost nothing; only actually running a job on real hardware spends your minutes. My whole four-circuit run used just 7 seconds.

For a complete worked example, see my repository on GitHub. The submit step there is built on purpose to show exactly what it will send, and to refuse to spend any quantum time unless you explicitly confirm, so you cannot burn your budget by accident.

Part 4

What the results look like

What comes back is counts: how many of your shots landed on each possible answer. You compare that tally to what a perfect, noise-free machine would have given, and the difference is the effect of the real hardware's noise.

In my case, the noise grew with circuit size, and only my smallest circuit still clearly beat random guessing on the real machine. The full results, with the three-way comparison and the numbers, are on the main project page.

You can do this

The hardest part is the signup

Anyone can run a circuit on a real quantum computer, and the free tier is enough to learn on. If it feels intimidating, the hard part is the account setup, not the quantum. Once you are in, you are running the same kind of jobs researchers do.