Python client SDK for the QPI quantum computing platform
Project description
██████╗ ██████╗ ██╗ ██╔═══██╗██╔══██╗██║ ██║ ██║██████╔╝██║ ██║▄▄ ██║██╔═══╝ ██║ ╚██████╔╝██║ ██║ ╚══▀▀═╝ ╚═╝ ╚═╝
QPI Python Client
Python client SDK for the QPI quantum computing platform. Includes both a low-level HTTP client and a Qiskit-compatible backend.
Install
pip install qpi-client
Requires Python ≥ 3.10.
Quick Start
Low-level client
from qpi_client import QPIClient
client = QPIClient("http://localhost:8090", api_token="my-token")
# Submit a job
job_id = client.submit_job([
{"circuit": 'OPENQASM 3.0; include "stdgates.inc"; qubit[2] q; bit[2] c; h q[0]; cx q[0], q[1]; c = measure q;'}
], shots=1024)
print("Job ID:", job_id)
# Wait for completion
job = client.job(job_id)
result = job.result(timeout=120)
print(result.get_counts())
Qiskit integration
from qiskit.circuit import QuantumCircuit
from qpi_client import QPIClient, QPIBackend
client = QPIClient("http://localhost:8090", api_token="my-token")
backend = QPIBackend(client, num_qubits=5)
qc = QuantumCircuit(2, 2)
qc.h(0)
qc.cx(0, 1)
qc.measure([0, 1], [0, 1])
job = backend.run(qc, shots=4096)
result = job.result(timeout=120)
print(result.get_counts())
Submit raw QASM with parameters
job = backend.run(
qasm='OPENQASM 3.0; include "stdgates.inc"; qubit[1] q; bit[1] c; rx({{theta}}) q[0]; c = measure q;',
parameter_values=[[0.5], [1.0]],
shots=1024
)
result = job.result()
API Overview
QPIClient
| Method | Description |
|---|---|
QPIClient(base_url, api_token) |
Create a new client |
submit_job(circuits, shots, ...) |
Submit a quantum job |
job(job_id) |
Retrieve a job by ID (returns QPIJob) |
list_jobs() |
List all jobs for the authenticated user |
cancel_job(job_id) |
Request job cancellation |
get_backend(name) |
Get a Qiskit-compatible backend |
QPIBackend (Qiskit)
| Method | Description |
|---|---|
backend.run(circuit, shots) |
Run a QuantumCircuit |
backend.run(qasm, parameter_values, shots) |
Run raw QASM with parameter bindings |
backend.job(job_id) |
Retrieve a past job |
Documentation
License
MIT — see the main repository for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qpi_client-0.0.10.tar.gz.
File metadata
- Download URL: qpi_client-0.0.10.tar.gz
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd3521ae033f2aabc1c082e3481421d371ad1d02fb7340bbb609ff6eaf53f11c
|
|
| MD5 |
74df653afed7672df8a99256fb96a305
|
|
| BLAKE2b-256 |
92834f0a8509e99db6aa8058b39070d9c59c869a9ea074c181e121f892804c83
|
Provenance
The following attestation bundles were made for qpi_client-0.0.10.tar.gz:
Publisher:
ci.yml on sopherapps/qpi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qpi_client-0.0.10.tar.gz -
Subject digest:
bd3521ae033f2aabc1c082e3481421d371ad1d02fb7340bbb609ff6eaf53f11c - Sigstore transparency entry: 1897114627
- Sigstore integration time:
-
Permalink:
sopherapps/qpi@6caba429b463389559c001b6bf28a3829617e063 -
Branch / Tag:
refs/tags/v0.0.10 - Owner: https://github.com/sopherapps
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@6caba429b463389559c001b6bf28a3829617e063 -
Trigger Event:
push
-
Statement type:
File details
Details for the file qpi_client-0.0.10-py3-none-any.whl.
File metadata
- Download URL: qpi_client-0.0.10-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75560e0d588c49af27500bcf57e93ff1bef069e7b1e217cd53e4b84831b75a1e
|
|
| MD5 |
b6ae37dcf5cdca896e8869c1e913980c
|
|
| BLAKE2b-256 |
e9948d9c715aeea754cd3da361432bcc18b22bc5bb081c46aa931fc721bce3c9
|
Provenance
The following attestation bundles were made for qpi_client-0.0.10-py3-none-any.whl:
Publisher:
ci.yml on sopherapps/qpi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qpi_client-0.0.10-py3-none-any.whl -
Subject digest:
75560e0d588c49af27500bcf57e93ff1bef069e7b1e217cd53e4b84831b75a1e - Sigstore transparency entry: 1897114790
- Sigstore integration time:
-
Permalink:
sopherapps/qpi@6caba429b463389559c001b6bf28a3829617e063 -
Branch / Tag:
refs/tags/v0.0.10 - Owner: https://github.com/sopherapps
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@6caba429b463389559c001b6bf28a3829617e063 -
Trigger Event:
push
-
Statement type: