class_docstr: Tests for parameter gradient methods
class_docstr_tok: ["Tests","for","parameter","gradient","methods"]
docstr: If an op has grad_method=F, this should be respected
docstr_tok: ["If","an","op","has","grad_method=F",",","this","should","be","respected"]
code: def test_finite_diff(self, monkeypatch):
      """If an op has grad_method=F, this should be respected"""
  
      monkeypatch.setattr(qml.RX, "grad_method", "F")
  
      psi = np.array([1, 0, 1, 0]) / np.sqrt(2)
  
      with qml.queuing.AnnotatedQueue() as q:
          qml.StatePrep(psi, wires=[0, 1])
          qml.RX(0.543, wires=[0])
          qml.RY(-0.654, wires=[1])
          qml.CNOT(wires=[0, 1])
          qml.probs(wires=[0, 1])
  
      tape = qml.tape.QuantumScript.from_queue(q)
      trainable_params = choose_trainable_params(tape, None)
      diff_methods = _find_gradient_methods(tape, trainable_params)
  
      assert diff_methods[0] is None
      assert diff_methods[1] == "F"
      assert diff_methods[2] == "A"
  
imports: import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.gradients.gradient_transform import _find_gradient_methods, _validate_gradient_methods, choose_trainable_params
label_desc: Use image node_id 4 for calling the TestGradAnalysis obj's underlying member method code with example usage: obj.test_finite_diff(monkeypatch) without return types