class_docstr: Tests for the probs function
class_docstr_tok: ["Tests","for","the","probs","function"]
docstr: Test that the correct probability is returned.
docstr_tok: ["Test","that","the","correct","probability","is","returned","."]
code: def test_prob_generalize_param(self, hermitian, tol, mocker):
      """Test that the correct probability is returned."""
      dev = qml.device("default.qubit.legacy", wires=3)
      spy = mocker.spy(qml.QubitDevice, "probability")
  
      @qml.qnode(dev)
      def circuit(x, y):
          qml.RZ(x, wires=0)
          qml.CNOT(wires=[0, 1])
          qml.RY(y, wires=1)
          qml.CNOT(wires=[0, 2])
          return qml.probs(op=qml.Hermitian(hermitian, wires=0))
  
      res = circuit(0.56, 0.1)
  
      def circuit_rotated(x, y):
          qml.RZ(x, wires=0)
          qml.CNOT(wires=[0, 1])
          qml.RY(y, wires=1)
          qml.CNOT(wires=[0, 2])
          qml.Hermitian(hermitian, wires=0).diagonalizing_gates()
  
      state = np.array([1, 0, 0, 0, 0, 0, 0, 0])
      matrix = qml.matrix(circuit_rotated)(0.56, 0.1)
      state = np.dot(matrix, state)
      expected = np.reshape(np.abs(state) ** 2, [2] * 3)
      expected = np.einsum("ijk->i", expected).flatten()
      assert np.allclose(res, expected, atol=tol, rtol=0)
  
      custom_measurement_process(dev, spy)
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.measurements import ProbabilityMP, Shots
  from pennylane.devices.qubit.measure import flatten_state
label_desc: Use image node_id 15 for calling the TestProbs obj's underlying member method code with example usage: obj.test_prob_generalize_param(hermitian, tol, mocker) and returns: qml