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 operation and nested tape expansion
  is differentiable
docstr_tok: ["Test","that","operation","and","nested","tape","expansion","is","differentiable"]
code: def test_differentiable_expand(self, execute_kwargs, tol):
      """Test that operation and nested tape expansion
      is differentiable"""
  
      class U3(qml.U3):
          def decomposition(self):
              theta, phi, lam = self.data
              wires = self.wires
              return [
                  qml.Rot(lam, theta, -lam, wires=wires),
                  qml.PhaseShift(phi + lam, wires=wires),
              ]
  
      dev = qml.device("default.qubit.legacy", wires=1)
      a = np.array(0.1)
      p = tf.Variable([0.1, 0.2, 0.3], dtype=tf.float64)
  
      with tf.GradientTape() as tape:
          with qml.queuing.AnnotatedQueue() as q_qtape:
              qml.RX(a, wires=0)
              U3(p[0], p[1], p[2], wires=0)
              qml.expval(qml.PauliX(0))
  
          qtape = qml.tape.QuantumScript.from_queue(q_qtape)
          res = execute([qtape], dev, **execute_kwargs)[0]
  
      expected = tf.cos(a) * tf.cos(p[1]) * tf.sin(p[0]) + tf.sin(a) * (
          tf.cos(p[2]) * tf.sin(p[1])
          + tf.cos(p[0]) * tf.cos(p[1]) * tf.sin(p[2])
      )
      assert np.allclose(res, expected, atol=tol, rtol=0)
  
      res = tape.jacobian(res, p)
      expected = np.array(
          [
              tf.cos(p[1])
              * (
                  tf.cos(a) * tf.cos(p[0])
                  - tf.sin(a) * tf.sin(p[0]) * tf.sin(p[2])
              ),
              tf.cos(p[1]) * tf.cos(p[2]) * tf.sin(a)
              - tf.sin(p[1])
              * (
                  tf.cos(a) * tf.sin(p[0])
                  + tf.cos(p[0]) * tf.sin(a) * tf.sin(p[2])
              ),
              tf.sin(a)
              * (
                  tf.cos(p[0]) * tf.cos(p[1]) * tf.cos(p[2])
                  - tf.sin(p[1]) * tf.sin(p[2])
              ),
          ]
      )
      assert np.allclose(res, expected, atol=tol, rtol=0)
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane.gradients import finite_diff, param_shift
  from pennylane import execute
label_desc: Use image node_id 10 for calling the TestTensorFlowExecuteIntegration obj's underlying member method code with example usage: obj.test_differentiable_expand(execute_kwargs, tol) and returns: list