FAILURE MAP
← Case archive

FA-90900 / Quantum circuit simulation / Member archive

Marginal rounds the numerator before normalizing · case 05

Unnormalized states produce probabilities such as 0.3076923076 with many digits instead of values rounded to 6 decimals.

Member previewVariant 5 · 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 13{"000": 0.08257408326848203, "001": 0.1764651784919149, "010": 0.22074095782793463, "011": 0.13956556713404225, "100": 0.06438947913107607, "101": 0.08084274283439259, "110": 0.2220309505114279, "111": 0.013391040800729672}{"000": 0.082574, "001": 0.176465, "010": 0.220741, "011": 0.139566, "100": 0.064389, "101": 0.080843, "110": 0.222031, "111": 0.013391}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 ↗