code: def gaussian_conj(s_in, z_r_in, f):
      """
      Conjugation relation for gaussian beams.
  
      Parameters
      ==========
  
      s_in :
          The distance to optical element from the waist.
      z_r_in :
          The rayleigh range of the incident beam.
      f :
          The focal length of the optical element.
  
      Returns
      =======
  
      a tuple containing (s_out, z_r_out, m)
      s_out :
          The distance between the new waist and the optical element.
      z_r_out :
          The rayleigh range of the emergent beam.
      m :
          The ration between the new and the old waists.
  
      Examples
      ========
  
      >>> from sympy.physics.optics import gaussian_conj
      >>> from sympy import symbols
      >>> s_in, z_r_in, f = symbols('s_in z_r_in f')
  
      >>> gaussian_conj(s_in, z_r_in, f)[0]
      1/(-1/(s_in + z_r_in**2/(-f + s_in)) + 1/f)
  
      >>> gaussian_conj(s_in, z_r_in, f)[1]
      z_r_in/(1 - s_in**2/f**2 + z_r_in**2/f**2)
  
      >>> gaussian_conj(s_in, z_r_in, f)[2]
      1/sqrt(1 - s_in**2/f**2 + z_r_in**2/f**2)
      """
      s_in, z_r_in, f = map(sympify, (s_in, z_r_in, f))
      s_out = 1 / (-1 / (s_in + z_r_in**2 / (s_in - f)) + 1 / f)
      m = 1 / sqrt((1 - (s_in / f) ** 2) + (z_r_in / f) ** 2)
      z_r_out = z_r_in / ((1 - (s_in / f) ** 2) + (z_r_in / f) ** 2)
      return (s_out, z_r_out, m)
  
imports: from sympy.core.expr import Expr
  from sympy.core.numbers import I, pi
  from sympy.core.sympify import sympify
  from sympy.functions.elementary.complexes import im, re
  from sympy.functions.elementary.miscellaneous import sqrt
  from sympy.functions.elementary.trigonometric import atan2
  from sympy.matrices.dense import Matrix, MutableDenseMatrix
  from sympy.polys.rationaltools import together
  from sympy.utilities.misc import filldedent
label_desc: Use image node_id 5 for calling a global function with example usage: gaussian_conj(s_in, z_r_in, f) and returns: s_out,  z_r_out,  m