class_docstr: Test the tensorflow interface execute function
  integrates well for both forward and backward execution
class_docstr_tok: ["Test","the","tensorflow","interface","execute","function","integrates","well","for","both","forward","and","backward","execution"]
docstr: Test that the tensorflow interface works correctly
  with a matrix parameter
docstr_tok: ["Test","that","the","tensorflow","interface","works","correctly","with","a","matrix","parameter"]
code: def test_matrix_parameter(self, execute_kwargs, device, shots):
      """Test that the tensorflow interface works correctly
      with a matrix parameter"""
      U = tf.constant([[0, 1], [1, 0]], dtype=tf.complex128)
      a = tf.Variable(0.1)
  
      def cost(a, U):
          ops = [qml.QubitUnitary(U, wires=0), qml.RY(a, wires=0)]
          tape = qml.tape.QuantumScript(
              ops, [qml.expval(qml.PauliZ(0))]
          )
          return execute([tape], device, **execute_kwargs)[0]
  
      with tf.GradientTape() as tape:
          res = cost(a, U)
  
      assert np.allclose(res, -tf.cos(a), atol=atol_for_shots(shots))
  
      jac = tape.jacobian(res, a)
      assert isinstance(jac, tf.Tensor)
      assert np.allclose(
          jac, tf.sin(a), atol=atol_for_shots(shots), rtol=0
      )
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane.devices import DefaultQubit
  from pennylane.gradients import param_shift
  from pennylane import execute
label_desc: Use image node_id 9 for calling the TestTensorflowExecuteIntegration obj's underlying member method code with example usage: obj.test_matrix_parameter(execute_kwargs, device, shots) and returns: execute