Remove the input_ports_wiring and output_ports_wiring members from NativeFunctionDefinition, and change the type of the inputs, outputs, and inouts members to Dict[str, HandleBinding]. HandleBinding accepts the name of a port of the function, and passes that port to the called function. The following example represents a function that applies the gate H, and then applies the gate X to the same port: