Quantum circuit benchmarking is less about finding one universal score than about making a fair, repeatable comparison. This guide shows developers how to compare a circuit on local simulators, cloud simulators, and real quantum hardware using the same inputs, including runtime, depth, gate counts, shots, reliability proxies, queue time, and cost.
Overview
A circuit that runs quickly on a simulator may be slow or unreliable on hardware. Conversely, a circuit with a larger abstract gate count may become competitive after compilation for a particular device. A useful quantum hardware benchmark therefore measures the complete execution path rather than focusing on one number.
For each backend, record at least four categories of results:
- Compilation: transpilation or circuit-conversion time, final depth, and final gate counts.
- Execution: submission time, queue or reservation delay, device runtime, and shot count.
- Quality: ideal-simulator agreement, noisy-simulator agreement, measurement distributions, and a task-specific success metric.
- Economics: estimated or observed usage cost, subject to the provider’s current pricing and account rules.
Keep the circuit, observable, shots, optimization settings, and result-processing code fixed whenever possible. If you change several variables at once, the comparison becomes difficult to interpret.
For local development choices, see the quantum simulator comparison of Qiskit Aer, Cirq, and PennyLane. The goal here is not to declare a single best quantum computing platform, but to help you decide whether a backend is suitable for a particular workload.
How to estimate
Start by defining the question your benchmark must answer. Examples include:
- Does circuit optimization reduce depth without changing the output distribution?
- Can a hardware backend preserve enough signal for a variational algorithm?
- Is a cloud simulator practical for this circuit size and shot count?
- Will queue time and cost make repeated experiments impractical?
Then use the following workflow.
- Freeze the experiment. Choose the circuit version, input parameters, measurement basis, shot count, random seeds where supported, and post-processing method.
- Run an ideal reference. Use an exact or high-precision simulator when feasible. Save the expected bitstring probabilities, expectation values, or success condition.
- Compile for each target. Transpile or convert the circuit using the backend’s native gate set, connectivity, and optimization settings. Measure the compiled circuit, not only the source circuit.
- Run a noise-aware simulation. If a suitable noise model is available, use it as an intermediate reference. Treat it as an approximation, not a prediction of every hardware run.
- Execute with controlled shots. Use the same shot count for comparable runs, and repeat the experiment if you need to estimate run-to-run variation.
- Calculate comparable metrics. Store raw counts or samples as well as summaries such as success probability, expectation value, distance from the ideal distribution, and elapsed times.
- Inspect the trade-off. A backend is not necessarily better because it has lower runtime. Consider whether it produces a usable answer at an acceptable cost and reliability level.
A simple execution estimate can be written as:
total_time = compile_time + queue_time + device_time + result_processing_time
For a usage-based estimate, use:
estimated_cost = billable_units × current_unit_rate + fixed_run_charges
Do not hard-code rates into a tutorial or production tool. Provider pricing, minimum charges, credits, and account-specific limits can change. Read the current provider documentation when turning an estimate into a budget.
Inputs and assumptions
A benchmark becomes useful when another developer can reproduce it. Record these inputs in a machine-readable file, notebook, or results table.
| Input | What to record | Why it matters |
|---|---|---|
| Circuit | Version, qubit count, parameters, measurements | Small changes can alter depth and noise exposure. |
| Compilation | SDK version, optimization level, target gate set, layout method | Compilation may add swaps, decompositions, and measurements. |
| Backend | Simulator or device identifier and configuration | Capabilities and calibration data vary by target and time. |
| Shots | Requested shots and completed shots | More shots reduce sampling uncertainty but increase work and possible cost. |
| Timing | Compile, submission, queue, execution, and post-processing times | End-to-end performance is different from gate execution time. |
| Quality | Success rate, expectation value, distribution distance, or application loss | Reliability must be tied to the task. |
| Cost | Usage units, estimated charge, currency, and pricing date | Cost comparisons become stale when pricing inputs change. |
Use at least one circuit that is easy to verify and one that resembles your application. Useful starter cases include a Bell-state circuit, a parameterized single-layer circuit, a small mixer-and-cost circuit for a QAOA experiment, and a reduced VQE ansatz. A simple circuit reveals baseline overhead; an application-shaped circuit reveals whether optimization and noise affect the workload you actually care about.
For a VQE workload, save the measured energy and the number of circuit evaluations, not just the final parameter vector. A circuit can produce a plausible final value while requiring too many evaluations to be practical. Our VQE in Python tutorial provides useful context for identifying these repeated execution costs.
Choose quality metrics carefully. Exact state fidelity is often unavailable from measurement data alone, especially when the circuit has many qubits. Practical proxies include total-variation distance between ideal and observed distributions, the error in an expectation value, probability of the known correct answer, parity accuracy, or the application’s objective value. Label each metric clearly and avoid presenting one proxy as universal fidelity.
Worked examples
Suppose you are comparing an optimized circuit with its original version on an ideal simulator, a noisy simulator, and a hardware backend. Use the same input parameters and 4,096 shots for every comparable run. The following table is a template; replace the placeholders with measurements from your environment.
| Backend | Depth | Two-qubit gates | Shots | Queue time | Quality metric | Cost |
|---|---|---|---|---|---|---|
| Ideal simulator | [record] | [record] | 4,096 | 0 or local wait | Reference distribution | [record] |
| Noisy simulator | [record] | [record] | 4,096 | 0 or local wait | Distance from reference | [record] |
| Hardware backend A | [record] | [record] | 4,096 | [record] | Success or expectation error | [record] |
| Hardware backend B | [record] | [record] | 4,096 | [record] | Success or expectation error | [record] |
Imagine that optimization reduces source depth but compilation produces nearly the same hardware depth on both versions. In that case, the optimization has not yet improved the hardware execution path. If it reduces two-qubit gates while preserving the application metric, it may be more valuable than a reduction in single-qubit gates. If quality improves but queue time dominates total time, the next decision may involve scheduling or provider selection rather than circuit rewriting.
For reproducibility, save one row per run in a CSV or JSON file. Include a timestamp, backend configuration identifier when available, circuit hash, SDK version, shot count, random seed, and raw result location. This makes it possible to distinguish a code change from a backend or calibration change.
When moving from local code to a cloud provider, also check the provider’s current limits and workflow requirements. The IBM Quantum, AWS Braket, and Azure Quantum developer guide can help frame platform-level differences, but the benchmark should still use the exact targets and settings you intend to evaluate.
When to recalculate
Re-run the benchmark whenever an input that affects the decision changes. In practice, that means after a circuit rewrite, transpiler or SDK upgrade, backend change, hardware calibration change, noise-model change, shot-count change, pricing update, or provider-policy change. A new optimization setting can alter depth and connectivity enough to invalidate an earlier comparison.
Use a lightweight schedule between major changes: run the small verification circuits regularly, then run the full application-shaped benchmark before a release or platform migration. Repeat hardware measurements when queue conditions or device configuration differ materially from the original test. Report ranges or repeated-run variation when a single measurement would give false precision.
Before choosing a backend, use this checklist:
- Have you measured the compiled circuit rather than only the source circuit?
- Are shots, parameters, seeds, and post-processing held constant?
- Did you separate compile time, queue time, execution time, and processing time?
- Did you include at least one ideal reference and one noise-aware or hardware result?
- Is the quality metric connected to the application’s actual success condition?
- Have you recorded gate counts, especially two-qubit gates, and final depth?
- Did you verify current pricing, limits, and account assumptions before estimating cost?
- Can another developer reproduce the run from the saved circuit and metadata?
Benchmarking is complete when the results support a decision, not when the table contains the most columns. Start with a small, repeatable circuit; add an application-shaped workload; preserve raw results; and recalculate whenever the backend, software, circuit, or pricing inputs change. That workflow gives quantum computing developers a more dependable basis for choosing between simulators, cloud platforms, and real hardware.