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 API Key
Initialize the SDK client using your developer API Key. If not provided, it falls back to the COMMUTATOR_API_KEY environment variable.
Parameters
from commutator import CommutatorClient
client = CommutatorClient(api_key="cs_live_abc123...")JWT Login
Alternative method to authenticate using account credentials. Retrieves a temporary secure token.
Parameters
from commutator import CommutatorClient
client = CommutatorClient.login(
email="researcher@university.edu",
password="secure_password"
)Jobs Management
List Jobs
Retrieve the job list history and status for the authenticated user.
jobs = client.jobs.list()
for job in jobs:
print(job.id, job.status)Create Job
Creates a new quantum job. Returns the Job object with its assigned ID and initial Pending status. Note that this only creates the job from a file; execution configuration happens later unless using a specialized endpoint like submit_vqe.
Parameters
Expected JSON Format
{
"circuit_qasm": "OPENQASM 3.0; ...",
"hamiltonian": [["XXI", 0.5], ["ZZZ", -1.0]],
"parameters": [0.12, 0.34],
"metadata": "Optional description"
}new_job = client.jobs.create(
name="VQE Hydrogen Molecule",
algorithm="VQE1",
file_path="circuit.json"
)Execute Job
Executes a previously created job on the specified quantum backend. Triggers the event-driven orchestrator for routing.
Parameters
job_execution = client.jobs.execute(
job_id=new_job["id"],
backend="ibm_berlin",
optimization_level=3
)Get Job Details
Retrieve complete metadata, configuration, and current status of a specific job.
Parameters
job = client.jobs.get("job_8f7d9c2a")
print(job.status) # Returns 'Pending', 'Completed', or 'Failed'Cancel Job
Attempt to cancel a pending or queued job. Returns True if successfully cancelled.
Parameters
success = client.jobs.cancel("job_8f7d9c2a")
print("Cancelled:", success)List Algorithms
Retrieve the list of supported quantum algorithms available for execution.
algorithms = client.jobs.list_algorithms()
print("Supported:", algorithms)Download Results
Download the calculated mathematical eigenvalues or optimized quantum result data.
job = client.jobs.get("job_8f7d9c2a")
results = job.download_results()
print("Energy eigenvalue:", results.get("energy"))Fleet & Backends
List Backends
Query the available quantum processors, physical qubits count, and current availability status.
backends = client.fleet.list_backends()
for backend in backends:
print(backend["name"], backend["status"])Discover Backends
Discover detailed topology, calibration data, and capabilities of available backends.
topology = client.fleet.discover()
print("Coupling map:", topology.get("coupling_map"))Activate Backend
Request exclusive access or activation of a specific reserved backend processor.
Parameters
client.fleet.activate("550e8400-e29b-41d4-a716-446655440000")Optimizer Engine
Get Recommendation
Request target backend selection and optimal algorithm parameters based on circuit depth.
Parameters
config = client.optimizer.recommend(execution_id='550e8400-e29b-41d4-a716-446655440000', target_dd=True)Identity & Administration
Get Team Details
Retrieve details about your current organization/team and quota limits.
team = client.admin.get_team()
print("Team Name:", team["name"], "Quota:", team["monthly_quota"])List API Keys
Retrieve all active API keys associated with your account.
keys = client.admin.list_api_keys()
for k in keys:
print(k["name"], k["created_at"])Create API Key
Generate a new API key for automation or scripts.
Parameters
new_token = client.admin.create_api_key(name="CI Runner", expires_in_days=90)
print("SAVE THIS TOKEN:", new_token)Revoke API Key
Revoke and invalidate an active API key immediately.
Parameters
client.admin.revoke_api_key("key_id_456")Get Audit Logs
Retrieve recent security and access audit logs for the team.
Parameters
logs = client.admin.get_audit_logs(limit=10)
for log in logs:
print(log["action"], log["timestamp"])