Actively maintained. Last release 7 weeks ago. A safe choice.
pip install conductorquantumREADME as published on PyPI with version 0.5.1.
ConductorQuantum Python Library
The ConductorQuantum Python library provides convenient access to the ConductorQuantum API from Python.
Installation
pip install conductorquantum
Reference
A full reference for this library is available here. The documentation in this repository is maintained manually and is not auto-generated.
Authentication
Authenticate with a single token:
from conductorquantum import ConductorQuantum
client = ConductorQuantum(token="MY_TOKEN")
client.coda.* and the top-level Coda shortcuts require a Coda API token that
starts with coda_. If you call a Coda method with any other token, the SDK
raises ValueError before sending the request.
Usage
Control: analysis models
import numpy as np
from conductorquantum import ConductorQuantum
client = ConductorQuantum(token="CONTROL_TOKEN")
# Using a file
with open("path/to/file.npy", "rb") as f:
client.control.models.run(
model="coulomb-blockade-peak-detector-v1",
data=f,
)
# Using a numpy array
arr = np.array([2.643e-12, 2.164e-12, 8.481e-13, ..., 2.320e-11, 2.153e-11, 1.984e-11])
client.control.models.run(
model="coulomb-blockade-peak-detector-v1",
data=arr,
)
# Batch peak-detector-v2 traces in one request.
batch = np.stack([arr, arr])
result = client.control.models.batch.run(
model="coulomb-blockade-peak-detector-v2",
data=batch,
)
print(result.output["outputs"])
Coda: circuit tools, QPU, agents
from conductorquantum import ConductorQuantum
client = ConductorQuantum(token="coda_YOUR_TOKEN")
result = client.coda.tools.simulate(code="from qiskit import QuantumCircuit\nqc = QuantumCircuit(2)\nqc.h(0)\nqc.cx(0, 1)")
# Chat with the unified Coda agent. `budget` controls agent effort
# (low / medium / high) and `code_mode` controls code delivery
# (inline markdown, or virtual files in a terminal `files` event).
for event in client.coda.agents.run(
messages=[{"role": "user", "content": "Build a Bell state circuit"}],
budget="high",
):
print(event)