Quantum Resource Estimation: How to Calculate Qubits, Circuit Depth, Gates, Shots, and Runtime
quantum algorithmsresource estimationcircuit depthqubit requirementsquantum hardwarebenchmarking

Quantum Resource Estimation: How to Calculate Qubits, Circuit Depth, Gates, Shots, and Runtime

QQuantum 365 Editorial Team
2026-11-20
8 min read

Learn how to estimate qubits, depth, gates, shots, simulator memory, runtime, and execution workload before running a quantum algorithm.

Quantum resource estimation turns an abstract algorithm into a practical execution plan. This guide shows how to estimate logical and physical qubits, circuit depth, gate counts, measurement shots, simulator memory, runtime, and cloud usage before committing to a large experiment.

Overview

A circuit can look small in source code but become substantially larger after compilation. An algorithm may require a few problem qubits, additional ancillas, routing operations for hardware connectivity, repeated measurements, and classical optimisation loops. Resource estimation is the process of measuring those requirements before execution and recording the assumptions behind them.

The most useful estimates separate algorithmic resources from execution resources:

  • Algorithmic resources: logical qubits, ancillas, circuit layers, gate operations, measurements, and the number of circuit evaluations.
  • Execution resources: physical qubits after mapping, hardware-native gate counts, transpiled depth, shots, simulator memory, queue or submission overhead, and estimated cost.

This distinction matters because a circuit may need only 12 logical qubits but occupy more hardware qubits or have a much greater depth once it is mapped to a device with limited connectivity. Similarly, one circuit definition may be executed thousands of times when sampling a distribution or evaluating an objective function.

Resource estimates are not predictions of scientific success. They tell you whether an experiment is feasible under a selected simulator, processor, shot budget, time limit, or spending limit. Accuracy improves when you estimate the circuit after compilation for the specific backend you intend to use.

How to estimate

1. Define the workload

Start by writing down what one experiment means. Is it one circuit sampled 1,000 times, a parameterised circuit evaluated at 50 parameter settings, or an optimisation loop that may run for 100 iterations? Include state preparation, the algorithm, measurement, and any calibration or validation circuits that will also be submitted.

A useful workload equation is:

Total circuit executions = circuits per iteration × parameter settings × iterations × shots

Use this as a planning formula rather than a universal rule. Some platforms batch parameter values, some support grouped observables, and some workflows reuse a circuit or measure several terms in separate bases. Record those details explicitly.

2. Count logical qubits

Count the qubits required by the mathematical algorithm, then add temporary workspace. The result is the peak number of live logical qubits, not the sum of every qubit ever created. Include:

  • problem or data qubits;
  • ancillas used for arithmetic, controls, phase estimation, or error checking;
  • work registers that remain allocated during the deepest part of the circuit;
  • additional qubits introduced by encoding, such as basis, angle, or amplitude preparation.

For example, an algorithm using an eight-qubit problem register and a four-qubit workspace has a peak logical requirement of at least 12 qubits. If the workspace can be uncomputed and reused, its qubits may not need to be added again for a later stage.

3. Measure circuit depth and gates

Gate count is the total number of operations, while circuit depth is the number of sequential layers on the critical path. Gates acting on independent qubits can share a layer, so depth is usually lower than the total gate count.

Report gate counts by category where possible: one-qubit gates, two-qubit gates, measurements, resets, barriers, and any multi-qubit operations. Two-qubit count and depth are often particularly important for near-term hardware because connectivity and noise can make them costly. Also report both the pre-compilation circuit and the compiled circuit. The latter is the more useful figure for a hardware estimate.

4. Account for mapping and transpilation

Choose a target basis, coupling or connectivity graph, qubit layout, and optimisation setting. A compiler may rewrite abstract operations into native gates, reorder qubits, and insert routing operations such as swaps. These changes affect physical-qubit use, depth, and gate counts.

Do not compare two algorithms using only their high-level gate counts if they target different hardware layouts. Compile both with comparable settings and report the backend assumptions. For debugging compilation changes, see How to Debug Quantum Circuits.

5. Estimate shots and repetitions

Shots are repeated executions used to estimate probabilities or expectation values. A single sampled circuit with 2,000 shots has 2,000 repetitions, but a variational algorithm may require many distinct circuit evaluations. If an objective uses 20 Hamiltonian terms, those terms may require separate measurement groups or basis rotations.

Use the minimum shot budget that supports the decision you need to make, then increase it in a controlled benchmark. More shots reduce sampling uncertainty in many workflows, but they do not remove state-preparation error, gate error, readout error, or model bias. For interpreting counts and expectation values, consult How to Read Quantum Measurement Results.

6. Estimate simulator memory and runtime

For a full state-vector simulator, the state size grows as 2n complex amplitudes for n qubits. If each complex amplitude uses 16 bytes, the amplitude array alone requires approximately 16 × 2n bytes. Real workloads need additional memory for temporary arrays, circuit data, sampling, noise models, and parallel execution, so treat this as a lower-bound estimate.

Runtime depends on circuit depth, gate structure, simulator method, noise model, hardware acceleration, shots, batching, and system load. Instead of extrapolating from a single run, benchmark several circuit sizes and record wall-clock time. For a hardware job, separate submission time, queue time, execution time, result retrieval, and classical post-processing. These are operational estimates and can change between runs.

Inputs and assumptions

Put the following fields in a resource report so another developer can reproduce the estimate:

FieldWhat to record
Algorithm versionRepository revision, circuit-generation settings, and problem size
Logical qubitsProblem qubits, ancillas, peak live allocation, and encoding method
Compiled qubitsMapped physical qubits, including any platform-specific requirements
Depth and gatesPre- and post-compilation depth, total gates, and one- versus two-qubit counts
MeasurementsMeasurement bases, observable groups, circuits per evaluation, and shots
Simulator assumptionsState-vector, tensor-network, stabiliser, or noisy method; precision and memory limit
Hardware assumptionsBackend, native gate set, connectivity, calibration snapshot, and concurrency limits
Classical workOptimiser iterations, parameter settings, preprocessing, and result analysis
Commercial inputsProvider pricing fields, included usage, job limits, and currency as checked on the execution date

Frameworks expose different reporting paths. Qiskit users commonly inspect circuit metadata before and after transpilation; Cirq users can analyse moments and operations, then compile for a selected device; PennyLane users should account for device execution, differentiated evaluations, and observable measurements; Amazon Braket users should distinguish local simulator work from managed-device submissions. Names and APIs change, so verify the current documentation for the version and provider you use.

For larger projects, save the compiled circuit, resource report, backend identifier, software versions, and shot configuration alongside the results. This makes a later comparison meaningful and prevents a resource estimate from becoming detached from the experiment that produced it.

Worked examples

Example 1: a small sampling circuit

Suppose a four-qubit circuit has 18 abstract gates, a depth of 10, and one measurement at the end. You plan to run 5,000 shots. The initial estimate is four logical qubits, 18 gates, depth 10, and 5,000 circuit executions. After compilation, the circuit contains 26 native gates, including 12 two-qubit gates, and has depth 15. The hardware estimate should use the compiled figures: four mapped qubits, 26 native gates, depth 15, and 5,000 shots.

If the backend requires a separate circuit for each measurement basis and you use three bases, the workload becomes three circuit variants × 5,000 shots, or 15,000 shot executions. The logical algorithm has not changed, but the execution requirement has.

Example 2: a variational objective

Consider an eight-qubit variational circuit evaluated over 24 observable groups. Each evaluation uses 1,000 shots, and the optimiser is allowed 60 iterations. If every group requires its own circuit, the upper-bound shot workload is:

24 groups × 60 iterations × 1,000 shots = 1,440,000 shots.

This excludes an initial evaluation, parameter-shift or gradient circuits, validation runs, retries, and failed submissions. If gradients require two shifted evaluations per parameter and the circuit has 16 parameters, the gradient workload can dominate the original objective. Count those evaluations explicitly rather than treating one optimiser iteration as one quantum circuit run.

Example 3: simulator memory

A state-vector simulation with 28 qubits has 228 amplitudes. At an illustrative 16 bytes per complex amplitude, the amplitude storage is about 4 GiB before overhead. A practical run may need more memory, particularly when applying a noise model, storing intermediate states, or running multiple workers. Treat the calculation as a capacity check, then confirm it with a small benchmark on the intended machine.

When to recalculate

Recalculate before every materially different experiment. The most common triggers are:

  • the problem size, encoding, ansatz, or error-correction assumption changes;
  • the circuit is rewritten or a new optimiser, gradient method, or observable grouping is introduced;
  • you switch simulator type, precision, noise model, or classical hardware;
  • you change the target processor, qubit layout, compiler version, optimisation level, or native gate set;
  • shot counts, iteration limits, retries, or validation circuits change;
  • provider pricing, job limits, queue terminology, or account allowances change;
  • new calibration data changes expected depth tolerance or error assumptions.

Before running, use this checklist:

  1. Freeze the circuit version and problem-size parameters.
  2. Count peak logical qubits and identify ancillas that can be reused.
  3. Compile for the intended target and record mapped qubits, depth, and native gate counts.
  4. List every circuit variant, observable group, parameter setting, iteration, and shot count.
  5. Check simulator memory or hardware capacity before submitting the full workload.
  6. Run a small pilot to measure wall-clock time, result quality, and failure or retry behaviour.
  7. Update the report with observed values and use them to revise the next estimate.

Resource estimation is most valuable as a versioned habit rather than a one-time calculation. Keep the report next to the code, refresh it when inputs change, and compare estimates with measured runs. That workflow makes quantum algorithm experiments easier to budget, reproduce, and explain—whether you are using a simulator for development or preparing a circuit for real hardware.

For related planning, see Complete Guide to Quantum Simulators for Developers, Quantum Hardware Metrics Explained, and Quantum Chemistry with Quantum Computing.

Related Topics

#quantum algorithms#resource estimation#circuit depth#qubit requirements#quantum hardware#benchmarking
Q

Quantum 365 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.