PennyLaneAI / pennylane-lightning

The PennyLane-Lightning plugin provides a fast state-vector simulator written in C++ for use with PennyLane
https://docs.pennylane.ai/projects/lightning
Apache License 2.0
84 stars 35 forks source link

UserWarning: Pre-compiled binaries for lightning.qubit are not available #398

Closed QuantumFall closed 1 year ago

QuantumFall commented 1 year ago

Issue description

Unable to use pre-compiled binaries for lightning.qubit. Running the code keeps falling me back to default.qubit with the above warning. I have both Pennylane and Pennylane lightning installed. Pennylane version is 0.28.0. Current pennylane-lightning version is 0.28.0.

I tried following the instructions on here https://github.com/PennyLaneAI/pennylane-lightning to try and build from source as recommended by the error.

However, I keep running into issues after this line pip install -e .

python setup.py develop did not run successfully.
│ exit code: 1
╰─> [20 lines of output]
    running develop
    running egg_info
    writing PennyLane_Lightning.egg-info\PKG-INFO
    writing dependency_links to PennyLane_Lightning.egg-info\dependency_links.txt
    writing entry points to PennyLane_Lightning.egg-info\entry_points.txt
    writing requirements to PennyLane_Lightning.egg-info\requires.txt
    writing top-level names to PennyLane_Lightning.egg-info\top_level.txt
    reading manifest file 'PennyLane_Lightning.egg-info\SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    C:\Users\QuantumFall\anaconda3\lib\site-packages\setuptools\dist.py:530: UserWarning: Normalizing '0.29.0-dev' to '0.29.0.dev0'
      warnings.warn(tmpl.format(**locals()))
    C:\Users\QuantumFall\anaconda3\lib\site-packages\setuptools\command\easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    C:\Users\QuantumFall\anaconda3\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    warning: no files found matching 'CHANGELOG.rst'
    adding license file 'LICENSE'
    writing manifest file 'PennyLane_Lightning.egg-info\SOURCES.txt'
    running build_ext
    error: [WinError 2] The system cannot find the file specified
    [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
Rolling back uninstall of PennyLane-Lightning
Moving to c:\users\quantumfall\anaconda3\lib\site-packages\pennylane_lightning-0.28.0.dist-info\
 from C:\Users\QuantumFall\anaconda3\Lib\site-packages\~ennylane_lightning-0.28.0.dist-info
Moving to c:\users\quantumfall\anaconda3\lib\site-packages\pennylane_lightning\
 from C:\Users\QuantumFall\anaconda3\Lib\site-packages\~ennylane_lightning
error: subprocess-exited-with-error

Output of qml.about():

Name: PennyLane
Version: 0.28.0
Summary: PennyLane is a Python quantum machine learning library by Xanadu Inc.
Home-page: https://github.com/XanaduAI/pennylane
Author: 
Author-email: 
License: Apache License 2.0
Location: c:\users\quantumfall\anaconda3\lib\site-packages
Requires: appdirs, autograd, autoray, cachetools, networkx, numpy, pennylane-lightning, requests, retworkx, scipy, semantic-version, toml
Required-by: PennyLane-Lightning

Platform info:           Windows-10-10.0.19041-SP0
Python version:          3.8.5
Numpy version:           1.20.2
Scipy version:           1.8.0
Installed devices:
- default.gaussian (PennyLane-0.28.0)
- default.mixed (PennyLane-0.28.0)
- default.qubit (PennyLane-0.28.0)
- default.qubit.autograd (PennyLane-0.28.0)
- default.qubit.jax (PennyLane-0.28.0)
- default.qubit.tf (PennyLane-0.28.0)
- default.qubit.torch (PennyLane-0.28.0)
- default.qutrit (PennyLane-0.28.0)
- null.qubit (PennyLane-0.28.0)
- lightning.qubit (pennylane-lightning-0.28.0)
mlxd commented 1 year ago

Hi @QuantumFall Thanks for reporting this. It appears that for Windows the compiled libraries are not available on path. This looks to be a Windows-specific issue. We will look into a fix, and get this fixed as soon as possible.

mlxd commented 1 year ago

Hi @QuantumFall We have updated the released wheels for PennyLane Lightning to correct the above issue. Can you try upgrading your installation (python -m pip install pennylane_lightning --upgrade) and letting us know if this fixes the issue you had?

mlxd commented 1 year ago

Also, just a note, building Lightning under Windows is not as easy as under Linux or Mac, due to some additional steps required to ensure the wheels build successfully (e.g. a working Visual Studio installation, up-to-date Python version with all supporting libraries, and some additional Powershell scripting once built). If you would like to compile Lightning from scratch for development purposes under Windows, I would suggest using the Windows Subsystem for Linux (wsl) instead, as this offers a much better development experience.

QuantumFall commented 1 year ago

Thank you, that fixed it for me!