cirq_google.workflow.qubit_placement.default_topo_node_to_qubit
The default mapping from cirq.NamedTopology
nodes and cirq.Qid
.
cirq_google.workflow.qubit_placement.default_topo_node_to_qubit(
node: Any
) -> 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.
Returns |
A cirq.Qid appropriate for the node type.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-06-27 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-06-27 UTC."],[],[]]