def gaussian_conj(s_in, z_r_in, f):
 (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)

def gaussian_conj ( s_in , z_r_in , f ) : ( 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 )
conjugation relation for gaussian beams .