class_docstr: A black box gate.
  
  The gate marks the desired qubits of an unknown function by flipping
  the sign of the qubits.  The unknown function returns true when it
  finds its desired qubits and false otherwise.
  
  Parameters
  ==========
  
  qubits : int
      Number of qubits.
  
  oracle : callable
      A callable function that returns a boolean on a computational basis.
  
  Examples
  ========
  
  Apply an Oracle gate that flips the sign of ``|2>`` on different qubits::
  
      >>> from sympy.physics.quantum.qubit import IntQubit
      >>> from sympy.physics.quantum.qapply import qapply
      >>> from sympy.physics.quantum.grover import OracleGate
      >>> f = lambda qubits: qubits == IntQubit(2)
      >>> v = OracleGate(2, f)
      >>> qapply(v*IntQubit(2))
      -|2>
      >>> qapply(v*IntQubit(3))
      |3>
class_docstr_tok: ["A","black","box","gate",".","The","gate","marks","the","desired","qubits","of","an","unknown","function","by","flipping","the","sign","of","the","qubits",".","The","unknown","function","returns","true","when","it","finds","its","desired","qubits","and","false","otherwise",".","Parameters","==========","qubits",":","int","Number","of","qubits",".","oracle",":","callable","A","callable","function","that","returns","a","boolean","on","a","computational","basis",".","Examples","========","Apply","an","Oracle","gate","that","flips","the","sign","of","``","|2",">","``","on","different","qubits",":",":",">",">",">","from","sympy.physics.quantum.qubit","import","IntQubit",">",">",">","from","sympy.physics.quantum.qapply","import","qapply",">",">",">","from","sympy.physics.quantum.grover","import","OracleGate",">",">",">","f","=","lambda","qubits",":","qubits","==","IntQubit","(","2",")",">",">",">","v","=","OracleGate","(","2",",","f",")",">",">",">","qapply","(","v","*","IntQubit","(","2",")",")","-|2",">",">",">",">","qapply","(","v","*","IntQubit","(","3",")",")","|3",">"]
docstr: 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.
docstr_tok: ["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","."]
code: 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.
      """
      if qubits.nqubits != self.nqubits:
          raise QuantumError(
              "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)
      if self.search_function(qubits):
          return -qubits
      else:
          return qubits
  
imports: from sympy.core.numbers import pi
  from sympy.core.sympify import sympify
  from sympy.core.basic import Atom
  from sympy.functions.elementary.integers import floor
  from sympy.functions.elementary.miscellaneous import sqrt
  from sympy.matrices.dense import eye
  from sympy.core.numbers import NegativeOne
  from sympy.physics.quantum.qapply import qapply
  from sympy.physics.quantum.qexpr import QuantumError
  from sympy.physics.quantum.hilbert import ComplexSpace
  from sympy.physics.quantum.operator import UnitaryOperator
  from sympy.physics.quantum.gate import Gate
  from sympy.physics.quantum.qubit import IntQubit
label_desc: Use image node_id 5 for calling the OracleGate obj's underlying member method code with example usage: obj._apply_operator_Qubit(qubits) and returns: unknown, qubits