ArgumentExtension

class tket.extensions.ArgumentExtension[source]

Bases: TketExtension

Operations for reading runtime entrypoint arguments.

OPS()[source]

Return the operations defined by this extension

Return type:

list[OpDef]

TYPES()[source]

Return the types defined by this extension

Return type:

list[TypeDef]

__call__()[source]

Returns the argument extension

Return type:

Extension

__init__()
read_arg(tag, ty)[source]

Read a runtime argument of type ty identified by tag.

Return type:

ExtOp

Args:

tag: String tag identifying the argument (matches the provider’s key). ty: The HUGR type of the argument to read.

property read_arg_def: OpDef

Read a runtime argument of the given type identified by a string tag.

This is the generic operation definition. For the instantiated operation, see read_arg.

property version: Version

The version of the extension