Before submitting a quantum experiment, estimate its logical qubits, ancillas, transpiled gate count, circuit depth, shots, simulator memory, runtime, and execution cost. This guide provides a repeatable planning method, formulas, assumptions, and worked examples so you can compare implementations before consuming hardware or cloud resources.
Overview
Quantum circuit resource estimation has two distinct layers. The first is the algorithmic requirement: how many qubits, operations, layers, measurements, and repetitions the circuit appears to need in an abstract model. The second is the execution requirement after a simulator or hardware provider transforms that circuit. Transpilation can add routing gates and depth, while sampling, calibration, queueing, error mitigation, and repeated parameter evaluations can multiply the workload.
Keep these layers separate in your planning table. A useful minimum record is:
| Resource | Algorithmic estimate | Execution estimate |
|---|---|---|
| Qubits | Data qubits plus known ancillas | Physical or allocated qubits after mapping |
| Gates | Logical one- and two-qubit gates | Basis gates after transpilation |
| Depth | Abstract circuit layers | Scheduled or transpiled depth |
| Shots | Samples needed per circuit | Shots multiplied by circuits and repetitions |
| Memory | State representation assumed | Peak simulator memory or provider allocation |
| Runtime | Estimated execution work | Compilation, queue, execution, and post-processing time |
This distinction prevents a common planning mistake: treating a short source circuit as a short hardware job. For background on reducing depth and gate count, see How to Optimize Quantum Circuit Depth and Gate Count Before Execution.
How to estimate
Start with the experiment definition rather than the SDK job object. Write down the circuit family, number of parameter settings, observables, repetitions, and target precision. Then calculate resources in the following order.
- Count logical qubits. Add data qubits, work qubits, flag qubits, phase-estimation registers, and any qubits used by state preparation or error-correction routines. Do not count classical bits as qubits.
- Count logical operations and layers. Record one-qubit gates, two-qubit gates, measurements, resets, and barriers separately. Depth is the length of the longest dependency path, not the total gate count.
- Estimate transpilation overhead. Use a range until you have compiled for the target backend. Let G be the logical gate count and G' the transpiled count. Define the gate overhead as G'/G. Do the same for depth: D'/D. Connectivity, native gate restrictions, routing, and optimization settings can all change these values.
- Count circuits and evaluations. If an algorithm uses C distinct circuits, S shots per circuit, and R repetitions, the basic shot total is S × C × R. For variational algorithms, include every optimizer evaluation and every parameter-shift or gradient circuit.
- Estimate precision-driven shots. For a bounded expectation value, sampling error generally decreases with the square root of the number of shots. As a planning approximation, use S ≈ V/ε², where ε is the desired standard error and V is an assumed variance factor. If the variance is unknown, calculate a conservative range rather than presenting one precise number.
- Estimate simulator memory. A full statevector for n qubits contains 2n complex amplitudes. With b bytes per complex amplitude, the amplitude storage is approximately 2n × b bytes, before workspace and runtime overhead. For double-precision complex values, use 16 bytes as an explicit assumption, not a universal simulator limit.
- Estimate runtime and budget. Separate local compilation time, simulator compute time, provider queue time, device execution time, and post-processing. For commercial execution, use the provider's current pricing fields and job model at the time of submission; do not reuse an old estimate after those inputs change.
The most reliable workflow is iterative: estimate from the source circuit, transpile a representative instance, inspect the resulting counts, and replace assumptions with measured values. Provider-specific reporting differs, so preserve the SDK version, backend, optimization settings, and transpilation target with every estimate.
Inputs and assumptions
Before calculating, create a resource-estimation sheet with one row per circuit family. Include:
- Problem size: number of variables, data items, graph nodes, or basis states encoded.
- Encoding: basis, angle, amplitude, or another method. Encoding choices can change qubit count and state-preparation depth; compare alternatives in Quantum Data Encoding Methods.
- Ancillas: temporary workspace, oracle flags, arithmetic registers, measurement-assistance qubits, and reset requirements.
- Connectivity: whether interactions are all-to-all in the abstract circuit or restricted by the target device topology.
- Native operations: the one- and two-qubit gate set used by the target backend.
- Measurement plan: number of observables, commuting groups, basis rotations, and shots per group. Grouping can reduce measurement circuits, as discussed in Pauli Grouping for Quantum Measurements.
- Algorithmic repetition: optimizer iterations, random seeds, restart counts, amplitude-estimation repetitions, or error-mitigation scale factors.
- Execution assumptions: simulator type, precision, parallelism, queue model, timeout, pricing unit, and data-transfer needs.
Report ranges when uncertainty is material. For example, write “12 to 20 physical qubits after mapping” rather than “16 qubits” if the final layout is not known. Also distinguish a circuit's maximum qubit width from the number of qubits actively carrying meaningful state at every layer.
Worked examples
Example 1: Statevector simulator memory
Suppose a circuit uses 24 qubits and you plan to simulate a full statevector with double-precision complex amplitudes. The amplitude count is 224 = 16,777,216. At 16 bytes per amplitude, the raw state storage is about 268 MB using decimal units, or about 256 MiB using binary units. The actual peak requirement can be higher because the simulator may allocate work buffers, copies, measurement data, or multi-process communication. Record the estimate as “at least 256 MiB for amplitudes, plus runtime overhead,” not as a guaranteed machine requirement.
If the same experiment only needs sampled bitstrings, compare a shot-based or tensor-network approach rather than assuming a statevector is necessary. The trade-offs depend on circuit structure and simulator implementation; a quantum simulator comparison can help frame that choice.
Example 2: Hardware shots and transpilation
Assume a variational experiment has 8 logical qubits, 6 observables divided into 4 measurement groups, 1,000 shots per group, and 30 optimizer evaluations. The base shot total is:
4 groups × 1,000 shots × 30 evaluations = 120,000 shots.
Now assume each evaluation requires two additional circuits for a parameter-shift gradient for every of 8 parameters. The circuit count per evaluation becomes 4 measurement groups multiplied by 1 + 16 gradient circuits, or 68 circuit executions if each gradient circuit uses the same grouped measurement plan. The resulting shot estimate is 68 × 1,000 × 30 = 2,040,000 shots. This is an illustrative planning assumption, not a provider limit or price estimate.
Finally, suppose transpilation of a representative circuit changes 90 logical gates to 135 basis gates and depth from 18 to 31. Record gate overhead as 1.5× and depth overhead as approximately 1.72×. Recompile after changing topology, optimization level, layout, or native gate target. For hardware preparation and result review, use the real-hardware preflight checklist.
When to recalculate
Recalculate before each meaningful submission, not only when the algorithm changes. Trigger a new estimate when you change the problem size, encoding, ansatz, observable grouping, optimizer, gradient method, shot count, error-mitigation method, simulator, backend, transpiler settings, or circuit layout. Recalculate whenever a provider changes pricing fields, execution units, quotas, memory assumptions, or job semantics. Queue and benchmark inputs should also be refreshed when rates or measured performance move.
Use this practical preflight:
- Save the source circuit and environment details.
- Compile a representative instance for the intended target.
- Record final qubit count, gate counts, depth, measurements, and circuit count.
- Multiply shots by all evaluations, groups, repetitions, and mitigation variants.
- Check simulator peak memory or hardware width against the available allocation.
- Apply current provider pricing or quota inputs and label every assumption with a date.
- Run a small pilot, compare predicted and observed runtime, then update the worksheet before scaling.
Keep the estimate beside the experiment's results. The difference between predicted and observed resources is valuable operational data: it reveals routing overhead, hidden circuit replication, unexpected optimizer work, or measurement costs that should inform the next quantum computing experiment.