def_apply_operator_Qubit(self,qubits,**options):"""Apply this operator to a Qubit subclass. Parameters ========== qubits : Qubit The qubit subclass to apply this operator to. Returns ======= state : Expr The resulting quantum state. """ifqubits.nqubits!=self.nqubits:raiseQuantumError('OracleGate operates on %r qubits, got: %r'%(self.nqubits,qubits.nqubits))# If function returns 1 on qubits# return the negative of the qubits (flip the sign)ifself.search_function(qubits):return-qubitselse:returnqubits#-------------------------------------------------------------------------# Represent#-------------------------------------------------------------------------def_represent_ZGate(self,basis,**options):raiseNotImplementedError("Represent for the Oracle has not been implemented yet")