class_docstr: Test that GroverOperator is applied correctly.
class_docstr_tok: ["Test","that","GroverOperator","is","applied","correctly","."]
docstr: Test that apply_operation dispatches to einsum, tensordot and the kernel correctly.
docstr_tok: ["Test","that","apply_operation","dispatches","to","einsum",",","tensordot","and","the","kernel","correctly","."]
code: def test_dispatching(
      self,
      op_wires,
      state_wires,
      einsum_called,
      tensordot_called,
      mocker,
  ):
      """Test that apply_operation dispatches to einsum, tensordot and the kernel correctly."""
      # pylint: disable=too-many-arguments
      np.random.seed(752)
      state = np.random.random(
          [2] * state_wires
      ) + 1j * np.random.random([2] * state_wires)
  
      op = qml.GroverOperator(list(range(op_wires)))
      spy_einsum = mocker.spy(qml.math, "einsum")
      spy_tensordot = mocker.spy(qml.math, "argsort")
      apply_operation(op, state, is_state_batched=False, debugger=None)
      assert spy_einsum.call_count == int(einsum_called)
      assert spy_tensordot.call_count == int(tensordot_called)
  
imports: from functools import reduce
  import pytest
  import numpy
  from scipy.stats import unitary_group
  import pennylane
  from pennylane.operation import _UNSET_BATCH_SIZE, Operation
  from pennylane.devices.qubit.apply_operation import apply_operation, apply_operation_einsum, apply_operation_tensordot
label_desc: Use image node_id 3 for calling the TestApplyGroverOperator obj's underlying member method code with example usage: obj.test_dispatching(op_wires, state_wires, einsum_called, tensordot_called, mocker) without return types