code: def _quaternion_product(q1, q2):
      """Compute the product of two quaternions, q = q1 * q2."""
      qw = q1[0] * q2[0] - q1[1] * q2[1] - q1[2] * q2[2] - q1[3] * q2[3]
      qx = q1[0] * q2[1] + q1[1] * q2[0] + q1[2] * q2[3] - q1[3] * q2[2]
      qy = q1[0] * q2[2] - q1[1] * q2[3] + q1[2] * q2[0] + q1[3] * q2[1]
      qz = q1[0] * q2[3] + q1[1] * q2[2] - q1[2] * q2[1] + q1[3] * q2[0]
  
      return stack([qw, qx, qy, qz])
  
file_path: pennylane/pennylane/transforms/optimization/optimization_utils.py
imports: from functools import partial
  import numpy
  from pennylane.math import abs
  from pennylane.math import sum
  from pennylane.math import allclose, arccos, arctan2, cos, get_interface, is_abstract, sin, stack
  from pennylane.wires import Wires
  from pennylane.ops.identity import GlobalPhase
label_desc: Use image node_id 3 for calling a global function with example usage: _quaternion_product(q1, q2) and returns: stack