Commutator SDK
The Commutator Studios SDK is an intuitive wrapper designed for developers and researchers. Instead of invoking HTTP endpoints manually, you can interact with jobs, optimizer models, and quantum hardware backends natively within your environments.
Installation
Install the official package:
from commutator import CommutatorClient
client = CommutatorClient(
api_key="your_api_key"
)
# Start working
jobs = client.jobs.list()Authentication
Initialize SDK Client
Initialize the SDK client using your Commutator API Key generated from your Dashboard (Dashboard -> API Access). Environment endpoints (production, staging, demo, local) are automatically resolved based on your API key prefix (`cs_live_*`, `cs_stage_*`, `cs_demo_*`, `cs_loc_*`). Note: IBM credentials must be added through your Dashboard (Settings -> Credentials) prior to running hardware workloads.
Parameters
from commutator import CommutatorClient
# Initialize with API Key generated from Dashboard
client = CommutatorClient(api_key="cs_live_abc123...")Backend
List Quantum Backends
Query the available quantum processors, physical qubits count, and current availability status.
backends = client.backends.list()
for backend in backends:
print(backend["name"], backend["status"])Toggle Backend Status
Toggle or set activation status of a specific reserved backend processor.
Parameters
client.backends.activate(backend_id="550e8400-e29b-41d4-a716-446655440000", enabled=True)Optimizer
Predict Performance
Submits a hardware recommendation calculation job. Returns an immediate job submission response with jobId and jobStatus.
Parameters
res = client.optimizer.recommend(job_id="550e8400-e29b-41d4-a716-446655440000", target_backends=["ibm_kyiv"])Poll Recommendation Progress
Poll progress and retrieve completed recommendations for an optimization job, including total count, completion percentage, and expiration timestamp (validUntil).
Parameters
report = client.optimizer.get_status(job_id="550e8400-e29b-41d4-a716-446655440000")Job
List Algorithms
Retrieve the list of supported quantum algorithms available for execution.
algorithms = client.jobs.list_algorithms()
print("Supported:", algorithms)submit_job
Submits an integrated VQE execution job. Uploads the configuration artifact and registers the job record in one atomic operation.
Parameters
vqe_job = client.jobs.submit_job(
name="VQE Hydrogen Molecule",
algorithm="VQE",
file_path="circuit.json",
backend="ibm_fez",
optimization_level=3
)List Quantum Jobs
Retrieve the job list history and status for the authenticated user. Pass include_pagination=True to return the full payload with pagination metadata (total, nextCursor, hasMore).
Parameters
# Simple job list:
jobs = client.jobs.list(limit=10, offset=0)
# With pagination metadata:
res = client.jobs.list(limit=10, offset=0, include_pagination=True)
print("Total:", res["pagination"]["total"])
print("Next Cursor:", res["pagination"]["nextCursor"])Save Job Draft
Creates a new quantum job draft. Returns the Job object with its assigned ID and initial Created status.
Parameters
new_job = client.jobs.create(
name="VQE Hydrogen Molecule",
algorithm="VQE",
file_path="circuit.json"
)Get Job Results
Retrieve complete metadata, configuration, and current status of a specific job.
Parameters
job = client.jobs.get("77df8264-74d7-478d-b1b2-57ce96891161")
print(job["status"]) # Returns 'CREATED', 'PENDING', or 'COMPLETED'Run Saved Job
Executes a previously created job on the specified quantum backend. Accepts hardware backend selection, transpilation optimization level, dynamic decoupling, maximum iterations, and convergence parameters.
Parameters
job_execution = client.jobs.execute(
job_id=new_job["id"],
backend="ibm_kyiv",
optimization_level=3,
max_iterations=100,
convergence=0.001
)Delete Job
Delete or cancel a specific quantum job. Returns True if successfully deleted.
Parameters
success = client.jobs.delete("77df8264-74d7-478d-b1b2-57ce96891161")
print("Deleted:", success)Download Results
Download the calculated mathematical eigenvalues or optimized quantum result data.
Parameters
results = client.jobs.download_results("77df8264-74d7-478d-b1b2-57ce96891161")
print("Energy eigenvalue:", results.get("energy"))Administration
List Team Members
Retrieve details about your current organization/team and quota limits.
team = client.admin.get_team()
print("Team Name:", team["name"])List Audit Logs
Retrieve recent security and access audit logs for the team. Pass include_pagination=True to receive pagination metadata (total, nextCursor, hasMore).
Parameters
# Simple list:
logs = client.identity.get_audit_logs(limit=10, offset=0)
# With pagination metadata:
res = client.identity.get_audit_logs(limit=10, offset=0, include_pagination=True)
print("Total logs:", res["pagination"]["total"])