Quantum circuit resource estimation helps you decide whether a circuit is suitable for a simulator, practical for target hardware, and affordable to execute. This guide shows how to count qubits, depth, gates, two-qubit operations, shots, and execution overhead using a repeatable workflow that works across Qiskit, Cirq, PennyLane, and other quantum SDKs.
Overview
A circuit that runs successfully in a local development environment may still be unsuitable for a real quantum backend. The difference usually comes from resources that are easy to overlook: transpilation can add gates, hardware connectivity can increase two-qubit operations, measurement shots multiply execution work, and hybrid algorithms may execute the same circuit hundreds or thousands of times.
Resource estimation is therefore more than counting the qubits shown in a circuit diagram. A useful review records at least six quantities:
- Logical qubits: The number of qubits in the circuit before hardware-specific compilation.
- Physical qubits: The number of hardware qubits needed after mapping, routing, and any error-correction assumptions.
- Circuit depth: The number of sequential operation layers. Depth is often more informative than total gate count for hardware execution.
- Total gate count: The number of operations, ideally separated by gate type and by one- or two-qubit operations.
- Two-qubit gate count: Entangling operations such as controlled gates, which commonly require particular connectivity and have a strong effect on execution quality.
- Shots and executions: The number of repeated measurements, including repetitions caused by parameter sweeps, optimizer iterations, observables, or error-mitigation techniques.
The goal is not to produce one universal number. It is to compare circuit versions under clearly stated assumptions. A resource report should answer: “For this backend, compilation target, number of parameter settings, and shot budget, what work will be performed?”
How to estimate
1. Establish the circuit boundary
Decide what is being measured. For a standalone circuit, the boundary may run from state preparation through measurement. For a variational quantum algorithm, include the full loop: circuit construction, parameter binding, execution, measurement, classical optimization, and repeated evaluation.
For example, a VQE experiment may evaluate several Hamiltonian terms separately. A QAOA experiment may execute multiple parameter candidates during optimization. Counting only the circuit diagram once would understate the total workload. For background on these patterns, see the VQE tutorial and QAOA for Max-Cut tutorial.
2. Count logical qubits
Start with the highest index used by the circuit, plus one, or use the SDK's circuit metadata. Include ancilla qubits, workspace registers, and qubits used only for measurements. Do not assume that unused declared qubits are free: some execution systems reserve the entire declared register.
3. Measure pre- and post-compilation resources
Record the abstract circuit before optimization, then compile it for the intended target and record it again. These are different reports:
- Pre-compilation: Useful for comparing algorithm designs and identifying unnecessary operations.
- Post-compilation: Useful for estimating actual hardware workload, including routing operations, basis-gate decomposition, and optimization effects.
When comparing implementations, hold the compilation settings constant. A circuit optimized with one basis gate set or optimization level is not directly comparable with a circuit compiled under different settings. The Qiskit transpiler pass manager guide provides a practical framework for examining this stage.
4. Calculate execution volume
A simple execution estimate is:
Total shots = circuit evaluations × shots per evaluation
Then expand circuit evaluations when necessary:
Circuit evaluations = parameter settings × measured observables × mitigation or reconstruction overhead
This is a planning formula, not a platform billing rule. Providers may define jobs, circuits, shots, runtime, or other units differently. Always map the estimate to the target platform's current documentation before making a budget or capacity decision.
5. Review the critical path
Depth describes sequential layers, but not all depth is equally important. Separate single-qubit depth from two-qubit depth when your tooling allows it. Also note measurement and reset operations, control flow, mid-circuit operations, and any repeated sections. A circuit with fewer total gates can still be difficult to run if its entangling operations are concentrated in a long sequential chain.
Inputs and assumptions
Use the following worksheet for a repeatable quantum hardware resource estimation review:
| Input | What to record | Why it matters |
|---|---|---|
| Target backend | Simulator, emulator, or hardware target | Determines supported operations, connectivity, and limits. |
| Logical qubits | Algorithm qubits plus ancillas | Defines the minimum abstract register size. |
| Physical qubits | Mapped qubits after compilation | May exceed logical qubits because of routing or architecture constraints. |
| Gate counts | Total, single-qubit, two-qubit, measurement, reset | Shows where execution work and potential noise exposure are concentrated. |
| Depth | Total depth and, if available, two-qubit depth | Approximates the sequential execution path. |
| Shots | Shots per circuit and total shots | Determines sampling workload and statistical precision. |
| Parameter settings | Unique parameter vectors evaluated | Essential for VQE, QAOA, and quantum machine learning workflows. |
| Overhead | Transpilation, mitigation, tomography, or circuit cutting expansion | Can multiply the number of circuits or shots. |
State your assumptions beside every estimate. Useful notes include the SDK version, transpilation or compilation settings, optimization level, selected basis gates, coupling map, shot count, observable grouping method, and whether the circuit is measured once or repeatedly inside a classical loop.
Simulator capacity also depends on the simulation method. A statevector simulator can face memory pressure as qubit count grows, while shot-based, tensor-network, or hardware-emulation approaches have different trade-offs. Use the quantum simulator selection guide when choosing a development target.
Worked examples
Example 1: A small circuit comparison
Suppose version A uses 6 logical qubits, 42 total gates, 12 two-qubit gates, and depth 18. Version B uses the same six qubits, 34 total gates, 16 two-qubit gates, and depth 15.
Version B has fewer gates and lower depth, but more entangling operations. The correct conclusion is not automatically that B is better. Compare the circuits after compiling to the same target. If B's connectivity requires additional routing, its post-compilation two-qubit count or depth may exceed A's. Record both versions in a table rather than relying on the abstract circuit alone.
Example 2: A variational workload
Assume a variational circuit is evaluated for 20 parameter settings. Each setting measures 8 observables, and each observable uses 1,000 shots. Before considering mitigation, the estimate is:
20 × 8 × 1,000 = 160,000 shots
If the workflow uses three independently executed circuit variants for an error-mitigation comparison, the planning estimate becomes 480,000 shots, assuming all variants use the same settings and shot count. If observables can be grouped into fewer measurement circuits, the total may be lower. If tomography or circuit cutting is introduced, it may be higher. The error-mitigation guide and circuit-cutting guide explain why these techniques should be represented explicitly in the estimate.
Example 3: A hybrid quantum-AI experiment
For a quantum machine learning prototype, track both quantum and classical work. A single training epoch might evaluate 64 data batches, with 10 parameter-shift evaluations per batch and 500 shots per circuit. The quantum shot estimate is:
64 × 10 × 500 = 320,000 shots per epoch
This excludes validation circuits, repeated runs for uncertainty estimates, and failed or retried jobs. It also does not predict wall-clock time because queueing, batching, compilation, and provider scheduling vary. For a reproducible comparison, pair the resource report with a classical baseline as described in the hybrid quantum-AI experiment workflow.
When to recalculate
Recalculate resource estimates whenever an input changes, not only when the algorithm changes. The most important triggers are:
- You add a feature, ancilla, control condition, observable, or measurement.
- You change the transpilation target, basis gates, optimization settings, or coupling map.
- You move from a simulator to real hardware or to a different hardware architecture.
- You increase shots, optimizer iterations, training examples, parameter settings, or repeated trials.
- You introduce error mitigation, circuit cutting, tomography, batching, or observable grouping.
- The platform changes its backend limits, execution model, queue behavior, or pricing inputs.
- A benchmark shows that the circuit's accuracy, runtime, or sampling variance differs from the original assumption.
Before submitting a job, run this review checklist:
- Confirm logical and compiled physical qubit counts.
- Export total gate count, two-qubit gate count, and depth for the same compilation target.
- List every parameter setting, observable, shot count, and repeated trial.
- Include overhead from mitigation, reconstruction, or circuit decomposition.
- Separate estimates for simulator memory, quantum execution, and classical post-processing.
- Label every number with its assumptions and date.
- Compare the estimate with the target platform's current limits and execution terms.
Keep this report beside the circuit code and regenerate it in continuous integration when practical. A small resource regression—such as an unexpected increase in two-qubit gates after a dependency or compiler change—can then be caught before it reaches a cloud job or hardware experiment.