aboutsummaryrefslogtreecommitdiff
path: root/science/py-cirq-core
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 /science/py-cirq-core
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
Diffstat (limited to 'science/py-cirq-core')
-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
4 files changed, 61 insertions, 0 deletions
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