Skip to content

Latest commit

 

History

History
49 lines (36 loc) · 2.14 KB

README.md

File metadata and controls

49 lines (36 loc) · 2.14 KB

QFactor implementation on GPUs using JAX

bqskit-qfactor-jax is a Python package that implements circuit instantiation with QFactor 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 take a look at the examples to see some basic usage.

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

Kukliansky, Alon, et al. "QFactor:A Domain-Specific Optimizer for Quantum Circuit Instantiation." arXiv preprint arXiv:2306.08152 (2023).

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) 2023, U.S. Federal Government and the Government of Israel. All rights reserved.