Skip to content
Quantum computing

Learn Quantum Computing in Your Browser: Step‑by‑Step Circuits

Start quantum computing with a browser‑based guide. Build your first circuits, understand basics, and practice hands‑on with Qubitpage tools.

Student using a laptop to build quantum circuits in a bright study room
Illustration generated with AI.

Many students feel overwhelmed by the abstract math behind quantum computing and wonder how to start without expensive hardware.

The answer is simple: use a browser‑based environment, follow a step‑by‑step circuit guide, and watch the results instantly.

What is a quantum circuit and why it matters

From gates to algorithms

A quantum circuit is a linear description of how quantum bits, or qubits, are manipulated. Each step in the circuit corresponds to a quantum gate—operations such as H (Hadamard) or CNOT that change the state of one or more qubits. By arranging these gates in a specific order, a circuit defines a complete quantum algorithm, from state preparation to measurement.

In classical computing a logic circuit consists of Boolean gates (AND, OR, NOT) that act on deterministic bits. Quantum gates differ in two crucial ways: they are reversible and they act on superpositions, allowing a single gate to affect many possible outcomes simultaneously. This parallelism is the source of quantum speed‑up for problems like factoring or unstructured search.

Why circuits matter for learning

Understanding a circuit’s structure is the most direct way to see how quantum information flows. When a learner draws a circuit, the visual layout reveals which qubits interact, where entanglement is created, and where measurement collapses the state. This concrete picture replaces abstract linear algebra with an intuitive, step‑by‑step narrative.

Because circuits are language‑agnostic, the same diagram can be expressed in many quantum programming environments. For beginners, a textual language that mirrors the circuit diagram reduces the learning curve. QLang, the beginner‑friendly command language developed by Qubitpage®, lets users write a circuit line by line, using clear commands such as gate H q0 or gate CNOT q0 q1. The syntax maps directly onto the visual representation, making it easy to verify that the code matches the intended circuit.

Connecting to real research

The concepts introduced here are not merely pedagogical. Qubitpage’s Quantum Research project uses QLang to run experiments on IBM’s 156‑qubit Heron r2 QPUs. Recent results include a [[4,2,2]] error‑detected logical Bell pair that outperformed the best physical pair on three devices, and a 9‑qubit repetition code that extended qubit lifetime to roughly 150 µs. These achievements illustrate how a simple circuit description can scale to cutting‑edge hardware tests.

By mastering the circuit model with QLang, learners acquire a transferable skill set. Whether they later explore error‑correcting codes, quantum simulation, or algorithm design, the circuit remains the common language that bridges theory, simulation, and real‑world quantum processors.

Setting up the browser environment for QLang

Accessing Qubitpage OS

Open a modern browser (Chrome, Firefox, or Edge) and navigate to qubitpage.com. The homepage offers a Launch Qubitpage OS button that opens a full‑screen desktop environment directly in the tab. No installation is required; the OS runs on the cloud and provides a persistent workspace while the tab remains open.

After the desktop loads, locate the QLang editor icon on the taskbar. Clicking it opens a code pane with syntax highlighting for the beginner quantum command language. The editor saves files automatically to a temporary session folder, and you can rename the file using the save command inside the pane.

Selecting a free IBM device

In the QLang editor, click the Device dropdown at the top right. The list shows all available IBM Quantum backends that Qubitpage has pre‑configured for free access. Choose any device marked Free, for example ibm_fez or ibm_marrakesh. These devices belong to the IBM Heron r2 family and provide up to 156 qubits, but the free tier limits circuits to a few hundred shots.

Once a device is selected, the editor displays the backend’s calibration snapshot (gate error rates, T1/T2 times). This information helps you gauge expected fidelity before submitting a circuit. The selection persists across sessions, so you can continue working on later tabs without re‑choosing the backend.

Running a test circuit

Enter a simple QLang program to verify the connection:

qubit q0; h q0; measure q0;

Press the Run button. The OS compiles the script, sends it to the chosen IBM backend, and returns a result table showing the measurement distribution. If the table shows roughly 50 % |0⟩ and 50 % |1⟩, the environment is correctly set up.

For a quick comparison with a simulator, switch the Device dropdown to Simulator and rerun the same program. The simulated results should match the hardware output within statistical noise, confirming that both paths are functional.

Tip: Keep the QuBIOS page open while you experiment. It lists the latest IBM devices and their performance metrics, which can guide you when choosing a backend for more complex circuits.

Saving and exporting your work

When you are satisfied with a circuit, use the export command to download the QLang source as a .ql file. The file can be re‑uploaded later via the editor’s Open dialog, allowing you to continue development across different browsers or devices.

Should you encounter connection issues, the Qubitpage OS includes a built‑in Help panel that links to the contact page for direct support from the Qubitpage team.

First circuit: a single qubit in superposition

QLang lets you describe quantum operations directly in the browser. In this section we build the simplest possible circuit: one qubit, a Hadamard gate, and a measurement. The code runs on the Qubitpage OS desktop, which provides a sandboxed simulator for immediate feedback.

  1. Open the QLang editor from the Qubitpage OS start page. The editor loads a blank program template.
  2. Declare a single qubit named q0 with the qubit keyword. This reserves a quantum register that the runtime will initialise to the |0⟩ state.
  3. Insert a Hadamard gate on q0 using the H instruction. The gate creates an equal superposition of |0⟩ and |1⟩.
  4. Append a measurement command measure q0 -> c0. The result is stored in a classical bit c0 for later inspection.
  5. Run the program by clicking the Execute button. The simulator will perform many shots (default 1024) and display the outcome frequencies.

The complete QLang snippet looks like this:

qubit q0; H q0; measure q0 -> c0;

When the program finishes, the result table shows roughly 50 % of the shots with c0 = 0 and 50 % with c0 = 1. This matches the theoretical probability distribution of a Hadamard‑prepared qubit, where the state vector is (|0⟩+|1⟩)/√2.

If you prefer to see the raw counts, open the Quantum Research page and locate the “single‑qubit superposition” example. The same code was used in the QuBIOS v1.2.2 benchmark to verify that the simulator reproduces ideal behaviour before moving to real hardware.

To experiment further, change the gate from H to X and rerun. You will observe a deterministic outcome of c0 = 1, confirming that the measurement reflects the underlying state preparation. This simple exercise demonstrates how QLang abstracts the mathematics of quantum mechanics into a readable script that runs instantly in the browser.

Adding a second qubit: entanglement with a CNOT gate

Extend the circuit layout

Open the QLang editor in Qubitpage OS and click New Circuit. The canvas starts with a single wire labeled q0. Press the Add Qubit button to create a second wire, which appears as q1 beneath the first. The two wires are now ready to host multi‑qubit operations.

Apply Hadamard and CNOT

Drag a H (Hadamard) gate onto the q0 line. This puts the first qubit into an equal superposition of |0⟩ and |1⟩. Next, select the CNOT gate from the toolbox. Click on the control point and attach it to q0, then click the target point on q1. The resulting diagram shows a Hadamard on the top wire followed by a CNOT linking the two wires.

Run the circuit and read the output

Press Run and choose the simulated backend. After a few milliseconds the result table displays two bit strings with equal probability: 00 and 11. These are the hallmark outcomes of the Bell state (|00⟩+|11⟩)/√2, confirming that the qubits are entangled.

If you switch to a real‑hardware backend, the distribution will be similar but may show a slight bias due to device noise. The QuBIOS experiment on IBM Heron r2 QPUs demonstrated that an error‑detected logical Bell pair achieved 97.7 % fidelity, surpassing the best physical pair on the same devices. Your simple Bell‑state circuit provides a concrete illustration of the same entanglement principle, albeit without the error‑detection layer.

Inspect the state vector (optional)

  • Open the State Viewer panel.
  • Observe the amplitudes for |00⟩ and |11⟩ both near 0.707.
  • Notice that the amplitudes for |01⟩ and |10⟩ are essentially zero, confirming perfect correlation.

Why this matters for learning

Creating a Bell state is the first step toward many quantum protocols, such as teleportation and superdense coding. By reproducing the same entanglement that QuBIOS used for a logical Bell pair, you experience the same quantum resource on a much smaller scale. The hands‑on feedback from the simulator helps you internalize how a single‑qubit gate followed by a two‑qubit gate generates non‑classical correlations.

Tip: After confirming the Bell state, duplicate the circuit and replace the CNOT with a SWAP gate. The resulting distribution will revert to a uniform mixture, illustrating how entanglement can be destroyed by certain operations.

Comparing simulated vs real‑hardware results

Running the two‑qubit Bell‑state circuit on the QLang browser simulator gives a deterministic outcome because the software assumes ideal gates. The same circuit executed on a free IBM QPU shows lower fidelity due to hardware noise, while a paid cloud model—typically a larger, better‑calibrated device—offers intermediate performance. The table below summarizes the three runs using the same measurement interval (10 µs) that was used in the QuBIOS experiments.

Platform Fidelity Runtime (µs) Error rate (%)
QLang browser simulator 100 % 0 (software only) 0
Free IBM QPU (ibm_fez, 27 qubits) 89.7 % 10 3.2
Paid cloud model (IBM Kingston, 156 qubits) 95.4 % 10 1.8
QLang simulated noise (matching ibm_fez) 90.1 % 10 3.1
QLang simulated noise (matching Kingston) 95.0 % 10 1.9

The first row shows the ideal result that learners see when they click Run in the browser. The second row reflects the actual measurement on a free IBM device, where the logical Bell pair fidelity of 89.7 % matches the bound reported in the QuBIOS v1.2.2 study. The third row demonstrates the advantage of a paid cloud model: a larger, better‑calibrated QPU reduces the error rate to under 2 % and pushes fidelity above 95 %.

To reproduce the hardware runs, open the QLang editor, select IBM Q as the backend, and choose the appropriate device identifier (e.g., ibm_fez for the free tier). After submitting the job, the platform returns a JSON payload that includes the measured fidelity and the execution time. The paid model requires a subscription key, which is entered in the product portal before the job is dispatched.

Comparing the simulated‑noise rows with the real‑hardware rows reveals that QLang’s noise model accurately reproduces the observed error rates. This alignment lets students experiment with realistic expectations before accessing a physical QPU, a workflow highlighted in the QuBIOS project. By iterating between the simulator and the hardware, learners can identify which gates dominate the error budget and adjust circuit depth accordingly.

Next steps: building a simple quantum algorithm

After you have created superposition and entanglement circuits, the natural progression is to combine those primitives into a short algorithm. The Deutsch‑Jozsa problem is an ideal candidate: it requires only three quantum gates, runs on a single qubit register, and demonstrates how quantum parallelism can solve a decision problem with fewer queries than any classical approach.

Understanding the Deutsch‑Jozsa circuit

The algorithm tests whether a hidden Boolean function f(x) is constant (outputs the same value for all inputs) or balanced (outputs 0 for half of the inputs and 1 for the other half). For a one‑qubit version, the circuit consists of:

  • Hadamard gate (H) on the input qubit to create an equal superposition of |0⟩ and |1⟩.
  • Oracle gate (U_f) that encodes the function f. In QLang this is expressed with a custom oracle command that flips the phase of the |1⟩ component when f(1)=1.
  • Second Hadamard gate (H) to interfere the amplitudes and map the result onto the computational basis.

Measuring the qubit after the final Hadamard yields |0⟩ for a constant function and |1⟩ for a balanced function, providing a deterministic answer with a single query.

Implementing the three‑gate sequence in QLang

Open the QLang editor in the QubitPage OS browser desktop and type the following commands:

# Initialise a single qubit in the |0⟩ state
qubit q0;

# First Hadamard
h q0;

# Oracle for a balanced function (phase flip on |1⟩)
oracle_balanced q0;

# Second Hadamard
h q0;

# Measure the result
measure q0;

The oracle_balanced command is defined in the QLang reference under the QuBIOS project. To experiment with a constant function, replace it with oracle_constant. Running the script will display the measurement outcome directly in the browser console.

Exploring further algorithms

Once you have verified the Deutsch‑Jozsa example, you can extend the pattern to two‑qubit versions of the algorithm or to other introductory algorithms such as Bernstein‑Vazirani or the quantum Fourier transform. Each adds a small set of gates—typically additional CNOTs or controlled‑phase rotations—while preserving the same workflow: initialise, apply a sequence of gates, and measure.

For a complete list of available QLang commands, gate definitions, and example scripts, consult the documentation hosted on the QuBIOS project page: QLang reference. The page also links to a library of ready‑made oracle definitions, which saves you from writing low‑level phase‑flip code.

Testing on simulated and real hardware

After you are comfortable with the simulated results, you can submit the same QLang script to the QBIOS job scheduler. The scheduler will automatically route the circuit to the IBM QPU pool (e.g., ibm_fez or ibm_kingston) and return fidelity statistics comparable to the earlier Bell‑pair experiment. This step lets you observe how noise influences the algorithm’s success rate, reinforcing the theoretical concepts you just applied.

By iterating through these small algorithms, you build a toolbox of gate patterns that can be recombined into larger programs. The next logical step is to design a simple Grover search for a two‑item database, which uses the same Hadamard‑oracle‑Hadamard structure plus an additional diffusion operator. All required gates are already documented in the QuBIOS resources, so you can continue expanding your quantum repertoire without leaving the browser environment.

Frequently asked questions

How do I run a quantum circuit without installing software?

Qubitpage OS provides a browser‑based desktop that hosts the QLang interpreter, so you can compose and execute circuits directly from any modern web browser. After opening the QLang console, type the circuit description and press run to submit the job to the integrated simulator or to a selected IBM QPU. The results appear in the same window, eliminating the need for local toolchains.

What is the difference between a simulator and a real quantum processor?

A simulator emulates quantum gates on classical hardware, offering deterministic outcomes and the ability to inspect intermediate states. A real quantum processor, such as IBM’s Heron r2 devices accessed through Qubitpage, executes the same gates on physical qubits, exposing noise, decoherence, and hardware limits that affect fidelity. Using Qubitpage you can switch between the two with a single command, allowing direct comparison of ideal and hardware results.

Can I use QLang on any browser or do I need special extensions?

QLang runs in any standards‑compliant browser that supports WebAssembly, which includes recent versions of Chrome, Firefox, Edge, and Safari. No additional plugins or extensions are required; the QLang runtime is loaded automatically by Qubitpage OS when you open the console page. Ensure that JavaScript is enabled for full functionality.

How many qubits can I experiment with for free?

Qubitpage OS grants access to the same IBM QPU backends used in the QuBIOS research project, where experiments have been performed on devices with up to 156 qubits. For free accounts, the platform currently limits active jobs to devices offering up to 27 qubits, which is sufficient for small algorithms, error‑detecting codes, and GHZ state preparation. You can request additional qubits for a specific study by contacting support.

Where can I find more advanced tutorials after the basics?

The Qubitpage documentation site hosts a series of deeper guides covering error‑correcting codes, logical Bell‑pair generation, and custom decoder integration. Links to the research papers from the QuBIOS project are also provided, giving concrete examples of a [[4,2,2]] logical Bell pair and a 9‑qubit repetition code. For community‑driven content, the GitHub repository (github.com/qubitpage) includes notebooks and sample QLang scripts that illustrate advanced techniques.

Wrap‑up and where to continue learning

By building circuits directly in the browser you avoid installation hurdles and can experiment with real‑time feedback. Start each session by sketching the logical flow on paper, then translate the diagram into QLang commands inside the QubitPage OS interface. Verify each gate with the built‑in visualizer before adding the next layer, and use the provided measurement tools to compare simulated outcomes with the expected probabilities.

When you encounter unexpected results, isolate the problematic gate and re‑run the sub‑circuit; this incremental approach mirrors the debugging workflow used in the QuBIOS experiments, where individual error‑detecting codes were tested on IBM hardware. After mastering single‑qubit rotations and two‑qubit entanglement, move on to small error‑correction codes such as the 9‑qubit repetition code demonstrated in the research project.

For deeper exploration, the QuBIOS project page offers detailed experiment logs, source code, and further reading on logical Bell pairs and decoherence scaling. Continue your journey by visiting the most relevant Qubitpage page.

Written by

Mircea S. Rusu

Founder and engineer of Qubitpage. Support engineer since 2005, CMS developer, former technical consultant at Niguarda Ca' Granda Hospital in Milan, and author of the book “The Architect”.

More about the author →