code: def jvp(tape, tangent, gradient_fn, gradient_kwargs=None):
      r"""Generate the gradient tapes and processing function required to compute
      the Jacobian vector product of a tape. This function only works with the new return type system on.
  
      Args:
          tape (.QuantumTape): quantum tape to differentiate
          tangent (tensor_like, list): Gradient-output vector. Must have shape
              matching the number of trainable parameters.
          gradient_fn (callable): the gradient transform to use to differentiate
              the tape
          gradient_kwargs (dict): dictionary of keyword arguments to pass when
              determining the gradients of tapes
  
      Returns:
          tensor_like or tuple or None: Jacobian vector product. Returns None if the tape
          has no trainable parameters.
  
      **Example**
  
      Consider the following quantum tape with Jax parameters:
  
      .. code-block:: python
  
          import jax
  
          x = jax.numpy.array([[0.1, 0.2, 0.3],
                               [0.4, 0.5, 0.6]])
  
          ops = [
              qml.RX(x[0, 0], wires=0),
              qml.RY(x[0, 1], wires=1),
              qml.RZ(x[0, 2], wires=0),
              qml.CNOT(wires=[0, 1]),
              qml.RX(x[1, 0], wires=1),
              qml.RY(x[1, 1], wires=0),
              qml.RZ(x[1, 2], wires=1)
          ]
          measurements = [qml.expval(qml.PauliZ(0)), qml.probs(wires=1)]
          tape = qml.tape.QuantumTape(ops, measurements)
  
      We can use the ``jvp`` function to compute the Jacobian vector product,
      given a tangent vector ``tangent``:
  
      >>> tangent = [jax.numpy.array(1.0), jax.numpy.array(1.0), jax.numpy.array(1.0), jax.numpy.array(1.0), jax.numpy.array(1.0), jax.numpy.array(1.0)]
      >>> jvp_tapes, fn = qml.gradients.jvp(tape, tangent, qml.gradients.param_shift)
  
      Note that ``tangent`` has six elements, matching the parameter dimension of the tape.
  
      Executing the JVP tapes, and applying the processing function:
  
      >>> dev = qml.device("default.qubit", wires=2)
      >>> jvp = fn(dev.execute(jvp_tapes))
      >>> jvp
      (Array(-0.62073976, dtype=float32), Array([-0.3259707 ,  0.32597077], dtype=float32))
      """
      if len(tape.trainable_params) == 0:
          # The tape has no trainable parameters; the JVP
          # is simply none.
          def zero_vjp(_):
              res = tuple(
                  np.zeros(mp.shape(None, tape.shots))
                  for mp in tape.measurements
              )
              return res[0] if len(tape.measurements) == 1 else res
  
          return tuple(), zero_vjp
  
      multi_m = len(tape.measurements) > 1
  
      try:
          # if qml.math.allclose(qml.math.stack(tangent), 0):
          if qml.math.allclose(tangent, 0):
              # If the tangent vector is zero, then the
              # corresponding element of the JVP will be zero,
              # and we can avoid a quantum computation.
  
              def func(_):  # pylint: disable=unused-argument
                  # TODO: Update shape for CV variables and for qutrit simulations
                  res = tuple(
                      _single_measurement_zero(m, tangent)
                      for m in tape.measurements
                  )
                  if not multi_m:
                      res = res[0]
                  return res
  
              return [], func
      except (AttributeError, TypeError):
          pass
  
      gradient_kwargs = gradient_kwargs or {}
      gradient_tapes, fn = gradient_fn(tape, **gradient_kwargs)
  
      def processing_fn(results):
          # postprocess results to compute the Jacobian
          jac = fn(results)
          _jvp_fn = compute_jvp_multi if multi_m else compute_jvp_single
  
          # Jacobian without shot vectors
          if not tape.shots.has_partitioned_shots:
              return _jvp_fn(tangent, jac)
  
          # The jacobian is calculated for shot vectors
          return tuple(
              _jvp_fn(tangent, jac[i])
              for i in range(tape.shots.num_copies)
          )
  
      return gradient_tapes, processing_fn
  
imports: import numpy
  import pennylane
  from pennylane.measurements import ProbabilityMP
label_desc: Use image node_id 3 for calling a global function with example usage: jvp(tape, tangent, gradient_fn, gradient_kwargs) and returns: gradient_tapes,  processing_fn, tuple,  zero_vjp, tuple, unknown, list,  func, _jvp_fn, res