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.0.tar.gz (60.7 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.0-py3-none-any.whl (67.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qaas-0.3.0.tar.gz
  • Upload date:
  • Size: 60.7 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.0.tar.gz
Algorithm Hash digest
SHA256 414328ac832597d059580d4b4d3aaddecc05f74670a6acc92270f3c85558bb95
MD5 306d332bf8240c547356d6ed563a7c70
BLAKE2b-256 42ae0179593ded20ebf133a1090fd1d396c81026d252e8bb19180e1a1ca59bda

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: qaas-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 67.3 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 14b9e8340bb24acbe8b11fdb59fd069e98189c07d5f2419de134955c9791bb13
MD5 f8e8d9b8c81a5b787263f128e704ff26
BLAKE2b-256 c0cca35a2dbfe5166668d0648527278c00192cce18dd9d7fd7ea4930dfb618c8

See more details on using hashes here.

Provenance

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