cirq.SupportsDecompose¶
-
class
cirq.SupportsDecompose(*args, **kwargs)[source]¶ An object that can be decomposed into simpler operations.
ReturningNotImplementedmeans “not decomposable”. Otherwise an operation,list of operations, or generally anything meeting theOP_TREEcontract canbe returned.For example, a Toffoli could be decomposed into Hadamards, CNOTs, and Ts.These operations are simpler because they act on fewer qubits. In general, adecomposition should move closer towards the basic 1-qubit and 2-qubit gatesincluded by default in cirq. It is not necessary to get all the way there,just closer (callers will iteratively decompose if needed).DECOMPOSITIONS MUST NEVER BE CYCLIC. If B has A in its decomposition, Ashould not have B in its decomposition. Decomposition is often performediteratively, until a fixed point or some desired criteria is met. Cyclicdecompositions cause that kind of code to loop forever.-
__init__(*args, **kwargs)¶
Methods
-