Put the numbers in context.
Explore six teaching models. Change the inputs while keeping the assumptions and limits beside each result.
Statevector memory
How much memory does one dense quantum state array require on a classical computer?
The model
Memory = 16 × 2n bytes
Each extra qubit doubles this array. At 30 qubits the model gives 16 GiB. At 31 it gives 32 GiB. A GiB is 1,073,741,824 bytes.
A dense density matrix instead stores 4ⁿ complex entries. At the same 16 bytes per entry, 15 qubits require 16 GiB for that array, the same raw storage as a 30-qubit statevector. Each added density-matrix qubit quadruples storage. This comparison does not change the calculator’s statevector representation or its supported 0–60 range.
For structured alternatives and the distinction between exact probabilities and sampled counts, read how to choose a simulator.
Real simulators need additional working memory. Other methods can use very different amounts. This does not estimate a quantum computer’s physical memory, speed or cost.
Model basis: Qiskit Aer documentationRepeated independent trials
How many tries give a chosen chance of observing at least one success?
The model
P(at least one success) = 1 − (1 − p)n
With a 1% success probability, 299 independent tries reach a 95% target. With 298 tries the probability remains below 95%.
The probability must be known and unchanged between independent trials. Correlated errors or drift break those assumptions. This is not statistical confidence or an estimate of quantum advantage or error-correction resources.
Model basis: NIST binomial distributionFollow the denominator and the assumptions.
Explore a positive signal’s meaning, a misleading average, the limits of a survey and a complete classical control reference. Every example uses declared synthetic inputs.
A positive signal needs a base rate.
A detector can find most true events while many of its positive signals are false. Count the routes to a positive label before interpreting a herald or a classifier result.
Positive-label fraction: 0.999% of all attempts.
| Route | Expected count |
|---|---|
| True event, positive label | 900 |
| No true event, positive label | 99 |
| True event, missed | 100 |
The calculation
P(true | positive) = πt / [πt + (1 − π)f]With π = 0.01, t = 0.9 and f = 0.001, 900 true positives compete with 99 false positives per 100,000 attempts. The true-event fraction is 90.09009%. Raising only f to 0.01 produces 990 false positives and lowers that fraction to 47.61905%.
The event classes and conditional rates are stipulated and stationary. This does not infer a quantum-state fidelity from a detector confusion matrix. An unknown prevalence or changing threshold needs additional evidence. When the model produces no positive labels, the conditional fraction is undefined.
Mathematical context: NIST on Bayes’ formulaOriginal synthetic teaching example. Inputs stay on this page. The result is a mathematical model, with no device measurements, experimental replication or quantum-performance claim. Formulas and baseline examples remain readable without JavaScript.
An overall score can hide a weak class.
Hold each class’s correct fraction fixed, then change how common the classes are. Ordinary accuracy changes with that mix. Balanced accuracy gives the two class recalls equal weight.
74.5% balanced accuracy under the same class-specific rates.
Overall = w a + (1 − w)b
Balanced = (a + b) / 2The baseline is 0.9 × 0.99 + 0.1 × 0.5 = 94.1% overall. Balanced accuracy is 74.5%. Making A 99% of the population increases overall accuracy to 98.51% while both class recalls remain unchanged.
Both metrics omit error costs and probability calibration. An equal-class objective is a reporting choice. If a class is absent from a real evaluation set, its recall cannot be estimated from that set; this model instead stipulates both class rates.
Definition: scikit-learn balanced accuracyCompare workload-mix reversals in the decision labs →
Original synthetic teaching example. Inputs stay on this page. The result is a mathematical model, with no device measurements, experimental replication or quantum-performance claim. Formulas and baseline examples remain readable without JavaScript.
A census answers a bounded question.
Sampling without replacement from one fixed, finite population changes sampling uncertainty. It does not make that population representative of a different or future population.
A dimensionless factor for the stated finite-population model.
Factor = √[(M − n) / (M − 1)]For M = 1,000 and n = 100, the factor is 0.949158. Applied to a with-replacement standard error of 0.01, it gives 0.00949158. Sampling all 1,000 makes the finite-population sampling variance zero.
The comparison uses the Bernoulli with-replacement standard error √[p(1 − p)/n] with p defined by this fixed population. It assumes a simple random sample without replacement. Coverage gaps, measurement errors and changes after the snapshot remain, even in a census.
Context: NIST finite-population correctionOriginal synthetic teaching example. Inputs stay on this page. The result is a mathematical model, with no device measurements, experimental replication or quantum-performance claim. Formulas and baseline examples remain readable without JavaScript.
Solve a small control problem completely.
For the scalar dynamics xₜ₊₁ = axₜ + buₜ, choose controls to minimize the sum of qxₜ² + ruₜ² over H steps plus a terminal penalty Pₕxₕ². Backward dynamic programming gives the solution; a forward replay checks its cost.
Forward replay: 1.617978. These are arbitrary quadratic cost units.
Inspect every step of the computed trajectory
| Step | State x | Control u | Cost |
|---|---|---|---|
| 0 | 1 | -0.6179775 | 1.381896 |
| 1 | 0.3820225 | -0.2359551 | 0.201616 |
| 2 | 0.1460674 | -0.08988764 | 0.02941548 |
| 3 | 0.05617978 | -0.03370787 | 0.004292387 |
| 4 | 0.02247191 | -0.01123596 | 0.0006312334 |
| 5 terminal | 0.01123596 | None | 0.0001262467 |
Pₜ = q + a²Pₜ₊₁ − (abPₜ₊₁)² / (r + b²Pₜ₊₁)
Kₜ = abPₜ₊₁ / (r + b²Pₜ₊₁)
uₜ = −Kₜxₜ; J* = P₀x₀²With all coefficients and x₀ set to 1 and H = 5, P₀ = 144/89, so the optimal cost is approximately 1.617978. The code evaluates an algebraically equivalent recurrence to reduce subtraction error.
This is a fully observed, deterministic, unconstrained scalar problem. State and terminal penalties are nonnegative and the control penalty is positive. Real constraints, observation noise and large-scale data-access costs are excluded. A solved teaching example does not validate a quantum control algorithm.
Derivation context: MIT’s discrete-time Riccati equationsOriginal synthetic teaching example. Inputs stay on this page. The result is a mathematical model, with no device measurements, experimental replication or quantum-performance claim. Formulas and baseline examples remain readable without JavaScript.
Continue with the explanation
- Hybrid quantum computing: understand where a classical simulator or a quantum processor fits into a workflow.
- Physical and logical qubits: understand why error correction needs a different resource model.
Inputs stay in this page. These calculations do not change your saved items or require an account. Model version 1.0.