-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add short description and simplify readme for pypi.
- Loading branch information
Showing
2 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
[tool.poetry] | ||
name = "guppylang" | ||
version = "0.1.0" | ||
description = "" | ||
description = "Pythonic quantum-classical programming language" | ||
authors = ["Mark Koch <[email protected]>"] | ||
license = "Apache-2.0" | ||
readme = "README.md" | ||
readme = "quickstart.md" | ||
repository = "https://github.com/CQCL/guppy" | ||
|
||
[tool.poetry.dependencies] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
``` |