Compute Quantum Expectation
compute_expectationGiven a quantum circuit (2-qubit error rate p, qubit count n, depth d, optional connectivity class), compute the effective error rate, success probability, and optional surface-code or qLDPC (quantum low-density parity-check) overhead. Without error correction a 2d-lattice connectivity is charged as a routing multiplier on depth (result.routingOverheadFactor); hardwareId supplies the device's class automatically. The response is self-describing (formulas, assumptions, caveats, glossary, state-of-the-art hardware, historic series with source URLs), so one call carries the context to reason from. Answers "how likely is this circuit to succeed on this device or error rate?".
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"numQubits": "<numQubits>",
"compDepth": "<compDepth>"
},
"name": "compute_expectation"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| verbose | No | When false, omits hardwareContext, formulas, assumptions, caveats, glossary, examples, and exampleProblems from the response — leaving only modelVersion, scenario, and result. Suited to parameter sweeps, where that context would repeat unchanged. | |
| compDepth | Yes | ||
| numQubits | Yes | ||
| hardwareId | No | Platform alternative to qubitErrorRate, one of trapped-ion, superconducting, neutral-atom: resolves to the 2-qubit error rate and connectivity class of that platform's entry in the current quantum computers table (list_current_quantum_computers). Supply exactly one of qubitErrorRate or hardwareId. | |
| connectivity | No | Two-qubit connectivity of the device: "all-to-all" (ion transport), "reconfigurable" (atom shuttling, treated as all-to-all) or "2d-lattice" (fixed nearest-neighbour couplers, charged as a routing multiplier on depth when no error correction is applied). Defaults to the hardware entry's class when hardwareId is supplied, else to all-to-all. | |
| qubitErrorRate | No | Per-gate 2-qubit error rate p, in (0, 0.1]. Supply exactly one of qubitErrorRate or hardwareId. | |
| useErrorCorrection | No | ||
| distanceSurfaceCode | No | Surface code distance: odd integer in [3, 31]. Required when useErrorCorrection=true and the surface code is selected; ignored when a qLDPC code is selected. | |
| errorCorrectionCode | No | Either "surface" (default when useErrorCorrection=true) or a qLDPC code id from list_qldpc_codes. "surface-code" is accepted as an alias for "surface". |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes | ||
| caveats | No | ||
| examples | No | ||
| formulas | No | Verbose only: formula specs keyed by name. | |
| glossary | No | ||
| scenario | Yes | ||
| assumptions | No | ||
| methodology | No | ||
| modelVersion | Yes | Noise-model version; bumps when a formula or constant changes. | |
| exampleProblems | No | ||
| hardwareContext | No | Verbose only: current hardware, record series, timings, measured QUOPS scores. | |
| exampleProblemProvenance | No |