Skip to content

Commit

Permalink
use float and not from hugr-py
Browse files Browse the repository at this point in the history
  • Loading branch information
ss2165 committed Jul 9, 2024
1 parent 5c1b08f commit fb73843
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 37 deletions.
12 changes: 6 additions & 6 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ packages = [{ include = "tket2-py" }]
python = "^3.10"
pytket = "1.29.2"
# hugr = "^0.3.1"
hugr = { git = "https://github.com/CQCL/hugr.git", subdirectory = "hugr-py", branch = "ss/extend" }
hugr = { git = "https://github.com/CQCL/hugr.git", subdirectory = "hugr-py", branch = "ss/std" }

[tool.poetry.group.dev.dependencies]
maturin = "^1.7.0"
Expand Down
2 changes: 1 addition & 1 deletion tket2-py/test/test_pauli_prop.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
Measure,
QAlloc,
QFree,
Not,
load_custom,
id_circ,
)
from hugr.std.logic import Not
from tket2.pattern import Rule, RuleMatcher # type: ignore
from tket2.rewrite import CircuitRewrite, Subcircuit # type: ignore

Expand Down
30 changes: 1 addition & 29 deletions tket2-py/tket2/circuit/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from hugr.hugr import Hugr
from hugr import tys, ops
from hugr.ops import ComWire, Command
from hugr.std.float import FLOAT_T
from hugr.tracked_dfg import TrackedDfg
from tket2.circuit import Tk2Circuit

Expand Down Expand Up @@ -112,14 +113,6 @@ def __call__(self, q: ComWire) -> Command:
Measure = MeasureDef()


FLOAT_T = tys.Opaque(
extension="arithmetic.float.types",
id="float64",
args=[],
bound=tys.TypeBound.Copyable,
)


_RzSig = tys.FunctionType([tys.Qubit, FLOAT_T], [tys.Qubit])


Expand Down Expand Up @@ -166,24 +159,3 @@ def __call__(self, qb: ComWire) -> Command:


QFree = QFreeDef()


@dataclass(frozen=True)
class LogicOps(ops.Custom):
extension: tys.ExtensionId = "logic"


_NotSig = tys.FunctionType.endo([tys.Bool])


@dataclass(frozen=True)
class NotDef(LogicOps):
num_out: int = 1
op_name: str = "Not"
signature: tys.FunctionType = _NotSig

def __call__(self, a: ComWire) -> Command:
return super().__call__(a)


Not = NotDef()

0 comments on commit fb73843

Please sign in to comment.