cirq.CircuitDag.succ¶
-
CircuitDag.succ¶ Graph adjacency object holding the successors of each node.
This object is a read-only dict-like structure with node keysand neighbor-dict values. The neighbor-dict is keyed by neighborto the edge-data-dict. SoG.succ[3][2]['color'] = 'blue'setsthe color of the edge(3, 2)to"blue".Iterating over G.succ behaves like a dict. Useful idioms includefor nbr, datadict in G.succ[n].items():. A data-view not providedby dicts also exists:for nbr, foovalue in G.succ[node].data('foo'):and a default can be set via adefaultargument to thedatamethod.The neighbor information is also provided by subscripting the graph.Sofor nbr, foovalue in G[node].data('foo', default=1):works.For directed graphs,
G.adjis identical toG.succ.