PennyLane-Lightning plugin
Project description
The PennyLane-Lightning plugin provides a fast state-vector simulator written in C++.
PennyLane is a cross-platform Python library for quantum machine learning, automatic differentiation, and optimization of hybrid quantum-classical computations.
Features
Combine PennyLane-Lightning’s high performance simulator with PennyLane’s automatic differentiation and optimization.
Installation
PennyLane-Lightning requires Python version 3.8 and above. It can be installed using pip:
$ pip install pennylane-lightning
To build PennyLane-Lightning from source you can run
$ pip install pybind11 pennylane-lightning --no-binary :all:
A C++ compiler such as g++, clang++, or MSVC is required. On Debian-based systems, this can be installed via apt:
$ sudo apt install g++
On MacOS, we recommend using the latest version of clang++ and libomp:
$ brew install llvm libomp
The pybind11 library is also used for binding the C++ functionality to Python.
Alternatively, for development and testing, you can install by cloning the repository:
$ git clone https://github.com/PennyLaneAI/pennylane-lightning.git
$ cd pennylane-lightning
$ pip install -r requirements.txt
$ pip install -e .
Note that subsequent calls to pip install -e . will use cached binaries stored in the build folder. Run make clean if you would like to recompile.
You can also pass cmake options with CMAKE_ARGS as follows:
$ CMAKE_ARGS="-DENABLE_OPENMP=OFF -DENABLE_BLAS=OFF -DENABLE_KOKKOS=OFF" pip install -e . -vv
or with build_ext and the --define flag as follows:
$ python3 setup.py build_ext -i --define="ENABLE_OPENMP=OFF;ENABLE_BLAS=OFF;ENABLE_KOKKOS=OFF"
$ python3 setup.py develop
GPU support
For GPU support, PennyLane-Lightning-GPU can be installed by providing the optional [gpu] tag:
$ pip install pennylane-lightning[gpu]
For more information, please refer to the PennyLane Lightning GPU documentation.
Testing
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
CMake Support
One can also build the plugin using CMake:
$ cmake -S. -B build
$ cmake --build build
To test the C++ code:
$ mkdir build && cd build
$ cmake -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Debug ..
$ make
Other supported options are
-DENABLE_WARNINGS=ON
-DENABLE_NATIVE=ON (for -march=native)
-DENABLE_BLAS=ON
-DENABLE_OPENMP=ON
-DENABLE_KOKKOS=ON
-DENABLE_CLANG_TIDY=ON
Compile on Windows with MSVC
You can also compile Pennylane-Lightning on Windows using Microsoft Visual C++ compiler. You need cmake and appropriate Python environment (e.g. using Anaconda).
We recommend to use [x64 (or x86)] Native Tools Command Prompt for VS [version] for compiling the library. Be sure that cmake and python can be called within the prompt.
$ cmake --version
$ python --version
Then a common command will work.
$ pip install -r requirements.txt
$ pip install -e .
Note that OpenMP and BLAS are disabled in this setting.
Please refer to the plugin documentation as well as to the PennyLane documentation for further reference.
Docker Support
One can also build the Pennylane-Lightning image using Docker:
$ git clone https://github.com/PennyLaneAI/pennylane-lightning.git
$ cd pennylane-lightning
$ docker build -t lightning/base -f docker/Dockerfile .
Please refer to the PennyLane installation for detailed description about PennyLane Docker support.
Contributing
We welcome contributions - simply fork the repository of this plugin, and then make a pull request containing your contribution. All contributors 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.
Support
Source Code: https://github.com/PennyLaneAI/pennylane-lightning
Issue Tracker: https://github.com/PennyLaneAI/pennylane-lightning/issues
PennyLane Forum: https://discuss.pennylane.ai
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.
License
The PennyLane lightning plugin is free and open source, released under the Apache License, Version 2.0.
Acknowledgements
PennyLane Lightning makes use of the following libraries and tools, which are under their own respective licenses:
pybind11: https://github.com/pybind/pybind11
Kokkos Core: https://github.com/kokkos/kokkos
Kokkos Kernels: https://github.com/kokkos/kokkos-kernels
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 Distributions
Hashes for PennyLane-Lightning-0.31.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c8772a6a516ddeedf0b29b58a492f29b3aaf176fb9f89b678e001fe825898af |
|
MD5 | dd43997f39c75b8f13d54b922616e7e6 |
|
BLAKE2b-256 | 1298fbcc98af988c4fdc2d4b01fe383f846caaebb309404c66f1c8f24a12b001 |
Hashes for PennyLane_Lightning-0.31.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c138f4b2f630b52703c7f561208b009a69f9ea76134704ada59c2b856ce3a90 |
|
MD5 | ad845d44986b65bebc1ebb7bcdf7e630 |
|
BLAKE2b-256 | 8493b9e57e008765f40a637f32304c261efba9f65aa3a825abdb10b85be636b1 |
Hashes for PennyLane_Lightning-0.31.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2986e00143f833f031843b83b8e09bc3ac5f61c985ec05ba17d27cbdba4af2a5 |
|
MD5 | 269e08abd54970d7f8fde9ce77e93a94 |
|
BLAKE2b-256 | 0ddf417d6193d66537e27ea0433aa664bfaeaf5f41275f25cab092d3b5c803c2 |
Hashes for PennyLane_Lightning-0.31.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef8e9c41c173b2ebd8f1d8fcc764b85ada1b977009df64c4d18d6f66a5329392 |
|
MD5 | bd3e65c6880c07f18cd8ae76229f74b4 |
|
BLAKE2b-256 | de3ad8fbd159021bdddac534d4e22ea1a3f55a8759248256b65bfa7bbaff658a |
Hashes for PennyLane_Lightning-0.31.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0cb8a2e350f80f7d160c24a19fce6fce7a31ca3e483f989bded6463554de677b |
|
MD5 | b735987e293d2407bd409bc7befe6450 |
|
BLAKE2b-256 | 63dc6a093a3b3737adac5262f11656e0b8e2cc303d04f37a979e5836bf6c54c2 |
Hashes for PennyLane_Lightning-0.31.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee80b863778f97548460a152281a525672e91b3986a50bc080a618e4e7a7a270 |
|
MD5 | 58f91f1f24f61afff29cf0c9572de7e7 |
|
BLAKE2b-256 | 52d337f08e6f147ab980c2b2cb4326792e92d53c76decb6868a011ddb80dbbf4 |
Hashes for PennyLane_Lightning-0.31.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9be67929e991fd5a40857e369e10a264db4a960721a29d8bb59a237301794eab |
|
MD5 | c3ca77968e547095c938aa1bd61866d9 |
|
BLAKE2b-256 | b25425268088469f1c912f06f9d547b375e495a7f31262e629596b6eee3e844a |
Hashes for PennyLane_Lightning-0.31.0-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d36229f8adc862f3ad65abb16fd6fdc805db0bd789dd449a4b01a71a03e2807c |
|
MD5 | 7c3d9c98d3947f4e10aad2857210192f |
|
BLAKE2b-256 | 0157b316c75d0b26a71ca04d5979a506a1b8d2b244eb634419cfc176999fec7a |
Hashes for PennyLane_Lightning-0.31.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03c08d0fe64f53dafe407363adf35e5888c39ae81b80c944c2911bad896b81dc |
|
MD5 | e012dc428ec0236c3f4b8fbbc005bc4a |
|
BLAKE2b-256 | 339ee34421ea42d36d6f6a409660727eabfe5dc06bcbe43d0878b2709cf6bfd5 |
Hashes for PennyLane_Lightning-0.31.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6da075730f52f065083ac38ae9331fb7cb68ec9790e4eb5c7f0945d0ed2f8a1 |
|
MD5 | abe37e1f6077389686a88291a131343b |
|
BLAKE2b-256 | fe3e7f691380bcbc194c31897addfe0e18b68b51806a67539728f5fea7e1a94a |
Hashes for PennyLane_Lightning-0.31.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a434fd9eece1dca403346fdf60d90022eec4d4cb7bba9c0710bd788311151ea0 |
|
MD5 | 0f9ad1bfb646c3bc384a65400e6ba75f |
|
BLAKE2b-256 | c4802c871c1c8d71abed2575e91954343e4a27cbf636f6e266b2663a865e7341 |
Hashes for PennyLane_Lightning-0.31.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e5f80369b0001d891374c53a41f5eac9c798f38cfff8cb1217fbd006007c210 |
|
MD5 | 62a0c3033e8d3582fef99529f6592066 |
|
BLAKE2b-256 | 531cff3edc196bb58a9b281ac6448366dbb0e613c9fd311e236e4941e0bf6521 |
Hashes for PennyLane_Lightning-0.31.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69b5946980d7c798fc559dcdcf8bada924cb776f04e4e68918bac58a73954e70 |
|
MD5 | 0a606de5cd9d61f8cdc322d142724289 |
|
BLAKE2b-256 | e7d56e824412525fea01252976fb25a76747389078db4e418509286f8976173b |
Hashes for PennyLane_Lightning-0.31.0-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ae4bbe7ab2927619080aa815e542655f67cfe0275b0030715c3e1f2721fcd1c |
|
MD5 | 28c89cbc506b59a3c5a6740130664eb7 |
|
BLAKE2b-256 | ce0c94fed4a6306073a9684d4c5043b31ae2762f29e812a772503b886c72b0a6 |
Hashes for PennyLane_Lightning-0.31.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6150d3fe52fffcad4ce7e26245ebf82ea5daadd849318db3000665c2a08aeacc |
|
MD5 | 1093604de421f43a4df50814f65e96c0 |
|
BLAKE2b-256 | 1d5117f5771490ad127b0696964f0364ea5ce0aedf09cb145567f1d7529e0912 |
Hashes for PennyLane_Lightning-0.31.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb1beb33392735d93a0a204b6870f13d82aa67d7c0f1c2e4667ecbdcc57bf32d |
|
MD5 | dd8957ff8871a59adfa563b2b060f56e |
|
BLAKE2b-256 | aaece5977a5d11525c2a7a451a20265adbf5fb6ea0bc24647464c7222e134f29 |
Hashes for PennyLane_Lightning-0.31.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 999154ff29ab4fd7d13391af20a992259c8c018fc937d0332b1e82b3f87473c2 |
|
MD5 | 302eb26a73c36cba784e03d5e55e5820 |
|
BLAKE2b-256 | 16f9bce7596c50a9cb64db171ce70da530b2e146cb9b9d52ff8b7aabcbb75719 |
Hashes for PennyLane_Lightning-0.31.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38260393eb945e224ef8eefa5095f5f800c82b7a306cb5bd73fe60a543951089 |
|
MD5 | b47ac0828449c51495176d1ea9273ec2 |
|
BLAKE2b-256 | 7a661da5152375528079225ac7c94296e441d36ca51e6371bd18534624bea5b6 |
Hashes for PennyLane_Lightning-0.31.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be2a1082dc680fb59918fa521a11acefe4ad3f6d0af438750155e0aac50a1ecd |
|
MD5 | 0b0b939a186dedd4f9f0ebf30c8f1958 |
|
BLAKE2b-256 | 122421062bda62a11e963c0ca45acca8bd6c1d8a8ed59e04b8b4d9ea022e729b |
Hashes for PennyLane_Lightning-0.31.0-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41550e44f7ace1b162badbf39ec1dda10a4a3d18eb902f54a7379b51df890334 |
|
MD5 | 37a070779948603f68b0ca3f47e13a92 |
|
BLAKE2b-256 | fa02d646e65b3df42b4fd376bfe2f4fe04c6fd9cda06ed838100b8569d39d5d5 |
Hashes for PennyLane_Lightning-0.31.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d30ee4c0dc29b858bb38dca36aa9ce63a3c8ba941383dc97e017854751209d9e |
|
MD5 | 8b4b3442ca43106bdab9a086689bc5bf |
|
BLAKE2b-256 | f4f5b91883d1fc592237a3abd4cffde44fd74c1643956449754d0efa39c0ba41 |
Hashes for PennyLane_Lightning-0.31.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ea9b94cee2f91e4b8bf5c0cab281599606936a951a1d86065f95839b47658dd |
|
MD5 | a76ee0b52f7a641c3205b319aba1b473 |
|
BLAKE2b-256 | 59e7a725505a4a54c77200db528cac4a73c12b39b9cf21e8c606d7ac644e3f76 |
Hashes for PennyLane_Lightning-0.31.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 726cb7bd1a085065eb41f9eaee8588ee0b5ef0c30cdf21d2c64ffba991825951 |
|
MD5 | 0a6462f73f6cd329318abd02f8f7ab29 |
|
BLAKE2b-256 | dd07bcd49bdf61cd0fcd67161cf0230d58e39ac054fd737c518f1f0aafe72f1d |
Hashes for PennyLane_Lightning-0.31.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22d9e1d27c08b61b50b488c17bb62387e480820a783210c9fc2ef14f2f8bb034 |
|
MD5 | 08db3aec89370a66497c169afd1f0801 |
|
BLAKE2b-256 | f2f1f33ce5706ec3a6fd9f50fbc096fa2c01cf01fedbbabd7392183cf6985027 |
Hashes for PennyLane_Lightning-0.31.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d026917b538c36e98db4b37f8f7f6aced0a1c86db620598c024a1ea2ebd75e3e |
|
MD5 | 9a1191fd44dbee8034506e8bc95c7cbc |
|
BLAKE2b-256 | a6cc1be861243fbae4de4a225180c1653ad40e077cdbecea84e229d33e12646c |
Hashes for PennyLane_Lightning-0.31.0-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ff566c5f02376778254fbe782429171b83566c91d0e4b320ecfb14e083cae73 |
|
MD5 | 7154bbf24d7a208d2762f440fc522d8d |
|
BLAKE2b-256 | b1a8b3ee5e22abf3c57de54468102af748b047436e998198228a7117df523637 |