class_docstr: Test the specialized kernel for MultiControlledX and its dispatching.
class_docstr_tok: ["Test","the","specialized","kernel","for","MultiControlledX","and","its","dispatching","."]
docstr: Test that apply_multicontrolledx dispatches to the right method and is correct.
docstr_tok: ["Test","that","apply_multicontrolledx","dispatches","to","the","right","method","and","is","correct","."]
code: def test_multicontrolledx_dispatching(
      self,
      num_op_wires,
      num_state_wires,
      einsum_called,
      tdot_called,
      mocker,
  ):
      """Test that apply_multicontrolledx dispatches to the right method and is correct."""
      np.random.seed(2751)
      op = qml.MultiControlledX(wires=list(range(num_op_wires)))
      state = np.random.random([2] * num_state_wires).astype(complex)
      spies = [
          mocker.spy(qml.math, "einsum"),
          mocker.spy(qml.math, "tensordot"),
      ]
      out = apply_operation(
          op, state, is_state_batched=False, debugger=None
      )
      # Compute expected output
      exp_out = state.copy()
      idx = (1,) * (num_op_wires - 1)
      exp_out[idx] = np.roll(exp_out[idx], 1, 0)
      assert spies[0].call_count == einsum_called
      assert spies[1].call_count == tdot_called
      assert np.allclose(out, exp_out)
  
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 1 for calling the TestMultiControlledXKernel obj's underlying member method code with example usage: obj.test_multicontrolledx_dispatching(num_op_wires, num_state_wires, einsum_called, tdot_called, mocker) without return types