Skip to content
LEARNING TOOLS · TRANSPARENT MODELS

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?

16 GiB17,179,869,184 bytes for the state array.

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 documentation

Repeated independent trials

How many tries give a chosen chance of observing at least one success?

299 trialsMinimum for the target under this model. Resulting probability: 95.04637% (approximately).

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 distribution
Four more ways to question a number

Follow 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.

Conditional probability

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.

90.09009% true events among positives

Positive-label fraction: 0.999% of all attempts.

Expected counts in 100,000 synthetic attempts
RouteExpected count
True event, positive label900
No true event, positive label99
True event, missed100

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’ formula

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 fair denominator

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.

94.1% overall accuracy

74.5% balanced accuracy under the same class-specific rates.

Overall = w a + (1 − w)b
Balanced = (a + b) / 2

The 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 accuracy

Compare 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.

Sampling scope

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.

0.949158 × the with-replacement standard error

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 correction

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 classical reference

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.

1.617978 optimal model cost

Forward replay: 1.617978. These are arbitrary quadratic cost units.

Inspect every step of the computed trajectory
Synthetic state and control sequence
StepState xControl uCost
01-0.61797751.381896
10.3820225-0.23595510.201616
20.1460674-0.089887640.02941548
30.05617978-0.033707870.004292387
40.02247191-0.011235960.0006312334
5 terminal0.01123596None0.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 equations

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.

Continue with the explanation

Inputs stay in this page. These calculations do not change your saved items or require an account. Model version 1.0.