Hello,
I tried to install and use lightning.qubit on a Linux cluster machine. I used this command to install pennylane-lightning:
pip install pennylane-lightning
When I run the following python code:
import os
os.environ[“OMP_NUM_THREADS”] = “2”
import pennylane as qml
dev = qml.device(“lightning.qubit”, wires=2)
print(‘the end’)
I encountered this warning:
/path_to_conda/.conda/envs/penny3/lib/python3.11/site-packages/pennylane_lightning/lightning_qubit.py:707: UserWarning: Pre-compiled binaries for lightning.qubit are not available. Falling back to using the Python-based default.qubit implementation. To manually compile from source, follow the instructions at https://pennylane-lightning.readthedocs.io/en/latest/installation.html.
warn(
I tried two qml versions (0.25.1 and 0.26.0 as detailed below); both had the same problem shown above. How can I fix the problem to use lightning.qubit instead of falling back to default.qubit? I assume the former can run faster than the latter on 20+ qubit circuits. Thanks!
BTW, I tried to use the following two ways described at the link given above to install pennylane_lightning but was not successful (use the 0.26.0 PennyLane shown below).
git clone https://github.com/PennyLaneAI/pennylane-lightning.git
cd pennylane-lightning
pip install -r requirements.txt
pip install -e .
cmake -S. -B build
cmake --build build
qml.about()
Name: PennyLane
Version: 0.25.1
Summary: PennyLane is a Python quantum machine learning library by Xanadu Inc.
Home-page: :…
Author:
Author-email:
License: Apache License 2.0
Location: /path_to_conda/.conda/envs/penny3/lib/python3.11/site-packages
Requires: appdirs, autograd, autoray, cachetools, networkx, numpy, pennylane-lightning, retworkx, scipy, semantic-version, toml
Required-by: PennyLane-Lightning
Platform info: Linux-4.18.0-193.28.1.el8_2.x86_64-x86_64-with-glibc2.28
Python version: 3.11.0
Numpy version: 1.23.4
Scipy version: 1.9.3
Installed devices:
- lightning.qubit (PennyLane-Lightning-0.25.1)
- default.gaussian (PennyLane-0.25.1)
- default.mixed (PennyLane-0.25.1)
- default.qubit (PennyLane-0.25.1)
- default.qubit.autograd (PennyLane-0.25.1)
- default.qubit.jax (PennyLane-0.25.1)
- default.qubit.tf (PennyLane-0.25.1)
- default.qubit.torch (PennyLane-0.25.1)
- default.qutrit (PennyLane-0.25.1)
qml.about()
Name: PennyLane
Version: 0.26.0
Summary: PennyLane is a Python quantum machine learning library by Xanadu Inc.
Home-page: …
Author:
Author-email:
License: Apache License 2.0
Location: /path_to_conda/.conda/envs/penny3/lib/python3.11/site-packages
Requires: appdirs, autograd, autoray, cachetools, networkx, numpy, pennylane-lightning, retworkx, scipy, semantic-version, toml
Required-by: PennyLane-Lightning
Platform info: Linux-4.18.0-193.28.1.el8_2.x86_64-x86_64-with-glibc2.28
Python version: 3.11.0
Numpy version: 1.23.4
Scipy version: 1.9.3
Installed devices:
- lightning.qubit (PennyLane-Lightning-0.26.1)
- default.gaussian (PennyLane-0.26.0)
- default.mixed (PennyLane-0.26.0)
- default.qubit (PennyLane-0.26.0)
- default.qubit.autograd (PennyLane-0.26.0)
- default.qubit.jax (PennyLane-0.26.0)
- default.qubit.tf (PennyLane-0.26.0)
- default.qubit.torch (PennyLane-0.26.0)
- default.qutrit (PennyLane-0.26.0)