Quantum resource estimation helps you decide whether a circuit should run locally, on a noisy simulator, or on cloud hardware before you submit it. This guide provides a repeatable workflow for estimating qubits, gates, circuit depth, measurement shots, simulator memory, runtime, queue exposure, and cloud cost without relying on provider-specific prices that may change.
Overview
A quantum circuit has several different resource requirements, and no single number describes its cost. A circuit may use only a few qubits but require many shots. Another may have a modest shot count but exceed the memory available to a state-vector simulator. A hardware submission can fit the device but produce weak results because its two-qubit depth is too large for the available fidelity.
For practical planning, separate the estimate into six questions:
- How many logical qubits does the algorithm require?
- How many physical qubits are needed after mapping, routing, or error correction?
- How many operations and layers will the transpiled circuit contain?
- How many measurement shots are needed for a useful estimate?
- How much memory and runtime will simulation require?
- What will the cloud execution cost under the selected provider’s current billing model?
Estimate the circuit after transpilation whenever possible. The source circuit is a useful algorithmic description, but the backend receives a hardware-compatible circuit that may contain additional swaps, basis-change gates, measurements, and scheduling delays. For background, see Quantum Circuit Transpilation Explained and How to Benchmark a Quantum Circuit.
How to estimate
1. Define the experiment, not just the circuit
Write down the quantity you want to estimate: a bitstring probability, an expectation value, an optimization objective, or a classifier score. Resource needs depend on the required uncertainty. A circuit used to inspect a rough distribution may need fewer shots than a variational algorithm comparing two close objective values.
Also record whether you need one circuit or a family of circuits. A variational quantum algorithm may execute hundreds or thousands of parameterized circuit instances during optimization. Its total workload is therefore:
total circuit executions = circuits per iteration × optimizer iterations × repetitions or parameter settings
2. Count logical qubits and transpiled physical qubits
Start with the logical qubit count in the algorithm. Then inspect the transpiled circuit for the target backend. Connectivity constraints can require extra routing qubits or additional operations. If error correction is part of the design, distinguish algorithmic logical qubits from the physical qubits used to encode them; the conversion depends on the code, target error rate, and architecture, so it should be treated as a separate engineering estimate rather than a fixed multiplier.
3. Count gates, depth, and especially two-qubit gates
Record total gate count, maximum circuit depth, and depth by operation type. Single-qubit gates and two-qubit gates do not have the same hardware impact. Two-qubit operations commonly deserve a separate budget because they depend strongly on connectivity, calibration, and routing. Include inserted swap operations in the post-transpilation count.
A useful first-pass record is:
one-qubit gates | two-qubit gates | measurement operations | total depth | two-qubit depth
Depth is not wall-clock runtime. Gates may be scheduled in parallel, while measurement, reset, control overhead, and device timing add other contributions. Use the backend’s timing metadata or a short pilot run when execution time matters.
4. Choose a shot count from the required precision
For a measured probability estimated from independent shots, the standard error is approximately:
standard error ≈ √(p(1 − p) / S)
where S is the number of shots. Without knowing p, use the conservative worst-case approximation:
standard error ≤ 1 / (2√S)
For an approximate 95% confidence margin of error e in a single proportion, a planning estimate is:
S ≈ 0.96 / e²
This is a planning formula, not a guarantee. Correlated noise, readout error, post-selection, and multiple-comparison effects can increase the required sample count. Expectation values may also require additional measurement bases, so multiply the shot budget by the number of bases or distinct circuits.
5. Estimate simulator memory and runtime
A full state-vector simulator stores 2^n complex amplitudes for n qubits. A simple memory estimate is:
memory ≈ 2^n × bytes per complex amplitude
With double-precision complex values, use approximately 16 bytes per amplitude before allocating workspace, copies, buffers, and framework overhead. For example, 25 qubits require about 512 MiB for the raw state vector, 30 qubits about 16 GiB, and 32 qubits about 64 GiB. Actual requirements can be higher, and distributed simulation introduces communication and storage overhead.
Runtime depends on gate count, shot handling, simulator method, hardware parallelism, measurement sampling, and whether noise is modeled. A noisy density-matrix simulation can scale far more severely than an ideal state-vector simulation. Treat a short benchmark at the intended qubit count and simulator settings as more reliable than a runtime extrapolation from a tiny circuit.
6. Estimate cloud execution cost from the current pricing model
Cloud quantum computing providers may price by job, circuit execution, shot, task duration, subscription tier, or a combination. Do not transfer a price from one provider or backend to another. Instead, copy the current unit, minimum charge, included allocation, maximum runtime, and queue or priority rules into your worksheet.
A generic variable-cost model is:
estimated cost = billable units per submission × current price per unit × number of submissions
Add any applicable fixed fee or allocation accounting separately. If the provider bills runtime, estimate active execution time rather than queue time unless the pricing policy says otherwise. Queue time is still important operationally, but it may not be a billed unit.
Inputs and assumptions
Use a worksheet that makes uncertain inputs visible. This prevents a precise-looking estimate from hiding weak assumptions.
Algorithm: ______________________________
Backend or simulator: ___________________
Logical qubits: ______ Physical qubits: ______
Transpiler target and optimization: ______
One-qubit gates: ______
Two-qubit gates: ______
Total depth: ______ Two-qubit depth: ______
Circuits per iteration: ______
Iterations or parameter settings: ______
Shots per circuit: ______
Measurement bases: ______
Simulator method: ________________________
Raw state-vector memory: _________________
Estimated execution time: _______________
Billing unit and current rate: ___________
Estimated submissions: ___________________
Budget limit: ____________________________
Keep ideal and noisy estimates separate. An ideal simulator can answer whether the circuit is logically behaving as expected. A noisy simulator can explore sensitivity to an assumed error model, but its result depends on the model’s assumptions. Hardware execution adds calibration drift, queue conditions, device topology, and measurement error. These are different experiments, not interchangeable cost estimates.
| Execution option | Main resource to estimate | Best use | Important limitation |
|---|---|---|---|
| Local ideal simulator | RAM, CPU or GPU time, shots | Debugging and small-scale validation | Does not represent hardware noise |
| Local noisy simulator | RAM, compute time, noise-model overhead | Sensitivity and error experiments | Results depend on the selected noise model |
| Cloud simulator | Provider quota, runtime, billed units | Larger or accelerated simulations | Remote limits and pricing can change |
| Cloud quantum hardware | Shots, execution time, queue exposure, billed units | Device-level experiments | Noise, connectivity, calibration, and availability matter |
SDKs can expose useful counts after compilation. In Qiskit, inspect the transpiled circuit’s qubit count, depth, operation counts, and duration where backend timing is available. Cirq and PennyLane provide comparable circuit inspection and compilation workflows, although method names and backend metadata differ by version. Verify commands against the installed SDK and provider documentation rather than copying an old API example. The quantum simulator comparison can help frame those choices.
Worked examples
Example 1: Shot planning for one probability
Suppose a circuit estimates one probability with an approximate margin of error of 0.05. Using the planning formula gives:
S ≈ 0.96 / 0.05² = 384 shots
Round upward to a practical batch size, then validate the result with repeated runs or confidence intervals. If the experiment measures four independent bases, begin with approximately four times the per-basis budget: about 1,536 shots across the four circuits. If the algorithm compares small differences between expectation values, increase the budget after a pilot rather than assuming this first estimate is sufficient.
Example 2: Simulator memory
A 30-qubit ideal state-vector simulation needs approximately:
2^30 × 16 bytes ≈ 16 GiB
That figure describes the raw vector only. A machine with exactly 16 GiB of memory is not a safe target because the simulator and operating system need space too. Choose a smaller circuit, a suitable distributed or accelerated method, or a different simulation strategy if the available environment cannot provide headroom.
Example 3: A variational workload
Assume an optimizer evaluates 12 parameterized circuits per iteration for 80 iterations, using 2,000 shots per circuit. The shot workload is:
12 × 80 × 2,000 = 1,920,000 shots
If each evaluation also requires three measurement bases, the workload becomes 5,760,000 circuit shots unless the implementation groups or reuses measurements. This is why reducing the number of optimizer evaluations or measurement bases may matter more than removing a few single-qubit gates. For a variational classifier, connect the estimate to the training loop described in a quantum machine learning tutorial.
When to recalculate
Recalculate before each meaningful submission, not only when the algorithm changes. Transpiler settings, backend selection, qubit mapping, optimization level, noise model, and shot count can all alter the estimate.
- After compilation: update physical qubits, routed gates, depth, and timing from the actual target backend.
- After a circuit optimization: check whether fewer gates also changed measurement bases, parameter evaluations, or convergence behavior.
- Before a production-scale sweep: multiply one-circuit estimates by the full number of iterations, data points, seeds, and repetitions.
- When provider pricing changes: refresh the billing unit, rate, included allocation, minimum charge, and runtime limits.
- When backend conditions change: review connectivity, calibration information, supported instructions, queue conditions, and execution limits.
- After a pilot run: replace assumptions with observed runtime, output variance, failure rate, and usable shots.
Before submitting, set three limits: a maximum spend or quota, a maximum number of shots, and a maximum acceptable runtime. Run a small validation job first, compare observed metrics with the worksheet, and only then scale up. This simple loop turns resource estimation from a one-time guess into a practical quantum programming workflow.