cirq.CircuitDag.pred¶
-
CircuitDag.pred¶ Graph adjacency object holding the predecessors 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.pred[2][3]['color'] = 'blue'setsthe color of the edge(3, 2)to"blue".Iterating over G.pred behaves like a dict. Useful idioms includefor nbr, datadict in G.pred[n].items():. A data-view not providedby dicts also exists:for nbr, foovalue in G.pred[node].data('foo'):A default can be set via adefaultargument to thedatamethod.