Be the first to know.
Get our Computing weekly email digest.

Programming a Quantum Computer Is More Like Building a Circuit Than Writing a Program

Prototype quantum machines are open to developers over the cloud, and the workflow behind them looks little like classical programming.

author avatar

23 Nov, 2026. 8 minutes read

Quantum processors are no longer inaccessible. Through cloud platforms, a developer can write a quantum program on a laptop, submit it to real hardware, and get results back, subject to usage limits and queues. IBM's Heron processors, with up to 156 qubits, are one such target.[1] IonQ and Quantinuum also offer cloud access to their machines, while Google currently limits hardware access to approved groups.[2] Access, then, is the easy part. Knowing what to send the machine is harder.

A qubit can hold a superposition of 0 and 1 rather than a single fixed value, and entanglement links qubits so that their measured outcomes are correlated. Today's machines are also noisy, and that noise shapes nearly every decision a developer makes.

Recommended reading: Quantum Computing: What It Can, Can't, and Might Eventually Do

This article explains what a quantum program is, the toolchain that builds it, how a circuit changes before it reaches hardware, and the hybrid loop where most development happens. One example, estimating the energy of a hydrogen molecule, runs throughout.

Quantum Programs as Circuits

A classical program is a list of instructions that read and overwrite stored values one step at a time. In gate-based quantum computing, by contrast, the quantum part of a program is a circuit. Drawn as one horizontal wire per qubit with operations placed from left to right, it resembles a schematic more than a script. Classical code still builds the circuit, submits it, and processes the results.

Gates, Measurement, and Control Flow

The operations on those wires are called gates, and each one is a reversible transformation of a qubit's state rather than an assignment to a variable. In quantum computing, qubit states are conventionally written using Dirac bra-ket notation as |0⟩ and |1⟩ to distinguish them from classical binary bits. Applied to a qubit that starts in |0⟩, the Hadamard gate creates an equal superposition of |0⟩ and |1⟩. The X gate flips a qubit, much like a classical NOT. The controlled-NOT (CNOT) gate flips a target qubit when its control qubit is |1⟩, and when the control is first placed in superposition with a Hadamard gate, the CNOT entangles the two qubits.

Measurement is where quantum information becomes classical data. A standard measurement returns a 0 or 1 for each measured qubit and generally changes the quantum state, which is why it usually sits at the end of a circuit. Modern platforms also support mid-circuit measurement, in which a result feeds classical logic that steers later gates.[3] However, this control flow is still limited and adds latency, so most circuits, unlike ordinary programs, are largely defined before execution.

Shots and Probability Distributions

One execution of a circuit, called a shot, returns a single sampled bitstring. Because the outcome is probabilistic, the circuit runs hundreds or thousands of times, and the answer comes from the statistics of those results.

The hydrogen example shows how this works. With a compact encoding, the molecule's electronic structure maps onto just a few qubits.[4] A circuit with an adjustable rotation angle prepares a trial state. The molecule's energy, meanwhile, is a weighted sum of simpler terms, each group of which must be measured in its own basis. The program therefore repeats the circuit for each measurement setting, and classical code combines the averages into one energy estimate for that angle. The search for the lowest-energy angle comes later.

Quantum computing, data code flowing concept. Source: AdobeStock.

The Quantum Development Toolchain

Most of this work happens in Python on an ordinary laptop. Quantum software development kits (SDKs) wrap circuit construction, simulation, and hardware submission in familiar libraries.

Qiskit, IBM's open-source SDK, builds and optimizes circuits and is the most direct route onto IBM hardware.[5] Google's Cirq focuses on building circuits with fine control over how operations are arranged in time.[6] PennyLane, from Xanadu, treats circuits as differentiable functions, which suits machine learning and optimization workflows.[7] Microsoft's Q#, on the other hand, is a dedicated programming language rather than a Python library.[8]

OpenQASM, meanwhile, is a common circuit-description language that compatible tools can exchange, although supported features vary by platform.[9] In short, the syntax changes between SDKs, but the development model does not.

Local Simulators and Their Limits

Development typically starts on a local simulator. An ideal simulator runs without hardware noise, making it a cheap place to confirm a circuit's logic, while noisy simulators model selected hardware errors.

Simulators hit a limit, though. A full state-vector simulation stores one complex number for every possible combination of qubit values, so memory doubles with each added qubit. At double precision, the state vector alone needs about 16 GiB for 30 qubits and 16 TiB for 40 qubits. As a result, exact simulation becomes impractical on an ordinary workstation past roughly 30 to 35 qubits. High-performance computing (HPC) systems push further, and tensor-network methods can handle larger circuits when their structure allows.

Transpilation for Real Hardware

The circuit a developer writes is rarely the circuit the hardware executes. Between the two sits a translation step called transpilation—analogous to how traditional compilers convert high-level code into machine code—to adapt the algorithm for specific hardware constraints.

Native Gates, Connectivity, and Routing

Each processor physically supports only a handful of operations, known as its native gate set. The transpiler rewrites every gate into that set, and because the translation is rarely one-for-one, a compact circuit can grow noticeably on hardware.

Connectivity adds a second constraint. On many processors, a two-qubit gate needs its qubits to be physically connected, and superconducting chips have fixed neighbor layouts. IBM's 156-qubit Heron, for example, uses a heavy-hexagonal lattice in which each qubit links to only two or three others.[1] Trapped-ion systems, such as those from IonQ and Quantinuum, typically offer far more flexible connectivity.

When two qubits that must interact are not neighbors, the transpiler inserts SWAP operations to route quantum states across the chip. That fix comes at a cost. A standard SWAP decomposes into three CNOT gates, which are then translated into native operations, and each added operation is another chance for error.

Circuit Depth and Noise

Qubits hold their quantum state only briefly before their surroundings degrade it, a process called decoherence. Combined with imperfect gates and readout, this makes circuit depth, the number of sequential operation layers, a key resource. The deeper a circuit runs, the more errors accumulate, until the signal becomes hard to separate from noise.

For this reason, developers optimize depth and two-qubit gate count much as embedded developers optimize clock cycles and memory. Checking the transpiled circuit, not just the written one, becomes a routine step.

Quantum computing technology concept. Source: AdobeStock.

The Hybrid Quantum-Classical Loop

A common mental image is a quantum computer running an entire program from start to finish. In practice, the processor works more like an accelerator, called repeatedly by a classical program.

Variational Algorithms in Practice

The hydrogen example completes the picture. The circuit runs with one rotation angle, and the measurements produce an energy estimate. A classical optimizer then proposes a new angle and sends the circuit back. Because each estimate carries statistical noise, the energy does not necessarily fall at every step. The loop stops when a convergence criterion is met, and the best result approximates the ground-state energy within the limits of the trial circuit and hardware.

This approach is the variational quantum eigensolver (VQE), first demonstrated in 2014 by pairing a photonic quantum processor with a conventional computer.[10] IBM researchers later ran VQE on superconducting hardware for hydrogen and larger molecules.[4] Such calculations are an active research target for materials discovery and drug development, two application areas Mouser highlights, although small-molecule demonstrations do not yet beat classical methods.[11]

Similarly, the quantum approximate optimization algorithm (QAOA) applies a related loop to combinatorial problems.[12] Scheduling, routing, and portfolio problems are potential targets, linking it to the transportation and finance applications on Mouser's page.

Not every quantum computer uses the gate model, however. Quantum annealers encode an optimization problem as an energy landscape and sample low-energy solutions from it, with no guarantee of finding the best one on every run.[13]

The Role of Classical Code

Most of the code in a hybrid project handles problem setup, optimization, and data, so the skills involved sit closer to numerical optimization than to physics. The structure also suits current hardware. Variational methods replace one long computation with many short circuits, which accumulate fewer errors, while repeated shots reduce statistical uncertainty. Repetition alone, however, does not remove systematic hardware errors.

Debugging and Verifying Quantum Programs

Classical debugging often means printing variables or pausing a program to inspect its state. Quantum programs can log classical values and measurement outcomes, but they cannot read an unknown quantum state like a variable. The no-cloning theorem rules out copying such a state; measuring it disturbs it, and reconstructing it is possible only statistically from many repeated runs.[14] Instead, developers rely on ideal simulators that expose the full state, smaller test circuits that isolate sections, and measurements of known quantities.

Verification on hardware adds another layer. Because current hardware is noisy, results drift from ideal values, so developers may apply error-mitigation techniques, such as running a circuit at deliberately amplified noise levels and extrapolating back toward a noise-free result.[15] Checking the answer, whether a distribution, an energy estimate, or a candidate solution, means comparing it against a theoretical prediction or classical baseline within statistical uncertainty.

Getting Started With Quantum Development

Getting hands-on can cost nothing. IBM's Open Plan, for instance, provides up to 10 minutes of runtime on real quantum hardware every 28 days, and other providers offer their own access options.[16]

A good first project is a small circuit, such as the hydrogen example. First, run it on an ideal simulator and compare the result with the expected histogram or classically calculated energy. Then transpile the same circuit for real hardware, run it, and compare again. That gap teaches noise faster than any explanation.

Problem choice matters as much as tooling. Good early candidates are small optimization or simulation tasks with a clear classical baseline. Loading classical data into a quantum state can add substantial overhead, so data-heavy problems need careful scrutiny.

A New Discipline, Not a New Syntax

Programming a quantum computer means thinking in circuits rather than instructions. The surrounding code stays classical, the transpiler reshapes what actually runs, the hybrid loop carries most of the work, and results arrive as statistics rather than single answers.

For most engineering teams, quantum computing remains experimental rather than a drop-in replacement for classical systems. Still, the intuition behind this programming model takes time to build, which is the best reason to start now. As error correction matures and circuits run deeper, developers who already think this way will be ready to put that hardware to work.[17]


References

  1. IBM Quantum, "Processor types," IBM Quantum Documentation. Accessed: Oct. 9, 2026. [Online]. Available: https://quantum.cloud.ibm.com/docs/en/guides/processor-types
  2. Google Quantum AI, "Access and authentication," Cirq Documentation. Accessed: Oct. 9, 2026. [Online]. Available: https://quantumai.google/cirq/google/access 
  3. IBM Quantum, "Execute dynamic circuits," IBM Quantum Documentation. Accessed: Oct. 9, 2026. [Online]. Available: https://quantum.cloud.ibm.com/docs/en/guides/execute-dynamic-circuits 
  4. A. Kandala et al., "Hardware-efficient variational quantum eigensolver for small molecules and quantum magnets," Nature, vol. 549, no. 7671, pp. 242–246, Sep. 2017, doi: 10.1038/nature23879.
  5. IBM Quantum, "Qiskit SDK," IBM Quantum Documentation. Accessed: Oct. 9, 2026. [Online]. Available: https://quantum.cloud.ibm.com/docs 
  6. Google Quantum AI, "Cirq," Google Quantum AI. Accessed: Oct. 10, 2026. [Online]. Available: https://quantumai.google/cirq 
  7. Xanadu, "PennyLane: Quantum programming software," PennyLane. Accessed: Oct. 10, 2026. [Online]. Available: https://pennylane.ai 
  8. Microsoft, "Introduction to the quantum programming language Q#," Microsoft Learn. Accessed: Oct. 10, 2026. [Online]. Available: https://learn.microsoft.com/en-us/azure/quantum/qsharp-overview 
  9. OpenQASM, "OpenQASM live specification." Accessed: Oct. 10, 2026. [Online]. Available: https://openqasm.com 
  10. A. Peruzzo et al., "A variational eigenvalue solver on a photonic quantum processor," Nat. Commun., vol. 5, Art. no. 4213, Jul. 2014, doi: 10.1038/ncomms5213.
  11. Mouser Electronics, "Quantum computing," Empowering Innovation Together. Accessed: Oct. 9, 2026. [Online]. Available: https://www.mouser.com/en/empowering-innovation/quantum-computing 
  12. E. Farhi, J. Goldstone, and S. Gutmann, "A quantum approximate optimization algorithm," 2014, arXiv:1411.4028.
  13. D-Wave Quantum, "What is quantum annealing?," D-Wave Documentation. Accessed: Oct. 11, 2026. [Online]. Available: https://docs.dwavequantum.com/en/latest/quantum_research/quantum_annealing_intro.html 
  14. W. K. Wootters and W. H. Zurek, "A single quantum cannot be cloned," Nature, vol. 299, no. 5886, pp. 802–803, Oct. 1982, doi: 10.1038/299802a0.
  15. K. Temme, S. Bravyi, and J. M. Gambetta, "Error mitigation for short-depth quantum circuits," Phys. Rev. Lett., vol. 119, no. 18, Art. no. 180509, Nov. 2017, doi: 10.1103/PhysRevLett.119.180509.
  16. IBM Quantum, "Plans overview," IBM Quantum Documentation. Accessed: Oct. 11, 2026. [Online]. Available: https://quantum.cloud.ibm.com/docs/en/guides/plans-overview 
  17. Google Quantum AI and Collaborators, "Quantum error correction below the surface code threshold," Nature, vol. 638, no. 8052, pp. 920–926, Feb. 2025, doi: 10.1038/s41586-024-08449-y.

24,000+ Subscribers

Stay Cutting Edge

Join thousands of innovators, engineers, and tech enthusiasts who rely on our newsletter for the latest breakthroughs in the Engineering Community.

By subscribing, you agree to ourPrivacy Policy.You can unsubscribe at any time.