Quantum resource estimation turns an abstract algorithm into an engineering plan. This guide shows how to estimate logical and physical qubits, circuit depth, gate counts, executions, runtime, and cloud cost using a repeatable worksheet that can be applied before comparing backends or starting a proof of concept.
Overview
The question how many qubits do I need? rarely has a single answer. A useful estimate depends on the algorithm, data encoding, error-correction model, target accuracy, circuit implementation, execution strategy, and hardware or simulator chosen. A circuit that appears small at the algorithm level may require more operations after transpilation, while a short circuit repeated thousands of times can consume more execution time than a deeper circuit run only a few times.
Resource estimation is therefore best treated as a range rather than a fixed promise. Start with an algorithm-level estimate, refine it with the chosen software development kit and transpiler, then validate the result against the limits and pricing model of a target service.
Keep logical and physical resources separate:
| Resource | Meaning | Why it matters |
|---|---|---|
| Logical qubits | Ideal, error-corrected information units required by the algorithm | Describes the computational problem without hardware overhead |
| Physical qubits | Hardware qubits used to represent logical qubits and support error correction | Determines whether a fault-tolerant implementation is feasible on a given architecture |
| Circuit depth | Number of sequential operation layers | Indicates exposure to noise and contributes to execution duration |
| Gate count | Total operations, often separated by gate type | Helps assess compilation overhead and error exposure |
| Shots | Repeated circuit executions used to estimate measurement probabilities | Often dominates workload volume for sampling-based algorithms |
| Runtime and cost | Time and provider consumption associated with all executions | Supports backend selection and business-case decisions |
A credible estimate records all of these dimensions instead of reporting only a qubit count.
How to estimate
1. Define the computational target
Write down what the circuit must produce and how accurate the result needs to be. A single expectation value, a probability distribution, an optimisation answer, and a sampled classification output have different measurement requirements. Specify the acceptable statistical error, confidence target if relevant, and whether error mitigation or post-processing is part of the design.
2. Count the algorithm-level qubits
List the data, work, ancilla, output, and any reusable register qubits. The initial logical-qubit estimate can be expressed as:
Logical qubits = data qubits + work qubits + ancilla qubits + output qubits
Do not automatically add a new register for every stage. Some work qubits can be uncomputed and reused, but that reuse may increase circuit depth. Record both the minimum qubit design and any higher-qubit design that reduces depth.
3. Measure the untranspiled circuit
Capture total gates, two-qubit gates, measurement operations, depth, and width from the circuit generated by your algorithm. Two-qubit operations deserve particular attention because connectivity, calibration, and compilation can make them more expensive or difficult to execute than single-qubit operations.
4. Transpile for a candidate backend
Run the circuit through the target SDK and backend-specific compilation settings. Record the output width, depth, total gate count, two-qubit gate count, inserted routing operations, and any circuit rejection caused by backend limits. Repeat this for each serious backend candidate; a hardware-neutral circuit metric is not enough for a final decision.
5. Estimate the number of executions
For a simple sampling workload:
Total executions = number of circuit variants × shots per variant × repetitions
Variations may come from parameter sweeps, optimisation iterations, measurement bases, error-mitigation settings, or separate validation runs. For a hybrid quantum-classical workflow, include the number of optimiser steps and the circuits submitted at each step. If the circuit is evaluated at 40 parameter settings, uses 2,000 shots per setting, and is repeated for 25 optimisation steps, the baseline volume is 2,000,000 circuit shots before validation or mitigation overhead.
6. Convert executions into runtime
A practical first model is:
Quantum runtime ≈ total executions × (circuit duration + readout/reset overhead) + submission overhead
Circuit duration is influenced by the transpiled depth and the duration of its operations. Submission overhead includes batching, job creation, result retrieval, and any time spent waiting in a queue. Queue time is operational elapsed time, not necessarily active device time, so report it separately rather than hiding it in the circuit estimate.
7. Convert runtime into cost
Use the provider's current pricing definition only after identifying what is billable. Depending on the service, the relevant unit may be task execution, machine time, shots, simulator usage, or a subscription allocation. A general model is:
Estimated cost = billable quantum usage × applicable rate + classical compute cost + storage or transfer cost
Enter the actual rate from the provider's current documentation in your worksheet. If the rate, included allowance, or access model is unknown, show a scenario range instead of inventing a price.
Inputs and assumptions
Use one row per experiment or circuit family. The following worksheet fields are enough for an initial enterprise estimate:
- Algorithm and version: Identify the code commit or notebook version so later changes can be compared.
- Problem size: Record the number of variables, data points, graph nodes, Hamiltonian terms, or other workload dimensions.
- Logical width: Separate data, work, ancilla, and output qubits.
- Transpiled width: Capture the backend-specific physical circuit width.
- Depth and gate counts: Record total depth, single-qubit gates, two-qubit gates, measurements, and inserted routing operations.
- Shots and variants: Include shots per circuit, parameter settings, measurement bases, and repetitions.
- Accuracy target: State the statistical or application-level tolerance.
- Mitigation overhead: Include extra circuits, folding factors, calibration runs, or post-processing where applicable.
- Runtime assumptions: Note operation duration, reset, readout, batching, queue, and retry assumptions.
- Backend constraints: Record maximum width, supported operations, connectivity, job limits, and any execution restrictions that affect the estimate.
- Cost inputs: Record the date checked, billing unit, rate, allowance, and whether classical resources are included.
Keep three confidence levels: minimum for the smallest valid circuit, expected for the planned implementation, and stress case for extra shots, retries, mitigation, or a larger problem instance. This is more useful for budgeting than a single precise-looking number.
Worked examples
Example 1: A sampling circuit
Suppose a circuit uses 12 logical qubits, has 12 measured outputs, and is transpiled to 14 physical qubits on a candidate backend. The transpiled circuit has depth 180 and includes 260 two-qubit operations. You plan to run one circuit with 5,000 shots and repeat the experiment across three independent seeds.
The workload estimate is:
- Logical width: 12 qubits
- Transpiled width: 14 qubits
- Total executions: 5,000 × 3 = 15,000 shots
- Two-qubit operations per shot: 260
- Total two-qubit operations: 260 × 15,000 = 3,900,000 operation instances
The final figure is not a prediction of useful results. It is a workload description. You must next measure or obtain the backend's operation and readout timing, then add submission and queue assumptions. If the result is too noisy, increasing shots may improve statistical precision but will increase runtime and cost; it does not automatically correct hardware error.
Example 2: A hybrid optimisation loop
Consider a variational algorithm with 8 measurement settings, 1,500 shots per setting, and 60 optimiser iterations. Assume each iteration evaluates the same eight settings once, followed by a final validation run using twice the normal shots.
The optimisation volume is:
8 × 1,500 × 60 = 720,000 shots
The validation volume is:
8 × 3,000 = 24,000 shots
The estimated total is therefore 744,000 shots, before accounting for gradient circuits, parameter-shift evaluations, error-mitigation variants, failed jobs, or warm-up experiments. If the implementation uses parameter-shift gradients, count the additional shifted circuits explicitly rather than treating each optimiser iteration as one execution.
Example 3: Logical versus physical planning
An algorithm may require 20 logical qubits and a maximum logical depth of 500 operations. A fault-tolerant design would need an error-correction overhead that depends on the code, physical error rates, target logical error rate, connectivity, and implementation details. Without those inputs, it is not responsible to convert 20 logical qubits into a definitive physical-qubit number. Instead, record the logical requirement, define a physical-overhead model, and present several scenarios. This distinction prevents near-term hardware capacity from being confused with future fault-tolerant requirements.
When to recalculate
Recalculate the estimate whenever an input that affects width, execution volume, runtime, or billing changes. In practice, that includes a new algorithm version, a larger problem size, a different SDK or compiler release, changed transpiler settings, a new backend, altered connectivity, a revised shot or accuracy target, and the addition of error mitigation or validation experiments.
Pricing and access assumptions also need a deliberate review. Check them before approving a proof of concept, comparing providers, or presenting a budget. Hardware specifications, supported operations, job limits, queue behaviour, and provider billing models can change independently of your application code. Record the date of every pricing and hardware check.
For an actionable review, create a small resource-estimation report containing the circuit source version, backend name, transpiler configuration, pre- and post-transpilation metrics, shots, number of variants, runtime formula, cost inputs, and minimum/expected/stress scenarios. Run the report in CI or as part of each experiment review. Then compare the observed execution time, rejected jobs, output quality, and final spend with the estimate. The gap between forecast and observation is itself a useful engineering metric.
Before choosing a first backend, pair this worksheet with a broader quantum cloud platform decision guide. For noisy workloads, review how error mitigation changes execution overhead. A repeatable estimate will not remove uncertainty, but it will make that uncertainty visible and give your team a defensible basis for its next quantum computing proof of concept.