code: def gradient(scalar, frame):
      """
      Returns the vector gradient of a scalar field computed wrt the
      coordinate symbols of the given frame.
  
      Parameters
      ==========
  
      scalar : sympifiable
          The scalar field to take the gradient of
  
      frame : ReferenceFrame
          The frame to calculate the gradient in
  
      Examples
      ========
  
      >>> from sympy.physics.vector import ReferenceFrame
      >>> from sympy.physics.vector import gradient
      >>> R = ReferenceFrame('R')
      >>> s1 = R[0]*R[1]*R[2]
      >>> gradient(s1, R)
      R_y*R_z*R.x + R_x*R_z*R.y + R_x*R_y*R.z
      >>> s2 = 5*R[0]**2*R[2]
      >>> gradient(s2, R)
      10*R_x*R_z*R.x + 5*R_x**2*R.z
  
      """
  
      _check_frame(frame)
      outvec = Vector(0)
      scalar = express(scalar, frame, variables=True)
      for i, x in enumerate(frame):
          outvec += diff(scalar, frame[i]) * x
      return outvec
  
file_path: sympy/sympy/physics/vector/fieldfunctions.py
imports: from sympy.core.function import diff
  from sympy.core.singleton import S
  from sympy.integrals.integrals import integrate
  from sympy.physics.vector import Vector, express
  from sympy.physics.vector.frame import _check_frame
  from sympy.physics.vector.vector import _check_vector
label_desc: Use image node_id 3 for calling a global function with example usage: gradient(scalar, frame) and returns: outvec