OpDef#
- class hugr.ext.OpDef(name: str, signature: ~hugr.ext.OpDefSig, description: str = '', misc: dict[str, ~typing.Any] = <factory>, lower_funcs: list[~hugr.ext.FixedHugr] = <factory>)[source]#
Bases:
ExtensionObject
Operation definition in an
Extension
.Methods
Retrieve the extension associated with the object.
Instantiate an operation from this definition.
qualified_name
Attributes
A description of the operation.
The name of the operation.
The type signature of the operation.
Miscellaneous information about the operation.
Lowerings of the operation.
- get_extension() Extension #
Retrieve the extension associated with the object.
- Returns:
The extension associated with the object.
- Raises:
NoParentExtension – If the object is not associated with an extension.
- instantiate(args: Sequence[tys.TypeArg] | None = None, concrete_signature: tys.FunctionType | None = None) ops.ExtOp [source]#
Instantiate an operation from this definition.
- Parameters:
args – Type arguments corresponding to the type parameters of the definition.
concrete_signature – Concrete function type of the operation, only required
polymorphic. (if the operation is)