Lightning-Tensor installation¶
Lightning-Tensor requires CUDA 12 and the cuQuantum SDK (only the cutensornet 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.
Lightning-Tensor and cutensornet-cu12
can be installed via:
pip install cutensornet-cu12
pip install pennylane-lightning-tensor
Install Lightning-Tensor from source¶
Note
The 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. 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.
Lightning-Qubit should be installed before Lightning-Tensor (compilation is not necessary):
git clone https://github.com/PennyLaneAI/pennylane-lightning.git
cd pennylane-lightning
pip install -r requirements.txt
pip install cutensornet-cu12
PL_BACKEND="lightning_qubit" python scripts/configure_pyproject_toml.py
SKIP_COMPILATION=True pip install -e . --config-settings editable_mode=compat
Then a CUQUANTUM_SDK
environment variable can be set:
export CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum')")
The Lightning-Tensor can then be installed with pip
:
PL_BACKEND="lightning_tensor" python scripts/configure_pyproject_toml.py
pip install -e . --config-settings editable_mode=compat -vv