Quantum Circuit Resource Estimation: How to Calculate Qubits, Depth, Gates, and Shots
quantum circuitsresource estimationcircuit depthqubit planningexperiment design

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

QQuantum 365 Editorial Team
2026-11-04
7 min read

Learn how to estimate qubits, gates, depth, shots, runtime, and execution constraints before running a quantum circuit.

Quantum circuit resource estimation turns an idea into a testable experiment. This guide shows how to estimate the qubits, gates, circuit depth, repetitions, runtime, and practical constraints of a circuit before choosing a simulator or quantum processor.

Overview

A circuit can be mathematically valid but still unsuitable for the device or workflow you intend to use. A useful resource estimate answers five questions:

  • How many logical and physical qubits are required?
  • How many gates are applied, and what types are they?
  • What is the circuit depth after compilation?
  • How many measurement shots are needed?
  • What execution time, memory, or access cost should be expected?

These figures are related, but they are not interchangeable. A circuit with many gates may have modest depth if operations run in parallel. Conversely, a circuit with a small gate count can be difficult to execute if its gates must be performed sequentially or require long-range interactions.

It is also important to distinguish logical resources from compiled or physical resources. A high-level algorithm may use an abstract two-qubit gate between any pair of qubits. A hardware compiler may need to add routing operations, decompose that gate into native operations, or insert scheduling delays. The compiled circuit is the better basis for a hardware decision.

For background on terms such as qubits, depth, fidelity, and error rates, see the Quantum Computing Glossary. Resource estimates should complement, not replace, an understanding of the device's connectivity, noise, and measurement behaviour.

How to estimate

1. Define the experiment boundary

Start by writing down what one experiment includes. Does it cover state preparation, the algorithm, measurement, and classical post-processing? If the circuit is part of a variational algorithm, are you estimating one circuit evaluation or the complete optimisation loop?

For an iterative workload, use:

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

If several parameter settings or data batches are evaluated, include them as separate circuit executions. This prevents a single-circuit estimate from being mistaken for the cost of the full application.

2. Count the qubits

Record the algorithm's data qubits, ancilla qubits, work registers, index registers, and any qubits used for flags or arithmetic. The logical requirement is usually the maximum number of qubits alive at the same time, not the total number mentioned throughout the source code.

For example, if a temporary register is uncomputed and reused, it may not increase the peak qubit count. If qubits are retained for mid-circuit measurement, feed-forward, or error correction, however, they remain part of the resource plan.

3. Count gates by type

Separate one-qubit gates, two-qubit gates, measurements, resets, barriers, and any special operations supported by the target platform. Gate counts are most useful when reported both before and after compilation.

A practical worksheet can use these columns:

ResourceLogical circuitCompiled circuitNotes
Peak qubitsInclude ancillas and temporary registers
One-qubit gatesRecord native basis gates where possible
Two-qubit gatesOften a key noise indicator
MeasurementsCount measured qubits and measurement points
DepthReport total and two-qubit depth if available
ShotsState the precision target

4. Calculate depth

Circuit depth is the number of sequential layers after operations that can run in parallel have been grouped. A simple circuit with alternating single-qubit and entangling layers can often be described as:

Depth ≈ preparation layers + algorithm layers + measurement-related operations

This is only an initial estimate. Compilation can increase depth because of connectivity constraints, gate decomposition, scheduling, dynamical decoupling, or inserted error-management operations. Report the depth produced by the actual compiler configuration whenever you are planning hardware execution.

5. Estimate shots

Quantum computing shots are repeated executions of the same circuit. One shot produces one sampled measurement result. More shots generally improve the stability of estimated probabilities, expectation values, or counts, but the required number depends on the observable and the precision you need.

Use a stated target rather than choosing a round number without explanation. For example:

  • For a basic circuit demonstration, a smaller exploratory shot count may be sufficient.
  • For comparing two circuit variants, use the same shot policy for both unless the experiment explicitly studies sampling efficiency.
  • For expectation-value estimation, allocate shots across measured terms and record that allocation.
  • For rare outcomes, plan for enough repetitions to observe the event reliably rather than assuming that a short run will reveal it.

When several observables are measured separately, the total shot count is the sum across those measurement settings. Grouping compatible observables can reduce executions, but it may change measurement circuits and post-processing requirements.

Inputs and assumptions

A resource estimate is only as useful as its assumptions. Record the following inputs alongside every estimate:

  • Algorithm version: note the circuit source, parameters, data size, and whether ancillas are reused.
  • Compilation target: specify the simulator, gate set, connectivity model, and optimisation settings.
  • Execution mode: distinguish statevector simulation, shot-based simulation, noisy simulation, and hardware execution.
  • Precision goal: define the acceptable uncertainty or the decision the result must support.
  • Measurement layout: list observables, basis rotations, grouping, and the number of distinct measurement circuits.
  • Classical work: include parameter updates, result aggregation, error mitigation, and data transfer if they affect runtime.

Simulator requirements can differ sharply from hardware requirements. A statevector simulator's memory requirement grows rapidly with the number of simulated qubits, even when the circuit has relatively few gates. A shot-based simulator may avoid storing every amplitude but still incur significant work for a deep circuit or a large number of repetitions. A noisy simulator can add further overhead depending on the noise model.

Hardware execution adds queueing, calibration windows, compilation, readout, reset, and provider-specific execution rules. Avoid treating a gate count as a direct price or time estimate unless the selected platform documents how those resources are charged or scheduled. Provider limits and pricing can change, so verify them immediately before execution.

Framework resource-reporting functions are useful, but their output depends on the circuit representation and compilation target. Check whether a tool reports logical gates, native gates, scheduled duration, or only operations visible in the current intermediate representation.

Worked examples

Example 1: a small entanglement circuit

Suppose a two-qubit demonstration prepares one qubit in superposition, applies one entangling operation, and measures both qubits. The logical worksheet might show:

  • Peak qubits: 2
  • One-qubit gates: 1, plus any basis-change operations
  • Two-qubit gates: 1
  • Measurement operations: 2
  • Logical depth: a small number of sequential layers

The compiled result may contain additional native operations if the target does not support the abstract entangling gate directly. This is a good example of why a teaching circuit can be easy to simulate while still requiring a compiled check before hardware execution.

Example 2: a variational circuit

Consider a variational circuit with n data qubits, L repeated layers, and one measurement setting per parameter evaluation. If each layer contains one rotation per qubit and one entangling operation per connection, the first estimate is:

  • Peak qubits: n, plus any ancillas
  • One-qubit gates: approximately n × L, before parameterisation details and compilation
  • Two-qubit gates: connections per layer × L
  • Executions: optimisation iterations × shots

If the objective uses multiple Pauli terms, replace one measurement setting with the number of distinct settings after grouping. If the optimiser evaluates several parameter points per iteration, multiply by those evaluations too. The resulting execution count can be much larger than the circuit count shown in a single source file.

Example 3: simulator versus hardware

For a simulator, first estimate peak qubits and the number of circuit repetitions. Then check whether the selected simulation method supports the qubit count, noise model, and memory budget. For hardware, compile to a specific target and record the resulting two-qubit gate count, depth, connectivity-related routing, measurement settings, and shot total.

Run a small pilot using the same measurement and compilation configuration. Compare observed counts, execution duration, and result variance with the worksheet. If results are unstable, inspect measurement handling and circuit construction using the workflow in How to Debug Quantum Circuits.

When to recalculate

Recalculate before every meaningful change to the experiment, not only when the algorithm changes. In particular, revisit the estimate when:

  • the number of input features, data points, layers, or observables changes;
  • ancillas are added, removed, or reused differently;
  • the target hardware, simulator, native gate set, or connectivity changes;
  • compiler optimisation settings or transpilation passes change;
  • measurement grouping, error mitigation, or shot allocation is updated;
  • the precision target or statistical confidence requirement changes;
  • provider limits, execution rules, benchmarks, or pricing inputs are revised.

Keep two versions of the worksheet: a logical estimate for algorithm design and a compiled estimate for execution planning. Add the date, software versions, target configuration, and assumptions. This makes comparisons between circuit optimisations meaningful and gives collaborators enough information to reproduce the estimate.

A practical go/no-go checklist is simple: confirm that the peak qubit count fits the target, the compiled depth and two-qubit count are defensible for the noise level, the shot budget matches the precision goal, and the simulator or hardware workflow can accommodate the full execution count. If any answer is unclear, reduce the problem size or run a smaller pilot first. For a broader introduction to quantum programming and study sequence, use the quantum computing learning path for beginners, then return to this worksheet as your circuits become more demanding.

Related Topics

#quantum circuits#resource estimation#circuit depth#qubit planning#experiment design
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.