VibeQ
tutorial: making quantum circuits
Open the app VibeGDS ↗ Quantum computing primer

Making quantum circuits with VibeQ

You describe a circuit in a sentence. VibeQ writes it, runs it, shows you what it does, checks it, compiles it for a real chip's gates and hands you a file. This page shows how to get good circuits out of it, how to read every panel, and how to go from "a Bell pair" to algorithms.

If qubits, gates and superposition are new to you, read the quantum computing primer first; it uses the same circuits.

1. Your first circuit in thirty seconds
2. How to describe a circuit
3. Reading the diagram
4. The Simulate tab: probabilities, shots, Bloch vectors
5. The Verify tab: checks and hardware targets
6. Changing a circuit in plain English
7. Editing the script yourself
8. Export: OpenQASM 3
9. Patterns that work (states, oracles, algorithms)
10. What VibeQ checks, and what it cannot
11. Troubleshooting

1. Your first circuit in thirty seconds

Open VibeQ. The page is one big prompt. Type a sentence that says what the circuit should do, pick a target (leave it on Ideal simulator for now) and press Build it.

Try it A Bell pair: put two qubits into the entangled state (|00⟩ + |11⟩)/√2 and measure both.

Within a few seconds you get: the circuit drawn in the viewer, the Qiskit script in the Code tab, and a chat message that ends with a line computed from the run, for example Built from the run: 2 qubits, depth 3, h ×1, cx ×1, measure ×2; most likely outcomes 00 (50.0 %), 11 (50.0 %). That last line is never written by the model; it is what the circuit actually did.

q0q1 H M M c/2

The Bell pair: a Hadamard (H) puts qubit 0 into superposition, a CNOT (dot and ⊕) copies that superposition onto qubit 1 as entanglement, two measurements (M) write the results to classical bits.

2. How to describe a circuit

VibeQ hands your sentence to a language model with a strict contract: it must return one Qiskit script that defines build(), it may not simulate or print, and every angle must be a number. The better your sentence, the fewer repairs it needs. Four habits that pay off:

HabitWeakStrong
Say the size"a GHZ state""a 4-qubit GHZ state"
Say what is measured"Grover for 101""…marking |101⟩, two iterations, measure all three qubits"
Number the qubits when roles matter"teleport a state""teleport RY(π/3)|0⟩ from qubit 0 to qubit 2 using a Bell pair on qubits 1 and 2"
Name the oracle"Deutsch-Jozsa""Deutsch-Jozsa on 3 inputs with the balanced oracle f(x) = x0 XOR x2"
Vague requests ("make it better") get a question back instead of a build. Requests that name a known state (Bell, GHZ, W) are checked against that state's exact outcome statistics; a circuit that misses them is sent back to the model for repair before you see it.

Bit order matters when you read outcomes: VibeQ prints bit strings the way Qiskit does, with qubit 0 as the rightmost character. "Qubit 2 = 1, qubits 1 and 0 = 0" prints as 100.

3. Reading the diagram

Each horizontal line is a qubit, time runs left to right, and the double line at the bottom is the classical register that measurements write into. Colours tell gate families apart:

LookMeaning
Blue box HHadamard: makes an equal superposition (or undoes one).
Red box X, Y, Z, √XPauli-type flips: X is a bit flip, Z a phase flip.
Yellow box RX(θ), RY(θ), RZ(θ)Rotations by an angle; angles print as fractions of π.
Purple box S, T, P(θ)Phase gates: they change the sign or phase of the |1⟩ part only.
Dot joined to a ⊕CNOT (CX): flip the target when the control is 1. Two dots and a ⊕ is a Toffoli.
Dot joined to a boxControlled gate (CRY, CP, …): apply the box only when the control is 1.
Two × marks joinedSWAP.
Green M with a dashed line downMeasurement into the classical bit named at the bottom.
Dashed vertical lineBarrier: no gate, just a visual separator the compiler respects.

Text in the viewer toolbar switches to Qiskit's own text drawing, useful for pasting into notes. Fit re-centres a long circuit.

4. The Simulate tab: probabilities, shots, Bloch vectors

Three views of the same circuit, in order of trust:

  1. Exact outcome probabilities. The statevector of the whole circuit (with the final measurements removed), so these numbers are what the mathematics says, with no sampling noise. Available up to 20 qubits, and not for circuits that measure in the middle and keep going.
  2. Sampled counts. The circuit run shots times on an ideal simulator with a fixed seed. Change the shot count in the composer; a rare outcome needs many shots to show up at all.
  3. Bloch vectors. One small sphere per qubit, showing that qubit's reduced state. A full-length arrow means the qubit is in a pure state on its own; a short arrow means it is entangled with the rest (or mixed). In a Bell pair both arrows vanish: each qubit alone is completely random, together they are perfectly correlated.
Try it A 3-qubit W state, measured. Then look at the three Bloch arrows.
Everything here is noiseless. Real hardware adds errors on every gate and readout; see the Verify tab for the two-qubit gate count, which is the main thing that decides how much of the ideal signal survives.

5. The Verify tab: checks and hardware targets

The checks run on every build:

CheckWhat it means
Script builds a circuitThe code ran and returned a circuit with at least one qubit and no unbound parameters.
Outcomes are measuredWarns when nothing is measured; the histogram then measures every qubit for you.
Final state computed exactlyStatevector available (size and no mid-circuit measurement). Otherwise only sampling.
EntanglementWhich qubits have reduced-state purity below 1.
Sampled N shotsThe histogram ran.
Compiles to the targetThe circuit was rewritten in the target's native gates and routed on its connectivity; depth and two-qubit counts before and after.
Two-qubit gate budgetWarns above 50 two-qubit gates, where today's hardware returns mostly noise.
Gate sequence is unitaryFor small circuits, the full matrix is built and checked.

Targets. The top-bar chooser compiles the same logical circuit for different machines:

Switching the target re-runs the circuit and refreshes the compiled form; the numbers to compare are depth and two-qubit gates. A 4-qubit W state is 15 two-qubit gates on an ideal machine and ~46 on heavy-hex after routing: the same circuit, a very different experiment.

Try it A 5-qubit GHZ state, then switch the target to the linear chain and watch the depth.

6. Changing a circuit in plain English

Once a circuit exists, the composer under the chat edits it. The model receives the current script and your request, and must keep what you did not ask to change. Good change requests are one thing at a time:

Every revision is saved under History with its result. New circuit clears the workspace (the old one stays in History). The Ask about this panel line on every tab answers questions from the numbers on screen and can propose a change you apply with one click.

7. Editing the script yourself

The Code tab holds the Qiskit script. Edit it and press Run; the same harness re-runs it, so the diagram, state, checks and target compile all refresh. The contract is small:

import math
from qiskit import QuantumCircuit

def build() -> QuantumCircuit:
    qc = QuantumCircuit(2, 2, name="bell_pair")   # 2 qubits, 2 classical bits
    qc.h(0)
    qc.cx(0, 1)
    qc.measure([0, 1], [0, 1])
    return qc

Only qiskit, qiskit.circuit.library, numpy and math are available; the script runs in a sandbox with no network and no files. Library blocks (QFT(3), GroverOperator) are fine; call .decompose() on them if you want the gate list drawn in full.

8. Export: OpenQASM 3

QASM 3 in the top bar downloads the circuit as OpenQASM 3, the interchange format Qiskit (qasm3.loads), Cirq, Amazon Braket and most vendor consoles accept. The Info tab shows the same text, plus qubit and register names, depth and gate counts.

9. Patterns that work

States

Protocols

Oracle algorithms

Fourier and phases

Small building blocks

All of these are in Examples as verified scripts: clicking one does not call the model at all, it runs a circuit whose outcome statistics were checked against the textbook answer.

10. What VibeQ checks, and what it cannot

It checks that the circuit builds, that angles are bound, that it compiles to the chosen target, that the ideal state is self-consistent, and (for requests that name a known state) that the outcome statistics are the right ones. It does not model noise, calibration drift, crosstalk, readout error, or a vendor's exact coupling map beyond the generic layouts here. For an algorithm it has no textbook answer for, the only proof is you reading the probabilities and agreeing they are what the algorithm should produce.

11. Troubleshooting

You seeWhat happenedWhat to do
"Repair 1 of 2: …" in the status lineThe script errored or missed something you asked for; the model is fixing it.Wait. If it fails three times, the reason is in the chat with the trace behind "Show the error trace".
"Not done: …" in the chatThe circuit built but a request was not met (qubit count, measurement, a named state).Ask for that one thing again in the composer, or edit the script.
No exact state, only countsMore than 20 qubits, a mid-circuit measurement, or classical control flow.Expected; the histogram is still right.
Flat histogram for GroverToo many or too few iterations, or the oracle marks the wrong string.Say the number of iterations and spell the marked string per qubit.
"Request failed: network error"The connection dropped during a build.The page resumes the build from the server automatically; if not, Retry.

Open VibeQ and build something