code: def jones_2_stokes(e):
      """Return the Stokes vector for a Jones vector ``e``.
  
      Parameters
      ==========
  
      e : SymPy Matrix
          A Jones vector.
  
      Returns
      =======
  
      SymPy Matrix
          A Jones vector.
  
      Examples
      ========
  
      The axes on the Poincaré sphere.
  
      >>> from sympy import pprint, pi
      >>> from sympy.physics.optics.polarization import jones_vector
      >>> from sympy.physics.optics.polarization import jones_2_stokes
      >>> H = jones_vector(0, 0)
      >>> V = jones_vector(pi/2, 0)
      >>> D = jones_vector(pi/4, 0)
      >>> A = jones_vector(-pi/4, 0)
      >>> R = jones_vector(0, pi/4)
      >>> L = jones_vector(0, -pi/4)
      >>> pprint([jones_2_stokes(e) for e in [H, V, D, A, R, L]],
      ...         use_unicode=True)
      ⎡⎡1⎤  ⎡1 ⎤  ⎡1⎤  ⎡1 ⎤  ⎡1⎤  ⎡1 ⎤⎤
      ⎢⎢ ⎥  ⎢  ⎥  ⎢ ⎥  ⎢  ⎥  ⎢ ⎥  ⎢  ⎥⎥
      ⎢⎢1⎥  ⎢-1⎥  ⎢0⎥  ⎢0 ⎥  ⎢0⎥  ⎢0 ⎥⎥
      ⎢⎢ ⎥, ⎢  ⎥, ⎢ ⎥, ⎢  ⎥, ⎢ ⎥, ⎢  ⎥⎥
      ⎢⎢0⎥  ⎢0 ⎥  ⎢1⎥  ⎢-1⎥  ⎢0⎥  ⎢0 ⎥⎥
      ⎢⎢ ⎥  ⎢  ⎥  ⎢ ⎥  ⎢  ⎥  ⎢ ⎥  ⎢  ⎥⎥
      ⎣⎣0⎦  ⎣0 ⎦  ⎣0⎦  ⎣0 ⎦  ⎣1⎦  ⎣-1⎦⎦
  
      """
      ex, ey = e
      return Matrix(
          [
              Abs(ex) ** 2 + Abs(ey) ** 2,
              Abs(ex) ** 2 - Abs(ey) ** 2,
              2 * re(ex * ey.conjugate()),
              -2 * im(ex * ey.conjugate()),
          ]
      )
  
file_path: sympy/sympy/physics/optics/polarization.py
imports: from sympy.core.numbers import I, pi
  from sympy.functions.elementary.complexes import Abs, im, re
  from sympy.functions.elementary.exponential import exp
  from sympy.functions.elementary.miscellaneous import sqrt
  from sympy.functions.elementary.trigonometric import cos, sin
  from sympy.matrices.dense import Matrix
  from sympy.simplify.simplify import simplify
  from sympy.physics.quantum import TensorProduct
label_desc: Use image node_id 3 for calling a global function with example usage: jones_2_stokes(e) and returns: Matrix