Skip to content

Commit

Permalink
add "tket2" extension suffix for quantum ops
Browse files Browse the repository at this point in the history
  • Loading branch information
ss2165 committed Oct 24, 2023
1 parent 877c9a0 commit 4c649d2
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 4c649d2

Please sign in to comment.