ImplementOpsSpec¶
- class guppyft.encode.ImplementOpsSpec(*, ops, tys=<factory>, build_wrapper=<function ImplementOpsSpec.<lambda>>, libs=<factory>, adapt_rotation_inputs=False)[source]¶
A specification for the implement ops pass, supplying implementations to a set of HUGR extension ops.
- __init__(*, ops, tys=<factory>, build_wrapper=<function ImplementOpsSpec.<lambda>>, libs=<factory>, adapt_rotation_inputs=False)¶
- adapt_rotation_inputs: bool = False¶
Expect Guppy angle tuples for top-level HUGR rotation inputs in implementations and generated declarations. Call sites insert to_halfturns and wrap the resulting floats in tuples. Other input and output types are unchanged.
- build_wrapper()¶
Allows creating a wrapper around the transformed program, e.g. to setup and teardown the environment required for the op implementations.
- libs: list[Package | bytes]¶
Additional libraries required to run the transformed program, either as a HUGR package or the same in serialised form (using Package.to_bytes).
- ops: OpReplacements¶
The operations to replace.
- tys: TyReplacements¶
The types to replace.