summaryrefslogtreecommitdiff
path: root/science/py-cirq-web
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--science/py-cirq-web/Makefile25
-rw-r--r--science/py-cirq-web/distinfo3
-rw-r--r--science/py-cirq-web/files/example.py18
-rw-r--r--science/py-cirq-web/pkg-descr4
4 files changed, 50 insertions, 0 deletions
diff --git a/science/py-cirq-web/Makefile b/science/py-cirq-web/Makefile
new file mode 100644
index 000000000000..d537afc2c21d
--- /dev/null
+++ b/science/py-cirq-web/Makefile
@@ -0,0 +1,25 @@
+PORTNAME= cirq-web
+DISTVERSIONPREFIX= v
+DISTVERSION= 1.6.1
+CATEGORIES= science python # quantum-computing
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER= yuri@FreeBSD.org
+COMMENT= Cirq module to visualize quantum circuits in 3D in a web browser
+WWW= https://github.com/quantumlib/cirq
+
+LICENSE= APACHE20
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+USES= python
+USE_PYTHON= distutils autoplist
+
+USE_GITHUB= yes
+GH_ACCOUNT= quantumlib
+GH_PROJECT= Cirq
+
+WRKSRC_SUBDIR= cirq-web
+
+NO_ARCH= yes
+
+.include <bsd.port.mk>
diff --git a/science/py-cirq-web/distinfo b/science/py-cirq-web/distinfo
new file mode 100644
index 000000000000..bea87b2b10aa
--- /dev/null
+++ b/science/py-cirq-web/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1760339430
+SHA256 (quantumlib-Cirq-v1.6.1_GH0.tar.gz) = 65da567eea507b5a2b2609fea8cb5e6a2b4e92a6622fad9c2a5c406761b09475
+SIZE (quantumlib-Cirq-v1.6.1_GH0.tar.gz) = 7898333
diff --git a/science/py-cirq-web/files/example.py b/science/py-cirq-web/files/example.py
new file mode 100644
index 000000000000..d93432d5d3bf
--- /dev/null
+++ b/science/py-cirq-web/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-web/pkg-descr b/science/py-cirq-web/pkg-descr
new file mode 100644
index 000000000000..22e7e20a4ae9
--- /dev/null
+++ b/science/py-cirq-web/pkg-descr
@@ -0,0 +1,4 @@
+Cirq-web is a Python library that provides browser-based 3D visualization
+tools for quantum circuits created with the Cirq framework. It allows users
+to inspect and understand the structure of their quantum circuits in a visual
+way.