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.1.24.tar.gz (17.5 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.24-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qio-0.1.24.tar.gz
  • Upload date:
  • Size: 17.5 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.24.tar.gz
Algorithm Hash digest
SHA256 e79a848fc94cdf79ad2978a6cf58d12d2cde43fb407b43686eaf85c6f1296014
MD5 37a4b8c548e927a1d3ec0e51617b3c11
BLAKE2b-256 72f18ed1b574ffffd51b3db6f3a503ca63c3a1fe04d7215fc9a73308d13fd724

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qio-0.1.24-py3-none-any.whl
  • Upload date:
  • Size: 20.0 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.24-py3-none-any.whl
Algorithm Hash digest
SHA256 bb5d2b51e96686ab49ab2acea8f79f6468d3632a3affb9b841712d65d4338830
MD5 70f36d0bf847de4fd79e55c895fb0acb
BLAKE2b-256 14b3539fdc2fe72be840002013ec9d3a2433c9f325b19009e7341bfc7cce9684

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