code: def test_scalar_potential_difference():
      origin = Point("O")
      point1 = origin.locatenew("P1", 1 * R.x + 2 * R.y + 3 * R.z)
      point2 = origin.locatenew("P2", 4 * R.x + 5 * R.y + 6 * R.z)
      genericpointR = origin.locatenew(
          "RP", R[0] * R.x + R[1] * R.y + R[2] * R.z
      )
      genericpointP = origin.locatenew(
          "PP", P[0] * P.x + P[1] * P.y + P[2] * P.z
      )
      assert (
          scalar_potential_difference(S.Zero, R, point1, point2, origin)
          == 0
      )
      assert (
          scalar_potential_difference(
              scalar_field, R, origin, genericpointR, origin
          )
          == scalar_field
      )
      assert (
          scalar_potential_difference(
              grad_field, R, origin, genericpointR, origin
          )
          == scalar_field
      )
      assert (
          scalar_potential_difference(
              grad_field, R, point1, point2, origin
          )
          == 948
      )
      assert (
          scalar_potential_difference(
              R[1] * R[2] * R.x + R[0] * R[2] * R.y + R[0] * R[1] * R.z,
              R,
              point1,
              genericpointR,
              origin,
          )
          == R[0] * R[1] * R[2] - 6
      )
      potential_diff_P = (
          2
          * P[2]
          * (P[0] * sin(q) + P[1] * cos(q))
          * (P[0] * cos(q) - P[1] * sin(q)) ** 2
      )
      assert (
          scalar_potential_difference(
              grad_field, P, origin, genericpointP, origin
          ).simplify()
          == potential_diff_P
      )
  
file_path: sympy/sympy/physics/vector/tests/test_fieldfunctions.py
imports: from sympy.core.singleton import S
  from sympy.core.symbol import Symbol
  from sympy.functions.elementary.trigonometric import cos, sin
  from sympy.physics.vector import ReferenceFrame, Vector, Point, dynamicsymbols
  from sympy.physics.vector.fieldfunctions import divergence, gradient, curl, is_conservative, is_solenoidal, scalar_potential, scalar_potential_difference
  from sympy.testing.pytest import raises
label_desc: Use image node_id 7 for calling a global function with example usage: test_scalar_potential_difference() without return types