The default mapping from cirq.NamedTopology nodes and cirq.Qid.

There is a correspondence between nodes and the "abstract" Qids used to construct un-placed circuit. cirq.get_placements returns a dictionary mapping from node to Qid. We use this function to transform it into a mapping from "abstract" Qid to device Qid. This function encodes the default behavior used by RandomDevicePlacer.

If nodes are tuples of integers, map to cirq.GridQubit. Otherwise, try to map to cirq.LineQubit and rely on its validation.

node A node from a cirq.NamedTopology graph.

A cirq.Qid appropriate for the node type.