Quantum circuit resource estimation helps you decide whether a circuit is suitable for a simulator, a constrained quantum processor, or another round of optimization. This guide provides a repeatable way to count logical qubits, circuit depth, total gates, two-qubit operations, measurements, and shots before you submit an experiment. It also explains why the numbers that matter on paper can change after transpilation to a target backend.
Overview
A circuit can be small in one sense and expensive in another. A circuit may use only a few qubits but contain many sequential operations. Another may have moderate depth but a high number of two-qubit gates, which can be more difficult for hardware to execute reliably. A useful estimate therefore reports several resources together rather than relying on a single gate count.
| Resource | What it measures | Why it matters |
|---|---|---|
| Logical qubits | Qubits named by the algorithm before hardware mapping | Sets the minimum problem width and simulator state size |
| Physical qubits | Qubits available on the selected device after mapping | Determines whether placement is possible |
| Circuit depth | Number of sequential layers on the critical path | Relates to execution time and exposure to noise |
| Total gates | All operations, including single-qubit and two-qubit gates | Provides a broad workload estimate |
| Two-qubit gates | Entangling operations such as controlled gates | Often drives routing overhead and hardware sensitivity |
| Measurement operations | Measured qubits and measurement placement | Influences output interpretation and execution behavior |
| Shots | Repeated circuit executions used to estimate results | Drives sampling cost and statistical precision |
Keep two versions of the estimate: the algorithmic circuit and the compiled circuit. The algorithmic version describes the design you wrote. The compiled version reflects the target backend's native gate set, connectivity, qubit layout, routing, scheduling, and measurement conventions. Hardware decisions should be based primarily on the compiled version.
This distinction is also useful when comparing simulators. A statevector simulator, tensor-network simulator, stabilizer simulator, and noisy simulator can have very different practical limits even when they receive the same logical circuit. See the quantum simulator selection guide for a complementary way to choose a backend.
How to estimate
Use the following workflow before running a large sweep or requesting real quantum hardware access.
1. Define the circuit boundary
Decide what you are measuring. Include state preparation, the computational circuit, basis rotations, and measurements if they are part of the experiment. If classical preprocessing or postprocessing is significant, record it separately rather than mixing it into quantum gate counts.
2. Count logical qubits
Record the number of qubit wires used by the circuit. Include ancillas, workspace qubits, and qubits that are initialized or measured even if they do not carry the final result. For a circuit with data register size n and ancilla count a:
Logical qubits = n + a
Do not assume that unused wires are free. Some frameworks preserve declared registers in the circuit object, while others omit unused resources during construction. Inspect the final circuit rather than relying only on the source code.
3. Measure logical depth and gate counts
Gate count is the number of operations. Depth is the number of sequential layers after operations that act on separate qubits are placed in parallel. A simple circuit with one gate on each of eight qubits can have eight gates but depth one. Conversely, a chain of eight dependent operations can have depth eight.
At minimum, report:
- total operation count;
- single-qubit operation count;
- two-qubit operation count;
- maximum or critical-path depth;
- measurement count; and
- parameterized operation count, if the circuit is used in an optimization loop.
4. Transpile or compile for the target
Compilation can replace one abstract operation with several native operations. If the circuit requires interactions between nonadjacent qubits, the compiler may add routing operations, such as swaps or equivalent decompositions. It can also change depth through scheduling and optimization.
Run the target-specific compilation step at the optimization setting you intend to use. Record the compiler version, target name or configuration, optimization setting, initial layout policy, and any connectivity assumptions. A resource report without these fields is difficult to reproduce.
5. Estimate execution volume
For a single circuit, a basic shot estimate is simply the requested number of shots. For a parameter sweep with p parameter settings and s shots per setting:
Total circuit executions = p × s
If each setting evaluates m separately measured observables or measurement groups, use the experiment design's actual execution model:
Total executions ≈ p × m × s
This is an estimate, not a universal billing or queue-time formula. Providers may batch circuits, combine compatible measurements, or apply platform-specific execution rules. Use it to compare experiment designs, then verify the selected service's current behavior.
Inputs and assumptions
A resource worksheet should make its assumptions visible. Record the following inputs before comparing backends:
- Circuit definition: source revision, number of registers, ancillas, parameters, and measurement basis.
- Target constraints: available qubits, supported native operations, connectivity, and any restrictions on measurement or reset.
- Compilation settings: SDK and compiler versions, optimization level, layout method, routing method, and random seed where applicable.
- Experiment volume: number of parameter points, observables, repetitions, shots, and retry policy.
- Noise assumptions: ideal simulation, a generic noise model, or calibration data from a particular device.
- Acceptance criteria: maximum depth, two-qubit gate budget, expected statistical error, runtime limit, or minimum success probability.
Separate hard constraints from preferences. A circuit that exceeds the target's available qubit count cannot run without redesign. A circuit that exceeds a preferred depth limit may still run, but its results may be difficult to interpret. This distinction prevents an informal benchmark threshold from being mistaken for a platform requirement.
For variational algorithms, estimate the complete optimization workload rather than one circuit evaluation. A useful record includes the number of optimizer iterations, objective evaluations per iteration, gradient method, parameter-shift evaluations if used, and shots per expectation value. The parameterized circuit guide covers practical ways to organize these sweeps.
Worked examples
Example 1: A compact logical circuit
Suppose a four-qubit circuit contains 12 single-qubit gates, 6 two-qubit gates, and measurements on all four qubits. Its logical resource summary is:
- Logical qubits: 4
- Total gates: 18
- Two-qubit gates: 6
- Measurements: 4 qubits
- Shots: 2,000
Assume the compiler maps this circuit to a target with compatible connectivity and produces 21 total gates, including 8 two-qubit gates, with depth increasing from 9 to 13. The logical circuit fits the width requirement, but the compiled report is the relevant benchmark for hardware sensitivity. The additional two-qubit operations may be more important than the modest increase in total gates.
Example 2: A parameter sweep
Now assume the same circuit is evaluated at 50 parameter settings, with 2,000 shots per setting and three measurement groups. A conservative execution estimate is:
50 × 3 × 2,000 = 300,000 circuit executions
If the framework can combine measurement groups or batch compatible circuits, the submitted job structure may differ. Still, the estimate reveals that reducing shots, sharing measurements, or narrowing the parameter grid could matter more than shaving one single-qubit gate from the circuit.
Example 3: Backend selection
Imagine two candidate targets. Backend A has enough physical qubits but requires substantial routing, producing a compiled circuit with 40 additional two-qubit operations. Backend B has fewer available qubits but supports the circuit's interaction pattern with little routing. If the circuit fits Backend B's width after mapping, Backend B may be the better experimental candidate even if Backend A has more total qubits.
This is why “largest device” is not a complete selection rule. Compare available width, topology, compiled depth, two-qubit count, calibration information, queue or execution constraints, and the experiment's tolerance for noise. The backend selection guide provides a broader calibration-focused workflow.
SDK-neutral reporting pattern
For each circuit revision, save a row containing:
revision, target, logical_qubits, physical_qubits, logical_depth, compiled_depth, total_gates, two_qubit_gates, measurements, shots, parameter_points, compiler_settings
Most quantum SDKs expose circuit depth, operation counts, qubit count, and target-specific compiled circuits through inspection or drawing utilities. The method names differ across Qiskit, Cirq, PennyLane, Azure Quantum integrations, and Amazon Braket workflows, so treat the exact command as SDK- and version-dependent. The measurement schema above is more durable than a copied command.
When to recalculate
Recalculate resources whenever an input that affects execution changes. At minimum, repeat the estimate when you:
- change the circuit structure, ansatz, oracle, data-encoding method, or measurement basis;
- add ancillas, error-mitigation steps, resets, or dynamical operations;
- change the target backend, topology, native gate set, or qubit layout;
- change compiler version, optimization settings, routing settings, or initial layout;
- increase parameter points, observables, repetitions, or shots;
- move from ideal simulation to a noisy simulator or real hardware;
- compare new calibration data or hardware availability; or
- change experiment objectives, such as a tighter statistical error requirement.
Make resource estimation part of the experiment workflow rather than a one-time preflight check. Store compiled circuit summaries with test artifacts, set review thresholds for depth and two-qubit gates, and fail a regression check when a circuit changes unexpectedly. The quantum software testing guide explains how to turn these checks into repeatable CI tests.
Before the next run, use this short checklist:
- Count logical qubits, including ancillas.
- Record logical depth and gate-type counts.
- Compile for the actual target configuration.
- Record compiled depth, total gates, and two-qubit gates.
- Calculate shots and parameter-sweep volume.
- Compare the results with explicit hardware or simulator constraints.
- Save the assumptions so the estimate can be reproduced after the next circuit or platform change.
For a reusable worksheet and a fuller reporting structure, see the quantum resource estimation guide. The numbers will change as circuits, compilers, and backends change, but this workflow remains a practical foundation for benchmarking and research translation.