optimized_for_xmon(circuit: cirq.circuits.circuit.Circuit, new_device: Optional[cirq.google.xmon_device.XmonDevice] = None, qubit_map: Callable[cirq.ops.raw_types.Qid, cirq.devices.grid_qubit.GridQubit] = <function <lambda>>, allow_partial_czs: bool = False) → cirq.circuits.circuit.Circuit¶
Optimizes a circuit with XmonDevice in mind.Starts by converting the circuit’s operations to the xmon gate set, thenbegins merging interactions and rotations, ejecting pi-rotations and phasingoperations, dropping unnecessary operations, and pushing operations earlier.
- circuit – The circuit to optimize.
- new_device – The device the optimized circuit should be targeted at. If set to None, the circuit’s current device is used.
- qubit_map – Transforms the qubits (e.g. so that they are GridQubits).
- allow_partial_czs – If true, the optimized circuit may contain partial CZ gates. Otherwise all partial CZ gates will be converted to full CZ gates. At worst, two CZ gates will be put in place of each partial CZ from the input.
The optimized circuit.