{"name":"Fault-Tolerant Resources Tool","description":"Derives the full surface-code + magic-state-distillation footprint of an algorithm — factory choice, tile layout, required code distance, physical qubits, wall-clock time — from (numLogicalQubits, tCount, physical error rate), using the Litinski lattice-surgery cost model (arXiv:1808.02892). With errorCorrectionCode set to a qLDPC code that has architecture data (bb-144-12-12, bb-288-12-18) it sizes a machine on that code's published architecture instead, with a surface-code factory. Results are reported under two published logical-error fits (conservative + optimistic) because they disagree by 13-268x (d=7 to d=25); the spread is genuine model uncertainty. Returns an explicit `infeasible` block when no cataloged factory or distance satisfies the error budget. This tool computes numbers only — comparisons against classical alternatives and any \"should this run on a quantum computer\" conclusion stay with the calling agent.","endpoints":{"POST /api/fault-tolerant-resources":"Compute one scenario. Send the input as JSON in the body.","GET /api/fault-tolerant-resources":"Returns this schema document.","GET /api/fault-tolerant-resources?numLogicalQubits=...&tCount=...&qubitErrorRate=...":"Compute one scenario via query parameters. Returns the same JSON as POST. Cacheable."},"input":{"numLogicalQubits":{"type":"integer","required":true,"bounds":{"min":1,"max":1000000},"description":"Number of logical data qubits the algorithm needs."},"tCount":{"type":"integer","required":true,"bounds":{"min":1,"max":10000000000000},"description":"Total T gates (magic states consumed). Convert Toffoli counts to T before calling (1 Toffoli ≈ 4–7 T)."},"qubitErrorRate":{"type":"number","required":"exactly one of qubitErrorRate | hardwareId","bounds":{"exclusiveMin":0,"max":0.1},"description":"Physical 2-qubit error rate p."},"hardwareId":{"type":"string","required":"exactly one of qubitErrorRate | hardwareId","enum":["trapped-ion","superconducting","neutral-atom"],"description":"Platform alternative to qubitErrorRate, one of trapped-ion, superconducting, neutral-atom: resolves to the 2-qubit error rate of that platform's entry in the current quantum computers table (list_current_quantum_computers). It sets the error rate only; cycleTimeSeconds keeps its 1 µs (superconducting) default unless given. Supply exactly one of qubitErrorRate or hardwareId. Pass it, rather than a generic qubitErrorRate, whenever the question names a platform without stating its error rate."},"targetSuccessProbability":{"type":"number","required":false,"default":0.98,"bounds":{"exclusiveMin":0,"exclusiveMax":1},"description":"End-to-end success target. The failure budget is split evenly between T-state and logical error (Litinski §4 convention)."},"dataBlock":{"type":"string","required":false,"default":"compact","enum":["compact","intermediate","fast"],"description":"Data-block layout: compact = fewest qubits, fast = shortest time per T gate."},"cycleTimeSeconds":{"type":"number","required":false,"default":0.000001,"bounds":{"exclusiveMin":0,"max":1},"description":"Syndrome-cycle time in seconds (surface code, or one cycle of the selected qLDPC code), at most 1. Default 1 µs (superconducting scale). Set explicitly for other platforms — trapped-ion/neutral-atom cycles are orders of magnitude slower."},"errorCorrectionCode":{"type":"string","required":false,"default":"surface","enum":["surface","surface-code","bb-144-12-12","bb-288-12-18"],"description":"Code holding the logical data. \"surface\" (alias \"surface-code\"): Litinski lattice-surgery footprint. A qLDPC id with architecture data (the architecture field of list_qldpc_codes): footprint on that published architecture (code modules, per-instruction error rates, full-support compilation per T gate); the factory stays a surface-code block, and each fit's distance is then the factory's."}},"outputTopLevelKeys":{"scenario":"Echo of the validated input (with hardwareId resolution and the canonical errorCorrectionCode).","qldpc":"Null for surface. For a qLDPC code: modules, module qubit breakdown, instruction error rates at the scenario p, error per T gate by instruction, publishedRange / withinPublishedRange, assumedRates, fittedRates, caveats.","infeasible":"Null when a solution exists under AT LEAST ONE fit; otherwise { reason } — either no cataloged factory reaches the T-error budget (catalog-relative, see caveats) or no modeled distance suppresses the logical error under either fit. When null, still check each per-fit unreachableReason before dereferencing that fit's numbers: one fit can be unreachable while the other is feasible.","factory":"Chosen distillation factory: id, tiles, outputErrorRate, successProbability, stepsPerOutputState.","layout":"Tile accounting: dataBlockTiles, factoryTiles, storageTiles, totalTiles. Null in qLDPC mode.","effectiveStepsPerTGate":"max(factory production steps per state, data-block consumption steps).","totalTimeSteps":"tCount × effectiveStepsPerTGate.","results":"{ conservative, optimistic } — per-fit: required distance, physicalQubits (= totalTiles × 2d²), wallClockSeconds (= totalTimeSteps × d × cycleTime), errorBudget breakdown, unreachableReason if applicable. In qLDPC mode distance is the factory's, physicalQubits = data modules + factory, and qldpcDetail carries timesteps per T gate and the error split.","formulas":"Every formula executed, in one place.","assumptions":"What the model assumes (single factory, even budget split, T-count-limited runtime, …).","caveats":"Fit spread (13-268x (d=7 to d=25)), systematic time-optimism (decoder latency excluded), catalog-relative factory screen, ADR-002 note that conclusions stay with the caller.","sources":"Primary papers behind every constant."},"forwardCompat":{"contract":"additive-only — top-level keys listed above are stable; new keys may be added without notice.","cors":"Access-Control-Allow-Origin: * on both GET and POST."}}