cirq.LineInitialMapper

Places logical qubits in the circuit onto physical qubits on the device.

Inherits From: AbstractInitialMapper

Starting from the center physical qubit on the device, attempts to map disjoint lines of logical qubits given by the circuit graph onto one long line of physical qubits on the device, greedily maximizing each physical qubit's degree. If this mapping cannot be completed as one long line of qubits in the circuit graph mapped to qubits in the device graph, the line can be split as several line segments and then we: (i) Map first line segment. (ii) Find another high degree vertex in G near the center. (iii) Map the second line segment (iv) etc. A line is split by mapping the next logical qubit to the nearest available physical qubit to the center of the device graph.

The expected runtime of this strategy is O(m logn + n^2) where m is the # of operations in the given circuit and n is the number of qubits. The first term corresponds to the runtime of 'make_circuit_graph()' and the second for 'initial_mapping()'.

device_graph device graph

Methods

initial_mapping

View source

Maps disjoint lines of logical qubits onto lines of physical qubits.

Args
circuit the input circuit with logical qubits

Returns
a dictionary that maps logical qubits in the circuit (keys) to physical qubits on the device (values).

__eq__

View source

__ne__

View source