class_docstr: Tests for the batch JVP function
class_docstr_tok: ["Tests","for","the","batch","JVP","function"]
docstr: Test the 'extend' reduction strategy
docstr_tok: ["Test","the","'extend","'","reduction","strategy"]
code: def test_reduction_extend_special(self):
      """Test the 'extend' reduction strategy"""
      dev = qml.device("default.qubit", wires=2)
  
      with qml.queuing.AnnotatedQueue() as q1:
          qml.RX(0.4, wires=0)
          qml.CNOT(wires=[0, 1])
          qml.expval(qml.PauliZ(0))
  
      tape1 = qml.tape.QuantumScript.from_queue(q1)
      with qml.queuing.AnnotatedQueue() as q2:
          qml.RX(0.4, wires=0)
          qml.RX(0.6, wires=0)
          qml.CNOT(wires=[0, 1])
          qml.expval(qml.PauliZ(0))
          qml.probs(wires=0)
  
      tape2 = qml.tape.QuantumScript.from_queue(q2)
      tape1.trainable_params = {0}
      tape2.trainable_params = {0, 1}
  
      tapes = [tape1, tape2]
      tangents = [np.array([1.0]), np.array([1.0, 1.0])]
  
      v_tapes, fn = qml.gradients.batch_jvp(
          tapes,
          tangents,
          param_shift,
          reduction=lambda jvps, x: jvps.extend(
              qml.math.reshape(x, (1,))
          )
          if not isinstance(x, tuple) and x.shape == ()
          else jvps.extend(x),
      )
      res = fn(dev.execute(v_tapes))
  
      assert len(res) == 3
  
imports: import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.gradients import param_shift
label_desc: Use image node_id 6 for calling the TestBatchJVP obj's underlying member method code with example usage: obj.test_reduction_extend_special() without return types