class_docstr: Tests for the probs function
class_docstr_tok: ["Tests","for","the","probs","function"]
docstr: Test that Operators that do not have a diagonalizing_gates representation cannot
  be used in probability measurements.
docstr_tok: ["Test","that","Operators","that","do","not","have","a","diagonalizing_gates","representation","can","not","be","used","in","probability","measurements","."]
code: def test_generalize_prob_not_hermitian(self, operation):
      """Test that Operators that do not have a diagonalizing_gates representation cannot
      be used in probability measurements."""
  
      dev = qml.device("default.qubit.legacy", wires=2)
  
      @qml.qnode(dev)
      def circuit():
          qml.PauliX(wires=0)
          qml.PauliZ(wires=1)
          return qml.probs(op=operation(0.56, wires=[0, 1]))
  
      with pytest.raises(
          qml.QuantumFunctionError,
          match="does not define diagonalizing gates : cannot be used to rotate the probability",
      ):
          circuit()
  
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 21 for calling the TestProbs obj's underlying member method code with example usage: obj.test_generalize_prob_not_hermitian(operation) and returns: qml