Skip to content

Commit

Permalink
Merge pull request #51 from CQCL-DEV/fix/t2op
Browse files Browse the repository at this point in the history
fix: add "tket2" extension suffix for quantum ops
  • Loading branch information
ss2165 authored Oct 24, 2023
2 parents 877c9a0 + 4c649d2 commit 261b4b8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions guppy/prelude/quantum.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,21 @@

# mypy: disable-error-code=empty-body

from guppy.guppy_types import GuppyType
from guppy.hugr.tys import TypeBound
from guppy.prelude import builtin
from guppy.extension import GuppyExtension, OpCompiler
from guppy.hugr import ops, tys


class QuantumOpCompiler(OpCompiler):
def __init__(self, op_name: str, ext: str = "quantum"):
def __init__(self, op_name: str, ext: str = "quantum.tket2"):
super().__init__(ops.CustomOp(extension=ext, op_name=op_name, args=[]))


_hugr_qubit = tys.Opaque(extension="prelude", id="qubit", args=[], bound=TypeBound.Any)


extension = GuppyExtension("quantum", dependencies=[builtin])
extension = GuppyExtension("quantum.tket2", dependencies=[builtin])


@extension.type(_hugr_qubit, linear=True)
Expand Down

0 comments on commit 261b4b8

Please sign in to comment.