ψcatstate

platform

Routing strategies

A five-stage pipeline resolves every cs() call against a live device catalog — calibration, queue depth, pricing, and lifecycle per device — and records why the winning device was chosen.

Strategies

strategies.pypy
cs("best") # highest expected fidelity
cs("cheapest") # min(base fee + shots * per-shot rate)
cs("fastest") # min(queue wait + execution time)
cs("ibm:brisbane") # pinned — skips scoring, still validated
cs() # this key's configured default

The best score blends 2-qubit gate fidelity, readout fidelity, SABRE SWAP overhead, and a normalized queue penalty. Stale calibration data (older than 6 hours) excludes a device from strategy-routed consideration entirely.

Pipeline stages

routing pipelinetxt
target
└─ 1. ResolveStrategy call arg → sub-key default → credential default
└─ 2. DeviceFilter allowlists ∩ ACTIVE catalog ∩ qubits ∩ topology
└─ 3. Freshness calibration_synced_at < 6h old?
└─ 4. ScoringEngine best | cheapest | fastest
└─ 5. Dispatch 202 Accepted, event to outbox

Explainability

Every run records requested_strategy, resolved_strategy, and strategy_source (CALL_ARG, SUB_KEY_DEFAULT, or CREDENTIAL_DEFAULT), so the dashboard can say exactly why Brisbane beat Osaka — down to the calibration snapshot the decision was made against.

Failure behavior

  • Retired device, strategy-routed: silently excluded from consideration.
  • Retired device, pinned: DEVICE_RETIRED (410) with the eligible-device list in the error body.
  • Provider outage: the circuit breaker excludes that provider from routing; pinned requests get PROVIDER_TEMPORARILY_UNAVAILABLE (503) immediately.