Skip to content

osiris nexus: Quantinuum Nexus via the official qnexus SDK (0.51.4) - #72

Merged
quantum-osiris merged 1 commit into
mainfrom
claude/nexus-sdk-adapter
Nov 22, 2026
Merged

quantum-osiris merged 1 commit into
mainfrom
claude/nexus-sdk-adapter

Conversation

@quantum-osiris

@quantum-osiris quantum-osiris commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Why

QuantinuumNexusClient (merged in #71) sends hand-written REST calls to /api/v1/backends, /api/v1/targets and /api/v1/jobs. Nexus does not serve those paths. Its real API is versioned per resource (/api/circuits/v1beta2, /api/jobs/v1beta3, /api/compilations/v1beta3, …) and authenticates with qnx.login(). The old client's tests pass only because they run against fakes of the invented API.

What

  • osiris_cli/providers/nexus_sdk.py adds NexusSdkRunner, which works through the qnexus SDK:
    • preflight: upload, compile on Nexus with start_compile_job, then price each compiled circuit with circuits.cost(..., syntax_checker="H2-1SC"), cross-checked against the local HQC formula;
    • run: start_execute_job with a per-circuit max_cost. Tier 2 (H2-1E) is capped by --max-emulator-hqc. Tier 3 (H2-1, H2-2) needs a signed token bound to the compiled-batch SHA-256, target, shots and HQC (existing verify_tier3_token).
  • Receipts go to the existing hash-chained NexusAuditLedger, with no new store.
  • CLI subcommands: osiris nexus preflight|run|grant|status (--match regex, --limit).
  • New extra osiris-cli[nexus] pins qnexus==0.51.4.
  • docs/quantinuum/NEXUS_SDK_QUICKSTART.md covers the first session with the XTOP-005 H2-1 circuits.

Verification

  • tests/test_nexus_sdk.py: 7 passed. One test binds every recorded SDK call to the real qnexus 0.51.4 signatures; it is skipped when qnexus is not installed, so it does not run in CI.
  • Not run against the live Nexus service: there are no credentials yet. Without a login the CLI stops with qnexus's AuthenticationError.
  • Full suite on this branch: 3077 passed, 27 skipped, 12 failed. The same 12 fail on origin/main when pytket is installed (CI does not install it): tket_wrapper raises QASMUnsupportedError when exporting single-bit conditions, and ignores no_reduce on the pytket path. Fixed separately in the tket-conditionals PR. (An earlier version of this description said feed-forward was dropped; it is not, pytket only rewrites x as u3.)
  • bootstrap_osiris_agents.py --verify-only, py_compile and git diff --check: all pass.

🤖 Generated with Claude Code

The existing QuantinuumNexusClient calls /api/v1/{backends,targets,jobs},
which Nexus does not serve (real API: /api/circuits/v1beta2,
/api/jobs/v1beta3, ...; auth via qnx.login). New NexusSdkRunner uploads,
compiles on Nexus, prices with the H2 syntax checker (circuits.cost), and
executes with per-circuit max_cost caps; Tier 2 capped by HQC, Tier 3 needs a
signed token bound to the compiled-batch SHA-256. Receipts go to the existing
NexusAuditLedger. A test binds every SDK call to qnexus 0.51.4's real
signatures (skipped without qnexus). Extra: osiris-cli[nexus].

Full suite: 3077 passed, 27 skipped, 12 failed; the 12 also fail on
origin/main (tests/test_quantinuum_client.py, pytket 2.18.5 QASM conditionals).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@quantum-osiris
quantum-osiris merged commit 4cd16a3 into main Nov 22, 2026
10 checks passed
@quantum-osiris
quantum-osiris deleted the claude/nexus-sdk-adapter branch November 22, 2026 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant