cirq.CircuitDag.adj¶
-
CircuitDag.adj¶ Graph adjacency object holding the neighbors 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.adj[3][2]['color'] = 'blue'setsthe color of the edge(3, 2)to"blue".Iterating over G.adj behaves like a dict. Useful idioms includefor nbr, datadict in G.adj[n].items():.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.adjholds outgoing (successor) info.