Skip to main content

Run quantum circuits on CPU, GPU, or real hardware with a certified error estimate on every result

Project description

qsim-sdk

Python SDK for ZKSF (Zero Kelvin Simulation Foundry): run quantum circuits on CPU, GPU, or real quantum hardware, and get a certified error estimate on every approximate result.

pip install qsim-sdk

Get an API token from the console at app.zksf.org (sign in, then "Copy API token").

Three lines to run a circuit

import qsim_sdk
from qiskit import QuantumCircuit

qc = QuantumCircuit(3)
qc.h(0)
qc.cx(0, 1)
qc.cx(1, 2)
qc.measure_all()

client = qsim_sdk.Client(token="YOUR_TOKEN")
job = client.run(qc, shots=1000)

print(job["result"]["counts"])       # the outcome histogram
print(job["result"]["error_info"])   # how much to trust it

Estimate before you spend

est = client.estimate(qc, shots=1000)
# {'engine': 'clifford', 'predicted_seconds': 0.05,
#  'predicted_cost_usd': 0.000001, 'reason': '...'}

estimate() is free and instant: it tells you which engine will run the circuit, roughly how long it will take, and what it will cost, before anything is charged.

Choose an engine explicitly

By default the router picks the cheapest adequate simulator (clifford for Clifford circuits, exact.cpu for small ones, mps.quimb.cpu for structured larger ones). GPU and real hardware are opt-in:

client.run(qc, engine="exact.gpu")     # CUDA statevector
client.run(qc, engine="qpu.rigetti")   # real Rigetti hardware (billed at provider cost)

Hardware jobs may sit in the device queue for minutes to hours; run() polls until the result attaches. Use submit() + job() for a non-blocking flow:

job_id = client.submit(qc, shots=1000, engine="qpu.rigetti")
job = client.job(job_id)               # poll whenever you like

Error handling

run() raises instead of returning a bad result silently:

  • qsim_sdk.JobRejected — the circuit is intractable or infeasible for the request (the message says why, and what would make it work)
  • qsim_sdk.JobFailed — an engine or hardware-provider error

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qsim_sdk-0.1.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qsim_sdk-0.1.0-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file qsim_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: qsim_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for qsim_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 27586d5d9c2dfc143f31caca74b38d5c6f444011d87896b0856e0d0f1cfd04b6
MD5 60ca73e8f5f833c7ece4915a970876b4
BLAKE2b-256 6f97264c290563d6973359b35c6431c9709bdcb4142509d51d1116d84f8f0a89

See more details on using hashes here.

File details

Details for the file qsim_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: qsim_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for qsim_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d991fe8070863d0589b4f3b6f9c120dde764bbd75fa2b53219d2ccc1bbe6a2bd
MD5 5508b06e9027a974d38b565da0776aa9
BLAKE2b-256 6c59c868c2961632fe7b2a455f79e95e6ec07b83fea0e363a1cecabbf1d5e604

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page