ParentBuilder#
- class hugr.build.base.ParentBuilder(*args, **kwargs)[source]#
Bases:
ToNode
,Protocol
[OpVar
]Abstract interface implemented by builders of nodes that contain child HUGRs.
Methods
Generate an input port for this node.
Generate an output port for this node.
OutPort corresponding to this
Wire
.Returns an iterator over the output ports of this node.
Generate a port in direction for this node with offset.
Convert to a
Node
.Attributes
Metadata associated with this node.
The parent node's operation.
The child HUGR.
parent_node
- inp(offset: int) InPort #
Generate an input port for this node.
- Parameters:
offset – port offset.
- Returns:
Incoming port for this node.
Examples
>>> Node(0).inp(1) InPort(Node(0), 1)
- out(offset: int) OutPort #
Generate an output port for this node.
- Parameters:
offset – port offset.
- Returns:
Outgoing port for this node.
Examples
>>> Node(0).out(1) OutPort(Node(0), 1)
- property parent_op: OpVar#
The parent node’s operation.