Skip to main content

Base common quantum computing objects description library

Project description

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()

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()

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

qio-0.1.18.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

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

qio-0.1.18-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file qio-0.1.18.tar.gz.

File metadata

  • Download URL: qio-0.1.18.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for qio-0.1.18.tar.gz
Algorithm Hash digest
SHA256 3358a12df3352c7e33d1a7733736c3900bbad301e5fa87e5ee84eec51429b2aa
MD5 43d9b102902be2f771a2fbc7b6328199
BLAKE2b-256 46dc662930dda905f0e7546109c4bc4a032fb83622bc83f3d1ca812913b77f95

See more details on using hashes here.

File details

Details for the file qio-0.1.18-py3-none-any.whl.

File metadata

  • Download URL: qio-0.1.18-py3-none-any.whl
  • Upload date:
  • Size: 14.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for qio-0.1.18-py3-none-any.whl
Algorithm Hash digest
SHA256 1c20b9e2cde3753399e84431b53a9cd4861679bd09d10baa1bcbebdbbdc19d4e
MD5 a74e885b28a272dda1f2598fb2b705d6
BLAKE2b-256 db8a0ed02be1226e093e28cf106689644d88c359f91250a934f6258b763bdcfc

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