Quantum circuit resource estimation helps you decide whether an algorithm is suitable for a simulator, a cloud backend, or a hardware experiment before spending time and execution budget. This guide provides a repeatable worksheet for counting qubits, gates, depth, shots, memory, runtime, and noise-related overhead, with small examples you can adapt to Qiskit, Cirq, PennyLane, or another quantum SDK.
Overview
A circuit that uses 10 qubits and 100 gates may be easy to simulate in one representation but difficult to execute reliably on hardware. The useful question is therefore not simply “How many qubits does this algorithm need?” It is “What resources will this compiled circuit require on this target platform, and what result quality can I expect?”
Resource estimation separates the problem into several related measurements:
- Logical qubits: The qubits specified by the algorithm before hardware mapping or error correction.
- Physical qubits: The hardware qubits occupied after mapping, routing, ancilla allocation, and any error-correction overhead.
- Gate counts: The number of operations, usually separated into one-qubit and two-qubit gates.
- Circuit depth: The number of sequential layers after operations that can run in parallel are grouped together.
- Shots: The number of repeated circuit executions used to estimate measurement probabilities or expectation values.
- Memory and runtime: The resources required by a simulator or the elapsed execution time on a hardware platform.
- Noise overhead: Additional repetitions, mitigation circuits, calibration work, or error-correction resources needed to obtain a useful result.
These metrics should be recorded both before and after compilation. The original circuit describes algorithmic intent; the transpiled or compiled circuit describes what the selected backend will actually execute. A practical Qiskit transpilation guide can help explain why those two versions differ.
How to estimate
Use the following workflow for every algorithm-and-backend combination.
- Define the experiment. Record the input size, circuit parameters, measured observables, expected accuracy, and whether the target is a statevector simulator, shot-based simulator, or hardware device.
- Count logical resources. Measure the algorithm’s qubit count, total gates, one-qubit gates, two-qubit gates, measurements, and uncompiled depth.
- Compile for the target. Apply the SDK’s target-specific compilation or transpilation process. Capture the mapped qubit count, routed two-qubit gates, inserted swaps, native gates, and final depth.
- Estimate shots. Choose a preliminary shot count based on the precision required. Treat this as an experimental parameter rather than a universal constant: variational algorithms, probability sampling, and rare-event measurements have different needs.
- Estimate simulator memory. For a full statevector, the state contains complex amplitudes for every computational basis state. A rough planning expression is
memory ≈ 2^n × bytes per complex amplitude, wherenis the number of simulated qubits. The actual footprint is higher once buffers, framework objects, and parallelization overhead are included. - Estimate execution time. Separate circuit generation, compilation, queue or submission delay, device execution, measurement, and result retrieval. For repeated workloads, use
total work ≈ number of circuits × shots per circuitas a first comparison, then replace the estimate with measured timing. - Compare predicted and measured results. Record actual depth, gate counts, wall-clock time, queue delay, success metrics, and failure modes. Resource estimation becomes more accurate when it is calibrated against the same backend and workload shape.
For variational algorithms, count the number of circuit evaluations as well as the depth of each circuit. A single optimization step may evaluate several parameter settings, and each expectation value may require separate measurement circuits or repeated shots. The same principle applies to a QAOA Max-Cut workflow or a VQE implementation in Python.
Inputs and assumptions
A useful worksheet should make assumptions visible instead of hiding them inside a single runtime number. Create one row for each circuit or measurement task and include these fields:
| Field | What to record |
|---|---|
| Algorithm and input size | For example, graph vertices, Hamiltonian terms, search space, or number of data features. |
| Logical qubits | Algorithm qubits, ancillas, index registers, and temporary workspace. |
| Compiled qubits | Mapped hardware qubits and any ancillas added by the compiler or workflow. |
| Gate counts | Total gates, one-qubit gates, two-qubit gates, measurements, and inserted routing operations. |
| Depth | Logical depth and target-specific compiled depth. |
| Shots | Shots per circuit, number of circuits, and total shot executions. |
| Simulator mode | Statevector, shot-based, stabilizer, tensor-network, or another method, including precision assumptions. |
| Hardware assumptions | Connectivity, native gate set, calibration context, queue behavior, and execution limits that are relevant to the estimate. |
| Quality target | Allowed statistical error, success probability, expectation-value tolerance, or application-specific threshold. |
Do not treat logical depth as a hardware runtime estimate. A circuit with all-to-all connectivity may acquire extra swap operations when placed on a device with restricted couplings. Two-qubit gates are especially important to track because routing and noise can make them more consequential than a similar number of single-qubit operations. Review the quantum hardware connectivity guide before finalizing a backend assumption.
For simulators, match the simulation method to the circuit. A statevector estimate is sensitive to the total number of qubits, while a shot-based or tensor-network method may depend more strongly on circuit structure, entanglement, and requested shots. The quantum simulator comparison provides a framework for making that distinction.
Worked examples
Example 1: A two-qubit Bell circuit
Consider a circuit that applies a Hadamard gate to qubit 0, a controlled-NOT from qubit 0 to qubit 1, and then measures both qubits. Before compilation, the worksheet might contain:
- Logical qubits: 2
- One-qubit gates: 1
- Two-qubit gates: 1
- Logical depth: 2 computational layers, excluding measurement
- Measurements: 2
- Shots: an illustrative 1,000 repetitions for a stable demonstration histogram
The 1,000-shot value is an example assumption, not a required standard. If the circuit is mapped to a backend where the two qubits are directly connected, the compiled circuit may remain close to this form. If they are not adjacent in the hardware connectivity graph, routing can add operations and increase depth. Record both outcomes rather than reporting only the original two-gate circuit.
Example 2: A small QAOA-style workload
Suppose a Max-Cut experiment uses four logical qubits, one cost layer, one mixer layer, and three parameter-update iterations. Assume the cost and mixer layers produce one circuit per parameter evaluation, and that each evaluation uses 2,000 shots. If the optimizer requires four parameter evaluations per iteration, the first planning estimate is:
total circuits = 3 iterations × 4 evaluations = 12 circuitstotal shots = 12 circuits × 2,000 shots = 24,000 shot executions
This is a workload estimate, not a prediction of quality. If each objective evaluation requires multiple measurement bases, multiply the circuit count accordingly. If error mitigation creates additional variants, include those variants as separate circuits. Then estimate compiled depth and two-qubit gate count for each circuit family, because the cost layer may be substantially different from the mixer layer.
For a hardware run, add a separate note for queue time, calibration or initialization behavior, and any provider-specific execution constraints. Keep those values as configurable inputs so a change in platform does not require rebuilding the worksheet.
When to recalculate
Recalculate the estimate whenever an input that affects execution changes. At minimum, revisit it when:
- The algorithm’s problem size, ansatz, search depth, or number of optimization steps changes.
- The SDK version, compiler settings, optimization level, or target gate set changes.
- The selected backend changes connectivity, available qubits, native operations, or execution limits.
- The shot count, measurement strategy, precision target, or error-mitigation method changes.
- Simulator settings change, including precision, parallelism, or simulation method.
- Provider pricing, quotas, submission rules, or billing units change. Verify current values directly in the provider’s documentation rather than copying an old estimate.
- A measured benchmark shows that queue time, compilation time, runtime, or result quality differs materially from the model.
Before a new run, copy this checklist into your project documentation:
- Save the logical circuit and its input size.
- Compile with the intended target and save the compiled circuit.
- Record logical and compiled qubits, depth, gate categories, and routing operations.
- Calculate circuits multiplied by shots, including measurement groups and mitigation variants.
- Choose a simulator memory estimate or hardware timing estimate with assumptions stated.
- Run a small benchmark, compare measured results with the estimate, and update the worksheet.
Resource estimation is most useful as a living engineering artifact. Keep separate estimates for algorithmic resources, compiled resources, and observed resources. That separation makes it easier to identify whether a problem comes from circuit design, hardware connectivity, statistical sampling, simulator limits, or platform execution behavior.