Skip to content

Commit

Permalink
Define an identity node for CFGs.
Browse files Browse the repository at this point in the history
  • Loading branch information
cqc-alec committed Dec 14, 2023
1 parent 370e6dc commit 37a5f72
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions specification/hugr.md
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,8 @@ Some normalizations are possible:
- If the entry node has only one successor and that successor is the
exit node, the CFG node itself can be removed.

An special `passthrough<T>` `DFB` is defined having no effect on the data.

The CFG in the example below has three inputs: one (call it `v`) of type "P"
(not specified, but with a conversion to boolean represented by the nodes labelled "P?1" and "P?2"), one of
type "qubit" and one (call it `t`) of type "angle".
Expand Down Expand Up @@ -1333,13 +1335,14 @@ the children of that CFG node.
###### `InsertIdentity`
Given an edge between sibling nodes in a DSG, insert an `identity<T>`
node having its source as predecessor and its target as successor.
Given an edge between sibling nodes in a DSG or CFG, insert an `identity<T>` or
`passthrough<T>` node having its source as predecessor and its target as
successor.
###### `RemoveIdentity`
Remove an `identity<T>` node from a DSG, wiring its predecessor to its
successor.
Remove an `identity<T>` node from a DSG, or a `passthrough<T>` node from a CFG,
wiring its predecessor to its successor.
##### Order insertion and removal methods
Expand Down

0 comments on commit 37a5f72

Please sign in to comment.