Before submitting a quantum circuit to a simulator or hardware backend, estimate its logical qubits, gate count, circuit depth, mapped physical qubits, and shot budget. This repeatable worksheet shows how to record those inputs, distinguish source-circuit resources from transpiled resources, and compare revisions for variational and oracle-based circuits.
Overview
Quantum circuit resource estimation is not a single number. A useful estimate has several layers because the circuit you write is not always the circuit that runs. High-level gates may be decomposed into native operations, routing gates may be inserted to satisfy hardware connectivity, and measurement requirements may multiply the number of executions.
Use five resource views:
- Logical qubits: the qubits required by the algorithm before hardware mapping.
- Gate count: the number of operations, preferably separated by gate family or type.
- Depth: the length of the longest dependency chain, where gates acting on independent qubits may run in parallel.
- Mapped physical resources: the qubits, gates, and depth after transpilation for a selected target.
- Execution volume: the number of shots, circuit variants, parameter settings, and repeated jobs needed to obtain the result.
Keeping these views separate prevents common mistakes. For example, a circuit with a small logical gate count can acquire substantial routing overhead on a restricted coupling graph. Conversely, increasing the number of gates does not always increase depth if the added operations act in parallel.
For a practical record, save the original circuit, the transpiled circuit, the target assumptions, and the measurement plan together. A circuit visualizer can help inspect barriers, idle periods, entangling layers, and inserted swaps, but visual inspection should be supported by programmatic counts from the SDK or simulator.
How to estimate
1. Count logical qubits
Start with the algorithmic circuit rather than the backend. Count the qubits in the computational register, then add ancillas, flag qubits, workspace registers, and any qubits used to store controls or comparison results. Record whether each ancilla is returned to its initial state or remains entangled until measurement.
Write the result as:
Logical qubits = data qubits + control qubits + workspace qubits + ancillas
Do not count classical bits as qubits. Classical registers affect result storage and post-processing, but not the quantum width.
2. Record gates by family
A total gate count is useful for a quick comparison, but it hides which operations dominate execution. At minimum, record single-qubit gates, two-qubit gates, measurements, resets, and barriers. If the framework exposes them, also record native entangling gates, controlled operations, and operations that require ancillas.
For a source circuit, note both the explicit gates in your program and any composite gates. A controlled unitary, for example, may represent many lower-level operations after decomposition. Use the source count to understand algorithm structure and the transpiled count to estimate what the selected target must execute.
3. Calculate circuit depth
Depth is the number of sequential layers after scheduling independent operations in parallel. A simple worksheet should include:
- Source depth before decomposition.
- Depth after decomposition into the chosen basis or gate set.
- Depth after routing for the target connectivity.
- Scheduled duration, when gate durations and timing information are available.
Depth is often more informative than total gates for circuits affected by decoherence or limited parallelism. Record barriers separately because they can prevent optimizations or scheduling across a boundary. If your workflow uses dynamical decoupling, delays, or active reset, include them in the timing record even when they do not appear as ordinary algorithmic gates.
4. Transpile for a stated target
Logical-to-physical mapping is target-dependent. Select the backend, simulator configuration, basis gates, coupling map, optimization setting, and layout policy before comparing mapped resources. Then record:
- Number of physical qubits allocated.
- Final layout from logical to physical indices.
- Inserted routing operations, such as swaps or their decompositions.
- Transpiled gate counts and depth.
- Any operations rejected, approximated, or rewritten by the toolchain.
Compare like with like. A depth value from an unconstrained simulator should not be presented as a hardware estimate, and a hardware-transpiled circuit should not be compared with a source circuit without labeling the difference.
5. Estimate the shot budget
Shots are repeated circuit executions used to estimate probabilities or expectation values. Begin with the number of distinct circuits and parameter settings, then multiply by shots per circuit:
Total shots = circuit variants × parameter settings × shots per execution
For a bounded observable, a rough standard-error relationship is proportional to 1 / √N, where N is the number of shots. Rearranging gives a planning estimate of N ≈ 1 / e² for a target error scale e, before applying a confidence factor or accounting for observable variance. Treat this as a starting point, not a guarantee. Grouped measurements, covariance, noise, readout mitigation, and post-selection can change the required budget.
For a variational algorithm, include every objective-evaluation circuit. If one optimization step requires several parameter-shift evaluations, the measurement cost is the sum across all those evaluations, not merely the number of ansatz circuits shown in the source code.
Inputs and assumptions
Use the following worksheet for each circuit version. Keeping the fields stable makes revisions easier to audit.
| Field | Value to record | Why it matters |
|---|---|---|
| Algorithm and version | Name, commit, or experiment ID | Links resources to reproducible code. |
| Logical qubits | Data, controls, workspace, ancillas | Defines algorithmic width. |
| Source gates | Total and counts by family | Shows circuit structure before lowering. |
| Source depth | Unmapped layer count | Provides a baseline for optimization. |
| Target | Backend or simulator, basis, connectivity | Makes transpilation results meaningful. |
| Physical qubits | Allocated qubits after mapping | Captures layout overhead. |
| Transpiled gates | Total, one-qubit, two-qubit, routing | Approximates executed work. |
| Transpiled depth | Depth after lowering and routing | Helps assess sequential exposure to noise. |
| Measurements | Observables, bases, classical outputs | Determines circuit variants. |
| Shots | Per circuit and total | Sets statistical precision and workload. |
State assumptions explicitly. Examples include whether measurements are included in depth, whether barriers are preserved, whether reset operations are counted, and whether a simulator uses an ideal or noisy model. For hardware planning, also record whether error mitigation, calibration circuits, readout correction, or repeated runs are part of the experiment. These additions can increase execution volume even when the algorithmic circuit is unchanged.
When comparing SDK reports, check terminology carefully. “Operations,” “instructions,” “gates,” and “two-qubit gates” may not represent identical categories. Prefer a small custom counting script or a documented reporting method, and preserve the tool version with the result. For broader workflow context, see the engineering checklist for moving a quantum research prototype into a hybrid application.
Worked examples
Example 1: a variational circuit
Suppose an ansatz uses 6 data qubits, no extra ancillas, and 3 repeated layers. Each layer contains one parameterized rotation on every qubit followed by a chain of five entangling operations. The logical width is therefore 6 qubits. If the rotations can run in parallel and the entangling chain is scheduled sequentially, the approximate source depth per layer is two layers, giving an approximate source depth of six, subject to the exact gate order and parameterization.
Now assume the optimizer evaluates one energy expectation using four measurement groups and requires eight parameter-shift evaluations plus one unshifted evaluation. The planning count is:
9 evaluations × 4 measurement groups = 36 circuit variants per optimization step
At 1,000 shots per variant, the step requires approximately 36,000 shots before any additional calibration or mitigation circuits. If the optimizer performs 50 steps, the basic estimate becomes 1.8 million shots. This is not a prediction of runtime; it is an execution-volume estimate that can be revised when grouping, gradients, stopping criteria, or shot allocation changes.
After transpilation, record whether the entangling chain maps directly to the target connectivity. If it does not, inserted routing operations may increase both two-qubit gate count and depth. A useful comparison table is:
| Version | Logical qubits | Source depth | Mapped depth | Total shots per step |
|---|---|---|---|---|
| Baseline ansatz | 6 | 6 | Record after transpilation | 36,000 |
| Reduced entangling pattern | 6 | Record revised value | Record after transpilation | Recalculate |
Example 2: an oracle-based circuit
Consider an oracle that uses 4 input qubits, 1 output qubit, and 2 work qubits. Its logical width is 7. The source circuit may contain a compact multi-controlled operation, but the target execution requires that operation to be decomposed. Record both descriptions: the source-level oracle gates explain the algorithm, while the decomposed count explains the expected workload.
If the oracle is placed inside a phase-estimation or amplitude-amplification routine, count how many times it and its inverse are called. A single oracle depth estimate is insufficient when the complete algorithm invokes the oracle repeatedly. Use:
Total oracle applications = forward calls + inverse calls + controlled or repeated calls
Then estimate the total circuit depth as the depth of each block multiplied by its number of sequential applications, with any parallel blocks subtracted from the schedule where appropriate. For small circuits, a statevector or noisy simulator can validate the count and reveal whether decomposition introduces unexpected ancillas or routing. A simulator comparison workflow can help separate ideal circuit complexity from noise-model effects; see the guide to benchmarking statevector, tensor-network, and noisy simulators.
When to recalculate
Recalculate the worksheet whenever an input that affects execution changes. The most important triggers are:
- Code changes: a new ansatz layer, oracle implementation, ancilla strategy, measurement grouping, or optimizer evaluation rule.
- Target changes: a different backend, coupling map, basis, layout, optimization level, or simulator method.
- Transpiler updates: decomposition, routing, scheduling, or optimization behavior may change the mapped circuit.
- Precision changes: a tighter observable error target or confidence requirement increases the shot estimate.
- Experiment changes: error mitigation, calibration circuits, post-selection, or repeated statistical trials add execution volume.
- Benchmark movement: revised runtime, queue, or usage assumptions change practical cost estimates, even if the circuit itself is unchanged.
Run a formal review at least every six months for a maintained project, and review immediately before an important hardware submission. Save a new worksheet rather than overwriting the old one. This creates a resource trend: logical width, mapped width, two-qubit count, depth, and shots can be compared across circuit revisions.
Before submitting, use this short checklist:
- Count logical qubits, including workspace and ancillas.
- Record source gate counts and source depth.
- Transpile for the stated target and save the final layout.
- Record physical qubits, routing gates, two-qubit gates, and mapped depth.
- List every measurement group and parameter evaluation.
- Calculate shots per circuit and total shots.
- Document assumptions about noise, mitigation, scheduling, and confidence.
- Compare the result with the previous circuit version.
Resource estimation becomes most useful when treated as a versioned engineering artifact rather than a one-time guess. Use the worksheet before each run, inspect the circuit visually, verify the numbers programmatically, and investigate any increase in mapped depth or shot volume before committing execution time.