aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2021-07-26 22:34:51 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2021-07-26 22:36:19 +0000
commite1f12f98d320c589b57a40436d627796945065bb (patch)
tree238d64cb3e39337fbacc1da1b8d4d832a4665147
parentd341003fdfc2d751e9c427311dd83963f0dcbf20 (diff)
downloadports-e1f12f98d320c589b57a40436d627796945065bb.tar.gz
ports-e1f12f98d320c589b57a40436d627796945065bb.zip
science/py-{core,google}: New ports: Writing, manipulating, and optimizing quantum circuits and running them against quantum computers and simulators
-rw-r--r--science/Makefile2
-rw-r--r--science/py-cirq-core/Makefile36
-rw-r--r--science/py-cirq-core/distinfo3
-rw-r--r--science/py-cirq-core/files/example.py18
-rw-r--r--science/py-cirq-core/pkg-descr4
-rw-r--r--science/py-cirq-google/Makefile27
-rw-r--r--science/py-cirq-google/distinfo3
-rw-r--r--science/py-cirq-google/pkg-descr5
8 files changed, 98 insertions, 0 deletions
diff --git a/science/Makefile b/science/Makefile
index 17618e77c829..7cf6897ba403 100644
--- a/science/Makefile
+++ b/science/Makefile
@@ -231,6 +231,8 @@
SUBDIR += py-chainer
SUBDIR += py-chainer-chemistry
SUBDIR += py-chempy
+ SUBDIR += py-cirq-core
+ SUBDIR += py-cirq-google
SUBDIR += py-coards
SUBDIR += py-dipy
SUBDIR += py-dlib
diff --git a/science/py-cirq-core/Makefile b/science/py-cirq-core/Makefile
new file mode 100644
index 000000000000..899d14f831a1
--- /dev/null
+++ b/science/py-cirq-core/Makefile
@@ -0,0 +1,36 @@
+PORTNAME= cirq-core
+DISTVERSIONPREFIX= v
+DISTVERSION= 0.11.1
+CATEGORIES= science python
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER= yuri@FreeBSD.org
+COMMENT= Framework for Noisy Intermediate Scale Quantum (NISQ) circuits
+
+LICENSE= APACHE20
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+RUN_DEPENDS= ${PYNUMPY} \
+ ${PYTHON_PKGNAMEPREFIX}cirq-google>0:science/py-cirq-google@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}matplotlib>0:math/py-matplotlib@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}networkx>0:math/py-networkx@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}pandas>0:math/py-pandas@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}requests>0:www/py-requests@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}scipy>0:science/py-scipy@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}sortedcontainers>0:devel/py-sortedcontainers@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}sympy>0:math/py-sympy@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}tqdm>=0:misc/py-tqdm@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}typing-extensions>0:devel/py-typing-extensions@${PY_FLAVOR}
+
+USES= python:3.8+
+USE_PYTHON= distutils autoplist
+
+USE_GITHUB= yes
+GH_ACCOUNT= quantumlib
+GH_PROJECT= Cirq
+
+WRKSRC_SUBDIR= cirq-core
+
+NO_ARCH= yes
+
+.include <bsd.port.mk>
diff --git a/science/py-cirq-core/distinfo b/science/py-cirq-core/distinfo
new file mode 100644
index 000000000000..960f88936229
--- /dev/null
+++ b/science/py-cirq-core/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1627331168
+SHA256 (quantumlib-Cirq-v0.11.1_GH0.tar.gz) = fb956fd075f86847e20816d1320b5eaaa479ab126b6dce10cfea1c7cf4dd9067
+SIZE (quantumlib-Cirq-v0.11.1_GH0.tar.gz) = 6384560
diff --git a/science/py-cirq-core/files/example.py b/science/py-cirq-core/files/example.py
new file mode 100644
index 000000000000..d93432d5d3bf
--- /dev/null
+++ b/science/py-cirq-core/files/example.py
@@ -0,0 +1,18 @@
+import cirq
+
+# Pick a qubit.
+qubit = cirq.GridQubit(0, 0)
+
+# Create a circuit
+circuit = cirq.Circuit(
+ cirq.X(qubit)**0.5, # Square root of NOT.
+ cirq.measure(qubit, key='m') # Measurement.
+)
+print("Circuit:")
+print(circuit)
+
+# Simulate the circuit several times.
+simulator = cirq.Simulator()
+result = simulator.run(circuit, repetitions=20)
+print("Results:")
+print(result)
diff --git a/science/py-cirq-core/pkg-descr b/science/py-cirq-core/pkg-descr
new file mode 100644
index 000000000000..69d0f6d7563b
--- /dev/null
+++ b/science/py-cirq-core/pkg-descr
@@ -0,0 +1,4 @@
+Cirq is a Python library for writing, manipulating, and optimizing quantum
+circuits and running them against quantum computers and simulators.
+
+WWW: https://github.com/quantumlib/cirq
diff --git a/science/py-cirq-google/Makefile b/science/py-cirq-google/Makefile
new file mode 100644
index 000000000000..f721bb6a5b5b
--- /dev/null
+++ b/science/py-cirq-google/Makefile
@@ -0,0 +1,27 @@
+PORTNAME= cirq-google
+DISTVERSIONPREFIX= v
+DISTVERSION= 0.11.1
+CATEGORIES= science python
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER= yuri@FreeBSD.org
+COMMENT= Google Cirq adapter for IQM's quantum architectures
+
+LICENSE= APACHE20
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}google-api-core>=1.14.0:www/py-google-api-core@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}protobuf>0:devel/py-protobuf@${PY_FLAVOR}
+
+USES= python:3.8+
+USE_PYTHON= distutils autoplist
+
+USE_GITHUB= yes
+GH_ACCOUNT= quantumlib
+GH_PROJECT= Cirq
+
+WRKSRC_SUBDIR= cirq-google
+
+NO_ARCH= yes
+
+.include <bsd.port.mk>
diff --git a/science/py-cirq-google/distinfo b/science/py-cirq-google/distinfo
new file mode 100644
index 000000000000..960f88936229
--- /dev/null
+++ b/science/py-cirq-google/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1627331168
+SHA256 (quantumlib-Cirq-v0.11.1_GH0.tar.gz) = fb956fd075f86847e20816d1320b5eaaa479ab126b6dce10cfea1c7cf4dd9067
+SIZE (quantumlib-Cirq-v0.11.1_GH0.tar.gz) = 6384560
diff --git a/science/py-cirq-google/pkg-descr b/science/py-cirq-google/pkg-descr
new file mode 100644
index 000000000000..4da714b04b3c
--- /dev/null
+++ b/science/py-cirq-google/pkg-descr
@@ -0,0 +1,5 @@
+Google Cirq adapter for IQM's quantum architectures.
+
+Part of the Cirq quantum computing framework.
+
+WWW: https://github.com/quantumlib/Cirq