class_docstr: Test that GroverOperator is applied correctly.
class_docstr_tok: ["Test","that","GroverOperator","is","applied","correctly","."]
docstr: Test that apply_operation is correct for GroverOperator for all dispatch branches
  when applying it to a Tensorflow state.
docstr_tok: ["Test","that","apply_operation","is","correct","for","GroverOperator","for","all","dispatch","branches","when","applying","it","to","a","Tensorflow","state","."]
code: def test_correctness_tf(self, op_wires, state_wires, batch_dim):
      """Test that apply_operation is correct for GroverOperator for all dispatch branches
      when applying it to a Tensorflow state."""
      import tensorflow as tf
  
      batched = batch_dim is not None
      shape = (
          [batch_dim] + [2] * state_wires
          if batched
          else [2] * state_wires
      )
      # Input state
      np.random.seed(752)
      state = np.random.random(shape) + 1j * np.random.random(shape)
  
      wires = list(range(op_wires))
      op = qml.GroverOperator(wires)
      expected_via_mat = apply_operation_tensordot(op, state, batched)
      if op_wires == state_wires:
          expected_via_kernel = self.grover_kernel_full_wires(
              state, wires, batched
          )
      else:
          expected_via_kernel = self.grover_kernel_partial_wires(
              state, wires, batched
          )
  
      # Cast to interface and apply operation
      state = tf.Variable(state)
      out = apply_operation(
          op, state, is_state_batched=batched, debugger=None
      )
  
      assert qml.math.allclose(out, expected_via_mat)
      assert qml.math.allclose(out, expected_via_kernel)
  
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 7 for calling the TestApplyGroverOperator obj's underlying member method code with example usage: obj.test_correctness_tf(op_wires, state_wires, batch_dim) without return types