class_docstr: Unit tests for the hadamard_grad function
class_docstr_tok: ["Unit","tests","for","the","hadamard_grad","function"]
docstr: Test diff of single probabilities.
code: def test_diff_single_probs(self, tol):
      """Test diff of single probabilities."""
      dev = qml.device("default.qubit", wires=3)
      x = 0.543
      y = -0.654
  
      with qml.queuing.AnnotatedQueue() as q:
          qml.RX(x, wires=[0])
          qml.RY(y, wires=[1])
          qml.CNOT(wires=[0, 1])
          qml.probs(wires=[1])
  
      tape = qml.tape.QuantumScript.from_queue(q)
  
      res_hadamard, tapes = grad_fn(tape, dev)
  
      assert len(tapes) == 2
      assert isinstance(res_hadamard, tuple)
      assert len(res_hadamard) == 2
  
      assert res_hadamard[0].shape == (2,)
      assert res_hadamard[1].shape == (2,)
  
      expected = np.array(
          [
              [-np.sin(x) * np.cos(y) / 2, -np.cos(x) * np.sin(y) / 2],
              [np.cos(y) * np.sin(x) / 2, np.cos(x) * np.sin(y) / 2],
          ]
      )
  
      assert np.allclose(
          res_hadamard[0], expected.T[0], atol=tol, rtol=0
      )
      assert np.allclose(
          res_hadamard[1], expected.T[1], atol=tol, rtol=0
      )
  
imports: import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 14 for calling the TestHadamardGrad obj's underlying member method code with example usage: obj.test_diff_single_probs(tol) without return types