class cirq.google.ConvertToXmonGates(ignore_failures=False)[source]

Attempts to convert strange gates into XmonGates.

First, checks if the given operation is already a native xmon operation.

Second, checks if the operation has a known unitary. If so, and the gate
is a 1-qubit or 2-qubit gate, then performs circuit synthesis of the
operation.

Third, attempts to cirq.decompose to the operation.

Fourth, if ignore_failures is set, gives up and returns the gate unchanged.
Otherwise raises a TypeError.
__init__(ignore_failures=False) → None[source]
Parameters: ignore_failures – If set, gates that fail to convert are forwarded unchanged. If not set, conversion failures raise a TypeError.

Methods

 convert(op) optimization_at(circuit, index, op) Describes how to change operations near the given location. optimize_circuit(circuit)