aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2022-08-15 21:11:35 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2022-08-15 21:12:19 +0000
commitdcbef540c8b0f5002152f31989474d6189a94cec (patch)
tree3672af9cf507016ec68a9cf7807642e4035b19ad
parentb0e5744aa34e43d6ef016e77b5acf07c4211a9b3 (diff)
science/py-pyqubo: New port: DWave: Python DSL for constructing QUBOs from mathematical expressions
-rw-r--r--science/Makefile1
-rw-r--r--science/py-pyqubo/Makefile43
-rw-r--r--science/py-pyqubo/distinfo3
-rw-r--r--science/py-pyqubo/files/patch-CMakeLists.txt20
-rw-r--r--science/py-pyqubo/pkg-descr8
5 files changed, 75 insertions, 0 deletions
diff --git a/science/Makefile b/science/Makefile
index 94401dcf6aec..ce9926eeff35 100644
--- a/science/Makefile
+++ b/science/Makefile
@@ -346,6 +346,7 @@
SUBDIR += py-pymol
SUBDIR += py-pyosf
SUBDIR += py-pyprecice
+ SUBDIR += py-pyqubo
SUBDIR += py-pysal
SUBDIR += py-pyscf
SUBDIR += py-pyteomics
diff --git a/science/py-pyqubo/Makefile b/science/py-pyqubo/Makefile
new file mode 100644
index 000000000000..d3e9b27683a8
--- /dev/null
+++ b/science/py-pyqubo/Makefile
@@ -0,0 +1,43 @@
+PORTNAME= pyqubo
+DISTVERSION= 1.2.0
+CATEGORIES= science python # quantum-computing
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER= yuri@FreeBSD.org
+COMMENT= DWave: Python DSL for constructing QUBOs from mathematical expressions
+
+LICENSE= APACHE20
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+PY_DEPENDS= ${PYTHON_PKGNAMEPREFIX}deprecated>=1.2.10:devel/py-deprecated@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}dimod>=0.9.14:science/py-dimod@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}dwave-neal>=0.5.7:science/py-dwave-neal@${PY_FLAVOR} \
+ ${PYNUMPY} \
+ ${PYTHON_PKGNAMEPREFIX}six>=1.15.0:devel/py-six@${PY_FLAVOR}
+BUILD_DEPENDS= ${PY_DEPENDS} \
+ ${PYTHON_PKGNAMEPREFIX}codecov>=2.1.9:devel/py-codecov@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}coverage>=4.5.1:devel/py-coverage@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}nbsphinx>=0.8.3:textproc/py-nbsphinx@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}scikit-build>=0.11.1:devel/py-scikit-build@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}wheel>=0.36.2:devel/py-wheel@${PY_FLAVOR} \
+ boost-libs>0:devel/boost-libs \
+ cimod>0:math/cimod \
+ cmake:devel/cmake \
+ ninja:devel/ninja \
+ pybind11>0:devel/pybind11 \
+ robin-hood-hashing>0:devel/robin-hood-hashing
+RUN_DEPENDS= ${PY_DEPENDS}
+
+USES= eigen:3 python:3.8+
+USE_PYTHON= distutils cython autoplist unittest
+
+USE_GITHUB= yes
+GH_ACCOUNT= recruit-communications
+
+CXXFLAGS+= -I${LOCALBASE}/include/cimod \
+ -I${LOCALBASE}/include/eigen3
+
+TEST_ENV= ${MAKE_ENV} PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
+TEST_WRKSRC= ${WRKSRC}/tests
+
+.include <bsd.port.mk>
diff --git a/science/py-pyqubo/distinfo b/science/py-pyqubo/distinfo
new file mode 100644
index 000000000000..575f89b6f16b
--- /dev/null
+++ b/science/py-pyqubo/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1660514425
+SHA256 (recruit-communications-pyqubo-1.2.0_GH0.tar.gz) = a967dc7e4f94aa6d02b21badf5f5b3a95de0dbd435ce98435cc8078e14af73bc
+SIZE (recruit-communications-pyqubo-1.2.0_GH0.tar.gz) = 207142
diff --git a/science/py-pyqubo/files/patch-CMakeLists.txt b/science/py-pyqubo/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..4c2ba0ac35ab
--- /dev/null
+++ b/science/py-pyqubo/files/patch-CMakeLists.txt
@@ -0,0 +1,20 @@
+--- CMakeLists.txt.orig 2022-01-08 04:45:42 UTC
++++ CMakeLists.txt
+@@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.20)
+
+ project(cpp_pyqubo)
+
++if (FALSE)
+ include(external/boost_assert.cmake)
+ include(external/boost_config.cmake)
+ include(external/boost_container.cmake)
+@@ -17,6 +18,9 @@ include(external/cimod.cmake)
+ include(external/eigen.cmake)
+ include(external/pybind11.cmake)
+ include(external/robin_hood.cmake)
++endif()
++
++find_package(pybind11)
+
+ pybind11_add_module(cpp_pyqubo src/main.cpp)
+
diff --git a/science/py-pyqubo/pkg-descr b/science/py-pyqubo/pkg-descr
new file mode 100644
index 000000000000..af60236d0664
--- /dev/null
+++ b/science/py-pyqubo/pkg-descr
@@ -0,0 +1,8 @@
+PyQUBO allows you to create QUBOs or Ising models from flexible mathematical
+expressions easily. Some of the features of PyQUBO:
+* python based (C++ backend)
+* fully integrated with Ocean SDK
+* automatic validation of constraints
+* placeholder for parameter tuning
+
+WWW: https://pyqubo.readthedocs.io/en/latest/