Skip to main content
Glama

Quantum Expectations

Compute Quantum Expectation

compute_expectation
Read-onlyIdempotent

Given 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

NameRequiredDescriptionDefault
verboseNoWhen 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.
compDepthYes
numQubitsYes
hardwareIdNoPlatform 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.
connectivityNoTwo-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.
qubitErrorRateNoPer-gate 2-qubit error rate p, in (0, 0.1]. Supply exactly one of qubitErrorRate or hardwareId.
useErrorCorrectionNo
distanceSurfaceCodeNoSurface code distance: odd integer in [3, 31]. Required when useErrorCorrection=true and the surface code is selected; ignored when a qLDPC code is selected.
errorCorrectionCodeNoEither "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

NameRequiredDescriptionDefault
resultYes
caveatsNo
examplesNo
formulasNoVerbose only: formula specs keyed by name.
glossaryNo
scenarioYes
assumptionsNo
methodologyNo
modelVersionYesNoise-model version; bumps when a formula or constant changes.
exampleProblemsNo
hardwareContextNoVerbose only: current hardware, record series, timings, measured QUOPS scores.
exampleProblemProvenanceNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedOutput schema / properties / result / properties / qldpcInstructionComparison
      Added value: +{
      +  "additionalProperties": {},
      +  "description": "qLDPC codes with published architecture data only, at the scenario p: memoryDerivedOp is one block's memory-fit error over one logical operation (roundsPerLogicalOp x per-cycle rate; logicalErrorRatePerGate is this x blocks / numQubits); inModuleMeasurement and interModuleMeasurement are the architecture's published rates for one in-module measurement and one measurement joining two neighbouring blocks (per block pair). Published rates are fitted, extrapolated or assumed per point (list_qldpc_codes, architecture.errorPoints[].basis; assumedRates). The fields are reported side by side; no direction between them is implied.",
      +  "properties": {
      +    "assumedRates": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "inModuleMeasurement": {
      +      "type": "number"
      +    },
      +    "interModuleMeasurement": {
      +      "type": "number"
      +    },
      +    "memoryDerivedOp": {
      +      "type": "number"
      +    },
      +    "withinPublishedRange": {
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "memoryDerivedOp",
      +    "inModuleMeasurement",
      +    "interModuleMeasurement",
      +    "withinPublishedRange",
      +    "assumedRates"
      +  ],
      +  "type": "object"
      +}
  2. Changed3 schema fields changed
    • changedInput schema / properties / connectivity / description
      Previous value: -"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 in the no-EC path). Defaults to the hardware entry's class when hardwareId is supplied, else to all-to-all."New value: +"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."
    • changedInput schema / properties / hardwareId / description
      Previous value: -"Alias for qubitErrorRate: resolves to the 2-qubit error rate of the given SOTA hardware entry from list_current_quantum_computers. Use this, not a generic qubitErrorRate, whenever the question names a platform without stating its own error rate (superconducting, trapped-ion, neutral-atom). Supply exactly one of qubitErrorRate or hardwareId."New value: +"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."
    • changedInput schema / properties / verbose / description
      Previous value: -"When false, omits hardwareContext, formulas, assumptions, caveats, glossary, examples, and exampleProblems from the response — leaving only modelVersion, scenario, and result. Use for parameter sweeps where that context would repeat unchanged."New value: +"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."
  3. Changed1 schema field changed
    • changedInput schema / properties / hardwareId / description
      Previous value: -"Alias for qubitErrorRate: resolves to the 2-qubit error rate of the given SOTA hardware entry from list_current_quantum_computers. Supply exactly one of qubitErrorRate or hardwareId."New value: +"Alias for qubitErrorRate: resolves to the 2-qubit error rate of the given SOTA hardware entry from list_current_quantum_computers. Use this, not a generic qubitErrorRate, whenever the question names a platform without stating its own error rate (superconducting, trapped-ion, neutral-atom). Supply exactly one of qubitErrorRate or hardwareId."
  4. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "https://json-schema.org/draft/2020-12/schema",
      +  "additionalProperties": {},
      +  "properties": {
      +    "assumptions": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "caveats": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "exampleProblemProvenance": {},
      +    "exampleProblems": {
      +      "items": {},
      +      "type": "array"
      +    },
      +    "examples": {
      +      "items": {},
      +      "type": "array"
      +    },
      +    "formulas": {
      +      "additionalProperties": {},
      +      "description": "Verbose only: formula specs keyed by name.",
      +      "propertyNames": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    "glossary": {},
      +    "hardwareContext": {
      +      "additionalProperties": {},
      +      "description": "Verbose only: current hardware, record series, timings, measured QUOPS scores.",
      +      "properties": {},
      +      "type": "object"
      +    },
      +    "methodology": {},
      +    "modelVersion": {
      +      "description": "Noise-model version; bumps when a formula or constant changes.",
      +      "type": "string"
      +    },
      +    "result": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "effectiveErrorRate": {
      +          "description": "Probability that at least one gate fails over the (routed) circuit.",
      +          "type": "number"
      +        },
      +        "logicalErrorRatePerCycle": {
      +          "description": "Per-syndrome-cycle logical error rate as the calibration source reports it; null without error correction.",
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "logicalErrorRatePerGate": {
      +          "description": "Per-logical-qubit, per-logical-operation error rate; null without error correction.",
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "minimumClockRuntimeSeconds": {
      +          "description": "Lower bound on wall-clock runtime; present only when hardwareId was supplied.",
      +          "type": "number"
      +        },
      +        "physicalQubitsPerLogicalQubit": {
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "routedDepth": {
      +          "description": "compDepth after routing: the depth the effective-error formula consumed.",
      +          "type": "number"
      +        },
      +        "routingOverheadFactor": {
      +          "description": "Multiplier the connectivity class applied to compDepth (1 for all-to-all and reconfigurable).",
      +          "type": "number"
      +        },
      +        "successProbability": {
      +          "description": "1 - effectiveErrorRate.",
      +          "type": "number"
      +        },
      +        "totalPhysicalQubits": {
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        }
      +      },
      +      "required": [
      +        "effectiveErrorRate",
      +        "successProbability",
      +        "routingOverheadFactor",
      +        "routedDepth",
      +        "logicalErrorRatePerGate",
      +        "logicalErrorRatePerCycle",
      +        "physicalQubitsPerLogicalQubit",
      +        "totalPhysicalQubits"
      +      ],
      +      "type": "object"
      +    },
      +    "scenario": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "compDepth": {
      +          "type": "number"
      +        },
      +        "connectivity": {
      +          "enum": [
      +            "all-to-all",
      +            "reconfigurable",
      +            "2d-lattice"
      +          ],
      +          "type": "string"
      +        },
      +        "distanceSurfaceCode": {
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "errorCorrectionCode": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "hardwareId": {
      +          "description": "Non-null when qubitErrorRate was resolved from a current-hardware entry.",
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "numQubits": {
      +          "type": "number"
      +        },
      +        "qubitErrorRate": {
      +          "type": "number"
      +        },
      +        "useErrorCorrection": {
      +          "type": "boolean"
      +        }
      +      },
      +      "required": [
      +        "qubitErrorRate",
      +        "hardwareId",
      +        "connectivity",
      +        "numQubits",
      +        "compDepth",
      +        "useErrorCorrection",
      +        "distanceSurfaceCode",
      +        "errorCorrectionCode"
      +      ],
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "modelVersion",
      +    "scenario",
      +    "result"
      +  ],
      +  "type": "object"
      +}
  5. Changed1 schema field changed
    • addedInput schema / properties / connectivity
      Added value: +{
      +  "description": "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 in the no-EC path). Defaults to the hardware entry's class when hardwareId is supplied, else to all-to-all.",
      +  "enum": [
      +    "all-to-all",
      +    "reconfigurable",
      +    "2d-lattice"
      +  ],
      +  "type": "string"
      +}
  6. Changed4 schema fields changed
    • addedInput schema / properties / distanceSurfaceCode / description
      Added value: +"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."
    • removedInput schema / properties / distanceSurfaceCode / maximum
      Removed value: -31
    • removedInput schema / properties / distanceSurfaceCode / minimum
      Removed value: -3
    • changedInput schema / properties / distanceSurfaceCode / type
      Previous value: -"integer"New value: +"number"
  7. Changed1 schema field changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  8. Changed1 schema field changed
    • addedInput schema / properties / errorCorrectionCode / description
      Added value: +"Either \"surface\" (default when useErrorCorrection=true) or a qLDPC code id from list_qldpc_codes. \"surface-code\" is accepted as an alias for \"surface\"."
  9. First observed

TDQS

A3.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare this as a read-only, idempotent, non-destructive computation, so the safety bar is covered. The description adds real behavioral context beyond them: a 2d-lattice connectivity is charged as a routing multiplier on depth when no error correction is applied (exposed as result.routingOverheadFactor), and the response is self-describing with formulas, assumptions, caveats, glossary, and sourced historic series. It does not discuss cost/latency or the mutual-exclusion of qubitErrorRate and hardwareId in prose (that constraint lives in the schema).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core computation is front-loaded in the first sentence, followed by behavioral nuances and a closing use-case question; each sentence carries information. There is minor padding in 'so one call carries the context to reason from' and slight redundancy between the enumerated outputs and the self-describing-response claim, but nothing that impedes reading.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present, the description need not detail return values, yet it still summarizes them and flags routingOverheadFactor specifically. For a 9-parameter, 2-required computational tool the coverage is adequate, and the verbose flag's effect is documented in the schema. The main gap is the absence of explicit routing to sibling compute tools for adjacent questions.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 67%, and the description meaningfully extends it by explaining how connectivity interacts with results (routing multiplier on depth) and that hardwareId resolves to a platform's error rate and connectivity class. It ties the 'optional surface-code or qLDPC overhead' phrasing to the error-correction parameters, which helps an agent understand that useErrorCorrection is a mode switch. It adds little for compDepth/numQubits beyond what the schema already says.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource (compute effective error rate, success probability, and optional surface-code/qLDPC overhead for a circuit described by p, n, d, connectivity) and enumerates the returned quantities. It frames the purpose as answering 'how likely is this circuit to succeed on this device or error rate?', which is concrete. It does not differentiate itself from siblings such as compute_fault_tolerant_resources or compute_quantum_volume_rate, which keeps it short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The closing question gives an implied when-to-use (assessing success likelihood for a circuit on a device or error rate), and the note that hardwareId supplies the device class 'automatically' clarifies one selection pattern. However, there is no explicit when-not guidance and no named alternative for adjacent tasks (e.g., solving for a required error rate or fault-tolerant resource estimates), leaving routing between siblings to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources