Skip to main content

Common quantum computing objects description and conversion 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(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()

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.2.1.tar.gz (22.9 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.2.1-py3-none-any.whl (44.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for qio-0.2.1.tar.gz
Algorithm Hash digest
SHA256 85a3cf8f59cce1eebffe1428587aca2f0937d38a06d6bb85b52324558acf8c41
MD5 7f832af484fc1946af0f57567f5bd274
BLAKE2b-256 6a4a94a17b6d48a2fb14989692d5010908d2adc6819f28bfe75881e990301ad7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qio-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 44.3 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.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0d0bfba230ec52a596d430d86006b43125ffe99050df2655dcf2204ad0328b27
MD5 849b3f2544f66297e4bd1125b3cf3f9e
BLAKE2b-256 2b058911adeaa21c593a7a8453e0d2be9f5c0ddfae624fd4637623f98b65ae33

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