Installation

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

$ pip install pennylane-lightning

Alternatively, to build PennyLane-Lightning from source you can run

$ git clone https://github.com/XanaduAI/pennylane-lightning.git
$ cd pennylane-lightning
$ 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.

The following dependencies are required to install PennyLane-Lightning:

  • A C++ compiler, such as g++, clang, or MSVC.
  • pybind11 a library for binding C++ functionality to Python.

On Debian-based systems, these can be installed via apt and pip:

$ sudo apt install g++
$ pip install pybind11

Testing

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

$ make test

while the C++ code can be tested with

$ make test-cpp

Testing the C++ code requires the GoogleTest framework.