cirq.SupportsDecomposeWithQubits¶
-
class
cirq.SupportsDecomposeWithQubits(*args, **kwargs)[source]¶ An object that can be decomposed into operations on given qubits.
ReturningNotImplementedorNonemeans “not decomposable”. Otherwise anoperation, list of operations, or generally anything meeting theOP_TREEcontract can be returned.For example, a SWAP gate can be turned into three CNOTs. But in order todescribe those CNOTs one must be able to talk about “the target qubit” and“the control qubit”. This can only be done once the qubits-to-be-swapped areknown.The main user of this protocol isGateOperation, which decomposes itselfby delegating to its gate. The qubits argument is needed because gates arespecified independently of target qubits and so must be told the relevantqubits. AGateOperationimplementsSupportsDecomposeas long as its gateimplementsSupportsDecomposeWithQubits.-
__init__(*args, **kwargs)¶
Methods
-