{"id":17632770,"url":"https://github.com/pennylaneai/pennylane-lightning","last_synced_at":"2025-05-15T12:06:14.084Z","repository":{"id":37084916,"uuid":"277556169","full_name":"PennyLaneAI/pennylane-lightning","owner":"PennyLaneAI","description":"The Lightning plugin ecosystem provides fast quantum state-vector and tensor network simulators written in C++ for use with PennyLane.","archived":false,"fork":false,"pushed_at":"2025-05-13T21:56:51.000Z","size":12183,"stargazers_count":111,"open_issues_count":65,"forks_count":44,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-05-13T23:07:13.780Z","etag":null,"topics":["cuda","distributed-computing","gpu","hpc","mpi","openmp","parallel","quantum-computing","quantum-machine-learning","rocm"],"latest_commit_sha":null,"homepage":"https://docs.pennylane.ai/projects/lightning","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PennyLaneAI.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-07-06T13:55:59.000Z","updated_at":"2025-05-12T14:29:44.000Z","dependencies_parsed_at":"2023-09-22T03:23:44.666Z","dependency_job_id":"fbb54ecb-286b-486e-b0df-b0acde94b677","html_url":"https://github.com/PennyLaneAI/pennylane-lightning","commit_stats":{"total_commits":661,"total_committers":41,"mean_commits":"16.121951219512194","dds":0.8532526475037822,"last_synced_commit":"9eb61230724131d3fca036a09d1e84771aafacfa"},"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PennyLaneAI%2Fpennylane-lightning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PennyLaneAI%2Fpennylane-lightning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PennyLaneAI%2Fpennylane-lightning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PennyLaneAI%2Fpennylane-lightning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PennyLaneAI","download_url":"https://codeload.github.com/PennyLaneAI/pennylane-lightning/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254337613,"owners_count":22054253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cuda","distributed-computing","gpu","hpc","mpi","openmp","parallel","quantum-computing","quantum-machine-learning","rocm"],"created_at":"2024-10-23T01:45:40.788Z","updated_at":"2025-05-15T12:06:09.069Z","avatar_url":"https://github.com/PennyLaneAI.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"Lightning Plugins\n#################\n\n.. image:: https://img.shields.io/github/actions/workflow/status/PennyLaneAI/pennylane-lightning/tests_lqcpu_python.yml?branch=master\u0026label=LQubit%20%28Python%20Tests%29\u0026style=flat-square\n    :alt: Linux x86_64 L-Qubit Python tests (branch)\n    :target: https://github.com/PennyLaneAI/pennylane-lightning/actions/workflows/tests_lqcpu_python.yml\n\n.. image:: https://img.shields.io/github/actions/workflow/status/PennyLaneAI/pennylane-lightning/tests_lkcpu_python.yml?branch=master\u0026label=LKokkos%20%28Python%20Tests%29\u0026style=flat-square\n    :alt: Linux x86_64 L-Kokkos Python tests (branch)\n    :target: https://github.com/PennyLaneAI/pennylane-lightning/actions/workflows/tests_lkcpu_python.yml\n\n.. image:: https://img.shields.io/github/actions/workflow/status/PennyLaneAI/pennylane-lightning/tests_gpu_python.yml?branch=master\u0026label=GPU%20%28Python%20Tests%29\u0026style=flat-square\n    :alt: Linux x86_64 GPU Python tests (branch)\n    :target: https://github.com/PennyLaneAI/pennylane-lightning/actions/workflows/tests_gpu_python.yml\n\n.. image:: https://img.shields.io/github/actions/workflow/status/PennyLaneAI/pennylane-lightning/.github/workflows/wheel_linux_x86_64.yml?branch=master\u0026logo=github\u0026style=flat-square\n    :alt: Linux x86_64 wheel builds (branch)\n    :target: https://github.com/PennyLaneAI/pennylane-lightning/actions/workflows/wheel_linux_x86_64.yml?query=branch%3Amaster++\n\n.. image:: https://img.shields.io/codecov/c/github/PennyLaneAI/pennylane-lightning/master.svg?logo=codecov\u0026style=flat-square\n    :alt: Codecov coverage\n    :target: https://codecov.io/gh/PennyLaneAI/pennylane-lightning\n\n.. image:: https://img.shields.io/codefactor/grade/github/PennyLaneAI/pennylane-lightning/master?logo=codefactor\u0026style=flat-square\n    :alt: CodeFactor Grade\n    :target: https://www.codefactor.io/repository/github/pennylaneai/pennylane-lightning\n\n.. image:: https://readthedocs.com/projects/xanaduai-pennylane-lightning/badge/?version=latest\u0026style=flat-square\n    :alt: Read the Docs\n    :target: https://docs.pennylane.ai/projects/lightning\n\n.. image:: https://img.shields.io/pypi/v/PennyLane-Lightning.svg?style=flat-square\n    :alt: PyPI\n    :target: https://pypi.org/project/PennyLane-Lightning\n\n.. image:: https://img.shields.io/pypi/pyversions/PennyLane-Lightning.svg?style=flat-square\n    :alt: PyPI - Python Version\n    :target: https://pypi.org/project/PennyLane-Lightning\n\n.. header-start-inclusion-marker-do-not-remove\n\nThe Lightning plugin ecosystem provides fast state-vector and tensor network simulators written in C++.\n\n`PennyLane \u003chttps://docs.pennylane.ai\u003e`_ is a cross-platform Python library for quantum machine\nlearning, automatic differentiation, and optimization of hybrid quantum-classical computations.\nPennyLane supports Python 3.10 and above.\n\nFeatures\n********\n\nPennyLane-Lightning high performance simulators include the following backends:\n\n* ``lightning.qubit``: a fast state-vector simulator written in C++ with optional `OpenMP \u003chttps://www.openmp.org/\u003e`_ additions and parallelized gate-level SIMD kernels.\n* ``lightning.gpu``: a state-vector simulator based on the `NVIDIA cuQuantum SDK \u003chttps://developer.nvidia.com/cuquantum-sdk\u003e`_. It notably implements a distributed state-vector simulator based on `MPI \u003chttps://www.mpi-forum.org/docs/\u003e`_.\n* ``lightning.kokkos``: a state-vector simulator written with `Kokkos \u003chttps://kokkos.github.io/kokkos-core-wiki/index.html\u003e`_. It can exploit the inherent parallelism of modern processing units supporting the `OpenMP \u003chttps://www.openmp.org/\u003e`_, `CUDA \u003chttps://developer.nvidia.com/cuda-toolkit\u003e`_ or `HIP \u003chttps://rocm.docs.amd.com/projects/HIP/en/latest/\u003e`_ programming models.\n* ``lightning.tensor``: a tensor network simulator based on the `NVIDIA cuQuantum SDK \u003chttps://developer.nvidia.com/cuquantum-sdk\u003e`_. The supported methods are Matrix Product State (MPS) and Exact Tensor Network (TN).\n\nIf you're not sure what simulator to use, check out our `PennyLane performance \u003chttps://pennylane.ai/performance\u003e`_ page.\n\n.. header-end-inclusion-marker-do-not-remove\n\nThe following table summarizes the supported platforms and the primary installation mode:\n\n+-----------+---------+--------+-------------+----------------+-----------------+----------------+----------------+\n|           | L-Qubit | L-GPU  | L-GPU (MPI) | L-Kokkos (OMP) | L-Kokkos (CUDA) | L-Kokkos (HIP) |    L-Tensor    |\n+===========+=========+========+=============+================+=================+================+================+\n| Linux x86 | pip     | pip    | source      | pip            | source          | source         |     pip        |\n+-----------+---------+--------+-------------+----------------+-----------------+----------------+----------------+\n| Linux ARM | pip     | pip    |             | pip            | source          | source         |     pip        |\n+-----------+---------+--------+-------------+----------------+-----------------+----------------+----------------+\n| Linux PPC | pip     | source |             | source         | source          | source         |                |\n+-----------+---------+--------+-------------+----------------+-----------------+----------------+----------------+\n| MacOS x86 | pip     |        |             | pip            |                 |                |                |\n+-----------+---------+--------+-------------+----------------+-----------------+----------------+----------------+\n| MacOS ARM | pip     |        |             | pip            |                 |                |                |\n+-----------+---------+--------+-------------+----------------+-----------------+----------------+----------------+\n| Windows   | pip     |        |             |                |                 |                |                |\n+-----------+---------+--------+-------------+----------------+-----------------+----------------+----------------+\n\n\n.. installation_LQubit-start-inclusion-marker-do-not-remove\n\nLightning-Qubit installation\n****************************\n\nStandard installation\n=====================\n| **Lightning-Qubit comes pre-installed with PennyLane.**\n| Please follow our `installation instructions \u003chttps://pennylane.ai/install/#high-performance-computing-and-gpus\u003e`_ to install PennyLane.\n\nInstall from source\n===================\n\n.. note::\n\n    The section 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 \u003chttps://pennylane.ai/install\u003e`__.\n    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.\n\nTo build Lightning plugins from source you can run\n\n.. code-block:: bash\n\n    PL_BACKEND=${PL_BACKEND} pip install pybind11 pennylane-lightning --no-binary :all:\n\nwhere ``${PL_BACKEND}`` can be ``lightning_qubit`` (default), ``lightning_gpu``,  ``lightning_kokkos``, or ``lightning_tensor``.\nThe `pybind11 \u003chttps://pybind11.readthedocs.io/en/stable/\u003e`_ library is required to bind the C++ functionality to Python. If installing Lightning-GPU, Lightning-Tensor, or Lightning-Kokkos, additional dependencies may be required. We recommend referring to the respective guides for `Lightning-GPU installation \u003chttps://docs.pennylane.ai/projects/lightning/en/stable/lightning_gpu/installation.html\u003e`_, `Lightning-Tensor installation \u003chttps://docs.pennylane.ai/projects/lightning/en/stable/lightning_tensor/installation.html\u003e`_, and `Lightning-Kokkos installation \u003chttps://docs.pennylane.ai/projects/lightning/en/stable/lightning_kokkos/installation.html\u003e`_.\n\nA C++ compiler such as ``g++``, ``clang++``, or ``MSVC`` is required.\nOn Debian-based systems, this can be installed via ``apt``:\n\n.. code-block:: bash\n\n    sudo apt -y update \u0026\u0026 sudo apt install -y g++ libomp-dev\n\nwhere ``libomp-dev`` is included to also install OpenMP.\nOn MacOS, we recommend using the latest version of ``clang++`` and ``libomp``:\n\n.. code-block:: bash\n\n    brew install llvm libomp\n\nDevelopment installation\n========================\n\nFor development and testing, you can install by cloning the repository:\n\n.. code-block:: bash\n\n    git clone https://github.com/PennyLaneAI/pennylane-lightning.git\n    cd pennylane-lightning\n    pip install -r requirements.txt\n    PL_BACKEND=${PL_BACKEND} python scripts/configure_pyproject_toml.py\n    pip install -e . --config-settings editable_mode=compat -vv\n\nNote that subsequent calls to ``pip install -e .`` will use cached binaries stored in the\n``build`` folder, and the ``pyproject.toml`` file defined by the configuration script. Run ``make clean`` if you would like to recompile from scratch.\n\nYou can also pass ``cmake`` options with ``CMAKE_ARGS`` as follows:\n\n.. code-block:: bash\n\n    CMAKE_ARGS=\"-DENABLE_OPENMP=OFF -DENABLE_BLAS=OFF\" pip install -e . --config-settings editable_mode=compat -vv\n\n\nSupported options are ``-DENABLE_WARNINGS``, ``-DENABLE_NATIVE`` (for ``-march=native``) ``-DENABLE_BLAS``, ``-DENABLE_OPENMP``,  and ``-DENABLE_CLANG_TIDY``.\n\nCompile MSVC (Windows)\n======================\n\nLightning-Qubit can be compiled on Windows using the\n`Microsoft Visual C++ \u003chttps://visualstudio.microsoft.com/vs/features/cplusplus/\u003e`_ compiler.\nYou need `cmake \u003chttps://cmake.org/download/\u003e`_ and appropriate Python environment\n(e.g. using `Anaconda \u003chttps://www.anaconda.com/\u003e`_).\n\nWe recommend using ``[x64 (or x86)] Native Tools Command Prompt for VS [version]`` to compile the library.\nBe sure that ``cmake`` and ``python`` can be called within the prompt.\n\n.. code-block:: bash\n\n    cmake --version\n    python --version\n\nThen a common command will work.\n\n.. code-block:: bash\n\n    pip install -r requirements.txt\n    pip install -e .\n\nNote that OpenMP and BLAS are disabled on this platform.\n\n\nTesting\n=======\n\nTo test that a plugin is working correctly, one can check both Python and C++ unit tests for each device.\n\nPython Test\n^^^^^^^^^^^\n\nTest the Python code with:\n\n.. code-block:: bash\n\n    make test-python device=${PL.DEVICE}\n\nwhere ``${PL.DEVICE}`` differs from ``${PL_BACKEND}`` by replacing the underscore with a period. Options for ``${PL.DEVICE}`` are\n\n- ``lightning.qubit`` (default)\n- ``lightning.gpu``\n- ``lightning.kokkos``\n- ``lightning.tensor``\n\nC++ Test\n^^^^^^^^\n\nThe C++ code can be tested with\n\n.. code-block:: bash\n\n    PL_BACKEND=${PL_BACKEND} make test-cpp\n\n.. installation_LQubit-end-inclusion-marker-do-not-remove\n\n.. installation_LGPU-start-inclusion-marker-do-not-remove\n\n\nLightning-GPU installation\n**************************\n\nStandard installation\n=====================\n| For the majority of cases,\n| Lightning-GPU can be installed by following our installation instructions at `pennylane.ai/install \u003chttps://pennylane.ai/install/#high-performance-computing-and-gpus\u003e`__.\n\nInstall Lightning-GPU from source\n=================================\n\n.. note::\n\n    The section 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 \u003chttps://pennylane.ai/install/#high-performance-computing-and-gpus\u003e`__. 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.\n\nSince you will be installing PennyLane-Lightning from the master branch, it is recommended to install PennyLane from master:\n\n.. code-block:: bash\n\n    pip install git+https://github.com/PennyLaneAI/pennylane.git@master\n\nTo install Lightning-GPU from the package sources using the direct SDK path first install Lightning-Qubit (compilation is not necessary):\n\n.. code-block:: bash\n\n    git clone https://github.com/PennyLaneAI/pennylane-lightning.git\n    cd pennylane-lightning\n    pip install -r requirements.txt\n    pip install custatevec-cu12\n    PL_BACKEND=\"lightning_qubit\" python scripts/configure_pyproject_toml.py\n    SKIP_COMPILATION=True pip install -e . --config-settings editable_mode=compat -vv\n\nNote that `custatevec-cu12` is a requirement for Lightning-GPU, and is installed by ``pip`` separately. After `custatevec-cu12` is installed, the ``CUQUANTUM_SDK`` environment variable should be set to enable discovery during installation:\n\n.. code-block:: bash\n\n    export CUQUANTUM_SDK=$(python -c \"import site; print( f'{site.getsitepackages()[0]}/cuquantum')\")\n\nLightning-GPU can then be installed with ``pip``:\n\n.. code-block:: bash\n\n    PL_BACKEND=\"lightning_gpu\" python scripts/configure_pyproject_toml.py\n    python -m pip install -e . --config-settings editable_mode=compat -vv\n\nLightning-GPU also requires additional NVIDIA libraries including ``nvJitLink``, ``cuSPARSE``, ``cuBLAS``, and ``CUDA runtime``. These can be installed through the `CUDA Toolkit \u003chttps://developer.nvidia.com/cuda-toolkit/\u003e`_ or from ``pip``.\n\nTo simplify the build, we recommend using the containerized build process described in Docker support section.\n\nInstall Lightning-GPU with MPI\n==============================\n\n.. note::\n\n    Building Lightning-GPU with MPI also requires the ``NVIDIA cuQuantum SDK`` (currently supported version: `custatevec-cu12 \u003chttps://pypi.org/project/cuquantum-cu12/\u003e`_), ``mpi4py`` and ``CUDA-aware MPI`` (Message Passing Interface).\n    ``CUDA-aware MPI`` allows data exchange between GPU memory spaces of different nodes without the need for CPU-mediated transfers.\n    Both the ``MPICH`` and ``OpenMPI`` libraries are supported, provided they are compiled with CUDA support.\n    It is recommended to install the ``NVIDIA cuQuantum SDK`` and ``mpi4py`` Python package within ``pip`` or ``conda`` inside a virtual environment.\n    Please consult the `cuQuantum SDK \u003chttps://developer.nvidia.com/cuquantum-sdk\u003e`_ , `mpi4py \u003chttps://mpi4py.readthedocs.io/en/stable/install.html\u003e`_,\n    `MPICH \u003chttps://www.mpich.org/static/downloads/4.1.1/mpich-4.1.1-README.txt\u003e`_, or `OpenMPI \u003chttps://www.open-mpi.org/faq/?category=buildcuda\u003e`_ install guide for more information.\n\n**Before installing Lightning-GPU with MPI support using the direct SDK path, please ensure that:**\n\n.. note::\n\n    - Lightning-Qubit, ``CUDA-aware MPI`` and ``custatevec-cu12`` are installed.\n    - The environment variable ``CUQUANTUM_SDK`` is set properly.\n    - ``path/to/libmpi.so`` is added to ``LD_LIBRARY_PATH``.\n\nThen Lightning-GPU with MPI support can be installed in the *editable* mode:\n\n.. code-block:: bash\n\n    PL_BACKEND=\"lightning_gpu\" python scripts/configure_pyproject_toml.py\n    CMAKE_ARGS=\"-DENABLE_MPI=ON\" python -m pip install -e . --config-settings editable_mode=compat -vv\n\n\nTest Lightning-GPU with MPI\n===========================\n\nYou can test the Python layer of the MPI enabled plugin as follows:\n\n.. code-block:: bash\n\n    mpirun -np 2 python -m pytest mpitests --tb=short\n\nThe C++ code can be tested with:\n\n.. code-block:: bash\n\n    PL_BACKEND=\"lightning_gpu\" make test-cpp-mpi\n\n.. installation_LGPU-end-inclusion-marker-do-not-remove\n\n.. installation_LKokkos-start-inclusion-marker-do-not-remove\n\nLightning-Kokkos installation\n*****************************\n\nStandard installation\n=====================\n| On most Linux systems,\n| Lightning-Kokkos can be installed via Spack or Docker by following our installation instructions at `pennylane.ai/install \u003chttps://pennylane.ai/install/#high-performance-computing-and-gpus\u003e`__.\n\nInstall Lightning-Kokkos from source\n====================================\n\n.. note::\n\n    The section 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 \u003chttps://pennylane.ai/install/#high-performance-computing-and-gpus\u003e`__. 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.\n\nAs 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.\n\nInstall Kokkos (Optional)\n^^^^^^^^^^^^^^^^^^^^^^^^^\n\nWe suggest first installing Kokkos with the wanted configuration following the instructions found in the `Kokkos documentation \u003chttps://kokkos.github.io/kokkos-core-wiki/building.html\u003e`_.\nFor example, the following will build Kokkos for NVIDIA A100 cards\n\nDownload the `Kokkos code \u003chttps://github.com/kokkos/kokkos/releases\u003e`_. Lightning-Kokkos was tested with Kokkos version \u003c= 4.5.0\n\n.. code-block:: bash\n\n    # Replace x, y, and z by the correct version\n    wget https://github.com/kokkos/kokkos/archive/refs/tags/4.x.yz.tar.gz\n    tar -xvf 4.x.y.z.tar.gz\n    cd kokkos-4.x.y.z\n\nBuild Kokkos for NVIDIA A100 cards (``SM80`` architecture), and append the install location to ``CMAKE_PREFIX_PATH``.\n\n.. code-block:: bash\n\n    cmake -S . -B build -G Ninja \\\n        -DCMAKE_BUILD_TYPE=RelWithDebugInfo \\\n        -DCMAKE_INSTALL_PREFIX=/opt/kokkos/4.x.y.z/AMPERE80 \\\n        -DCMAKE_CXX_STANDARD=20 \\\n        -DBUILD_SHARED_LIBS:BOOL=ON \\\n        -DBUILD_TESTING:BOOL=OFF \\\n        -DKokkos_ENABLE_SERIAL:BOOL=ON \\\n        -DKokkos_ENABLE_CUDA:BOOL=ON \\\n        -DKokkos_ARCH_AMPERE80:BOOL=ON \\\n        -DKokkos_ENABLE_EXAMPLES:BOOL=OFF \\\n        -DKokkos_ENABLE_TESTS:BOOL=OFF \\\n        -DKokkos_ENABLE_LIBDL:BOOL=OFF\n    cmake --build build \u0026\u0026 cmake --install build\n    export CMAKE_PREFIX_PATH=/opt/kokkos/4.x.y.z/AMPERE80:$CMAKE_PREFIX_PATH\n\n\nNote that the C++20 standard is required (enabled via the ``-DCMAKE_CXX_STANDARD=20`` option), hence CUDA 12 is required for the CUDA backend.\n\nInstall Lightning-Kokkos\n^^^^^^^^^^^^^^^^^^^^^^^^\n\nIf an installation of Kokkos is not found, then our builder will automatically clone and install it during the build process. Lightning-Qubit needs to be 'installed' by ``pip`` before Lightning-Kokkos (compilation is not necessary).\n\nThe simplest way to install Lightning-Kokkos (OpenMP backend) through ``pip``.\n\n.. code-block:: bash\n\n    git clone https://github.com/PennyLaneAI/pennylane-lightning.git\n    cd pennylane-lightning\n    PL_BACKEND=\"lightning_qubit\" python scripts/configure_pyproject_toml.py\n    SKIP_COMPILATION=True pip install -e . --config-settings editable_mode=compat\n    PL_BACKEND=\"lightning_kokkos\" python scripts/configure_pyproject_toml.py\n    CMAKE_ARGS=\"-DKokkos_ENABLE_OPENMP=ON\" python -m pip install -e . --config-settings editable_mode=compat -vv\n\nThe supported backend options are\n\n.. list-table::\n    :align: center\n    :width: 100 %\n    :widths: 20 20 20 20 20\n    :header-rows: 0\n\n    * - ``SERIAL``\n      - ``OPENMP``\n      - ``THREADS``\n      - ``HIP``\n      - ``CUDA``\n\nand the corresponding build options are ``-DKokkos_ENABLE_XYZ=ON``, where ``XYZ`` needs be replaced by the backend name, for instance ``OPENMP``.\n\nOne can simutaneously activate one serial, one parallel CPU host (e.g. ``OPENMP``, ``THREADS``) and one parallel GPU device backend (e.g. ``HIP``, ``CUDA``), but not two of any category at the same time.\nFor ``HIP`` and ``CUDA``, the appropriate software stacks are required to enable compilation and subsequent use.\nSimilarly, the CMake option ``-DKokkos_ARCH_{...}=ON`` must also be specified to target a given architecture.\nA list of the architectures is found on the `Kokkos wiki \u003chttps://kokkos.org/kokkos-core-wiki/API/core/Macros.html#architectures\u003e`_.\nNote that ``THREADS`` backend is not recommended since `Kokkos does not guarantee its safety \u003chttps://github.com/kokkos/kokkos-core-wiki/blob/17f08a6483937c26e14ec3c93a2aa40e4ce081ce/docs/source/ProgrammingGuide/Initialization.md?plain=1#L67\u003e`_.\n\n.. installation_LKokkos-end-inclusion-marker-do-not-remove\n\n.. installation_LTensor-start-inclusion-marker-do-not-remove\n\n\nLightning-Tensor installation\n*****************************\nLightning-Tensor requires CUDA 12 and the `cuQuantum SDK \u003chttps://developer.nvidia.com/cuquantum-sdk\u003e`_ (only the `cutensornet \u003chttps://docs.nvidia.com/cuda/cuquantum/latest/cutensornet/index.html\u003e`_ library is required).\nThe 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.\nPlease see the `cuQuantum SDK \u003chttps://developer.nvidia.com/cuquantum-sdk\u003e`_ install guide for more information.\n\nStandard installation\n=====================\n| For the majority of cases,\n| Lightning-Tensor can be installed by following our installation instructions at `pennylane.ai/install \u003chttps://pennylane.ai/install/#high-performance-computing-and-gpus\u003e`__.\n\nInstall Lightning-Tensor from source\n====================================\n\n.. note::\n\n    The section below contains instructions for installing Lightning-Tensor **from source**. For most cases, *this is not required* and one can simply use the installation instructions at `pennylane.ai/install \u003chttps://pennylane.ai/install/#high-performance-computing-and-gpus\u003e`__. 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.\n\nLightning-Qubit needs to be 'installed' by ``pip`` before Lightning-Tensor (compilation is not necessary):\n\n.. code-block:: bash\n\n    git clone https://github.com/PennyLaneAI/pennylane-lightning.git\n    cd pennylane-lightning\n    pip install -r requirements.txt\n    pip install cutensornet-cu12\n    PL_BACKEND=\"lightning_qubit\" python scripts/configure_pyproject_toml.py\n    SKIP_COMPILATION=True pip install -e . --config-settings editable_mode=compat\n\nNote that `cutensornet-cu12` is a requirement for Lightning-Tensor, and is installed by ``pip`` separately. After `cutensornet-cu12` is installed, the ``CUQUANTUM_SDK`` environment variable should be set to enable discovery during installation:\n\n.. code-block:: bash\n\n    export CUQUANTUM_SDK=$(python -c \"import site; print( f'{site.getsitepackages()[0]}/cuquantum')\")\n\nThe Lightning-Tensor can then be installed with ``pip``:\n\n.. code-block:: bash\n\n    PL_BACKEND=\"lightning_tensor\" python scripts/configure_pyproject_toml.py\n    pip install -e . --config-settings editable_mode=compat -vv\n\n.. installation_LTensor-end-inclusion-marker-do-not-remove\n\nLightning-Tensor also requires additional NVIDIA libraries including ``nvJitLink``, ``cuSOLVER``, ``cuSPARSE``, ``cuBLAS``, and ``CUDA runtime``. These can be installed through the `CUDA Toolkit \u003chttps://developer.nvidia.com/cuda-toolkit/\u003e`_ or from ``pip``.\n\nPlease refer to the `plugin documentation \u003chttps://docs.pennylane.ai/projects/lightning/\u003e`_ as\nwell as to the `PennyLane documentation \u003chttps://docs.pennylane.ai/\u003e`_ for further reference.\n\n.. docker-start-inclusion-marker-do-not-remove\n\n\nDocker support\n**************\n\nDocker images for the various backends are found on the\n`PennyLane Docker Hub \u003chttps://hub.docker.com/u/pennylaneai\u003e`_ page, where a detailed description about PennyLane Docker support can be found.\nBriefly, one can build the Docker Lightning images using:\n\n.. code-block:: bash\n\n    git clone https://github.com/PennyLaneAI/pennylane-lightning.git\n    cd pennylane-lightning\n    docker build -f docker/Dockerfile --target ${TARGET} .\n\nwhere ``${TARGET}`` is one of the following\n\n* ``wheel-lightning-qubit``\n* ``wheel-lightning-gpu``\n* ``wheel-lightning-kokkos-openmp``\n* ``wheel-lightning-kokkos-cuda``\n* ``wheel-lightning-kokkos-rocm``\n\n.. docker-end-inclusion-marker-do-not-remove\n\nContributing\n************\n\nWe welcome contributions - simply fork the repository of this plugin, and then make a\n`pull request \u003chttps://help.github.com/articles/about-pull-requests/\u003e`_ containing your contribution.\nAll contributors to this plugin will be listed as authors on the releases.\n\nWe also encourage bug reports, suggestions for new features and enhancements, and even links to cool projects\nor applications built on PennyLane.\n\nBlack \u0026 Pylint\n==============\n\nIf you contribute to the Python code, please mind the following.\nThe Python code is formatted with the PEP 8 compliant opinionated formatter `Black \u003chttps://github.com/psf/black\u003e`_ (`black==25.1.0`).\nWe set a line width of a 100 characters.\nThe Python code is statically analyzed with `Pylint \u003chttps://pylint.readthedocs.io/en/stable/\u003e`_.\nWe set up a pre-commit hook (see `Git hooks \u003chttps://git-scm.com/docs/githooks\u003e`_) to run both of these on `git commit`.\nPlease make your best effort to comply with `black` and `pylint` before using disabling pragmas (e.g. `# pylint: disable=missing-function-docstring`).\n\nAuthors\n*******\n\n.. citation-start-inclusion-marker-do-not-remove\n\nLightning is the work of `many contributors \u003chttps://github.com/PennyLaneAI/pennylane-lightning/graphs/contributors\u003e`_.\n\nIf you are using Lightning for research, please cite:\n\n.. code-block:: bibtex\n\n    @misc{\n        asadi2024,\n        title={{Hybrid quantum programming with PennyLane Lightning on HPC platforms}},\n        author={Ali Asadi and Amintor Dusko and Chae-Yeun Park and Vincent Michaud-Rioux and Isidor Schoch and Shuli Shu and Trevor Vincent and Lee James O'Riordan},\n        year={2024},\n        eprint={2403.02512},\n        archivePrefix={arXiv},\n        primaryClass={quant-ph},\n        url={https://arxiv.org/abs/2403.02512},\n    }\n\n.. citation-end-inclusion-marker-do-not-remove\n.. support-start-inclusion-marker-do-not-remove\n\nSupport\n*******\n\n- **Source Code:** https://github.com/PennyLaneAI/pennylane-lightning\n- **Issue Tracker:** https://github.com/PennyLaneAI/pennylane-lightning/issues\n- **PennyLane Forum:** https://discuss.pennylane.ai\n\nIf you are having issues, please let us know by posting the issue on our Github issue tracker, or\nby asking a question in the forum.\n\n.. support-end-inclusion-marker-do-not-remove\n.. license-start-inclusion-marker-do-not-remove\n\nLicense\n*******\n\nThe Lightning plugins are **free** and **open source**, released under\nthe `Apache License, Version 2.0 \u003chttps://www.apache.org/licenses/LICENSE-2.0\u003e`_.\nThe Lightning-GPU and Lightning-Tensor plugins make use of the NVIDIA cuQuantum SDK headers to\nenable the device bindings to PennyLane, which are held to their own respective license.\n\n.. license-end-inclusion-marker-do-not-remove\n.. acknowledgements-start-inclusion-marker-do-not-remove\n\nAcknowledgements\n****************\n\nPennyLane Lightning makes use of the following libraries and tools, which are under their own respective licenses:\n\n- **pybind11:** https://github.com/pybind/pybind11\n- **Kokkos Core:** https://github.com/kokkos/kokkos\n- **NVIDIA cuQuantum:** https://developer.nvidia.com/cuquantum-sdk\n- **scipy-openblas32:** https://pypi.org/project/scipy-openblas32/\n- **Xanadu JET:** https://github.com/XanaduAI/jet\n\n.. acknowledgements-end-inclusion-marker-do-not-remove\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpennylaneai%2Fpennylane-lightning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpennylaneai%2Fpennylane-lightning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpennylaneai%2Fpennylane-lightning/lists"}