PennyLane is an open-source software framework for quantum machine learning, quantum chemistry, and quantum computing, with the ability to run on all hardware. Maintained with ❤️ by Xanadu.
For more information on PennyLane, including the demos, APIs and development guide, visit the PennyLane documentation site. You can also check the Lightning-plugins documentation:
Each image contains PennyLane and one of several high-performance plugins.
Choose a version (e.g. v0.34.0
) and append a device (plugin) name among the following:
lightning-qubit
: pennylane-lightning provides a fast state-vector simulator written in C++.lightning-gpu
: pennylane-lightning-gpu is a plugin based on the NVIDIA cuQuantum SDK.lightning-kokkos-cuda
: pennylane-lightning-kokkos parallelizes state-vector simulations using Kokkos' CUDA backend.lightning-kokkos-openmp
: pennylane-lightning-kokkos parallelizes state-vector simulations using Kokkos' OpenMP backend.lightning-kokkos-rocm
: pennylane-lightning-kokkos parallelizes state-vector simulations using Kokkos' HIP backend.
If you have Docker installed, download and spawn a container with pennylane-lightning
as follows
docker run -v pwd:/io -it pennylaneai/pennylane:v0.34.0-lightning-qubit bash
On certain systems, there may be other solutions supporting Docker containers. For instance, NERSC computers (e.g. Perlmutter) have Shifter bringing containers to HPC. In this case, spawning a container is simple as
shifterimg pull pennylaneai/pennylane:v0.34.0-lightning-qubit
shifter --image=pennylaneai/pennylane:v0.34.0-lightning-qubit /bin/bash
where the first command downloads the image and the second spawns a container.
You can test PennyLane and the lightning-qubit
plugin, for example, with
pip install pytest pytest-mock flaky
pl-device-test --device default.qubit
pl-device-test --device default.qubit --shots 10000
pl-device-test --device lightning.qubit
pl-device-test --device lightning.qubit --shots 10000
Decide on a target among:
wheel-lightning-qubit
wheel-lightning-gpu
wheel-lightning-kokkos-cuda
wheel-lightning-kokkos-openmp
wheel-lightning-kokkos-rocm
For instance TARGET=wheel-lightning-qubit
.
Then the following command will build the target
docker build -f docker/Dockerfile --tag=${TARGET} --target ${TARGET} .
You may also feed a git tag or version as follows
docker build -f docker/Dockerfile --tag=${TARGET} --target ${TARGET} --build-arg="LIGHTNING_VERSION=${VERSION}" .
To start a container with a bash
shell use
docker run -v `pwd`:/io -it ${TARGET} bash