QFactor GPU implementation in BQSKit using JAX
Project description
QFactor and QFactor-Sample implementations on GPUs using JAX
bqskit-qfactor-jax
is a Python package that implements circuit instantiation using the QFactor and QFactor-Sample algorithms on GPUs to accelerate BQSKit. It uses JAX as an abstraction layer of the GPUs, seamlessly utilizing JIT compilation and GPU parallelism.
Installation
bqskit-qfactor-jax
is available for Python 3.8+ on Linux.
First, install JAX with GPU support, you may refer to JAX's installation instructions. For users working on Perlmutter please use the following modules before installing JAX in your environment:
module load cudnn/8.9.3_cuda12
module load nccl/2.18.3-cu12
Next, install this package with pip:
pip install bqskit-qfactor-jax
Running bqskit-qfactor-jax
Please set the environment variable XLA_PYTHON_CLIENT_PREALLOCATE=False when using this package. Also, if you encounter OOM issues consider setting XLA_PYTHON_CLIENT_ALLOCATOR=platform.
Please look at the examples for basic usage, especially at performance comparison between QFactor and QFactor-Sample.
When using several workers on the same GPU, we recommend using Nvidia's MPS. You may initiate it using the command line
nvidia-cuda-mps-control -d
You can disable it by running this command line:
echo quit | nvidia-cuda-mps-control
References
If you are using QFactor-JAX please cite:
Kukliansky, Alon, et al. "QFactor: A Domain-Specific Optimizer for Quantum Circuit Instantiation." 2023 IEEE International Conference on Quantum Computing and Engineering (QCE). Vol. 1. IEEE, 2023. Link.
If you are using QFactor-Sample please cite:
Kukliansky, Alon, et al. "Leveraging Quantum Machine Learning Generalization to Significantly Speed-up Quantum Compilation" arXiv preprint arXiv:2405.12866 (2024).
License
The software in this repository is licensed under a BSD free software license and can be used in source or binary form for any purpose as long as the simple licensing requirements are followed. See the LICENSE file for more information.
Copyright
Quantum Fast Circuit Optimizer (QFactor) JAX implementation Copyright (c) 2024, U.S. Federal Government and the Government of Israel. All rights reserved.
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
File details
Details for the file bqskit-qfactor-jax-1.0.0.tar.gz
.
File metadata
- Download URL: bqskit-qfactor-jax-1.0.0.tar.gz
- Upload date:
- Size: 21.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd36c31730dde3814b40484dd683ef04aed165923a24386a4aa01d5b81171c04 |
|
MD5 | c259e57501702ff8f6b59535265376e8 |
|
BLAKE2b-256 | 88354f14596e9c2ed924d8e4bf734736b501b98c0aeb3f2842f34e24e5921e36 |
File details
Details for the file bqskit_qfactor_jax-1.0.0-py2.py3-none-any.whl
.
File metadata
- Download URL: bqskit_qfactor_jax-1.0.0-py2.py3-none-any.whl
- Upload date:
- Size: 23.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cada9608f7166a3b08830be61c5b7236de4452cb7290b91a464b3b20c6ac4ff5 |
|
MD5 | 14f212a316f474fdecb88b4e67f3d33b |
|
BLAKE2b-256 | 152ef9f39f0cf19b26a94ca2d6d3e53b864b550924e0d89d3f9ae417e4a5a534 |