Skip to main content

Quantum-as-a-Service utilizing IQMProvider, IQMBackend, IQMJob and HEAppE. Developed by IT4Innovations.

Project description

Documentation

Access IQM quantum hardware through the LEXIS platform via HEAppE.

Documentation: https://it4innovations.github.io/quantum-as-a-service/

Requirements

  • Python 3.11+

  • required Python packages: see dependencies in pyproject.toml

Quick start

QaaS is available on PyPI, so you can install it easily using pip.

pip install qaas

Alternatively, you can install the latest (development) version using:

pip install git+https://github.com/It4innovations/quantum-as-a-service.git@main

Example usage:

from py4lexis.session import LexisSession
from qaas import QProvider
from qiskit import QuantumCircuit

token    = LexisSession().get_access_token()
backend  = QProvider(token, "my_project").get_backend("EQE1-CZ-P0001")

qc = QuantumCircuit(2, 2)
qc.h(0); qc.cx(0, 1); qc.measure_all()

counts = backend.run(backend.transpile(qc), shots=1000).result().get_counts()
print(counts)

Also OpenQASM is supported on input:

from qiskit.qasm3 import dumps as qasm3dumps

qc = QuantumCircuit(2, 2)
qc.h(0); qc.cx(0, 1); qc.measure_all()

qasm_transpiled_qc:str = qasm3dumps(backend.transpile(qc))

counts = backend.run([qasm_transpiled_qc], shots=1000).result().get_counts()
print(counts)

IQM Pulla

from qiskit import QuantumCircuit, visualization
from qiskit.compiler import transpile
from iqm.qiskit_iqm.iqm_transpilation import optimize_single_qubit_gates
from iqm.pulla.utils_qiskit import sweep_job_to_qiskit
from qaas.client import QProvider, QBackend
from qaas.client.qpulla import qiskit_to_pulla, QPullaBackendIQM

provider = QProvider(lexis_access_token, "my_project")
client = provider.get_client(lexis_resource_name)
dqa = client.get_dynamic_architecture()
compiler = p.get_standard_compiler()
# Create Pulla instance
p = provider.get_pulla(lexis_resource_name)
pulla_backend: QPullaBackendIQM = QPullaBackendIQM(dqa,p,compiler)

qc_transpiled = backend.transpile(
   qc,
   layout_method='sabre',
   optimization_level=0
)
# Optimize single-qubit gates
qc_optimized = optimize_single_qubit_gates(qc_transpiled)

circuits, compiler = qiskit_to_pulla(p, pulla_backend, [qc_optimized])
playlist, context = compiler.compile(circuits[0])
# Build settings for execution
settings, context = compiler.build_settings(context, shots=100)
# Submit playlist returns SweepJob
job = p.submit_playlist(playlist, settings, context=context)
job.wait_for_completion()

# Get raw results
raw_results = job.result()

# Convert to Qiskit result format
qiskit_result = sweep_job_to_qiskit(
   job,
   shots=100,
   execution_options=context['options']
)
# Qiskit Counts
counts = qiskit_result.get_counts()

Authors

License

Apache 2.0 — see LICENSE.

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

qaas-0.3.1.tar.gz (61.0 kB view details)

Uploaded Source

Built Distribution

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

qaas-0.3.1-py3-none-any.whl (67.6 kB view details)

Uploaded Python 3

File details

Details for the file qaas-0.3.1.tar.gz.

File metadata

  • Download URL: qaas-0.3.1.tar.gz
  • Upload date:
  • Size: 61.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for qaas-0.3.1.tar.gz
Algorithm Hash digest
SHA256 f285462ed5a49b19d3d9c2d1e20fa28d6d26daeaf715a6dbba5e2035b253054d
MD5 ae2ef010d2c27441aaa853d99b18d842
BLAKE2b-256 7bc9ddab4f27f8f2336a1cd291cca7ca2c45719ab7479256a1d42e06b57744d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for qaas-0.3.1.tar.gz:

Publisher: build.yml on It4innovations/quantum-as-a-service

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qaas-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: qaas-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 67.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for qaas-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6c1551d9bff724d5d6a8d9c50f323f7b50185fd47afb1819e7176b9b44990c20
MD5 22dd9796a5cbfec70940011b7c788fd1
BLAKE2b-256 7bded502a6cc9a0c9b303befbb92f08f2a6fabaeb78d12fefc46aefe5ce8cb76

See more details on using hashes here.

Provenance

The following attestation bundles were made for qaas-0.3.1-py3-none-any.whl:

Publisher: build.yml on It4innovations/quantum-as-a-service

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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