class_docstr: Tests for parameter gradient methods
class_docstr_tok: ["Tests","for","parameter","gradient","methods"]
docstr: Test that a non-differentiable parameter is correctly marked
docstr_tok: ["Test","that","a","non-differentiable","parameter","is","correctly","marked"]
code: def test_non_differentiable(self):
      """Test that a non-differentiable parameter is correctly marked"""
  
      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] == "A"
      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 1 for calling the TestGradAnalysis obj's underlying member method code with example usage: obj.test_non_differentiable() without return types