Skip to content

Commit

Permalink
inline some signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
ss2165 committed Aug 12, 2024
1 parent cfc0fdb commit 502f3de
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions hugr-py/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,40 +20,35 @@
from hugr.ops import ComWire

EXTENSION = ext.Extension("pytest.quantum,", ext.Version(0, 1, 0))
_SINGLE_QUBIT = ext.OpDefSig(tys.FunctionType.endo([tys.Qubit]))
_TWO_QUBIT = ext.OpDefSig(tys.FunctionType.endo([tys.Qubit] * 2))
_MEAS_SIG = ext.OpDefSig(tys.FunctionType([tys.Qubit], [tys.Qubit, tys.Bool]))
_RZ_SIG = ext.OpDefSig(tys.FunctionType([tys.Qubit, FLOAT_T], [tys.Qubit]))

EXTENSION.add_op_def(
ext.OpDef(
name="H",
description="Hadamard gate",
signature=_SINGLE_QUBIT,
signature=ext.OpDefSig(tys.FunctionType.endo([tys.Qubit])),
)
)

EXTENSION.add_op_def(
ext.OpDef(
name="CX",
description="CNOT gate",
signature=_TWO_QUBIT,
signature=ext.OpDefSig(tys.FunctionType.endo([tys.Qubit] * 2)),
)
)

EXTENSION.add_op_def(
ext.OpDef(
name="Measure",
description="Measurement operation",
signature=_MEAS_SIG,
signature=ext.OpDefSig(tys.FunctionType([tys.Qubit], [tys.Qubit, tys.Bool])),
)
)

EXTENSION.add_op_def(
ext.OpDef(
name="Rz",
description="Rotation around the z-axis",
signature=_RZ_SIG,
signature=ext.OpDefSig(tys.FunctionType([tys.Qubit, FLOAT_T], [tys.Qubit])),
)
)

Expand Down

0 comments on commit 502f3de

Please sign in to comment.