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.2.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.2-py3-none-any.whl (67.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qaas-0.3.2.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.2.tar.gz
Algorithm Hash digest
SHA256 8342bb9264543b6853862edab91e54e43535d19fe224779070658d8546178576
MD5 f95cc03b438625582ad326f81785b5a3
BLAKE2b-256 5c876afdb39034e7a1c049e5dbaffb5cc55f9be32ed1b51d131de47f5e514eab

See more details on using hashes here.

Provenance

The following attestation bundles were made for qaas-0.3.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: qaas-0.3.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ff846de15bd4643ee0ef75cfc831969a4a1dc73bf04882683db75408a9a9cb7c
MD5 56b5052c27a512acdb41a8d9bf3f6536
BLAKE2b-256 9a91b3b0cef98c2805d27bfe89d2d457973d4b43c9d74e45ca78eeacbe459a49

See more details on using hashes here.

Provenance

The following attestation bundles were made for qaas-0.3.2-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