aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2022-08-14 05:41:24 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2022-08-14 05:41:24 +0000
commit06ac78be58f2c94320969226e8187fa32bdf9815 (patch)
tree62679dddd394accabc63b3f39e6c451f8c95b82a
parentdc6e8a18cea93c560c27d73438aa542fd0c69be1 (diff)
downloadports-06ac78be58f2c94320969226e8187fa32bdf9815.tar.gz
ports-06ac78be58f2c94320969226e8187fa32bdf9815.zip
science/py-dwave-neal: New port: DWave: Simulated annealing sampler for general Ising model graphs
-rw-r--r--science/Makefile1
-rw-r--r--science/py-dwave-neal/Makefile28
-rw-r--r--science/py-dwave-neal/distinfo3
-rw-r--r--science/py-dwave-neal/files/example.py9
-rw-r--r--science/py-dwave-neal/pkg-descr12
5 files changed, 53 insertions, 0 deletions
diff --git a/science/Makefile b/science/Makefile
index b9924879e109..cd0d8cc5ec07 100644
--- a/science/Makefile
+++ b/science/Makefile
@@ -284,6 +284,7 @@
SUBDIR += py-dimod
SUBDIR += py-dipy
SUBDIR += py-dlib
+ SUBDIR += py-dwave-neal
SUBDIR += py-dwave-samplers
SUBDIR += py-eccodes
SUBDIR += py-esda
diff --git a/science/py-dwave-neal/Makefile b/science/py-dwave-neal/Makefile
new file mode 100644
index 000000000000..5bb7dad7ae25
--- /dev/null
+++ b/science/py-dwave-neal/Makefile
@@ -0,0 +1,28 @@
+PORTNAME= dwave-neal
+DISTVERSION= 0.6.0.dev0
+CATEGORIES= science graphics # quantum-computing
+MASTER_SITES= CHEESESHOP
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER= yuri@FreeBSD.org
+COMMENT= DWave: Simulated annealing sampler for general Ising model graphs
+
+LICENSE= APACHE20
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+PY_DEPENDS= ${PYTHON_PKGNAMEPREFIX}dimod>0:science/py-dimod@${PY_FLAVOR} \
+ ${PYNUMPY}
+BUILD_DEPENDS= ${PY_DEPENDS}
+RUN_DEPENDS= ${PY_DEPENDS}
+
+USES= python:3.7+
+USE_PYTHON= distutils autoplist unittest
+
+TEST_ENV= ${MAKE_ENV} PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
+
+NO_ARCH= yes
+
+do-test:
+ @${SETENV} ${TEST_ENV} ${PYTHON_CMD} ${FILESDIR}/example.py
+
+.include <bsd.port.mk>
diff --git a/science/py-dwave-neal/distinfo b/science/py-dwave-neal/distinfo
new file mode 100644
index 000000000000..3affefba0cad
--- /dev/null
+++ b/science/py-dwave-neal/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1660454526
+SHA256 (dwave-neal-0.6.0.dev0.tar.gz) = 209e872c325cbdd79f05364624ff562abdf7e3cd0c52ac8b7657fa4ae165b742
+SIZE (dwave-neal-0.6.0.dev0.tar.gz) = 6500
diff --git a/science/py-dwave-neal/files/example.py b/science/py-dwave-neal/files/example.py
new file mode 100644
index 000000000000..be734d9f7229
--- /dev/null
+++ b/science/py-dwave-neal/files/example.py
@@ -0,0 +1,9 @@
+import neal
+
+sampler = neal.SimulatedAnnealingSampler()
+
+h = {0: -1, 1: -1}
+J = {(0, 1): -1}
+sampleset = sampler.sample_ising(h, J)
+
+print(sampleset)
diff --git a/science/py-dwave-neal/pkg-descr b/science/py-dwave-neal/pkg-descr
new file mode 100644
index 000000000000..4232cdcfec2a
--- /dev/null
+++ b/science/py-dwave-neal/pkg-descr
@@ -0,0 +1,12 @@
+An implementation of a simulated annealing sampler.
+
+A simulated annealing sampler can be used for approximate Boltzmann sampling or
+heuristic optimization. This implementation approaches the equilibrium
+distribution by performing updates at a sequence of increasing beta values,
+beta_schedule, terminating at the target beta. Each spin is updated once in a
+fixed order per point in the beta_schedule according to a Metropolis- Hastings
+update. When beta is large the target distribution concentrates, at equilibrium,
+over ground states of the model. Samples are guaranteed to match the equilibrium
+for long 'smooth' beta schedules.
+
+WWW: https://github.com/dwavesystems/dwave-neal