Skip to main content
Glama

WAI Quantum job service

Draw verified samples from an Ising model's Boltzmann law

sample_ising
Read-onlyIdempotent

Draw samples from the Boltzmann law p(s) proportional to exp(-beta E(s)) of an Ising, QUBO or Max-Cut model (wai.quantum.sample/1) by Gibbs sampling with the update a probabilistic bit makes, s_i = sgn(tanh(beta I_i) - r), in sequential or graph-coloured sweeps, in fixed point: the same samples on every machine. The answer gives the model's digest, the law's address and the draw's (the model, beta, the schedule, the seed and the sweeps), the digest of every sample, the histogram or the samples, the mean energy, the magnetisation and pair correlations each with its error bar from the integrated autocorrelation time and the effective sample size, and for up to 20 spins the exact law enumerated with the total-variation distance and the KL divergence of the samples from it. Sealed with the service's key, with the joules the host measured or the reason it measured none; verify_quantum_receipt checks the seal and the addresses. A request past a bound is refused before anything runs (J202, J203).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "sample_ising"
  }
}

Input Schema

NameRequiredDescriptionDefault
skNoThe all-to-all spin glass with couplings of +1 and -1 drawn from instance.
betaNoThe inverse temperature: the law is p(s) proportional to exp(-beta E(s)) (default 1).
gsetNoA weighted graph in the G-set text format: a line `n m`, then m lines `i j w`, vertices from 1; solved as maxcut.
quboNoA QUBO: Q(x) = sum q_ij x_i x_j + offset over x in {0, 1}^n; [i, i, q] is linear. Solved as its Ising form with s = 2x - 1, made exactly.
seedNoThe seed (default 1).
thinNoKeep every this many sweeps (default 1).
exactNoEnumerate the exact law and hold the samples to it (up to 20 spins; the default there).
isingNoAn Ising problem: E(s) = -sum_{i<j} J_ij s_i s_j - sum_i h_i s_i over s in {-1, +1}^n. A pair given twice adds.
pairsNoThe two-point correlations <s_i s_j> to estimate (default the first 8 coupled pairs).
chainsNoIndependent chains, each keyed by its index (default 4).
maxcutNoA weighted Max-Cut graph, solved with J = -w; the cut is reported.
outputNohistogram: every configuration drawn and how often (up to 64 spins; the default there); samples: every sample kept, in order; none.
sweepsNoSweeps each chain keeps from, after the burn-in (default 1000).
burn_inNoSweeps each chain runs first and keeps nothing from (default 100).
scheduleNosequential: spins 0 to n-1 each sweep; coloured: the classes of a greedy colouring in turn, every spin of a class drawn from the same configuration of the rest (default sequential).
frac_bitsNoHold the model in units of 2^-frac_bits (default: the fewest that hold every number exactly).

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, openWorldHint=false and idempotentHint, and the description is consistent with them while adding real context: deterministic seeding across machines, 'the joules the host measured or the reason it measured none', sealing with the service's key, and pre-run refusal of out-of-bound requests (J202, J203). What it does not disclose is cost or runtime behaviour for large spin counts or chain counts, which would matter for a sampling job of this scale.

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

Conciseness3/5

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

The purpose is front-loaded in the first clause, but the body is one enormous semicolon-chained sentence mixing mechanics, return contents, sealing and error codes. Every element is arguably informative, yet the lack of sentence breaks or listing makes it hard to parse and buries the operational facts an agent needs.

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?

For a 16-parameter tool with nested models, the description covers the important non-schema facts: model encodings, determinism, bounds failures, sealing and receipt verification. It does not need to spell out return values because an output schema exists. Coverage of the sampling controls themselves (chains, burn_in, thin) is left entirely to the schema, which is acceptable at 100% description coverage but leaves the narrative slightly lopsided toward outputs.

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 already 100%, so the schema carries most of the weight. The description still adds meaning beyond it: it names the components of the draw's address (model, beta, schedule, seed, sweeps), explains that the sweep can be 'sequential or graph-coloured', and clarifies that histogram output is limited to 64 spins while exact enumeration is limited to 20. It does not touch several parameters (chains, burn_in, thin, pairs defaults, frac_bits) that remain schema-only.

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

Purpose5/5

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

The description states a precise verb and resource: 'Draw samples from the Boltzmann law p(s) proportional to exp(-beta E(s)) of an Ising, QUBO or Max-Cut model', and adds the mechanism (Gibbs sampling) and the defining property (fixed point, same samples on every machine). An agent can distinguish this from a solver purely from the text, since it is explicitly about drawing from the law rather than optimising it.

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?

Usage context is only implied: 'Draw samples' plus the enumeration threshold 'for up to 20 spins' tells the agent roughly when this tool fits. There is no explicit statement of when to prefer it over a sibling such as solve_ising, no exclusions, and no prerequisites; the only sibling mentioned, verify_quantum_receipt, is a downstream check on the receipt rather than an alternative to this tool.

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