qio
qio is a python package to smoothly manipulate quantum computing objects between client and server.
It handle all the conversion boilerplate to focus your dev on your quantum SDK and backend on real matters.
Installation
We encourage installing qio via the pip tool (a Python package manager):
pip install qio
Getting started
To leverage qio and get quick interoperability between your frontend and your backend, you simply need to use qio wrappers system.
Here a snippet code for cirq and qsim:
import cirq
from cirq.circuits import Circuit
from qsimcirq import QSimSimulator
from qio.core import (
QuantumComputationModel,
QuantumComputationParameters,
QuantumProgramResult,
QuantumProgram,
)
#############
# Client side
qc = _random_cirq_circuit(10)
shots = 100
program = QuantumProgram.from_cirq_circuit(qc)
model_json = QuantumComputationModel(
programs=[program],
).to_json_str()
parameters_json = QuantumComputationParameters(
shots=shots,
).to_json_str()
# Send this to server side
###########################
# Server / Computation side
model = QuantumComputationModel.from_json_str(model_json)
params = QuantumComputationParameters.from_json_str(parameters_json)
circuit = model.programs[0].to_cirq_circuit()
qsim_simulator = QSimSimulator()
qsim_result = qsim_simulator.run(circuit, repetitions=params.shots)
program_result = QuantumProgramResult.from_cirq_result(result).to_json_str()
# Send this to back to client side
#####################
# Back to client side
cirq_result = qresult.to_cirq_result()
qiskit_result = qresult.to_qiskit_result()
Metadata
Release files for qio 0.2.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| qio-0.2.7.tar.gz | 27.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| qio-0.2.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 81.5 kB
Release files / qio-0.2.7.tar.gz
| Download URL | qio-0.2.7.tar.gz |
|---|---|
| Size | 27.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2cdd3d9220ff400f0efb11c935e0cf1b51f70d3693da965abab09725b8dd9348
|
|
BLAKE2b-256 checksum How to use checksums |
99f6ae7ca1ced2d6d5ee466c83487647be27a2c51d114e9a0f24eaed08e1464b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Release files / qio-0.2.7-py3-none-any.whl
| Download URL | qio-0.2.7-py3-none-any.whl |
|---|---|
| Size | 54.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
300431f825292ef3e4dd5c5a29f70399f22313ee37512c59f08f7e15fbc74df3
|
|
BLAKE2b-256 checksum How to use checksums |
13f4ef29fb285cc7cac3d39b45f06e65055de0f97b74b1a3b12bad357b5e3b47
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|