Skip to content

feat: add IBM Quantum Platform REST client#326

Open
blankenberg wants to merge 1 commit into
IBM:mainfrom
blankenberg:quantum-platform
Open

feat: add IBM Quantum Platform REST client#326
blankenberg wants to merge 1 commit into
IBM:mainfrom
blankenberg:quantum-platform

Conversation

@blankenberg

Copy link
Copy Markdown

PR summary

Adds a new QuantumPlatformV1 client for the IBM Quantum Platform / Qiskit Runtime REST API. The client supports IAM API key and bearer-token authentication through the standard IBM SDK core mechanisms, CRN-scoped Quantum requests via Service-CRN, API version headers, read/write Quantum Platform operations, examples, README registration, and unit coverage.

With this change, users can instantiate QuantumPlatformV1 from normal IBM SDK configuration and call the Quantum Platform REST endpoints through SDK-style methods matching the OpenAPI operation IDs. The examples also show how to discover Quantum service instance CRNs through Global Catalog and Resource Controller.

PR Checklist

Please make sure that your PR fulfills the following requirements:

  • The commit message follows the Angular Commit Message Guidelines.
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Current vs new behavior

Currently, this SDK does not provide a native Python service client for quantum.cloud.ibm.com Quantum Platform REST endpoints. Users must call the REST API directly or use other tooling when they need low-level platform endpoints such as instance usage, workloads, backend metadata, jobs, sessions, tags, analytics, or instance configuration.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Validation performed:

  • py_compile for the new client, unit tests, and examples
  • pytest test/unit/test_quantum_platform_v1.py
  • pytest examples/test_quantum_platform_v1_examples.py --collect-only -q
  • OpenAPI operation comparison against the live Quantum Platform OpenAPI spec
  • Read-only live checks for version, catalog/resource discovery, backend, instance, usage, workload, job-list, and analytics endpoints.

I do not have access to the IBM OpenAPI SDK generator, so the implementation intentionally keeps response bodies as standard SDK dict/raw results and does not add generated model classes in this first pass.

Of note, running IBM OpenAPI validator, lint-openapi --ruleset default --summary-only quantum-openapi-validator.json results in:

Summary:

  • 132 errors
  • 857 warnings
  • 4 infos

Top error categories:

  • 35: enum values must be snake case
  • 24: integer schemas should specify int32 or int64
  • 23: response array fields must not be optional
  • 20: integer schemas should define maximum
  • 17: integer schemas should define minimum
  • 12: response enum fields must be required

Add QuantumPlatformV1 for low-level access to the IBM Quantum Platform / Qiskit Runtime REST API.

The client follows the existing platform-services SDK style with BaseService, SDK core authenticators, environment-based new_instance() configuration, and DetailedResponse returns. It supports constructor-level instance CRN and API version defaults, plus per-call overrides for Service-CRN and IBM-API-Version.

Also add focused unit tests, example coverage for CRN discovery through ResourceControllerV2, and a README service table entry.
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

2 participants