Installation and dependencies¶
Dependencies¶
PennyLane requires the following libraries be installed:
Python >= 3.10
The following Python packages are hard dependencies, and will automatically be installed alongside PennyLane:
numpy < 2.1
rustworkx >= 0.14.0
autoray >= 0.6.11
pennylane-lightning >= 0.38
The following Python packages are optional:
openfermionpyscf, for the non-differentiable backend of the
qml.qchem
module
If you currently do not have Python 3 installed, we recommend Anaconda for Python 3, a distributed version of Python packaged for scientific computation.
Interface dependencies¶
For development of the TensorFlow, PyTorch, and JAX interfaces, there are additional requirements which must be installed manually:
JAX interface:
jax
andjaxlib
<= 0.4.28PyTorch interface:
pytorch
TensorFlow interface:
tensorflow
< 2.17
Installation¶
For development purposes, it is recommended to install PennyLane source code using development mode:
git clone https://github.com/PennyLaneAI/pennylane
cd pennylane
pip install -e .
The -e
flag ensures that edits to the source code will be reflected when
importing PennyLane in Python.
Note
Due to the use of entry points to install
plugins, changes to PennyLane device class locations or shortnames
requires pip install -e .
to be re-run in the plugin repository
for the changes to take effect.
Apart from the core packages needed to run PennyLane, some extra packages need
to be installed for several development processes, such as linting, testing, and
pre-commit quality checks. Those can be installed easily via pip
:
pip install -r requirements-dev.txt