docstr: Test operator arithmetic circuit with non-integer wires works with tensorflow.
docstr_tok: ["Test","operator","arithmetic","circuit","with","non-integer","wires","works","with","tensorflow","."]
code: def test_tensorflow_op_arithmetic(self):
      """Test operator arithmetic circuit with non-integer wires works with tensorflow."""
      import tensorflow as tf
  
      phi = tf.Variable(0.4203)
  
      def f(x):
          ops = [
              qml.PauliX("a"),
              qml.PauliX("b"),
              qml.ctrl(
                  qml.RX(x, "target"),
                  ("a", "b", -3),
                  control_values=[1, 1, 0],
              ),
          ]
  
          qs = qml.tape.QuantumScript(
              ops,
              [
                  qml.expval(
                      qml.sum(qml.PauliY("target"), qml.PauliZ("b"))
                  ),
                  qml.expval(qml.s_prod(3, qml.PauliZ("target"))),
              ],
          )
  
          return simulate(qs)
  
      with tf.GradientTape(persistent=True) as tape:
          results = f(phi)
  
      assert qml.math.allclose(results[0], -np.sin(phi) - 1)
      assert qml.math.allclose(results[1], 3 * np.cos(phi))
  
      g0 = tape.gradient(results[0], phi)
      assert qml.math.allclose(g0, -np.cos(phi))
      g1 = tape.gradient(results[1], phi)
      assert qml.math.allclose(g1, -3 * np.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 TestOperatorArithmetic obj's underlying member method code with example usage: obj.test_tensorflow_op_arithmetic() and returns: simulate