class_docstr: Test the Hermitian observable
class_docstr_tok: ["Test","the","Hermitian","observable"]
docstr: Asserts that the provided matrix is not internally converted to a vanilla numpy array.
docstr_tok: ["Asserts","that","the","provided","matrix","is","not","internally","converted","to","a","vanilla","numpy","array","."]
code: def test_preserves_autograd_trainability(self):
      """Asserts that the provided matrix is not internally converted to a vanilla numpy array."""
      a = qml.numpy.eye(2, requires_grad=True)
      op = qml.Hermitian(a, 0)
      assert op.data[0] is a
      assert qml.math.requires_grad(op.data[0])
  
imports: import functools
  import pickle
  import pytest
  import numpy
  from gate_data import I, X, Y, Z, H
  import pennylane
  from pennylane.ops.qubit.observables import BasisStateProjector, StateVectorProjector
label_desc: Use image node_id 1 for calling the TestHermitian obj's underlying member method code with example usage: obj.test_preserves_autograd_trainability() without return types