Adding py-pennylane from Xanadu (#34838)

* draft for py-pennylane recipe

* first draft for py-strawberryfields recipe

* minimal fix

* small fixes

* accounting for circular dep in py-pennylane and py-pennylane-lightning

* removing py-strawberryfields from this branch

* updated versions for py-pennylane 2x

* needs cmake

* py-pennylane-lightning using github tarball

* Update var/spack/repos/builtin/packages/py-autoray/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Update var/spack/repos/builtin/packages/py-pennylane-lightning/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
This commit is contained in:
Marco De La Pierre 2023-01-07 08:02:06 +08:00 committed by GitHub
parent 800ac7b53d
commit a5ef522f98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 80 additions and 0 deletions

View File

@ -0,0 +1,20 @@
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class PyAutoray(PythonPackage):
"""Write backend agnostic numeric code compatible with any numpy-ish array library."""
homepage = "https://github.com/jcmgray/autoray"
pypi = "autoray/autoray-0.5.3.tar.gz"
version("0.5.3", sha256="ecbecbc1ab65dd704234b3307fa7c7a511a36f6b9339a0ffcdaa4e5a7aab826b")
depends_on("python@3.6:", type=("build", "run"))
depends_on("py-setuptools@45:", type="build")
depends_on("py-setuptools-scm@6.2:+toml", type="build")

View File

@ -0,0 +1,26 @@
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class PyPennylaneLightning(PythonPackage):
"""PennyLane-Lightning plugin"""
homepage = "https://github.com/PennyLaneAI/pennylane-lightning"
url = "https://github.com/PennyLaneAI/pennylane-lightning/archive/refs/tags/v0.28.0.tar.gz"
# using github for now, because pypi tarball is missing the CMakeLists.txt file
# pypi = "PennyLane-Lightning/PennyLane-Lightning-0.28.0.tar.gz"
version("0.28.0", sha256="f5849c2affb5fb57aca20feb40ca829d171b07db2304fde0a37c2332c5b09e18")
depends_on("python@3.8:", type=("build", "run"))
depends_on("py-setuptools", type="build")
depends_on("cmake@3.16:", type="build")
depends_on("py-ninja", type=("build", "run"))
depends_on("py-numpy", type=("build", "run"))
# depends_on("py-pennylane@0.19:", type=("build", "run")) # circular dependency

View File

@ -0,0 +1,34 @@
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class PyPennylane(PythonPackage):
"""PennyLane is a Python quantum machine learning library by Xanadu Inc."""
homepage = "https://github.com/XanaduAI/pennylane"
pypi = "PennyLane/PennyLane-0.28.0.tar.gz"
maintainers = ["marcodelapierre"]
version("0.28.0", sha256="2a6100c00277c1eb59eab6856cdad7b1237e9d1fbda98b1e15020bd5a64b10a8")
depends_on("python@3.8:", type=("build", "run"))
depends_on("py-setuptools", type="build")
depends_on("py-numpy@:1.23", type=("build", "run"))
depends_on("py-scipy", type=("build", "run"))
depends_on("py-networkx", type=("build", "run"))
depends_on("py-retworkx", type=("build", "run"))
depends_on("py-autograd", type=("build", "run"))
depends_on("py-toml", type=("build", "run"))
depends_on("py-appdirs", type=("build", "run"))
depends_on("py-semantic-version@2.7:", type=("build", "run"))
depends_on("py-autoray@0.3.1:", type=("build", "run"))
depends_on("py-cachetools", type=("build", "run"))
depends_on("py-pennylane-lightning@0.28:", type=("build", "run"))
depends_on("py-requests", type=("build", "run"))