{"abstract":"A pure product qubit such as |+> reports purity 0.5 instead of 1.","category":"Quantum circuit simulation","checks":7,"contract":"Input [n, amps, keep]; trace out every qubit except keep (0 = LSB) from the pure state and return {\"rho\": 2x2 matrix of [re, im] entries with rho[r][c] = sum psi_r psi_c^*, trace-normalized, \"purity\": sum |rho_rc|^2}, all rounded to 6 decimals.","evaluation_group":"w2-quantum_circuit_simulation-reduced-density-matrix","failed_approach":"The attempted repair sums all entries but forgets to square the magnitudes.","family":"w2-quantum_circuit_simulation-reduced-density-matrix-purity-coherence-terms","id":"FA-91116","implementations":{"attempt":{"sha256":"cd26db595356ad4e780853059076ccd176f1916d1cf3411bc5bdc3cda8cb24c5","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    n, amps, keep = x\n    psi = [complex(a, b) for a, b in amps]\n    m = 1 << keep\n    rho = [[0j, 0j], [0j, 0j]]\n    for i in range(len(psi)):\n        for j in range(len(psi)):\n            if (i & ~m) != (j & ~m):\n                continue\n            rho[(i >> keep) & 1][(j >> keep) & 1] += psi[i] * psi[j].conjugate()\n    tr = (rho[0][0] + rho[1][1]).real\n    rho = [[v / tr for v in row] for row in rho]\n    purity = sum(abs(rho[r][c]) for r in range(2) for c in range(2))\n    f = lambda v: [round(v.real, 6) + 0.0, round(v.imag, 6) + 0.0]\n    return {'rho': [[f(v) for v in row] for row in rho], 'purity': round(purity, 6) + 0.0}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: product keep 0 complex', [2, [[0.6, 0], [0, 0.8], [0, 0], [0, 0]], 0], {'rho': [[[0.36, 0.0], [0.0, -0.48]], [[0.0, 0.48], [0.64, 0.0]]], 'purity': 1.0}], ['regression: random reduction 0', [3, [[0.069, -0.179], [-0.176, -0.715], [0.749, 0.757], [-0.786, 0.461], [0.287, -0.288], [-0.462, 0.389], [-0.216, 0.203], [0.456, 0.037]], 0], {'rho': [[[0.422483, 0.0], [-0.136327, -0.218796]], [[-0.136327, 0.218796], [0.577517, 0.0]]], 'purity': 0.644932}], ['repair check: bell keep 0', [2, [[0.707107, 0], [0, 0], [0, 0], [0.707107, 0]], 0], {'rho': [[[0.5, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.5, 0.0]]], 'purity': 0.5}], ['control: product keep 1', [2, [[0.6, 0], [0, 0.8], [0, 0], [0, 0]], 1], {'rho': [[[1.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]]], 'purity': 1.0}], ['regression: random reduction 1', [3, [[0.986, 1.972], [-1.424, 1.98], [-1.308, 1.935], [1.338, 1.563], [-1.898, 1.945], [-1.572, 1.06], [1.832, 0.52], [0.807, -1.748]], 0], {'rho': [[[0.549537, 0.0], [0.241932, 0.063109]], [[0.241932, -0.063109], [0.450463, 0.0]]], 'purity': 0.629935}], ['regression: random reduction 2', [3, [[-0.436, -0.609], [0.766, -0.544], [-0.426, -0.406], [0.661, 0.537], [-0.32, -0.358], [0.306, 0.359], [-0.048, -0.239], [-0.254, -0.85]], 0], {'rho': [[[0.313851, 0.0], [-0.134578, -0.188226]], [[-0.134578, 0.188226], [0.686149, 0.0]]], 'purity': 0.676383}], ['regression: random reduction 3', [3, [[1.49, -1.9], [-1.815, 0.487], [-1.545, 1.465], [1.903, 1.324], [1.584, -1.799], [1.763, -0.058], [-0.233, 1.643], [-1.856, 0.918]], 0], {'rho': [[[0.536366, 0.0], [0.005901, 0.046665]], [[0.005901, -0.046665], [0.463634, 0.0]]], 'purity': 0.50707}]], [['regression: random reduction 2', [3, [[-0.436, -0.609], [0.766, -0.544], [-0.426, -0.406], [0.661, 0.537], [-0.32, -0.358], [0.306, 0.359], [-0.048, -0.239], [-0.254, -0.85]], 0], {'rho': [[[0.313851, 0.0], [-0.134578, -0.188226]], [[-0.134578, 0.188226], [0.686149, 0.0]]], 'purity': 0.676383}], ['regression: random reduction 3', [3, [[1.49, -1.9], [-1.815, 0.487], [-1.545, 1.465], [1.903, 1.324], [1.584, -1.799], [1.763, -0.058], [-0.233, 1.643], [-1.856, 0.918]], 0], {'rho': [[[0.536366, 0.0], [0.005901, 0.046665]], [[0.005901, -0.046665], [0.463634, 0.0]]], 'purity': 0.50707}], ['repair check: unnormalized ghz keep 2', [3, [[2, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [2, 0]], 2], {'rho': [[[0.5, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.5, 0.0]]], 'purity': 0.5}], ['control: product keep 1', [2, [[0.6, 0], [0, 0.8], [0, 0], [0, 0]], 1], {'rho': [[[1.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]]], 'purity': 1.0}], ['regression: random reduction 1', [3, [[0.986, 1.972], [-1.424, 1.98], [-1.308, 1.935], [1.338, 1.563], [-1.898, 1.945], [-1.572, 1.06], [1.832, 0.52], [0.807, -1.748]], 0], {'rho': [[[0.549537, 0.0], [0.241932, 0.063109]], [[0.241932, -0.063109], [0.450463, 0.0]]], 'purity': 0.629935}], ['regression: random reduction 4', [3, [[-0.633, 0.511], [0.239, 0.051], [0.129, 0.555], [0.414, -0.526], [-0.93, 0.617], [-0.487, -0.199], [0.609, 0.703], [0.243, -0.571]], 1], {'rho': [[[0.525894, 0.0], [0.032047, 0.296983]], [[0.032047, -0.296983], [0.474106, 0.0]]], 'purity': 0.679793}], ['regression: random reduction 5', [2, [[-0.972, -0.109], [0.26, 0.259], [-0.134, -0.66], [-0.522, -0.043]], 0], {'rho': [[[0.775173, 0.0], [-0.100385, 0.309012]], [[-0.100385, -0.309012], [0.224827, 0.0]]], 'purity': 0.862571}]], [['regression: random reduction 5', [2, [[-0.972, -0.109], [0.26, 0.259], [-0.134, -0.66], [-0.522, -0.043]], 0], {'rho': [[[0.775173, 0.0], [-0.100385, 0.309012]], [[-0.100385, -0.309012], [0.224827, 0.0]]], 'purity': 0.862571}], ['regression: random reduction 6', [3, [[-0.509, 0.635], [-0.554, 0.902], [-0.528, 0.406], [0.035, -0.166], [0.785, 0.17], [0.113, 0.282], [-0.237, -0.733], [0.778, 0.455]], 1], {'rho': [[[0.57299, 0.0], [0.059796, 0.116878]], [[0.059796, -0.116878], [0.42701, 0.0]]], 'purity': 0.545127}], ['regression: random reduction 1', [3, [[0.986, 1.972], [-1.424, 1.98], [-1.308, 1.935], [1.338, 1.563], [-1.898, 1.945], [-1.572, 1.06], [1.832, 0.52], [0.807, -1.748]], 0], {'rho': [[[0.549537, 0.0], [0.241932, 0.063109]], [[0.241932, -0.063109], [0.450463, 0.0]]], 'purity': 0.629935}], ['control: product keep 1', [2, [[0.6, 0], [0, 0.8], [0, 0], [0, 0]], 1], {'rho': [[[1.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]]], 'purity': 1.0}], ['regression: random reduction 2', [3, [[-0.436, -0.609], [0.766, -0.544], [-0.426, -0.406], [0.661, 0.537], [-0.32, -0.358], [0.306, 0.359], [-0.048, -0.239], [-0.254, -0.85]], 0], {'rho': [[[0.313851, 0.0], [-0.134578, -0.188226]], [[-0.134578, 0.188226], [0.686149, 0.0]]], 'purity': 0.676383}], ['regression: random reduction 3', [3, [[1.49, -1.9], [-1.815, 0.487], [-1.545, 1.465], [1.903, 1.324], [1.584, -1.799], [1.763, -0.058], [-0.233, 1.643], [-1.856, 0.918]], 0], {'rho': [[[0.536366, 0.0], [0.005901, 0.046665]], [[0.005901, -0.046665], [0.463634, 0.0]]], 'purity': 0.50707}], ['regression: random reduction 4', [3, [[-0.633, 0.511], [0.239, 0.051], [0.129, 0.555], [0.414, -0.526], [-0.93, 0.617], [-0.487, -0.199], [0.609, 0.703], [0.243, -0.571]], 1], {'rho': [[[0.525894, 0.0], [0.032047, 0.296983]], [[0.032047, -0.296983], [0.474106, 0.0]]], 'purity': 0.679793}]], [['regression: random reduction 8', [3, [[-1.677, 1.763], [0.965, -0.593], [-1.405, -0.16], [0.617, -0.175], [-0.069, 0.647], [0.956, 1.91], [1.615, 1.856], [-0.044, 0.633]], 1], {'rho': [[[0.578893, 0.0], [0.238878, -0.116767]], [[0.238878, 0.116767], [0.421107, 0.0]]], 'purity': 0.653843}], ['regression: random reduction 9', [3, [[0.61, 0.432], [0.921, -0.251], [-0.196, 0.927], [-0.808, 0.05], [0.743, -0.342], [0.487, 0.369], [-0.844, 0.867], [-0.169, 0.678]], 2], {'rho': [[[0.502365, 0.0], [0.299281, -0.000926]], [[0.299281, 0.000926], [0.497635, 0.0]]], 'purity': 0.679151}], ['regression: random reduction 3', [3, [[1.49, -1.9], [-1.815, 0.487], [-1.545, 1.465], [1.903, 1.324], [1.584, -1.799], [1.763, -0.058], [-0.233, 1.643], [-1.856, 0.918]], 0], {'rho': [[[0.536366, 0.0], [0.005901, 0.046665]], [[0.005901, -0.046665], [0.463634, 0.0]]], 'purity': 0.50707}], ['control: product keep 1', [2, [[0.6, 0], [0, 0.8], [0, 0], [0, 0]], 1], {'rho': [[[1.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]]], 'purity': 1.0}], ['regression: random reduction 4', [3, [[-0.633, 0.511], [0.239, 0.051], [0.129, 0.555], [0.414, -0.526], [-0.93, 0.617], [-0.487, -0.199], [0.609, 0.703], [0.243, -0.571]], 1], {'rho': [[[0.525894, 0.0], [0.032047, 0.296983]], [[0.032047, -0.296983], [0.474106, 0.0]]], 'purity': 0.679793}], ['regression: random reduction 5', [2, [[-0.972, -0.109], [0.26, 0.259], [-0.134, -0.66], [-0.522, -0.043]], 0], {'rho': [[[0.775173, 0.0], [-0.100385, 0.309012]], [[-0.100385, -0.309012], [0.224827, 0.0]]], 'purity': 0.862571}], ['regression: random reduction 6', [3, [[-0.509, 0.635], [-0.554, 0.902], [-0.528, 0.406], [0.035, -0.166], [0.785, 0.17], [0.113, 0.282], [-0.237, -0.733], [0.778, 0.455]], 1], {'rho': [[[0.57299, 0.0], [0.059796, 0.116878]], [[0.059796, -0.116878], [0.42701, 0.0]]], 'purity': 0.545127}]], [['regression: random reduction 11', [2, [[0.608, -1.677], [-1.453, -1.131], [-0.939, -0.925], [-1.391, 1.723]], 1], {'rho': [[[0.497404, 0.0], [0.079671, 0.470271]], [[0.079671, -0.470271], [0.502596, 0.0]]], 'purity': 0.955018}], ['regression: random reduction 12', [2, [[0.346, 0.105], [0.065, -0.046], [0.207, 0.409], [0.186, -0.621]], 0], {'rho': [[[0.444161, 0.0], [-0.257772, 0.296257]], [[-0.257772, -0.296257], [0.555839, 0.0]]], 'purity': 0.814665}], ['regression: random reduction 5', [2, [[-0.972, -0.109], [0.26, 0.259], [-0.134, -0.66], [-0.522, -0.043]], 0], {'rho': [[[0.775173, 0.0], [-0.100385, 0.309012]], [[-0.100385, -0.309012], [0.224827, 0.0]]], 'purity': 0.862571}], ['control: product keep 1', [2, [[0.6, 0], [0, 0.8], [0, 0], [0, 0]], 1], {'rho': [[[1.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]]], 'purity': 1.0}], ['regression: random reduction 4', [3, [[-0.633, 0.511], [0.239, 0.051], [0.129, 0.555], [0.414, -0.526], [-0.93, 0.617], [-0.487, -0.199], [0.609, 0.703], [0.243, -0.571]], 1], {'rho': [[[0.525894, 0.0], [0.032047, 0.296983]], [[0.032047, -0.296983], [0.474106, 0.0]]], 'purity': 0.679793}], ['regression: random reduction 6', [3, [[-0.509, 0.635], [-0.554, 0.902], [-0.528, 0.406], [0.035, -0.166], [0.785, 0.17], [0.113, 0.282], [-0.237, -0.733], [0.778, 0.455]], 1], {'rho': [[[0.57299, 0.0], [0.059796, 0.116878]], [[0.059796, -0.116878], [0.42701, 0.0]]], 'purity': 0.545127}], ['regression: random reduction 7', [2, [[-0.319, 0.362], [0.196, -0.039], [0.357, 0.708], [-0.468, -0.352]], 1], {'rho': [[[0.219179, 0.0], [0.051763, 0.355461]], [[0.051763, -0.355461], [0.780821, 0.0]]], 'purity': 0.915786}]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"43182d74eb223562e2abbf28911b85149707d18455bb647daf02da0aef47b69e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    n, amps, keep = x\n    psi = [complex(a, b) for a, b in amps]\n    m = 1 << keep\n    rho = [[0j, 0j], [0j, 0j]]\n    for i in range(len(psi)):\n        for j in range(len(psi)):\n            if (i & ~m) != (j & ~m):\n                continue\n            rho[(i >> keep) & 1][(j >> keep) & 1] += psi[i] * psi[j].conjugate()\n    tr = (rho[0][0] + rho[1][1]).real\n    rho = [[v / tr for v in row] for row in rho]\n    purity = sum(abs(rho[r][r]) ** 2 for r in range(2))\n    f = lambda v: [round(v.real, 6) + 0.0, round(v.imag, 6) + 0.0]\n    return {'rho': [[f(v) for v in row] for row in rho], 'purity': round(purity, 6) + 0.0}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: product keep 0 complex', [2, [[0.6, 0], [0, 0.8], [0, 0], [0, 0]], 0], {'rho': [[[0.36, 0.0], [0.0, -0.48]], [[0.0, 0.48], [0.64, 0.0]]], 'purity': 1.0}], ['regression: random reduction 0', [3, [[0.069, -0.179], [-0.176, -0.715], [0.749, 0.757], [-0.786, 0.461], [0.287, -0.288], [-0.462, 0.389], [-0.216, 0.203], [0.456, 0.037]], 0], {'rho': [[[0.422483, 0.0], [-0.136327, -0.218796]], [[-0.136327, 0.218796], [0.577517, 0.0]]], 'purity': 0.644932}], ['repair check: bell keep 0', [2, [[0.707107, 0], [0, 0], [0, 0], [0.707107, 0]], 0], {'rho': [[[0.5, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.5, 0.0]]], 'purity': 0.5}], ['control: product keep 1', [2, [[0.6, 0], [0, 0.8], [0, 0], [0, 0]], 1], {'rho': [[[1.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]]], 'purity': 1.0}], ['regression: random reduction 1', [3, [[0.986, 1.972], [-1.424, 1.98], [-1.308, 1.935], [1.338, 1.563], [-1.898, 1.945], [-1.572, 1.06], [1.832, 0.52], [0.807, -1.748]], 0], {'rho': [[[0.549537, 0.0], [0.241932, 0.063109]], [[0.241932, -0.063109], [0.450463, 0.0]]], 'purity': 0.629935}], ['regression: random reduction 2', [3, [[-0.436, -0.609], [0.766, -0.544], [-0.426, -0.406], [0.661, 0.537], [-0.32, -0.358], [0.306, 0.359], [-0.048, -0.239], [-0.254, -0.85]], 0], {'rho': [[[0.313851, 0.0], [-0.134578, -0.188226]], [[-0.134578, 0.188226], [0.686149, 0.0]]], 'purity': 0.676383}], ['regression: random reduction 3', [3, [[1.49, -1.9], [-1.815, 0.487], [-1.545, 1.465], [1.903, 1.324], [1.584, -1.799], [1.763, -0.058], [-0.233, 1.643], [-1.856, 0.918]], 0], {'rho': [[[0.536366, 0.0], [0.005901, 0.046665]], [[0.005901, -0.046665], [0.463634, 0.0]]], 'purity': 0.50707}]], [['regression: random reduction 2', [3, [[-0.436, -0.609], [0.766, -0.544], [-0.426, -0.406], [0.661, 0.537], [-0.32, -0.358], [0.306, 0.359], [-0.048, -0.239], [-0.254, -0.85]], 0], {'rho': [[[0.313851, 0.0], [-0.134578, -0.188226]], [[-0.134578, 0.188226], [0.686149, 0.0]]], 'purity': 0.676383}], ['regression: random reduction 3', [3, [[1.49, -1.9], [-1.815, 0.487], [-1.545, 1.465], [1.903, 1.324], [1.584, -1.799], [1.763, -0.058], [-0.233, 1.643], [-1.856, 0.918]], 0], {'rho': [[[0.536366, 0.0], [0.005901, 0.046665]], [[0.005901, -0.046665], [0.463634, 0.0]]], 'purity': 0.50707}], ['repair check: unnormalized ghz keep 2', [3, [[2, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [2, 0]], 2], {'rho': [[[0.5, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.5, 0.0]]], 'purity': 0.5}], ['control: product keep 1', [2, [[0.6, 0], [0, 0.8], [0, 0], [0, 0]], 1], {'rho': [[[1.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]]], 'purity': 1.0}], ['regression: random reduction 1', [3, [[0.986, 1.972], [-1.424, 1.98], [-1.308, 1.935], [1.338, 1.563], [-1.898, 1.945], [-1.572, 1.06], [1.832, 0.52], [0.807, -1.748]], 0], {'rho': [[[0.549537, 0.0], [0.241932, 0.063109]], [[0.241932, -0.063109], [0.450463, 0.0]]], 'purity': 0.629935}], ['regression: random reduction 4', [3, [[-0.633, 0.511], [0.239, 0.051], [0.129, 0.555], [0.414, -0.526], [-0.93, 0.617], [-0.487, -0.199], [0.609, 0.703], [0.243, -0.571]], 1], {'rho': [[[0.525894, 0.0], [0.032047, 0.296983]], [[0.032047, -0.296983], [0.474106, 0.0]]], 'purity': 0.679793}], ['regression: random reduction 5', [2, [[-0.972, -0.109], [0.26, 0.259], [-0.134, -0.66], [-0.522, -0.043]], 0], {'rho': [[[0.775173, 0.0], [-0.100385, 0.309012]], [[-0.100385, -0.309012], [0.224827, 0.0]]], 'purity': 0.862571}]], [['regression: random reduction 5', [2, [[-0.972, -0.109], [0.26, 0.259], [-0.134, -0.66], [-0.522, -0.043]], 0], {'rho': [[[0.775173, 0.0], [-0.100385, 0.309012]], [[-0.100385, -0.309012], [0.224827, 0.0]]], 'purity': 0.862571}], ['regression: random reduction 6', [3, [[-0.509, 0.635], [-0.554, 0.902], [-0.528, 0.406], [0.035, -0.166], [0.785, 0.17], [0.113, 0.282], [-0.237, -0.733], [0.778, 0.455]], 1], {'rho': [[[0.57299, 0.0], [0.059796, 0.116878]], [[0.059796, -0.116878], [0.42701, 0.0]]], 'purity': 0.545127}], ['regression: random reduction 1', [3, [[0.986, 1.972], [-1.424, 1.98], [-1.308, 1.935], [1.338, 1.563], [-1.898, 1.945], [-1.572, 1.06], [1.832, 0.52], [0.807, -1.748]], 0], {'rho': [[[0.549537, 0.0], [0.241932, 0.063109]], [[0.241932, -0.063109], [0.450463, 0.0]]], 'purity': 0.629935}], ['control: product keep 1', [2, [[0.6, 0], [0, 0.8], [0, 0], [0, 0]], 1], {'rho': [[[1.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]]], 'purity': 1.0}], ['regression: random reduction 2', [3, [[-0.436, -0.609], [0.766, -0.544], [-0.426, -0.406], [0.661, 0.537], [-0.32, -0.358], [0.306, 0.359], [-0.048, -0.239], [-0.254, -0.85]], 0], {'rho': [[[0.313851, 0.0], [-0.134578, -0.188226]], [[-0.134578, 0.188226], [0.686149, 0.0]]], 'purity': 0.676383}], ['regression: random reduction 3', [3, [[1.49, -1.9], [-1.815, 0.487], [-1.545, 1.465], [1.903, 1.324], [1.584, -1.799], [1.763, -0.058], [-0.233, 1.643], [-1.856, 0.918]], 0], {'rho': [[[0.536366, 0.0], [0.005901, 0.046665]], [[0.005901, -0.046665], [0.463634, 0.0]]], 'purity': 0.50707}], ['regression: random reduction 4', [3, [[-0.633, 0.511], [0.239, 0.051], [0.129, 0.555], [0.414, -0.526], [-0.93, 0.617], [-0.487, -0.199], [0.609, 0.703], [0.243, -0.571]], 1], {'rho': [[[0.525894, 0.0], [0.032047, 0.296983]], [[0.032047, -0.296983], [0.474106, 0.0]]], 'purity': 0.679793}]], [['regression: random reduction 8', [3, [[-1.677, 1.763], [0.965, -0.593], [-1.405, -0.16], [0.617, -0.175], [-0.069, 0.647], [0.956, 1.91], [1.615, 1.856], [-0.044, 0.633]], 1], {'rho': [[[0.578893, 0.0], [0.238878, -0.116767]], [[0.238878, 0.116767], [0.421107, 0.0]]], 'purity': 0.653843}], ['regression: random reduction 9', [3, [[0.61, 0.432], [0.921, -0.251], [-0.196, 0.927], [-0.808, 0.05], [0.743, -0.342], [0.487, 0.369], [-0.844, 0.867], [-0.169, 0.678]], 2], {'rho': [[[0.502365, 0.0], [0.299281, -0.000926]], [[0.299281, 0.000926], [0.497635, 0.0]]], 'purity': 0.679151}], ['regression: random reduction 3', [3, [[1.49, -1.9], [-1.815, 0.487], [-1.545, 1.465], [1.903, 1.324], [1.584, -1.799], [1.763, -0.058], [-0.233, 1.643], [-1.856, 0.918]], 0], {'rho': [[[0.536366, 0.0], [0.005901, 0.046665]], [[0.005901, -0.046665], [0.463634, 0.0]]], 'purity': 0.50707}], ['control: product keep 1', [2, [[0.6, 0], [0, 0.8], [0, 0], [0, 0]], 1], {'rho': [[[1.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]]], 'purity': 1.0}], ['regression: random reduction 4', [3, [[-0.633, 0.511], [0.239, 0.051], [0.129, 0.555], [0.414, -0.526], [-0.93, 0.617], [-0.487, -0.199], [0.609, 0.703], [0.243, -0.571]], 1], {'rho': [[[0.525894, 0.0], [0.032047, 0.296983]], [[0.032047, -0.296983], [0.474106, 0.0]]], 'purity': 0.679793}], ['regression: random reduction 5', [2, [[-0.972, -0.109], [0.26, 0.259], [-0.134, -0.66], [-0.522, -0.043]], 0], {'rho': [[[0.775173, 0.0], [-0.100385, 0.309012]], [[-0.100385, -0.309012], [0.224827, 0.0]]], 'purity': 0.862571}], ['regression: random reduction 6', [3, [[-0.509, 0.635], [-0.554, 0.902], [-0.528, 0.406], [0.035, -0.166], [0.785, 0.17], [0.113, 0.282], [-0.237, -0.733], [0.778, 0.455]], 1], {'rho': [[[0.57299, 0.0], [0.059796, 0.116878]], [[0.059796, -0.116878], [0.42701, 0.0]]], 'purity': 0.545127}]], [['regression: random reduction 11', [2, [[0.608, -1.677], [-1.453, -1.131], [-0.939, -0.925], [-1.391, 1.723]], 1], {'rho': [[[0.497404, 0.0], [0.079671, 0.470271]], [[0.079671, -0.470271], [0.502596, 0.0]]], 'purity': 0.955018}], ['regression: random reduction 12', [2, [[0.346, 0.105], [0.065, -0.046], [0.207, 0.409], [0.186, -0.621]], 0], {'rho': [[[0.444161, 0.0], [-0.257772, 0.296257]], [[-0.257772, -0.296257], [0.555839, 0.0]]], 'purity': 0.814665}], ['regression: random reduction 5', [2, [[-0.972, -0.109], [0.26, 0.259], [-0.134, -0.66], [-0.522, -0.043]], 0], {'rho': [[[0.775173, 0.0], [-0.100385, 0.309012]], [[-0.100385, -0.309012], [0.224827, 0.0]]], 'purity': 0.862571}], ['control: product keep 1', [2, [[0.6, 0], [0, 0.8], [0, 0], [0, 0]], 1], {'rho': [[[1.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]]], 'purity': 1.0}], ['regression: random reduction 4', [3, [[-0.633, 0.511], [0.239, 0.051], [0.129, 0.555], [0.414, -0.526], [-0.93, 0.617], [-0.487, -0.199], [0.609, 0.703], [0.243, -0.571]], 1], {'rho': [[[0.525894, 0.0], [0.032047, 0.296983]], [[0.032047, -0.296983], [0.474106, 0.0]]], 'purity': 0.679793}], ['regression: random reduction 6', [3, [[-0.509, 0.635], [-0.554, 0.902], [-0.528, 0.406], [0.035, -0.166], [0.785, 0.17], [0.113, 0.282], [-0.237, -0.733], [0.778, 0.455]], 1], {'rho': [[[0.57299, 0.0], [0.059796, 0.116878]], [[0.059796, -0.116878], [0.42701, 0.0]]], 'purity': 0.545127}], ['regression: random reduction 7', [2, [[-0.319, 0.362], [0.196, -0.039], [0.357, 0.708], [-0.468, -0.352]], 1], {'rho': [[[0.219179, 0.0], [0.051763, 0.355461]], [[0.051763, -0.355461], [0.780821, 0.0]]], 'purity': 0.915786}]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"5ddf5ff903e8fe63274b3fccf879e33b1d198b3ecd70979f9748df2165ff3477","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    n, amps, keep = x\n    psi = [complex(a, b) for a, b in amps]\n    m = 1 << keep\n    rho = [[0j, 0j], [0j, 0j]]\n    for i in range(len(psi)):\n        for j in range(len(psi)):\n            if (i & ~m) != (j & ~m):\n                continue\n            rho[(i >> keep) & 1][(j >> keep) & 1] += psi[i] * psi[j].conjugate()\n    tr = (rho[0][0] + rho[1][1]).real\n    rho = [[v / tr for v in row] for row in rho]\n    purity = sum(abs(rho[r][c]) ** 2 for r in range(2) for c in range(2))\n    f = lambda v: [round(v.real, 6) + 0.0, round(v.imag, 6) + 0.0]\n    return {'rho': [[f(v) for v in row] for row in rho], 'purity': round(purity, 6) + 0.0}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: product keep 0 complex', [2, [[0.6, 0], [0, 0.8], [0, 0], [0, 0]], 0], {'rho': [[[0.36, 0.0], [0.0, -0.48]], [[0.0, 0.48], [0.64, 0.0]]], 'purity': 1.0}], ['regression: random reduction 0', [3, [[0.069, -0.179], [-0.176, -0.715], [0.749, 0.757], [-0.786, 0.461], [0.287, -0.288], [-0.462, 0.389], [-0.216, 0.203], [0.456, 0.037]], 0], {'rho': [[[0.422483, 0.0], [-0.136327, -0.218796]], [[-0.136327, 0.218796], [0.577517, 0.0]]], 'purity': 0.644932}], ['repair check: bell keep 0', [2, [[0.707107, 0], [0, 0], [0, 0], [0.707107, 0]], 0], {'rho': [[[0.5, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.5, 0.0]]], 'purity': 0.5}], ['control: product keep 1', [2, [[0.6, 0], [0, 0.8], [0, 0], [0, 0]], 1], {'rho': [[[1.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]]], 'purity': 1.0}], ['regression: random reduction 1', [3, [[0.986, 1.972], [-1.424, 1.98], [-1.308, 1.935], [1.338, 1.563], [-1.898, 1.945], [-1.572, 1.06], [1.832, 0.52], [0.807, -1.748]], 0], {'rho': [[[0.549537, 0.0], [0.241932, 0.063109]], [[0.241932, -0.063109], [0.450463, 0.0]]], 'purity': 0.629935}], ['regression: random reduction 2', [3, [[-0.436, -0.609], [0.766, -0.544], [-0.426, -0.406], [0.661, 0.537], [-0.32, -0.358], [0.306, 0.359], [-0.048, -0.239], [-0.254, -0.85]], 0], {'rho': [[[0.313851, 0.0], [-0.134578, -0.188226]], [[-0.134578, 0.188226], [0.686149, 0.0]]], 'purity': 0.676383}], ['regression: random reduction 3', [3, [[1.49, -1.9], [-1.815, 0.487], [-1.545, 1.465], [1.903, 1.324], [1.584, -1.799], [1.763, -0.058], [-0.233, 1.643], [-1.856, 0.918]], 0], {'rho': [[[0.536366, 0.0], [0.005901, 0.046665]], [[0.005901, -0.046665], [0.463634, 0.0]]], 'purity': 0.50707}]], [['regression: random reduction 2', [3, [[-0.436, -0.609], [0.766, -0.544], [-0.426, -0.406], [0.661, 0.537], [-0.32, -0.358], [0.306, 0.359], [-0.048, -0.239], [-0.254, -0.85]], 0], {'rho': [[[0.313851, 0.0], [-0.134578, -0.188226]], [[-0.134578, 0.188226], [0.686149, 0.0]]], 'purity': 0.676383}], ['regression: random reduction 3', [3, [[1.49, -1.9], [-1.815, 0.487], [-1.545, 1.465], [1.903, 1.324], [1.584, -1.799], [1.763, -0.058], [-0.233, 1.643], [-1.856, 0.918]], 0], {'rho': [[[0.536366, 0.0], [0.005901, 0.046665]], [[0.005901, -0.046665], [0.463634, 0.0]]], 'purity': 0.50707}], ['repair check: unnormalized ghz keep 2', [3, [[2, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [2, 0]], 2], {'rho': [[[0.5, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.5, 0.0]]], 'purity': 0.5}], ['control: product keep 1', [2, [[0.6, 0], [0, 0.8], [0, 0], [0, 0]], 1], {'rho': [[[1.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]]], 'purity': 1.0}], ['regression: random reduction 1', [3, [[0.986, 1.972], [-1.424, 1.98], [-1.308, 1.935], [1.338, 1.563], [-1.898, 1.945], [-1.572, 1.06], [1.832, 0.52], [0.807, -1.748]], 0], {'rho': [[[0.549537, 0.0], [0.241932, 0.063109]], [[0.241932, -0.063109], [0.450463, 0.0]]], 'purity': 0.629935}], ['regression: random reduction 4', [3, [[-0.633, 0.511], [0.239, 0.051], [0.129, 0.555], [0.414, -0.526], [-0.93, 0.617], [-0.487, -0.199], [0.609, 0.703], [0.243, -0.571]], 1], {'rho': [[[0.525894, 0.0], [0.032047, 0.296983]], [[0.032047, -0.296983], [0.474106, 0.0]]], 'purity': 0.679793}], ['regression: random reduction 5', [2, [[-0.972, -0.109], [0.26, 0.259], [-0.134, -0.66], [-0.522, -0.043]], 0], {'rho': [[[0.775173, 0.0], [-0.100385, 0.309012]], [[-0.100385, -0.309012], [0.224827, 0.0]]], 'purity': 0.862571}]], [['regression: random reduction 5', [2, [[-0.972, -0.109], [0.26, 0.259], [-0.134, -0.66], [-0.522, -0.043]], 0], {'rho': [[[0.775173, 0.0], [-0.100385, 0.309012]], [[-0.100385, -0.309012], [0.224827, 0.0]]], 'purity': 0.862571}], ['regression: random reduction 6', [3, [[-0.509, 0.635], [-0.554, 0.902], [-0.528, 0.406], [0.035, -0.166], [0.785, 0.17], [0.113, 0.282], [-0.237, -0.733], [0.778, 0.455]], 1], {'rho': [[[0.57299, 0.0], [0.059796, 0.116878]], [[0.059796, -0.116878], [0.42701, 0.0]]], 'purity': 0.545127}], ['regression: random reduction 1', [3, [[0.986, 1.972], [-1.424, 1.98], [-1.308, 1.935], [1.338, 1.563], [-1.898, 1.945], [-1.572, 1.06], [1.832, 0.52], [0.807, -1.748]], 0], {'rho': [[[0.549537, 0.0], [0.241932, 0.063109]], [[0.241932, -0.063109], [0.450463, 0.0]]], 'purity': 0.629935}], ['control: product keep 1', [2, [[0.6, 0], [0, 0.8], [0, 0], [0, 0]], 1], {'rho': [[[1.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]]], 'purity': 1.0}], ['regression: random reduction 2', [3, [[-0.436, -0.609], [0.766, -0.544], [-0.426, -0.406], [0.661, 0.537], [-0.32, -0.358], [0.306, 0.359], [-0.048, -0.239], [-0.254, -0.85]], 0], {'rho': [[[0.313851, 0.0], [-0.134578, -0.188226]], [[-0.134578, 0.188226], [0.686149, 0.0]]], 'purity': 0.676383}], ['regression: random reduction 3', [3, [[1.49, -1.9], [-1.815, 0.487], [-1.545, 1.465], [1.903, 1.324], [1.584, -1.799], [1.763, -0.058], [-0.233, 1.643], [-1.856, 0.918]], 0], {'rho': [[[0.536366, 0.0], [0.005901, 0.046665]], [[0.005901, -0.046665], [0.463634, 0.0]]], 'purity': 0.50707}], ['regression: random reduction 4', [3, [[-0.633, 0.511], [0.239, 0.051], [0.129, 0.555], [0.414, -0.526], [-0.93, 0.617], [-0.487, -0.199], [0.609, 0.703], [0.243, -0.571]], 1], {'rho': [[[0.525894, 0.0], [0.032047, 0.296983]], [[0.032047, -0.296983], [0.474106, 0.0]]], 'purity': 0.679793}]], [['regression: random reduction 8', [3, [[-1.677, 1.763], [0.965, -0.593], [-1.405, -0.16], [0.617, -0.175], [-0.069, 0.647], [0.956, 1.91], [1.615, 1.856], [-0.044, 0.633]], 1], {'rho': [[[0.578893, 0.0], [0.238878, -0.116767]], [[0.238878, 0.116767], [0.421107, 0.0]]], 'purity': 0.653843}], ['regression: random reduction 9', [3, [[0.61, 0.432], [0.921, -0.251], [-0.196, 0.927], [-0.808, 0.05], [0.743, -0.342], [0.487, 0.369], [-0.844, 0.867], [-0.169, 0.678]], 2], {'rho': [[[0.502365, 0.0], [0.299281, -0.000926]], [[0.299281, 0.000926], [0.497635, 0.0]]], 'purity': 0.679151}], ['regression: random reduction 3', [3, [[1.49, -1.9], [-1.815, 0.487], [-1.545, 1.465], [1.903, 1.324], [1.584, -1.799], [1.763, -0.058], [-0.233, 1.643], [-1.856, 0.918]], 0], {'rho': [[[0.536366, 0.0], [0.005901, 0.046665]], [[0.005901, -0.046665], [0.463634, 0.0]]], 'purity': 0.50707}], ['control: product keep 1', [2, [[0.6, 0], [0, 0.8], [0, 0], [0, 0]], 1], {'rho': [[[1.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]]], 'purity': 1.0}], ['regression: random reduction 4', [3, [[-0.633, 0.511], [0.239, 0.051], [0.129, 0.555], [0.414, -0.526], [-0.93, 0.617], [-0.487, -0.199], [0.609, 0.703], [0.243, -0.571]], 1], {'rho': [[[0.525894, 0.0], [0.032047, 0.296983]], [[0.032047, -0.296983], [0.474106, 0.0]]], 'purity': 0.679793}], ['regression: random reduction 5', [2, [[-0.972, -0.109], [0.26, 0.259], [-0.134, -0.66], [-0.522, -0.043]], 0], {'rho': [[[0.775173, 0.0], [-0.100385, 0.309012]], [[-0.100385, -0.309012], [0.224827, 0.0]]], 'purity': 0.862571}], ['regression: random reduction 6', [3, [[-0.509, 0.635], [-0.554, 0.902], [-0.528, 0.406], [0.035, -0.166], [0.785, 0.17], [0.113, 0.282], [-0.237, -0.733], [0.778, 0.455]], 1], {'rho': [[[0.57299, 0.0], [0.059796, 0.116878]], [[0.059796, -0.116878], [0.42701, 0.0]]], 'purity': 0.545127}]], [['regression: random reduction 11', [2, [[0.608, -1.677], [-1.453, -1.131], [-0.939, -0.925], [-1.391, 1.723]], 1], {'rho': [[[0.497404, 0.0], [0.079671, 0.470271]], [[0.079671, -0.470271], [0.502596, 0.0]]], 'purity': 0.955018}], ['regression: random reduction 12', [2, [[0.346, 0.105], [0.065, -0.046], [0.207, 0.409], [0.186, -0.621]], 0], {'rho': [[[0.444161, 0.0], [-0.257772, 0.296257]], [[-0.257772, -0.296257], [0.555839, 0.0]]], 'purity': 0.814665}], ['regression: random reduction 5', [2, [[-0.972, -0.109], [0.26, 0.259], [-0.134, -0.66], [-0.522, -0.043]], 0], {'rho': [[[0.775173, 0.0], [-0.100385, 0.309012]], [[-0.100385, -0.309012], [0.224827, 0.0]]], 'purity': 0.862571}], ['control: product keep 1', [2, [[0.6, 0], [0, 0.8], [0, 0], [0, 0]], 1], {'rho': [[[1.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]]], 'purity': 1.0}], ['regression: random reduction 4', [3, [[-0.633, 0.511], [0.239, 0.051], [0.129, 0.555], [0.414, -0.526], [-0.93, 0.617], [-0.487, -0.199], [0.609, 0.703], [0.243, -0.571]], 1], {'rho': [[[0.525894, 0.0], [0.032047, 0.296983]], [[0.032047, -0.296983], [0.474106, 0.0]]], 'purity': 0.679793}], ['regression: random reduction 6', [3, [[-0.509, 0.635], [-0.554, 0.902], [-0.528, 0.406], [0.035, -0.166], [0.785, 0.17], [0.113, 0.282], [-0.237, -0.733], [0.778, 0.455]], 1], {'rho': [[[0.57299, 0.0], [0.059796, 0.116878]], [[0.059796, -0.116878], [0.42701, 0.0]]], 'purity': 0.545127}], ['regression: random reduction 7', [2, [[-0.319, 0.362], [0.196, -0.039], [0.357, 0.708], [-0.468, -0.352]], 1], {'rho': [[[0.219179, 0.0], [0.051763, 0.355461]], [[0.051763, -0.355461], [0.780821, 0.0]]], 'purity': 0.915786}]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"A deterministic bounded teaching model with a stipulated toy contract; amplitudes are rounded to fixed decimals for strict JSON output. It is not a production quantum SDK and claims no standards conformance. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-quantum_circuit_simulation-reduced-density-matrix-purity-coherence-terms","generated_at":"2026-09-29T14:51:32.945761+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Reduced states quantify entanglement and are used in debugging subsystem behavior; index or conjugation slips give non-physical matrices.","repair":"Sum |rho_rc|^2 over all four entries (tr rho^2).","root_cause":"Purity sums only squared diagonal entries.","sha256":"634aa4c6370676e98476ef2255b5a0e4a13b9a84e53d3c6d18a6152684d964ef","title":"Reduced density purity ignores off-diagonal entries · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":44.944,"exit_code":1,"observations":[{"actual":{"purity":1.96,"rho":[[[0.36,0.0],[0.0,-0.48]],[[0.0,0.48],[0.64,0.0]]]},"check":"regression: product keep 0 complex","expected":{"purity":1.0,"rho":[[[0.36,0.0],[0.0,-0.48]],[[0.0,0.48],[0.64,0.0]]]},"passed":false},{"actual":{"purity":1.515585,"rho":[[[0.422483,0.0],[-0.136327,-0.218796]],[[-0.136327,0.218796],[0.577517,0.0]]]},"check":"regression: random reduction 0","expected":{"purity":0.644932,"rho":[[[0.422483,0.0],[-0.136327,-0.218796]],[[-0.136327,0.218796],[0.577517,0.0]]]},"passed":false},{"actual":{"purity":1.0,"rho":[[[0.5,0.0],[0.0,0.0]],[[0.0,0.0],[0.5,0.0]]]},"check":"repair check: bell keep 0","expected":{"purity":0.5,"rho":[[[0.5,0.0],[0.0,0.0]],[[0.0,0.0],[0.5,0.0]]]},"passed":false},{"actual":{"purity":1.0,"rho":[[[1.0,0.0],[0.0,0.0]],[[0.0,0.0],[0.0,0.0]]]},"check":"control: product keep 1","expected":{"purity":1.0,"rho":[[[1.0,0.0],[0.0,0.0]],[[0.0,0.0],[0.0,0.0]]]},"passed":true},{"actual":{"purity":1.500055,"rho":[[[0.549537,0.0],[0.241932,0.063109]],[[0.241932,-0.063109],[0.450463,0.0]]]},"check":"regression: random reduction 1","expected":{"purity":0.629935,"rho":[[[0.549537,0.0],[0.241932,0.063109]],[[0.241932,-0.063109],[0.450463,0.0]]]},"passed":false},{"actual":{"purity":1.462776,"rho":[[[0.313851,0.0],[-0.134578,-0.188226]],[[-0.134578,0.188226],[0.686149,0.0]]]},"check":"regression: random reduction 2","expected":{"purity":0.676383,"rho":[[[0.313851,0.0],[-0.134578,-0.188226]],[[-0.134578,0.188226],[0.686149,0.0]]]},"passed":false},{"actual":{"purity":1.094072,"rho":[[[0.536366,0.0],[0.005901,0.046665]],[[0.005901,-0.046665],[0.463634,0.0]]]},"check":"regression: random reduction 3","expected":{"purity":0.50707,"rho":[[[0.536366,0.0],[0.005901,0.046665]],[[0.005901,-0.046665],[0.463634,0.0]]]},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: product keep 0 complex\", \"actual\": {\"rho\": [[[0.36, 0.0], [0.0, -0.48]], [[0.0, 0.48], [0.64, 0.0]]], \"purity\": 1.96}, \"expected\": {\"rho\": [[[0.36, 0.0], [0.0, -0.48]], [[0.0, 0.48], [0.64, 0.0]]], \"purity\": 1.0}, \"passed\": false}, {\"check\": \"regression: random reduction 0\", \"actual\": {\"rho\": [[[0.422483, 0.0], [-0.136327, -0.218796]], [[-0.136327, 0.218796], [0.577517, 0.0]]], \"purity\": 1.515585}, \"expected\": {\"rho\": [[[0.422483, 0.0], [-0.136327, -0.218796]], [[-0.136327, 0.218796], [0.577517, 0.0]]], \"purity\": 0.644932}, \"passed\": false}, {\"check\": \"repair check: bell keep 0\", \"actual\": {\"rho\": [[[0.5, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.5, 0.0]]], \"purity\": 1.0}, \"expected\": {\"rho\": [[[0.5, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.5, 0.0]]], \"purity\": 0.5}, \"passed\": false}, {\"check\": \"control: product keep 1\", \"actual\": {\"rho\": [[[1.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]]], \"purity\": 1.0}, \"expected\": {\"rho\": [[[1.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]]], \"purity\": 1.0}, \"passed\": true}, {\"check\": \"regression: random reduction 1\", \"actual\": {\"rho\": [[[0.549537, 0.0], [0.241932, 0.063109]], [[0.241932, -0.063109], [0.450463, 0.0]]], \"purity\": 1.500055}, \"expected\": {\"rho\": [[[0.549537, 0.0], [0.241932, 0.063109]], [[0.241932, -0.063109], [0.450463, 0.0]]], \"purity\": 0.629935}, \"passed\": false}, {\"check\": \"regression: random reduction 2\", \"actual\": {\"rho\": [[[0.313851, 0.0], [-0.134578, -0.188226]], [[-0.134578, 0.188226], [0.686149, 0.0]]], \"purity\": 1.462776}, \"expected\": {\"rho\": [[[0.313851, 0.0], [-0.134578, -0.188226]], [[-0.134578, 0.188226], [0.686149, 0.0]]], \"purity\": 0.676383}, \"passed\": false}, {\"check\": \"regression: random reduction 3\", \"actual\": {\"rho\": [[[0.536366, 0.0], [0.005901, 0.046665]], [[0.005901, -0.046665], [0.463634, 0.0]]], \"purity\": 1.094072}, \"expected\": {\"rho\": [[[0.536366, 0.0], [0.005901, 0.046665]], [[0.005901, -0.046665], [0.463634, 0.0]]], \"purity\": 0.50707}, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.218,"exit_code":1,"observations":[{"actual":{"purity":0.5392,"rho":[[[0.36,0.0],[0.0,-0.48]],[[0.0,0.48],[0.64,0.0]]]},"check":"regression: product keep 0 complex","expected":{"purity":1.0,"rho":[[[0.36,0.0],[0.0,-0.48]],[[0.0,0.48],[0.64,0.0]]]},"passed":false},{"actual":{"purity":0.512018,"rho":[[[0.422483,0.0],[-0.136327,-0.218796]],[[-0.136327,0.218796],[0.577517,0.0]]]},"check":"regression: random reduction 0","expected":{"purity":0.644932,"rho":[[[0.422483,0.0],[-0.136327,-0.218796]],[[-0.136327,0.218796],[0.577517,0.0]]]},"passed":false},{"actual":{"purity":0.5,"rho":[[[0.5,0.0],[0.0,0.0]],[[0.0,0.0],[0.5,0.0]]]},"check":"repair check: bell keep 0","expected":{"purity":0.5,"rho":[[[0.5,0.0],[0.0,0.0]],[[0.0,0.0],[0.5,0.0]]]},"passed":true},{"actual":{"purity":1.0,"rho":[[[1.0,0.0],[0.0,0.0]],[[0.0,0.0],[0.0,0.0]]]},"check":"control: product keep 1","expected":{"purity":1.0,"rho":[[[1.0,0.0],[0.0,0.0]],[[0.0,0.0],[0.0,0.0]]]},"passed":true},{"actual":{"purity":0.504908,"rho":[[[0.549537,0.0],[0.241932,0.063109]],[[0.241932,-0.063109],[0.450463,0.0]]]},"check":"regression: random reduction 1","expected":{"purity":0.629935,"rho":[[[0.549537,0.0],[0.241932,0.063109]],[[0.241932,-0.063109],[0.450463,0.0]]]},"passed":false},{"actual":{"purity":0.569303,"rho":[[[0.313851,0.0],[-0.134578,-0.188226]],[[-0.134578,0.188226],[0.686149,0.0]]]},"check":"regression: random reduction 2","expected":{"purity":0.676383,"rho":[[[0.313851,0.0],[-0.134578,-0.188226]],[[-0.134578,0.188226],[0.686149,0.0]]]},"passed":false},{"actual":{"purity":0.502645,"rho":[[[0.536366,0.0],[0.005901,0.046665]],[[0.005901,-0.046665],[0.463634,0.0]]]},"check":"regression: random reduction 3","expected":{"purity":0.50707,"rho":[[[0.536366,0.0],[0.005901,0.046665]],[[0.005901,-0.046665],[0.463634,0.0]]]},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: product keep 0 complex\", \"actual\": {\"rho\": [[[0.36, 0.0], [0.0, -0.48]], [[0.0, 0.48], [0.64, 0.0]]], \"purity\": 0.5392}, \"expected\": {\"rho\": [[[0.36, 0.0], [0.0, -0.48]], [[0.0, 0.48], [0.64, 0.0]]], \"purity\": 1.0}, \"passed\": false}, {\"check\": \"regression: random reduction 0\", \"actual\": {\"rho\": [[[0.422483, 0.0], [-0.136327, -0.218796]], [[-0.136327, 0.218796], [0.577517, 0.0]]], \"purity\": 0.512018}, \"expected\": {\"rho\": [[[0.422483, 0.0], [-0.136327, -0.218796]], [[-0.136327, 0.218796], [0.577517, 0.0]]], \"purity\": 0.644932}, \"passed\": false}, {\"check\": \"repair check: bell keep 0\", \"actual\": {\"rho\": [[[0.5, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.5, 0.0]]], \"purity\": 0.5}, \"expected\": {\"rho\": [[[0.5, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.5, 0.0]]], \"purity\": 0.5}, \"passed\": true}, {\"check\": \"control: product keep 1\", \"actual\": {\"rho\": [[[1.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]]], \"purity\": 1.0}, \"expected\": {\"rho\": [[[1.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]]], \"purity\": 1.0}, \"passed\": true}, {\"check\": \"regression: random reduction 1\", \"actual\": {\"rho\": [[[0.549537, 0.0], [0.241932, 0.063109]], [[0.241932, -0.063109], [0.450463, 0.0]]], \"purity\": 0.504908}, \"expected\": {\"rho\": [[[0.549537, 0.0], [0.241932, 0.063109]], [[0.241932, -0.063109], [0.450463, 0.0]]], \"purity\": 0.629935}, \"passed\": false}, {\"check\": \"regression: random reduction 2\", \"actual\": {\"rho\": [[[0.313851, 0.0], [-0.134578, -0.188226]], [[-0.134578, 0.188226], [0.686149, 0.0]]], \"purity\": 0.569303}, \"expected\": {\"rho\": [[[0.313851, 0.0], [-0.134578, -0.188226]], [[-0.134578, 0.188226], [0.686149, 0.0]]], \"purity\": 0.676383}, \"passed\": false}, {\"check\": \"regression: random reduction 3\", \"actual\": {\"rho\": [[[0.536366, 0.0], [0.005901, 0.046665]], [[0.005901, -0.046665], [0.463634, 0.0]]], \"purity\": 0.502645}, \"expected\": {\"rho\": [[[0.536366, 0.0], [0.005901, 0.046665]], [[0.005901, -0.046665], [0.463634, 0.0]]], \"purity\": 0.50707}, \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":44.823,"exit_code":0,"observations":[{"actual":{"purity":1.0,"rho":[[[0.36,0.0],[0.0,-0.48]],[[0.0,0.48],[0.64,0.0]]]},"check":"regression: product keep 0 complex","expected":{"purity":1.0,"rho":[[[0.36,0.0],[0.0,-0.48]],[[0.0,0.48],[0.64,0.0]]]},"passed":true},{"actual":{"purity":0.644932,"rho":[[[0.422483,0.0],[-0.136327,-0.218796]],[[-0.136327,0.218796],[0.577517,0.0]]]},"check":"regression: random reduction 0","expected":{"purity":0.644932,"rho":[[[0.422483,0.0],[-0.136327,-0.218796]],[[-0.136327,0.218796],[0.577517,0.0]]]},"passed":true},{"actual":{"purity":0.5,"rho":[[[0.5,0.0],[0.0,0.0]],[[0.0,0.0],[0.5,0.0]]]},"check":"repair check: bell keep 0","expected":{"purity":0.5,"rho":[[[0.5,0.0],[0.0,0.0]],[[0.0,0.0],[0.5,0.0]]]},"passed":true},{"actual":{"purity":1.0,"rho":[[[1.0,0.0],[0.0,0.0]],[[0.0,0.0],[0.0,0.0]]]},"check":"control: product keep 1","expected":{"purity":1.0,"rho":[[[1.0,0.0],[0.0,0.0]],[[0.0,0.0],[0.0,0.0]]]},"passed":true},{"actual":{"purity":0.629935,"rho":[[[0.549537,0.0],[0.241932,0.063109]],[[0.241932,-0.063109],[0.450463,0.0]]]},"check":"regression: random reduction 1","expected":{"purity":0.629935,"rho":[[[0.549537,0.0],[0.241932,0.063109]],[[0.241932,-0.063109],[0.450463,0.0]]]},"passed":true},{"actual":{"purity":0.676383,"rho":[[[0.313851,0.0],[-0.134578,-0.188226]],[[-0.134578,0.188226],[0.686149,0.0]]]},"check":"regression: random reduction 2","expected":{"purity":0.676383,"rho":[[[0.313851,0.0],[-0.134578,-0.188226]],[[-0.134578,0.188226],[0.686149,0.0]]]},"passed":true},{"actual":{"purity":0.50707,"rho":[[[0.536366,0.0],[0.005901,0.046665]],[[0.005901,-0.046665],[0.463634,0.0]]]},"check":"regression: random reduction 3","expected":{"purity":0.50707,"rho":[[[0.536366,0.0],[0.005901,0.046665]],[[0.005901,-0.046665],[0.463634,0.0]]]},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: product keep 0 complex\", \"actual\": {\"rho\": [[[0.36, 0.0], [0.0, -0.48]], [[0.0, 0.48], [0.64, 0.0]]], \"purity\": 1.0}, \"expected\": {\"rho\": [[[0.36, 0.0], [0.0, -0.48]], [[0.0, 0.48], [0.64, 0.0]]], \"purity\": 1.0}, \"passed\": true}, {\"check\": \"regression: random reduction 0\", \"actual\": {\"rho\": [[[0.422483, 0.0], [-0.136327, -0.218796]], [[-0.136327, 0.218796], [0.577517, 0.0]]], \"purity\": 0.644932}, \"expected\": {\"rho\": [[[0.422483, 0.0], [-0.136327, -0.218796]], [[-0.136327, 0.218796], [0.577517, 0.0]]], \"purity\": 0.644932}, \"passed\": true}, {\"check\": \"repair check: bell keep 0\", \"actual\": {\"rho\": [[[0.5, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.5, 0.0]]], \"purity\": 0.5}, \"expected\": {\"rho\": [[[0.5, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.5, 0.0]]], \"purity\": 0.5}, \"passed\": true}, {\"check\": \"control: product keep 1\", \"actual\": {\"rho\": [[[1.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]]], \"purity\": 1.0}, \"expected\": {\"rho\": [[[1.0, 0.0], [0.0, 0.0]], [[0.0, 0.0], [0.0, 0.0]]], \"purity\": 1.0}, \"passed\": true}, {\"check\": \"regression: random reduction 1\", \"actual\": {\"rho\": [[[0.549537, 0.0], [0.241932, 0.063109]], [[0.241932, -0.063109], [0.450463, 0.0]]], \"purity\": 0.629935}, \"expected\": {\"rho\": [[[0.549537, 0.0], [0.241932, 0.063109]], [[0.241932, -0.063109], [0.450463, 0.0]]], \"purity\": 0.629935}, \"passed\": true}, {\"check\": \"regression: random reduction 2\", \"actual\": {\"rho\": [[[0.313851, 0.0], [-0.134578, -0.188226]], [[-0.134578, 0.188226], [0.686149, 0.0]]], \"purity\": 0.676383}, \"expected\": {\"rho\": [[[0.313851, 0.0], [-0.134578, -0.188226]], [[-0.134578, 0.188226], [0.686149, 0.0]]], \"purity\": 0.676383}, \"passed\": true}, {\"check\": \"regression: random reduction 3\", \"actual\": {\"rho\": [[[0.536366, 0.0], [0.005901, 0.046665]], [[0.005901, -0.046665], [0.463634, 0.0]]], \"purity\": 0.50707}, \"expected\": {\"rho\": [[[0.536366, 0.0], [0.005901, 0.046665]], [[0.005901, -0.046665], [0.463634, 0.0]]], \"purity\": 0.50707}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}