Skip to main content

PennyLane-Lightning-GPU plugin

Project description

Read the Docs PyPI PyPI - Python Version

The PennyLane-Lightning-GPU plugin extends the Pennylane-Lightning state-vector simulator written in C++, and offloads to the NVIDIA cuQuantum SDK for GPU accelerated circuit simulation.

PennyLane is a cross-platform Python library for quantum machine learning, automatic differentiation, and optimization of hybrid quantum-classical computations.


  • Combine the NVIDIA cuQuantum SDK high-performance GPU simulator library with PennyLane’s automatic differentiation and optimization.

  • Direct support for GPU-enabled quantum gradients with the adjoint differentiation method.


PennyLane-Lightning-GPU requires Python version 3.7 and above. It can be installed using pip:

pip install pennylane-lightning[gpu]

To build the C++ module from source:

cmake -BBuild -DENABLE_CLANG_TIDY=on -DCUQUANTUM_SDK=<path to sdk>
cmake --build ./Build --verbose

An Python wheel can be built using:

python -m pip install wheel
python build_ext --cuquantum=<path to sdk>
python bdist_wheel

To simplify the build process, we recommend using the following containerized build process.

Build locally with Docker

To build using Docker, run the following from the project root directory:

docker build . -f ./docker/Dockerfile -t "lightning-gpu-wheels"

This will build a Python wheel for Python 3.7 up to 3.10 inclusive, and be manylinux2014 (glibc 2.17) compatible. To acquire the built wheels, use:

docker run -v `pwd`:/io -it lightning-gpu-wheels cp -r ./wheelhouse /io

which mounts the current working directory, and copies the wheelhouse directory from the image to the local directory. For licensing information, please view docker/


To test that the plugin is working correctly you can test the Python code within the cloned repository:

make test-python

while the C++ code can be tested with

make test-cpp

Please refer to the GPU plugin documentation as well as to the CPU documentation and PennyLane documentation for further references.


We welcome contributions - simply fork the repository of this plugin, and then make a pull request containing your contribution. All contributers to this plugin will be listed as authors on the releases.

We also encourage bug reports, suggestions for new features and enhancements, and even links to cool projects or applications built on PennyLane.


If you are having issues, please let us know by posting the issue on our Github issue tracker, or by asking a question in the forum.


The PennyLane-Lightning-GPU plugin is free and open source, released under the Apache License, Version 2.0. The PennyLane-Lightning-GPU plugin makes use of the NVIDIA cuQuantum SDK headers to enable the device bindings to PennyLane, which are held to their own respective 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

PennyLane-Lightning-GPU-0.1.0.tar.gz (15.3 kB view hashes)

Uploaded Source

Built Distributions

PennyLane_Lightning_GPU-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.5 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

PennyLane_Lightning_GPU-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.5 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

PennyLane_Lightning_GPU-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.4 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

PennyLane_Lightning_GPU-0.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.1 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page