FAILURE MAP
← Case archive

FA-90883 / Quantum circuit simulation / Member archive

Marginal probability uses amplitude magnitude not its square · case 03

An unequal superposition such as 0.6|0> + 0.8i|1> is reported as 3/7 and 4/7 instead of 0.36 and 0.64.

Member previewVariant 3 · 3 implementations · 7 checks per implementation

Case contract

Input [n, amps, qubits]; amps are 2**n [re, im] pairs (qubit 0 = LSB), possibly unnormalized. Return the marginal outcome distribution over the listed qubits as {bitstring: probability} where the first listed qubit is the rightmost character, probabilities are normalized by the total squared norm, rounded to 6 decimals after summation, and zero entries are omitted. Errors: "bad-length", "duplicate-qubit", "bad-qubit", "zero-state" (total squared norm <= 1e-12).

Why this case matters

Marginal readout distributions are what users compare against hardware counts; ordering or normalization slips mislabel every histogram.

One recorded failure

Sample boundary fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
regression: random state 3{"00": 0.322876, "01": 0.356776, "10": 0.55845, "11": 0.343112}{"00": 0.157683, "01": 0.192532, "10": 0.471717, "11": 0.178068}Failed

MEMBER ARCHIVE

The complete case is available to members.

This record includes three runnable implementations, regression fixtures, execution results, and source hashes.

Member access is invitation-based. Sign in with your invited account to inspect the sources.

Sign in to the archive ↗