{"abstract":"Success probabilities are reported for angle 2k theta, underestimating the achievable probability.","category":"Quantum circuit simulation","checks":7,"contract":"Input [N, M]. \"invalid\" if N < 1, M < 0 or M > N; \"no-solution\" if M == 0; if 2M >= N return {\"iterations\": 0, \"success\": M/N}; else theta = asin(sqrt(M/N)), k = floor(pi/(4 theta)) and success = sin^2((2k+1) theta). Probabilities rounded to 6 decimals.","evaluation_group":"w2-quantum_circuit_simulation-grover-iteration-planner","failed_approach":"The attempted repair uses the right angle but returns sin instead of sin squared.","family":"w2-quantum_circuit_simulation-grover-iteration-planner-success-angle","id":"FA-91201","implementations":{"attempt":{"sha256":"d0ef7748952228d301b95952cb61765ed9ff2638d9a3e0432bdcdd64537feb88","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    N, M = x\n    if N < 1 or M < 0 or M > N:\n        return 'invalid'\n    if M == 0:\n        return 'no-solution'\n    if 2 * M >= N:\n        return {'iterations': 0, 'success': round(M / N, 6)}\n    theta = math.asin(math.sqrt(M / N))\n    k = math.floor(math.pi / (4 * theta))\n    return {'iterations': k, 'success': round(math.sin((2 * k + 1) * theta), 6)}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: odd N just under half', [5, 2], {'iterations': 1, 'success': 0.784}], ['regression: single marked N=4', [4, 1], {'iterations': 1, 'success': 1.0}], ['regression: N=7 M=3', [7, 3], {'iterations': 1, 'success': 0.708455}], ['control: half marked N=4 M=2', [4, 2], {'iterations': 0, 'success': 0.5}], ['control: no marked items', [8, 0], 'no-solution'], ['control: M greater than N', [4, 5], 'invalid'], ['control: negative M', [4, -1], 'invalid']], [['regression: N=9 M=4', [9, 4], {'iterations': 1, 'success': 0.663923}], ['regression: N=8 M=1', [8, 1], {'iterations': 2, 'success': 0.945312}], ['regression: N=8 M=3', [8, 3], {'iterations': 1, 'success': 0.84375}], ['control: empty space', [0, 0], 'invalid'], ['control: all marked', [8, 8], {'iterations': 0, 'success': 1.0}], ['control: one over the space', [4, 5], 'invalid'], ['control: all marked N=1', [1, 1], {'iterations': 0, 'success': 1.0}]], [['regression: N=8 M=3', [8, 3], {'iterations': 1, 'success': 0.84375}], ['regression: N=16 M=1', [16, 1], {'iterations': 3, 'success': 0.961319}], ['regression: N=16 M=2', [16, 2], {'iterations': 2, 'success': 0.945312}], ['control: all marked N=3', [3, 3], {'iterations': 0, 'success': 1.0}], ['control: N=8 M=5', [8, 5], {'iterations': 0, 'success': 0.625}], ['control: N=8 M=7', [8, 7], {'iterations': 0, 'success': 0.875}], ['control: N=16 M=13', [16, 13], {'iterations': 0, 'success': 0.8125}]], [['regression: N=16 M=3', [16, 3], {'iterations': 1, 'success': 0.949219}], ['regression: N=16 M=5', [16, 5], {'iterations': 1, 'success': 0.957031}], ['regression: N=16 M=2', [16, 2], {'iterations': 2, 'success': 0.945312}], ['control: half marked N=4 M=2', [4, 2], {'iterations': 0, 'success': 0.5}], ['control: no marked items', [8, 0], 'no-solution'], ['control: M greater than N', [4, 5], 'invalid'], ['control: negative M', [4, -1], 'invalid']], [['regression: N=32 M=1', [32, 1], {'iterations': 4, 'success': 0.999182}], ['regression: N=32 M=2', [32, 2], {'iterations': 3, 'success': 0.961319}], ['regression: N=16 M=5', [16, 5], {'iterations': 1, 'success': 0.957031}], ['control: empty space', [0, 0], 'invalid'], ['control: all marked', [8, 8], {'iterations': 0, 'success': 1.0}], ['control: one over the space', [4, 5], 'invalid'], ['control: all marked N=1', [1, 1], {'iterations': 0, 'success': 1.0}]]]\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":"a469bbe6d5be01c48dfe87d3cc4e83c306e2851c930a8ea4b718796334a03b9d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    N, M = x\n    if N < 1 or M < 0 or M > N:\n        return 'invalid'\n    if M == 0:\n        return 'no-solution'\n    if 2 * M >= N:\n        return {'iterations': 0, 'success': round(M / N, 6)}\n    theta = math.asin(math.sqrt(M / N))\n    k = math.floor(math.pi / (4 * theta))\n    return {'iterations': k, 'success': round(math.sin((2 * k) * theta) ** 2, 6)}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: odd N just under half', [5, 2], {'iterations': 1, 'success': 0.784}], ['regression: single marked N=4', [4, 1], {'iterations': 1, 'success': 1.0}], ['regression: N=7 M=3', [7, 3], {'iterations': 1, 'success': 0.708455}], ['control: half marked N=4 M=2', [4, 2], {'iterations': 0, 'success': 0.5}], ['control: no marked items', [8, 0], 'no-solution'], ['control: M greater than N', [4, 5], 'invalid'], ['control: negative M', [4, -1], 'invalid']], [['regression: N=9 M=4', [9, 4], {'iterations': 1, 'success': 0.663923}], ['regression: N=8 M=1', [8, 1], {'iterations': 2, 'success': 0.945312}], ['regression: N=8 M=3', [8, 3], {'iterations': 1, 'success': 0.84375}], ['control: empty space', [0, 0], 'invalid'], ['control: all marked', [8, 8], {'iterations': 0, 'success': 1.0}], ['control: one over the space', [4, 5], 'invalid'], ['control: all marked N=1', [1, 1], {'iterations': 0, 'success': 1.0}]], [['regression: N=8 M=3', [8, 3], {'iterations': 1, 'success': 0.84375}], ['regression: N=16 M=1', [16, 1], {'iterations': 3, 'success': 0.961319}], ['regression: N=16 M=2', [16, 2], {'iterations': 2, 'success': 0.945312}], ['control: all marked N=3', [3, 3], {'iterations': 0, 'success': 1.0}], ['control: N=8 M=5', [8, 5], {'iterations': 0, 'success': 0.625}], ['control: N=8 M=7', [8, 7], {'iterations': 0, 'success': 0.875}], ['control: N=16 M=13', [16, 13], {'iterations': 0, 'success': 0.8125}]], [['regression: N=16 M=3', [16, 3], {'iterations': 1, 'success': 0.949219}], ['regression: N=16 M=5', [16, 5], {'iterations': 1, 'success': 0.957031}], ['regression: N=16 M=2', [16, 2], {'iterations': 2, 'success': 0.945312}], ['control: half marked N=4 M=2', [4, 2], {'iterations': 0, 'success': 0.5}], ['control: no marked items', [8, 0], 'no-solution'], ['control: M greater than N', [4, 5], 'invalid'], ['control: negative M', [4, -1], 'invalid']], [['regression: N=32 M=1', [32, 1], {'iterations': 4, 'success': 0.999182}], ['regression: N=32 M=2', [32, 2], {'iterations': 3, 'success': 0.961319}], ['regression: N=16 M=5', [16, 5], {'iterations': 1, 'success': 0.957031}], ['control: empty space', [0, 0], 'invalid'], ['control: all marked', [8, 8], {'iterations': 0, 'success': 1.0}], ['control: one over the space', [4, 5], 'invalid'], ['control: all marked N=1', [1, 1], {'iterations': 0, 'success': 1.0}]]]\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":"fa4e071c071fe739d089653857396ae84e2cb51f6340bcd5d3a141f4afa6c381","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    N, M = x\n    if N < 1 or M < 0 or M > N:\n        return 'invalid'\n    if M == 0:\n        return 'no-solution'\n    if 2 * M >= N:\n        return {'iterations': 0, 'success': round(M / N, 6)}\n    theta = math.asin(math.sqrt(M / N))\n    k = math.floor(math.pi / (4 * theta))\n    return {'iterations': k, 'success': round(math.sin((2 * k + 1) * theta) ** 2, 6)}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: odd N just under half', [5, 2], {'iterations': 1, 'success': 0.784}], ['regression: single marked N=4', [4, 1], {'iterations': 1, 'success': 1.0}], ['regression: N=7 M=3', [7, 3], {'iterations': 1, 'success': 0.708455}], ['control: half marked N=4 M=2', [4, 2], {'iterations': 0, 'success': 0.5}], ['control: no marked items', [8, 0], 'no-solution'], ['control: M greater than N', [4, 5], 'invalid'], ['control: negative M', [4, -1], 'invalid']], [['regression: N=9 M=4', [9, 4], {'iterations': 1, 'success': 0.663923}], ['regression: N=8 M=1', [8, 1], {'iterations': 2, 'success': 0.945312}], ['regression: N=8 M=3', [8, 3], {'iterations': 1, 'success': 0.84375}], ['control: empty space', [0, 0], 'invalid'], ['control: all marked', [8, 8], {'iterations': 0, 'success': 1.0}], ['control: one over the space', [4, 5], 'invalid'], ['control: all marked N=1', [1, 1], {'iterations': 0, 'success': 1.0}]], [['regression: N=8 M=3', [8, 3], {'iterations': 1, 'success': 0.84375}], ['regression: N=16 M=1', [16, 1], {'iterations': 3, 'success': 0.961319}], ['regression: N=16 M=2', [16, 2], {'iterations': 2, 'success': 0.945312}], ['control: all marked N=3', [3, 3], {'iterations': 0, 'success': 1.0}], ['control: N=8 M=5', [8, 5], {'iterations': 0, 'success': 0.625}], ['control: N=8 M=7', [8, 7], {'iterations': 0, 'success': 0.875}], ['control: N=16 M=13', [16, 13], {'iterations': 0, 'success': 0.8125}]], [['regression: N=16 M=3', [16, 3], {'iterations': 1, 'success': 0.949219}], ['regression: N=16 M=5', [16, 5], {'iterations': 1, 'success': 0.957031}], ['regression: N=16 M=2', [16, 2], {'iterations': 2, 'success': 0.945312}], ['control: half marked N=4 M=2', [4, 2], {'iterations': 0, 'success': 0.5}], ['control: no marked items', [8, 0], 'no-solution'], ['control: M greater than N', [4, 5], 'invalid'], ['control: negative M', [4, -1], 'invalid']], [['regression: N=32 M=1', [32, 1], {'iterations': 4, 'success': 0.999182}], ['regression: N=32 M=2', [32, 2], {'iterations': 3, 'success': 0.961319}], ['regression: N=16 M=5', [16, 5], {'iterations': 1, 'success': 0.957031}], ['control: empty space', [0, 0], 'invalid'], ['control: all marked', [8, 8], {'iterations': 0, 'success': 1.0}], ['control: one over the space', [4, 5], 'invalid'], ['control: all marked N=1', [1, 1], {'iterations': 0, 'success': 1.0}]]]\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-grover-iteration-planner-success-angle","generated_at":"2026-09-29T14:51:33.713948+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Choosing the Grover iteration count wrongly overshoots the amplitude peak and collapses the success probability.","repair":"Use sin^2((2k+1) theta).","root_cause":"After k iterations the state angle is (2k+1) theta, but the planner uses 2k theta.","sha256":"4990702aa9c94c9f74b677dc053a8e118b673e71a1efe0a8be53e5545a000d32","title":"Grover planner omits the initial rotation from the success angle · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":44.837,"exit_code":1,"observations":[{"actual":{"iterations":1,"success":0.885438},"check":"regression: odd N just under half","expected":{"iterations":1,"success":0.784},"passed":false},{"actual":{"iterations":1,"success":1.0},"check":"regression: single marked N=4","expected":{"iterations":1,"success":1.0},"passed":true},{"actual":{"iterations":1,"success":0.841698},"check":"regression: N=7 M=3","expected":{"iterations":1,"success":0.708455},"passed":false},{"actual":{"iterations":0,"success":0.5},"check":"control: half marked N=4 M=2","expected":{"iterations":0,"success":0.5},"passed":true},{"actual":"no-solution","check":"control: no marked items","expected":"no-solution","passed":true},{"actual":"invalid","check":"control: M greater than N","expected":"invalid","passed":true},{"actual":"invalid","check":"control: negative M","expected":"invalid","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: odd N just under half\", \"actual\": {\"iterations\": 1, \"success\": 0.885438}, \"expected\": {\"iterations\": 1, \"success\": 0.784}, \"passed\": false}, {\"check\": \"regression: single marked N=4\", \"actual\": {\"iterations\": 1, \"success\": 1.0}, \"expected\": {\"iterations\": 1, \"success\": 1.0}, \"passed\": true}, {\"check\": \"regression: N=7 M=3\", \"actual\": {\"iterations\": 1, \"success\": 0.841698}, \"expected\": {\"iterations\": 1, \"success\": 0.708455}, \"passed\": false}, {\"check\": \"control: half marked N=4 M=2\", \"actual\": {\"iterations\": 0, \"success\": 0.5}, \"expected\": {\"iterations\": 0, \"success\": 0.5}, \"passed\": true}, {\"check\": \"control: no marked items\", \"actual\": \"no-solution\", \"expected\": \"no-solution\", \"passed\": true}, {\"check\": \"control: M greater than N\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"control: negative M\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.613,"exit_code":1,"observations":[{"actual":{"iterations":1,"success":0.96},"check":"regression: odd N just under half","expected":{"iterations":1,"success":0.784},"passed":false},{"actual":{"iterations":1,"success":0.75},"check":"regression: single marked N=4","expected":{"iterations":1,"success":1.0},"passed":false},{"actual":{"iterations":1,"success":0.979592},"check":"regression: N=7 M=3","expected":{"iterations":1,"success":0.708455},"passed":false},{"actual":{"iterations":0,"success":0.5},"check":"control: half marked N=4 M=2","expected":{"iterations":0,"success":0.5},"passed":true},{"actual":"no-solution","check":"control: no marked items","expected":"no-solution","passed":true},{"actual":"invalid","check":"control: M greater than N","expected":"invalid","passed":true},{"actual":"invalid","check":"control: negative M","expected":"invalid","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: odd N just under half\", \"actual\": {\"iterations\": 1, \"success\": 0.96}, \"expected\": {\"iterations\": 1, \"success\": 0.784}, \"passed\": false}, {\"check\": \"regression: single marked N=4\", \"actual\": {\"iterations\": 1, \"success\": 0.75}, \"expected\": {\"iterations\": 1, \"success\": 1.0}, \"passed\": false}, {\"check\": \"regression: N=7 M=3\", \"actual\": {\"iterations\": 1, \"success\": 0.979592}, \"expected\": {\"iterations\": 1, \"success\": 0.708455}, \"passed\": false}, {\"check\": \"control: half marked N=4 M=2\", \"actual\": {\"iterations\": 0, \"success\": 0.5}, \"expected\": {\"iterations\": 0, \"success\": 0.5}, \"passed\": true}, {\"check\": \"control: no marked items\", \"actual\": \"no-solution\", \"expected\": \"no-solution\", \"passed\": true}, {\"check\": \"control: M greater than N\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"control: negative M\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.599,"exit_code":0,"observations":[{"actual":{"iterations":1,"success":0.784},"check":"regression: odd N just under half","expected":{"iterations":1,"success":0.784},"passed":true},{"actual":{"iterations":1,"success":1.0},"check":"regression: single marked N=4","expected":{"iterations":1,"success":1.0},"passed":true},{"actual":{"iterations":1,"success":0.708455},"check":"regression: N=7 M=3","expected":{"iterations":1,"success":0.708455},"passed":true},{"actual":{"iterations":0,"success":0.5},"check":"control: half marked N=4 M=2","expected":{"iterations":0,"success":0.5},"passed":true},{"actual":"no-solution","check":"control: no marked items","expected":"no-solution","passed":true},{"actual":"invalid","check":"control: M greater than N","expected":"invalid","passed":true},{"actual":"invalid","check":"control: negative M","expected":"invalid","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: odd N just under half\", \"actual\": {\"iterations\": 1, \"success\": 0.784}, \"expected\": {\"iterations\": 1, \"success\": 0.784}, \"passed\": true}, {\"check\": \"regression: single marked N=4\", \"actual\": {\"iterations\": 1, \"success\": 1.0}, \"expected\": {\"iterations\": 1, \"success\": 1.0}, \"passed\": true}, {\"check\": \"regression: N=7 M=3\", \"actual\": {\"iterations\": 1, \"success\": 0.708455}, \"expected\": {\"iterations\": 1, \"success\": 0.708455}, \"passed\": true}, {\"check\": \"control: half marked N=4 M=2\", \"actual\": {\"iterations\": 0, \"success\": 0.5}, \"expected\": {\"iterations\": 0, \"success\": 0.5}, \"passed\": true}, {\"check\": \"control: no marked items\", \"actual\": \"no-solution\", \"expected\": \"no-solution\", \"passed\": true}, {\"check\": \"control: M greater than N\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"control: negative M\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}