class_docstr: Test the Hadamard gradient transform and edge cases such as non diff parameters, auxiliary wires, etc...
class_docstr_tok: ["Test","the","Hadamard","gradient","transform","and","edge","cases","such","as","non","diff","parameters",",","auxiliary","wires",",","etc","..."]
docstr: Test error raised if attempting to differentiate with respect to a variance
code: def test_variance_non_differentiable_error(self):
      """Test error raised if attempting to differentiate with respect to a variance"""
  
      with qml.queuing.AnnotatedQueue() as q:
          qml.RX(0.543, wires=[0])
          qml.RY(-0.654, wires=[1])
          qml.var(qml.PauliZ(wires=0))
  
      tape = qml.tape.QuantumScript.from_queue(q)
      with pytest.raises(
          ValueError,
          match=(
              r"Computing the gradient of variances with the Hadamard test "
              "gradient transform is not supported."
          ),
      ):
          qml.gradients.hadamard_grad(tape)
  
imports: import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 9 for calling the TestHadamardGradEdgeCases obj's underlying member method code with example usage: obj.test_variance_non_differentiable_error() without return types