Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lightning installation instructions improvements #848

Closed
Closed
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,11 @@

### Documentation

* The installation instructions for all lightning plugins have been improved.
[(#848)](https://github.com/PennyLaneAI/pennylane-lightning/pull/848)

* Updated the README and added citation format for Lightning arxiv preprint.
[#818](https://github.com/PennyLaneAI/pennylane-lightning/pull/818)
[(#818)](https://github.com/PennyLaneAI/pennylane-lightning/pull/818)

### Bug fixes

Expand Down
50 changes: 19 additions & 31 deletions README.rst
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of having installation instructions replicated in the README and docs, perhaps we could just make the README instructions very briefly redirect to the docs installation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the README instructions provide what's in the installation page (e.g.,

.. include:: ../../README.rst
)

Original file line number Diff line number Diff line change
Expand Up @@ -77,27 +77,16 @@ The following table summarizes the supported platforms and the primary installat
Lightning-Qubit installation
****************************

PyPI wheels (pip)
=================

Lightning plugins can be installed using ``pip`` as follows

.. code-block:: console

$ pip install pennylane-lightning

The above command will install the Lightning-Qubit plugin (the default since it is most broadly supported).
In order to install the Lightning-GPU and Lightning-Kokkos (OpenMP) backends, you can respectively use the following commands:

.. code-block:: console

$ pip install pennylane-lightning[gpu]
$ pip install pennylane-lightning[kokkos]

Lightning-Qubit comes pre-installed with PennyLane. Please follow our `installation instructions <https://pennylane.ai/install/#high-performance-computing-and-gpus>`_ to install PennyLane.

Install from source
===================

.. note::

The below contains instructions for installing Lightning Qubit ***from source***. For most cases, *this is not required* and one can simply use the `installation instructions at pennylane.ai/install <https://pennylane.ai/install>`_.
isaacdevlugt marked this conversation as resolved.
Show resolved Hide resolved
If those instructions do not work for you, or you have a more complex build environment that requires building from source, then consider reading on.

To build Lightning plugins from source you can run

.. code-block:: console
Expand Down Expand Up @@ -222,19 +211,15 @@ The C++ code can be tested with
Lightning-GPU installation
**************************

Lightning-GPU can be installed using ``pip``:

.. code-block:: console

pip install pennylane-lightning[gpu]

Lightning-GPU requires CUDA 12 and the `cuQuantum SDK <https://developer.nvidia.com/cuquantum-sdk>`_ (only the `cuStateVec <https://docs.nvidia.com/cuda/cuquantum/latest/custatevec/index.html>`_ library is required).
The SDK may be installed within the Python environment ``site-packages`` directory using ``pip`` or ``conda`` or the SDK library path appended to the ``LD_LIBRARY_PATH`` environment variable.
Please see the `cuQuantum SDK`_ install guide for more information.
For the majority of cases, Lightning-GPU can be installed by following our installation instructions at `pennylane.ai/install <https://pennylane.ai/install/#high-performance-computing-and-gpus>`_.

Install Lightning-GPU from source
=================================

.. note::
The below contains instructions for installing Lightning-GPU ***from source***. For most cases, *this is not required* and one can simply use the `installation instructions at pennylane.ai/install <https://pennylane.ai/install/#high-performance-computing-and-gpus>`_.
isaacdevlugt marked this conversation as resolved.
Show resolved Hide resolved
If those instructions do not work for you, or you have a more complex build environment that requires building from source, then consider reading on.

To install Lightning-GPU from the package sources using the direct SDK path, Lightning-Qubit should be install before Lightning-GPU:

.. code-block:: console
Expand Down Expand Up @@ -304,15 +289,16 @@ The C++ code is tested with
Lightning-Kokkos installation
*****************************

On linux systems, ``lightning.kokkos`` with the OpenMP backend can be installed by providing the optional ``[kokkos]`` tag:

.. code-block:: console

$ pip install pennylane-lightning[kokkos]
On most Linux systems, Lightning-Kokkos can be installed via Spack or Docker by following our installation instructions at `pennylane.ai/install <https://pennylane.ai/install/#high-performance-computing-and-gpus>`_.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with lightning.kokkos, I believe there may be more cases than qubit/gpu where you need to install from source (e.g., if you want to use GPUs)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Does this sentence need to be modified 🤔?


Install Lightning-Kokkos from source
====================================

.. note::

The below contains instructions for installing Lightning-Kokkos ***from source***. For most cases, one can install Lightning-Kokkos via Spack or Docker by the `installation instructions at pennylane.ai/install <https://pennylane.ai/install/#high-performance-computing-and-gpus>`_.
If those instructions do not work for you, or you have a more complex build environment that requires building from source, then consider reading on.

As Kokkos enables support for many different HPC-targeted hardware platforms, ``lightning.kokkos`` can be built to support any of these platforms when building from source.

We suggest first installing Kokkos with the wanted configuration following the instructions found in the `Kokkos documentation <https://kokkos.github.io/kokkos-core-wiki/building.html>`_.
Expand Down Expand Up @@ -366,12 +352,14 @@ Note that ``THREADS`` backend is not recommended since `Kokkos does not guarante

Lightning-Tensor installation
*****************************

Lightning-Tensor requires CUDA 12 and the `cuQuantum SDK <https://developer.nvidia.com/cuquantum-sdk>`_ (only the `cutensornet <https://docs.nvidia.com/cuda/cuquantum/latest/cutensornet/index.html>`_ library is required).
The SDK may be installed within the Python environment ``site-packages`` directory using ``pip`` or ``conda`` or the SDK library path appended to the ``LD_LIBRARY_PATH`` environment variable.
Please see the `cuQuantum SDK <https://developer.nvidia.com/cuquantum-sdk>`_ install guide for more information.

Install Lightning-Tensor from source
====================================

Lightning-Qubit should be installed before Lightning-Tensor:

.. code-block:: console
Expand Down
21 changes: 16 additions & 5 deletions doc/dev/installation.rst
Original file line number Diff line number Diff line change
@@ -1,26 +1,37 @@
Installation
############

Each device in the Lightning ecosystem is a separate Python package. Select the device below for installation instructions:
Lightning Qubit comes with installing PennyLane. Please follow our `installation instructions on pennylane.ai <https://pennylane.ai/install/>`_ to install PennyLane.

In most cases, installing Lightning GPU and Lightning Kokkos can be done by following our `high-performance computing installation instructions <https://pennylane.ai/install/#high-performance-computing-and-gpus>`_.

Install from source
**********************

.. note::
In cases where our `general installation instructions <https://pennylane.ai/install/>`_
do not suffice, please consider reading on.

Select the device below for detailed source-installation instructions:

.. title-card::
:name: Lightning Qubit
:description: Guidelines to installing and testing the Lightning Qubit device.
:description: Detailed guidelines to installing and testing the Lightning Qubit device.
:link: ../lightning_qubit/installation.html

.. title-card::
:name: Lightning GPU
:description: Guidelines to installing and testing the Lightning GPU device
:description: Detailed guidelines to installing and testing the Lightning GPU device
:link: ../lightning_gpu/installation.html

.. title-card::
:name: Lightning Kokkos
:description: Guidelines to installing and testing the Lightning Kokkos device
:description: Detailed guidelines to installing and testing the Lightning Kokkos device
:link: ../lightning_kokkos/installation.html

.. title-card::
:name: Lightning Tensor
:description: Guidelines to installing and testing the Lightning Tensor device
:description: Detailed guidelines to installing and testing the Lightning Tensor device
:link: ../lightning_tensor/installation.html

.. raw:: html
Expand Down
2 changes: 1 addition & 1 deletion pennylane_lightning/core/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
Version number (major.minor.patch[-label])
"""

__version__ = "0.38.0-dev29"
__version__ = "0.38.0-dev30"