-
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.
- Loading branch information
Showing
9 changed files
with
466 additions
and
3 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
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -5,6 +5,7 @@ description = "" | |
authors = ["Mark Koch <[email protected]>"] | ||
license = "Apache-2.0" | ||
readme = "README.md" | ||
repository = "https://github.com/CQCL/guppy" | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.10" | ||
|
@@ -13,13 +14,19 @@ networkx = "^3.2.1" | |
ormsgpack = "^1.4.1" | ||
pydantic = "^2.5.3" | ||
typing-extensions = "^4.9.0" | ||
pytket = { version = "^1.24.0", optional = true } | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
pytest = "^7.4.4" | ||
mypy = "^1.8.0" | ||
pre-commit = "^3.6.0" | ||
ruff = "^0.1.11" | ||
maturin = "^1.4.0" | ||
pytket = "*" | ||
|
||
[tool.poetry.extras] | ||
pytket = ["pytket"] | ||
# TODO add tket2 dependency here | ||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
|
@@ -31,4 +38,4 @@ strict = true | |
allow_redefinition = true | ||
# mypy doesn't support TypeAliasType fully yet | ||
# https://github.com/python/mypy/issues/16614 | ||
disable_error_code = "valid-type" | ||
disable_error_code = "valid-type" |
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,7 @@ | ||
Guppy compilation failed. Error in file $FILE:16 | ||
|
||
14: @guppy(module) | ||
15: def foo(q: Qubit) -> Qubit: | ||
16: f = py(circ) | ||
^^^^^^^^ | ||
GuppyError: Pytket compatibility requires `tket2` to be installed. See https://github.com/CQCL/tket2/tree/main/tket2-py |
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,20 @@ | ||
from pytket import Circuit | ||
|
||
from guppylang.decorator import guppy | ||
from guppylang.module import GuppyModule | ||
from guppylang.prelude.quantum import quantum, Qubit | ||
|
||
circ = Circuit(1) | ||
circ.H(0) | ||
|
||
module = GuppyModule("test") | ||
module.load(quantum) | ||
|
||
|
||
@guppy(module) | ||
def foo(q: Qubit) -> Qubit: | ||
f = py(circ) | ||
return f(q) | ||
|
||
|
||
module.compile() |
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
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