A module for optimally combining and distributing quantum circuits
Project description
Quantum Circuit Parallelizer
A Python module for optimally combining and distributing quantum circuits. See the
included notebooks for examples and more information. In summary, the motivation
for this module comes from frequent underutilization of increasingly large quantum processors. The
module processes several independent circuits into a smaller set of wider, combined circuits, which
it then runs on available backends in parallel. All of this happens behind the scenes, so ideally
the user can treat the module's functionality as a parallelized drop-in replacement for Qiskit's
backend.run().
Here is a brief and basic example:
# Define or load a number of circuits.
from qiskit import QuantumCircuit
circuits = [QuantumCircuit(...), QuantumCircuit(...), ...]
# Define backends for circuit execution. These can be any Qiskit-compatible backend objects, but
# here we define two simulators that mimic IQM's 5-qubit Adonis architechture.
import iqm.qiskit_iqm as iqm
backends = [iqm.IQMFakeAdonis(), iqm.IQMFakeAdonis()]
# Parallelize and execute. This call will
# 1. determine how to combine the circuits and for which backends, and
# 2. submit jobs to the backends.
import qc_parallelizer as parallelizer
job = parallelizer.execute(circuits, backends=backends)
# Fetch and handle results. This plots the first circuit's result histogram, for example.
results = job.results()
qiskit.visualization.plot_histogram(result[0].get_counts())
# Information on the parallelization and underlying jobs is also available.
print(f"On average, {job.info.avg_circuits_per_backend} circuits were placed per backend.")
print("Job IDs:")
for job_id in job.job_id():
print(f" - {job_id}")
For an operational overview, see this diagram:
Development setup
For the following commands, a virtual environment or equivalent isolation is recommended. This can be done with Conda, for example, with
conda create --name parallelizer python=3.10 pip # note the Python version!
conda activate parallelizer
The package can then be installed from a local copy of the directory by running
pip install -e .
from the repository root. If you additionally wish to run tests or the provided notebook(s), you can install dependencies for those with
pip install .[tests]
# and/or
pip install .[notebooks]
Testing
Running all tests is as simple as installing the required dependencie (.[tests]) and running
pytest
from the repository root. Additionally, there is a benchmarking script in the tests/ directory.
Authors
- Henri Ahola - henri.ahola@vtt.fi
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qc_parallelizer-1.0.0.tar.gz.
File metadata
- Download URL: qc_parallelizer-1.0.0.tar.gz
- Upload date:
- Size: 520.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1b5ad71f119ac2e9d18fe15690eb8b5cd860287c0311a39db96bd063958d734
|
|
| MD5 |
f06ff2451d8b9b405e4fda3e2a8f0bfd
|
|
| BLAKE2b-256 |
02164e725a934db38e9b65bc8cc042b01dfd0fc6012c39a1aba5d686de9a66c5
|
Provenance
The following attestation bundles were made for qc_parallelizer-1.0.0.tar.gz:
Publisher:
publish.yml on vttresearch/qc-parallelizer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qc_parallelizer-1.0.0.tar.gz -
Subject digest:
b1b5ad71f119ac2e9d18fe15690eb8b5cd860287c0311a39db96bd063958d734 - Sigstore transparency entry: 209034961
- Sigstore integration time:
-
Permalink:
vttresearch/qc-parallelizer@c5a40acf62238bc56740b9a2702d45214f1fd7de -
Branch / Tag:
refs/tags/1.0.0 - Owner: https://github.com/vttresearch
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c5a40acf62238bc56740b9a2702d45214f1fd7de -
Trigger Event:
push
-
Statement type:
File details
Details for the file qc_parallelizer-1.0.0-py3-none-any.whl.
File metadata
- Download URL: qc_parallelizer-1.0.0-py3-none-any.whl
- Upload date:
- Size: 24.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2854a30192262d75d6bcaa2f21e6a2b0c2f4499c95b49f2c36da7f8cb6abc9dc
|
|
| MD5 |
66d8a76d87a4119b46c907facf0ce721
|
|
| BLAKE2b-256 |
f304da0770e8ddbecccc278e11d3a3f07511e8c35c276277e136cd39ec46e5a1
|
Provenance
The following attestation bundles were made for qc_parallelizer-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on vttresearch/qc-parallelizer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qc_parallelizer-1.0.0-py3-none-any.whl -
Subject digest:
2854a30192262d75d6bcaa2f21e6a2b0c2f4499c95b49f2c36da7f8cb6abc9dc - Sigstore transparency entry: 209034967
- Sigstore integration time:
-
Permalink:
vttresearch/qc-parallelizer@c5a40acf62238bc56740b9a2702d45214f1fd7de -
Branch / Tag:
refs/tags/1.0.0 - Owner: https://github.com/vttresearch
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c5a40acf62238bc56740b9a2702d45214f1fd7de -
Trigger Event:
push
-
Statement type: