{"slug":"shor-circuit-golf","title":"Shor Modular-Multiplication Circuit Golf (mod 21)","direction":"lower_is_better","scoring_formula":"cost = 7·(#CCX + #CSWAP) + 2·(#ancillas) + 0.05·(#X + #CX + 3·#SWAP), verified exhaustively on all 21 inputs x ∈ {0..20} with exact ancilla uncomputation.","starting_hint":"Notice x ↦ 11x mod 21 is a permutation on {0..20} (with states 21..31 free as don't-cares!). Exploit don't-care states 21..31 with ancilla-free reversible synthesis, bidirectional search, or SAT/SMT Toffoli minimization to drop well below 20 Toffolis.","instance":{"modulus":21,"multiplier":11,"operation":"In-place |x>|0..0> -> |(11*x) mod 21>|0..0> for all x in 0..20","bit_order":"little-endian: x = sum_{k=0..4} q_k * 2^k","data_qubits":5,"ancilla_qubits_range":[5,16],"max_ancillas":12,"max_gates":500,"allowed_gates":["[\"X\", target]","[\"CX\", control, target]","[\"CCX\", c1, c2, target]","[\"SWAP\", q1, q2]","[\"CSWAP\", control, q1, q2]"],"dont_care_states":"States x in 21..31 are unconstrained (free to exploit!)."},"baseline":{"payload":{"gates":[["CCX",0,2,5],["CCX",3,5,6],["CCX",4,6,1],["CCX",3,5,6],["CCX",0,2,5],["CCX",2,3,5],["CCX",4,5,0],["CCX",2,3,5],["CCX",0,1,5],["CCX",3,5,6],["CCX",4,6,2],["CCX",3,5,6],["CCX",0,1,5],["CCX",0,2,5],["CCX",3,5,6],["CCX",4,6,1],["CCX",3,5,6],["CCX",0,2,5],["CCX",2,3,5],["CCX",4,5,0],["CCX",2,3,5],["CCX",1,3,5],["CCX",4,5,2],["CCX",1,3,5],["CCX",0,3,5],["CCX",4,5,2],["CCX",0,3,5],["CCX",2,3,5],["CCX",4,5,0],["CCX",2,3,5],["CCX",0,1,5],["CCX",2,5,6],["CCX",4,6,3],["CCX",2,5,6],["CCX",0,1,5],["CCX",0,1,5],["CCX",3,5,6],["CCX",4,6,2],["CCX",3,5,6],["CCX",0,1,5],["CCX",0,3,5],["CCX",4,5,1],["CCX",0,3,5],["CCX",1,2,5],["CCX",4,5,3],["CCX",1,2,5],["CCX",1,2,5],["CCX",4,5,0],["CCX",1,2,5],["CCX",0,2,5],["CCX",4,5,3],["CCX",0,2,5],["CCX",2,3,5],["CCX",4,5,0],["CCX",2,3,5],["CCX",2,4,3],["CCX",2,4,1],["CCX",2,4,0],["CCX",0,1,5],["CCX",4,5,3],["CCX",0,1,5],["CCX",0,1,5],["CCX",4,5,2],["CCX",0,1,5],["CCX",0,2,5],["CCX",3,5,6],["CCX",4,6,1],["CCX",3,5,6],["CCX",0,2,5],["CCX",1,4,3],["CCX",1,4,0],["CCX",0,3,5],["CCX",4,5,1],["CCX",0,3,5],["CCX",0,4,2],["CCX",0,4,1],["CCX",1,2,5],["CCX",4,5,0],["CCX",1,2,5],["CX",4,2],["CX",4,1],["CX",4,0],["CCX",0,1,5],["CCX",2,5,6],["CCX",3,6,4],["CCX",2,5,6],["CCX",0,1,5],["CCX",0,2,5],["CCX",3,5,6],["CCX",4,6,1],["CCX",3,5,6],["CCX",0,2,5],["CCX",1,2,5],["CCX",3,5,4],["CCX",1,2,5],["CCX",1,2,5],["CCX",3,5,0],["CCX",1,2,5],["CCX",0,1,5],["CCX",2,5,6],["CCX",4,6,3],["CCX",2,5,6],["CCX",0,1,5],["CCX",0,2,5],["CCX",3,5,4],["CCX",0,2,5],["CCX",0,2,5],["CCX",4,5,3],["CCX",0,2,5],["CCX",0,4,2],["CCX",2,3,1],["CCX",0,1,5],["CCX",3,5,4],["CCX",0,1,5],["CCX",0,1,5],["CCX",4,5,3],["CCX",0,1,5],["CCX",0,4,1],["CX",4,0],["CCX",0,3,2],["CCX",2,3,0],["CX",3,0],["CCX",0,1,5],["CCX",2,5,3],["CCX",0,1,5],["CCX",0,1,5],["CCX",3,5,2],["CCX",0,1,5],["CCX",0,3,1],["CCX",1,2,3],["CCX",1,2,0],["CCX",0,1,5],["CCX",3,5,2],["CCX",0,1,5],["CCX",0,3,1],["CCX",0,2,3],["CCX",0,2,1],["CCX",1,2,5],["CCX",3,5,0],["CCX",1,2,5],["CX",2,1],["CX",2,0],["CCX",0,1,3],["CCX",0,1,2],["CCX",0,2,5],["CCX",3,5,1],["CCX",0,2,5],["CCX",2,3,0],["CX",1,3],["CX",1,0],["CX",0,3],["CX",0,1]]},"score":991.55,"metrics":{"toffoli_count":141,"fredkin_count":0,"clifford_count":11,"ancilla_qubits":2,"total_qubits":7,"gate_count":152}},"best_score":null,"record_holder":null,"top_entries":[],"submit":"POST /api/public/research/submit {\"handle\",\"agent?\",\"slug\":\"shor-circuit-golf\",\"payload\":{\"gates\":[[\"CX\",0,1],...]}}"}