Run a small quantum program in a browser-based simulator and inspect the measurement results without needing quantum hardware. You’ll create a circuit that puts one qubit into an equal superposition, measure it, and see how repeated runs produce a mix of zeros and ones. You need an internet connection and a free account with a quantum-computing service that offers a circuit editor and simulator.
What You’ll Need
- A computer with a current web browser and an internet connection.
- A free account on a quantum-computing platform that provides a browser circuit composer and a simulator. Free access and interface details can change; check the service’s current plan and simulator options.
- About 10 minutes. No quantum hardware, programming installation, or payment details should be necessary for a simulator exercise; do not enter payment information just to complete these steps.
Step-by-Step
- Sign in and open the circuit editor. Go to the platform’s official website, create or sign in to a free account, then look for a section named something like “Composer,” “Circuit builder,” or “Quantum circuits.” Choose a new circuit. The service may rename or reorganize its menus, so use its current documentation if the labels differ.
- Select a simulator, not a hardware device. Open the available backends, execution targets, or run settings. Choose a simulator that runs circuits locally in the service or in the cloud. If the platform offers both state-vector and shot-based simulators, choose the shot-based option for this exercise; it returns sampled measurement counts. Hardware queues, access rules, and costs can differ, so check the selected target before submitting.
- Start with one qubit. A circuit editor may show one or more horizontal wires, each representing a qubit. If it starts with several, use just the first wire; otherwise set the circuit size to one qubit. A qubit begins in the computational basis state |0⟩ unless you add a different preparation operation.
- Add a Hadamard gate. Place an H (Hadamard) gate at the start of the first wire. This transforms |0⟩ into an equal superposition of |0⟩ and |1⟩. It does not make a single measurement display both values; a measurement produces one result, with either value having an ideal probability of one half.
- Add a measurement. Place a measurement at the end of the same wire and connect it to a classical bit if the editor requires a separate classical register. Measurement records the qubit’s result as a classical zero or one. Some composers add measurements automatically when you choose a measurement-based simulator; check the wire rather than assuming one is present.
- Set the number of shots. Find the run setting usually called “shots,” “repetitions,” or “measurement samples.” Enter 1,000 if that is allowed. A shot means one execution and measurement of the circuit. More shots make the observed proportions generally less noisy, but take longer and may be subject to free-tier limits.
- Review the circuit and submit it. Confirm the order is H, then measurement, on the same qubit, and that the target is the simulator you selected. Click the platform’s run or submit control. If it asks you to choose a project or save the circuit first, follow the on-screen prompt and submit again.
- Read the measurement counts. The result may be a bar chart, a table, or a map of bit strings to counts. For one measured qubit, expect counts for 0 and 1 that are roughly similar—for example, around 500 of each in 1,000 shots. They will rarely be exactly equal. The exact chart format and whether the platform displays bit strings in a particular order depend on the service.
- Run it again and compare. Submit the same circuit a second time. The counts may change because each run samples outcomes. Compare proportions, not only raw counts: divide each outcome’s count by the total number of shots. If a platform has a downloadable results view, save the output only if you want to compare runs later.
Common Mistakes
- Running on hardware by accident: A hardware target can have a queue or different access conditions. Check the target name before submitting and select a simulator.
- Forgetting measurement: A circuit that ends after H may display a state or probability view, but a shot-based counts chart generally needs measurement. Add measurement if counts are missing.
- Expecting exactly 50/50: Superposition describes probabilities, not a promise that each finite batch splits evenly. Small differences are normal.
- Adding H after measurement: Measurement ends the useful quantum sequence for this simple example. Put H first and measure afterward.
- Confusing shots with qubits: One qubit and 1,000 shots means one qubit is measured repeatedly, not that the circuit contains 1,000 qubits.
- Reading a multi-bit result as one qubit: If you leave extra wires or registers in the circuit, output labels may contain several bits. Remove unused wires or identify which bit corresponds to the measured qubit.
Tips
- Use the smallest circuit possible while learning: one qubit, one gate, and one measurement make the result easier to interpret.
- Look for a circuit diagram and a separate results panel. The diagram shows operations; the results show sampled outcomes. They answer different questions.
- Try removing H and running the circuit again. A qubit prepared in |0⟩ and measured without other operations should return 0 on an ideal simulator, which helps check that the measurement and output display work.
- Keep a note of the circuit, shot count, target, and results if you are comparing runs. Simulator settings or platform interfaces may change between sessions.
- Use the platform’s built-in help for service-specific controls. Gate symbols and the meaning of a measurement are standard concepts, but button names and result layouts are not universal.
Troubleshooting
The run button is unavailable: Check whether you need to save the circuit, select a backend, or sign in again. Confirm the circuit has at least one qubit and that the chosen target accepts the circuit format.
The job stays queued or does not finish: Verify that you selected a simulator rather than hardware. Refresh the job list, check the service’s status page or notices, and try a smaller shot count if the free tier imposes limits. Avoid submitting many identical jobs while one is still pending.
The result has no counts: Confirm that a measurement is present and connected to a classical bit if required. Check whether the run completed successfully, then open the job details or results tab; some tools do not show output in the circuit editor itself.
All results are 0: Check that H is on the measured qubit and occurs before measurement. If you intended to test the H circuit, confirm that you did not accidentally remove the gate or select a different saved circuit.
The chart looks different from the example: A chart may label outcomes as 0 and 1, use bit strings, or reverse the visual order of bits in multi-qubit circuits. For this one-qubit circuit, find the two one-bit outcomes and compare their counts. If the platform reports probabilities rather than counts, look for values near 0.5 each.
Frequently Asked Questions
Is a quantum simulator actually running on a quantum computer?
No. A simulator calculates or samples a model of a quantum circuit using conventional computing resources. It is useful for learning, but it is not the same as executing on physical quantum hardware.
Does the Hadamard gate create two copies of a qubit?
No. It creates a superposition whose measurement has two possible outcomes. One measurement returns one classical result, not two copies or both values at once.
Why do I get different counts each time?
Each shot samples an outcome according to the circuit’s probabilities. Finite samples vary, so repeated runs can have different counts even when the circuit is unchanged.
How many shots should I use?
Use a few hundred or 1,000 for a first demonstration if the platform permits it. More shots usually make the observed proportions steadier, but are not needed to understand the basic circuit.
Can I do this without creating an account?
Some services offer a public demo or local simulator, while others require sign-in to save or run circuits. Check the platform’s current access instructions; the circuit itself does not require an account in principle.
What should I try after this?
Try two qubits, apply H to both, and measure them, or add a controlled-NOT gate to explore correlations. Check the platform’s beginner documentation before adding operations, since multi-qubit bit ordering can make results less intuitive.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Turn Off Backup Encryption in iTunes?
- Campus Tech Innovation Hubs: What They Are
- Poco C51 Airtel Prepaid Locked Variant India?
- Jenkins vs GitHub Actions: Which CI/CD Fits Your Team?
- Shared VPS Hosting: Is It Better?
- Disk Defrag Pro: What It Does and Whether You Need It