class_docstr: Tests a basic circuit with one rx gate and two simple expectation values.
docstr: Tests execution and gradients of a simple circuit with tensorflow.
docstr_tok: ["Tests","execution","and","gradients","of","a","simple","circuit","with","tensorflow","."]
code: def test_tf_results_and_backprop(self):
      """Tests execution and gradients of a simple circuit with tensorflow."""
      import tensorflow as tf
  
      phi = tf.Variable(4.873)
  
      with tf.GradientTape(persistent=True) as grad_tape:
          qs = qml.tape.QuantumScript(
              [qml.RX(phi, wires=0)],
              [qml.expval(qml.PauliY(0)), qml.expval(qml.PauliZ(0))],
          )
          result = simulate(qs)
  
      assert qml.math.allclose(result[0], -tf.sin(phi))
      assert qml.math.allclose(result[1], tf.cos(phi))
  
      grad0 = grad_tape.jacobian(result[0], [phi])
      grad1 = grad_tape.jacobian(result[1], [phi])
  
      assert qml.math.allclose(grad0[0], -tf.cos(phi))
      assert qml.math.allclose(grad1[0], -tf.sin(phi))
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane.devices.qubit import simulate, get_final_state, measure_final_state
label_desc: Use image node_id 5 for calling the TestBasicCircuit obj's underlying member method code with example usage: obj.test_tf_results_and_backprop() without return types