Products

Uncertainty HubLearning workbenchMENOSSimulation runtimeSTHIRASAI modelQaulium StudioBuild studio
Startup AcceleratorComing soon

Exact, or refused: why MENOS never silently approximates

A simulator that quietly swaps in an approximation when the exact answer gets expensive hands you a number you cannot trust. MENOS refuses the job instead, and tells you why.

There is a tempting move available to any simulator that runs out of room. When the exact answer would not fit in memory or time, it can return a slightly worse answer instead: truncate a few singular values, sample an expectation value rather than compute it, drop a term that looks small. Fewer jobs fail, and the result usually looks fine.

MENOS does not make that move. A result is exact, or it is flagged, or the job is refused.

Why silent approximation is a bug

A simulation result is only as useful as your confidence in it. If you are checking a circuit before running it on hardware, validating a compiler pass, or measuring an algorithm's behaviour, the simulator is the reference. A reference that degrades without telling you is worse than one that fails, because the failure is at least visible.

The cost also falls on the wrong person. Whoever wrote the simulator made a trade-off between accuracy and completion, but the person using it is the one who has to live with that trade-off, without ever being asked.

What "exact" means in MENOS

Exact means no algorithmic approximation: no truncation, no sampled expectation values, no discarded singular values. Arithmetic is still double precision, so results agree with Qiskit's reference simulators to about 1e-16, not to infinite precision.

That rule applies engine by engine:

EngineExactness
DenseExact
StabilizerExact
Pauli propagationExact; refuses a job whose term count cannot be represented
MPSExact by default; feasible only if a rigorous bound on bond dimension fits the budget
Tensor networkExact; contraction does no truncation
Cut and recombineExact; every branch is enumerated, none sampled
Density matrixExact for the noise model you asked for

The one exception is trajectory simulation of noise, which samples by design. You have to ask for it explicitly, and its results come back marked exact = False, with a measured standard error on each expectation value.

Refusal, not degradation

When an exact run does not fit the constraints, MENOS says no:

  • An MPS run whose exact bond-dimension bound exceeds the memory budget is infeasible. It is never truncated to fit.
  • A cut plan refuses any policy that is not exact.
  • A run that overruns its time budget, with no other plan left, raises ResourceExceeded.

Refusals are not bare errors. During planning every candidate engine is priced, and the ones that cannot run are recorded with the reason. When a 100-qubit circuit arrives, for example, the report states that the dense engine was refused because 2¹⁰⁰ amplitudes exceeds the maximum it can address, and that the stabilizer engine was refused because operation 0 is a rotation outside the Clifford group. You can see exactly why each route was closed.

Checking it yourself

Every result carries exact, and it reflects what actually happened during execution, not what the planner expected:

from menos import Circuit, Opcode, RunOptions, run

circuit = Circuit(2, 2)
circuit.append(Opcode.H, [0])
circuit.append(Opcode.CX, [0, 1])
circuit.append_measure(0, 0)
circuit.append_measure(1, 1)

options = RunOptions()
options.shots = 10
options.seed = 1
result = run(circuit, options)

assert result.exact
assert "(exact)" in result.explain()

result.explain() prints the full execution report: every candidate, which one won, and the engine each region ran on.

The approximation that exists, and why you cannot reach it

The C++ core does contain a controlled-accuracy policy. It lets the MPS engine discard singular values below a per-step cutoff, marks the result as approximate, and reports an a-posteriori error bound built from what was actually discarded.

None of that is reachable from Python. There is no flag for it and no fallback into it. If approximation ever becomes available from Python, it will be something you ask for, with a reported error bound, not something that happens to you.

Read more in the exactness and determinism sections of the docs.