From e0adc52c7f313b07bff097ccbd7c17258da69f34 Mon Sep 17 00:00:00 2001 From: Alec Edgington Date: Wed, 24 Jan 2024 16:39:12 +0000 Subject: [PATCH] Add short description and simplify readme for pypi. --- pyproject.toml | 4 ++-- quickstart.md | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 quickstart.md diff --git a/pyproject.toml b/pyproject.toml index 35facba9..d5333aa2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,10 @@ [tool.poetry] name = "guppylang" version = "0.1.0" -description = "" +description = "Pythonic quantum-classical programming language" authors = ["Mark Koch "] license = "Apache-2.0" -readme = "README.md" +readme = "quickstart.md" repository = "https://github.com/CQCL/guppy" [tool.poetry.dependencies] diff --git a/quickstart.md b/quickstart.md new file mode 100644 index 00000000..7ac54976 --- /dev/null +++ b/quickstart.md @@ -0,0 +1,24 @@ +Guppy is a quantum programming language that is fully embedded into Python. It +allows you to write high-level hybrid quantum programs with classical control +flow and mid-circuit measurements using Pythonic syntax: + +```python +from guppylang import guppy, Qubit, quantum + +guppy.load(quantum) + +# Teleports the state in `src` to `tgt`. +@guppy +def teleport(src: Qubit, tgt: Qubit) -> Qubit: + # Create ancilla and entangle it with src and tgt + tmp = Qubit() + tmp, tgt = cx(h(tmp), tgt) + src, tmp = cx(src, tmp) + + # Apply classical corrections + if measure(h(src)): + tgt = z(tgt) + if measure(tmp): + tgt = x(tgt) + return tgt +```