Installation and dependencies¶
PennyLane requires the following libraries be installed:
Python >= 3.6
as well as the following Python packages:
The following Python packages are optional:
dask[“parallel”], for parallel QNodeCollection execution
tensornetwork >= 0.3, for the
If you currently do not have Python 3 installed, we recommend Anaconda for Python 3, a distributed version of Python packaged for scientific computation.
For development of the TensorFlow and PyTorch interfaces, there are additional requirements:
pytorch >= 1.1
tensorflow >= 1.15
Note that any version of TensorFlow supporting eager execution mode is supported, however there are slight differences between the eager API in TensorFlow 1.X versus 2.X.
Make sure that all modifications and tests involving the TensorFlow interface work for both TensorFlow 1.X and 2.X!
tf.__version__ == "1", running
Only using the
tf.GradientTapecontext for gradient computation.
Finally, for development of the QChem package, the following dependencies are required:
OpenFermion >= 0.10
The easiest way to install Psi4 is via Ananconda:
conda install psi4 psi4-rt -c psi4
Open Babel (optional but recommended to run the full test suite)
Open Babel can be installed using
aptif on Ubuntu/Debian:
sudo apt install openbabel
or using Anaconda:
conda install -c conda-forge openbabel
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 .
If also developing for the QChem package, this will need to installed as well:
pip install -e qchem
-e flag ensures that edits to the source code will be reflected when
importing PennyLane in Python.
Due to the use of entry points to install
plugins, changes to PennyLane device class locations or shortnames
pip install -e . to be re-run in the plugin repository
for the changes to take effect.