How to Benchmark Quantum Algorithms on Simulators and Real Hardware
quantum benchmarkingquantum simulatorsquantum hardwareQiskitcircuit optimization

How to Benchmark Quantum Algorithms on Simulators and Real Hardware

SSmart Qubit Editorial Team
2026-11-28
7 min read

Learn how to compare quantum simulators and real hardware using circuit metrics, transpilation, shots, noise, cost, and reproducible tests.

A simulator can show that a quantum circuit is logically correct, but it cannot by itself tell you how that circuit will behave after transpilation, measurement noise, queueing, and hardware errors. This quantum hardware benchmarking tutorial presents a repeatable workflow for comparing simulator and real-device results, estimating execution cost, and deciding whether an optimization produced a meaningful improvement.

Overview

Benchmarking a quantum algorithm means measuring more than whether the expected answer appears in the output. A useful benchmark connects four layers: the algorithm as written, the compiled circuit, the execution environment, and the quality of the result.

The same circuit may have different performance characteristics on different backends. A provider may map logical qubits to physical qubits differently, insert routing operations, use a different native gate set, or apply a different optimization pass. Real hardware also introduces sampling variation and noise that an ideal simulator does not reproduce.

For that reason, compare like with like wherever possible. Record the original circuit, the transpiled circuit, the backend configuration, the number of shots, the simulator noise model if used, and the result-quality metric. A benchmark that omits these details is difficult to interpret or reproduce.

Use the following sequence:

  1. Validate the algorithm on an ideal simulator.
  2. Measure the circuit's resources before and after compilation.
  3. Run a matched noisy simulation when a suitable noise model is available.
  4. Execute the compiled circuit on real hardware.
  5. Compare accuracy, distributional error, runtime, shots, and cost or quota consumption.
  6. Repeat the experiment enough times to separate a circuit change from ordinary sampling variation.

This workflow complements a broader benchmarking guide covering metrics, baselines, and hardware test workflows.

How to estimate

Start with a fixed benchmark definition. Identify the task, the expected output, and the metric that determines success. For a state-preparation circuit, this might be the probability of measuring a target bit string. For an optimization or classification circuit, it could be approximation error, objective value, accuracy, or loss.

1. Establish an ideal baseline

Run the circuit on an ideal state-vector or shot-based simulator. Save the exact circuit and the expected distribution. The ideal baseline answers a narrow question: does the implementation produce the intended result without hardware noise?

Do not treat this as a hardware prediction. An ideal simulation can confirm logic while hiding effects caused by connectivity, gate errors, readout, calibration drift, and finite sampling.

2. Count resources before execution

Record logical qubits, total operations, two-qubit gates, measurement operations, circuit depth, and any repeated subcircuits. Two-qubit gates and depth often deserve special attention because they can make a circuit more exposed to hardware noise, although the relationship depends on the device and workload.

3. Inspect transpilation

Transpile the circuit for the target backend and record the resulting gate counts and depth. Compare the pre- and post-transpilation circuits rather than reporting only the source-level numbers. A short high-level circuit can become substantially larger after native-gate conversion and qubit routing.

Keep the transpiler settings with the result: optimization level, layout method, routing method, target backend, SDK version, and any manually supplied initial layout. In a Qiskit transpilation tutorial or another SDK workflow, these settings are part of the experiment, not merely implementation details.

4. Match shots and outputs

Use the same shot count when comparing ideal simulation, noisy simulation, and hardware where practical. If shot counts differ, label the comparison clearly. More shots generally reduce sampling uncertainty, but they do not remove systematic hardware error.

Compare distributions instead of looking only at the most frequent bit string. Useful choices include success probability, total variation distance, heavy-output-style measures, expectation-value error, or task-specific loss. Select one primary metric before looking at results to reduce subjective interpretation.

5. Estimate execution cost

A simple planning estimate is:

Estimated execution volume = number of circuits × shots per circuit × repetitions

For a parameterized algorithm, count every parameter setting, optimizer evaluation, calibration variant, and repeat. If a provider bills by time, task, shot, or another unit, map this execution volume to the provider's current pricing or quota documentation rather than assuming that simulator and hardware usage are interchangeable.

For elapsed time, separate local preparation time, queue or scheduling time, device execution time, result retrieval, and post-processing. This makes it easier to identify whether an optimization improved the circuit or merely changed where time was spent.

Inputs and assumptions

Use a benchmark record with explicit inputs. The following table provides a practical template.

CategoryRecordWhy it matters
AlgorithmTask, circuit version, parameters, expected outputDefines what counts as success
ResourcesLogical qubits, depth, total gates, two-qubit gatesShows how circuit changes affect complexity
CompilationSDK version, transpiler settings, layout, routing, native gatesExplains backend-specific changes
ExecutionBackend, shots, repetitions, run timestamp, queue and runtime fieldsSeparates experiment conditions from results
NoiseIdeal or noisy simulator, noise-model assumptions, readout treatmentClarifies how closely simulation approximates hardware
OutcomePrimary metric, uncertainty estimate, cost or quota unitsSupports a defensible decision

Assume that an ideal simulator is a correctness baseline, not a hardware baseline. Assume that a noisy simulator is an approximation unless its noise data and modeling choices are documented. Also assume that a single hardware run is insufficient for a strong conclusion when the observed difference is small relative to sampling variation or known operational variability.

For reproducibility, save circuit source, transpiled circuit, parameters, seeds where supported, result files, environment details, and metadata. The reproducible quantum experiment setup guide provides a useful structure for this record.

Worked examples

Example 1: Comparing an optimization

Suppose version A and version B implement the same task. Version B uses fewer logical operations, but compilation produces a similar depth and a slightly different two-qubit gate count. Run both versions with the same parameters, backend target, transpiler configuration, shots, and repetitions.

Interpret the result in this order:

  1. Confirm that both versions match the ideal baseline within the chosen correctness threshold.
  2. Compare transpiled depth and two-qubit gates, not only source-level counts.
  3. Compare hardware success probability or task loss with uncertainty attached.
  4. Check whether runtime and execution volume changed.
  5. Accept the optimization only if the result improves the primary metric without an unacceptable cost or reproducibility trade-off.

If version B has fewer gates but worse hardware performance, inspect layout and routing before rejecting it. A different physical mapping may be responsible.

Example 2: Estimating a parameter sweep

Assume an algorithm evaluates 40 parameter settings, uses 2,000 shots per setting, and repeats the full sweep three times. The estimated execution volume is:

40 × 2,000 × 3 = 240,000 shots

This is a planning quantity, not a guaranteed bill. Convert it to cost only after checking the selected platform's current accounting unit, minimums, quotas, and simulator-versus-hardware rules. If each setting requires multiple circuits, multiply by the number of circuits per setting.

When comparing results, report the best setting, the average across repetitions, and the spread across repetitions. Reporting only the best run can make a noisy optimization look more reliable than it is.

For variational workloads, pair this benchmark with the variational quantum algorithm tutorial on ansätze, training, and barren plateaus. For resource planning, use the quantum resource estimation worksheet.

When to recalculate

Recalculate the benchmark whenever an input that affects execution or interpretation changes. This includes a new circuit version, a different transpiler optimization level, a changed qubit layout, an SDK or compiler upgrade, a new backend, a revised noise model, a different shot count, or a change in the algorithm's parameter sweep.

Review cost and quota estimates whenever the provider changes its pricing model, accounting units, access conditions, or execution limits. Do not carry an old price assumption into a new planning document without checking the current platform documentation.

Repeat hardware measurements when calibration conditions, backend availability, or queue behavior materially changes. A result that was useful for comparing two circuits in one experiment should not automatically be treated as a permanent ranking of devices.

Use this final checklist before publishing or acting on a benchmark:

  • Is the algorithm correct on an ideal simulator?
  • Are source and transpiled resource counts both recorded?
  • Are shots, repetitions, seeds, and backend details documented?
  • Is the simulator noise model clearly identified?
  • Does the primary metric match the actual application goal?
  • Are uncertainty, runtime, execution volume, and cost reported separately?
  • Can another developer rerun the experiment from the saved artifacts?

Benchmarking is most valuable when it becomes a repeatable engineering test rather than a one-time hardware demonstration. Store the benchmark with the code, rerun it after meaningful changes, and use the resulting evidence to decide whether an optimization improves the algorithm in the environment where it will actually run.

Related Topics

#quantum benchmarking#quantum simulators#quantum hardware#Qiskit#circuit optimization
S

Smart Qubit Editorial Team

Quantum Computing Editors

Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.