+
    
þÎj¢Q  ã                   ó|  € R t . R#Ot^ R
IHt ^ RIHtHt ^ RIHt ^ RI	H
t
Ht ^ RIHt ^ RIHt ^ RIHtHt ^ RIHt ^ RIHt  ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R	]4      tR$R lt R t!R t"R t#]#t$R  t%R! t&R"# )%aÜ  
Gaussian optics.

The module implements:

- Ray transfer matrices for geometrical and gaussian optics.

  See RayTransferMatrix, GeometricRay and BeamParameter

- Conjugation relations for geometrical and gaussian optics.

  See geometric_conj*, gauss_conj and conjugate_gauss_beams

The conventions for the distances are as follows:

focal distance
    positive for convergent lenses
object distance
    positive for real objects
image distance
    positive for real images
ÚRayTransferMatrixÚ	FreeSpaceÚFlatRefractionÚCurvedRefractionÚ
FlatMirrorÚCurvedMirrorÚThinLensÚGeometricRayÚBeamParameter)ÚExpr)ÚIÚpi)Úsympify)ÚimÚre)Úsqrt)Úatan2)ÚMatrixÚMutableDenseMatrix)Útogether)Ú
filldedentc                   óp   a € ] tR t^;t o RtR tR t]R 4       t]R 4       t	]R 4       t
]R 4       tRtV tR	# )
r   aB  
Base class for a Ray Transfer Matrix.

It should be used if there is not already a more specific subclass mentioned
in See Also.

Parameters
==========

parameters :
    A, B, C and D or 2x2 matrix (Matrix(2, 2, [A, B, C, D]))

Examples
========

>>> from sympy.physics.optics import RayTransferMatrix, ThinLens
>>> from sympy import Symbol, Matrix

>>> mat = RayTransferMatrix(1, 2, 3, 4)
>>> mat
Matrix([
[1, 2],
[3, 4]])

>>> RayTransferMatrix(Matrix([[1, 2], [3, 4]]))
Matrix([
[1, 2],
[3, 4]])

>>> mat.A
1

>>> f = Symbol('f')
>>> lens = ThinLens(f)
>>> lens
Matrix([
[   1, 0],
[-1/f, 1]])

>>> lens.C
-1/f

See Also
========

GeometricRay, BeamParameter,
FreeSpace, FlatRefraction, CurvedRefraction,
FlatMirror, CurvedMirror, ThinLens

References
==========

.. [1] https://en.wikipedia.org/wiki/Ray_transfer_matrix_analysis
c                ó~  € \        V4      ^8X  d&   V^ ,          V^,          3V^,          V^,          33pMs\        V4      ^8X  d@   \        V^ ,          \        4      '       d#   V^ ,          P                  R8X  d   V^ ,          pM$\	        \        R\        V4      ,          4      4      h\        P                  ! W4      # )é   z`
                Expecting 2x2 Matrix or the 4 elements of
                the Matrix but got %s)é   r   ©ÚlenÚ
isinstancer   ÚshapeÚ
ValueErrorr   ÚstrÚ__new__©ÚclsÚargsÚtemps   &* ÚS/opt/data/home/.local/lib/python3.14/site-packages/sympy/physics/optics/gaussopt.pyr!   ÚRayTransferMatrix.__new__s   sœ   € äˆt‹9˜Œ>Ø˜!•W˜d 1�gÐ&¨¨a­°$°qµ'Ð(:Ð;‰DÜ�‹Y˜!Œ^Ü˜4 �7¤F×+Ò+Ø˜•G—M‘M VÔ+Ø˜•7‰DäœZð ))ä+.¨t«9õ)5ó 6ó 7ð 7ô �~Š~˜cÓ(Ð(ó    c           	     óX  € \        V\        4      '       d%   \        \        V 4      \        V4      ,          4      # \        V\        4      '       d%   \        \        V 4      \        V4      ,          4      # \        V\        4      '       dŒ   \        V 4      \        VP
                  3R34      ,          pV^ ,          V^,          ,          P                  RR7      p\	        VP                  \        \        V4      4      \        \        V4      4      R7      # \        P                  ! W4      # )é   T)Úcomplex)Úz_r©r*   )r   r   r   r	   r
   ÚqÚexpandÚwavelenr   r   r   Ú__mul__)ÚselfÚotherr%   r.   s   &&  r&   r1   ÚRayTransferMatrix.__mul__�   sÑ   € Ü�eÔ.×/Ò/Ü$¤V¨D£\´&¸³-Õ%?Ó@Ð@Ü˜œ|×,Ò,Ü¤ t£¬V°E«]Õ :Ó;Ð;Ü˜œ}×-Ò-Ü˜$“<¤¨¯©¨
°DÐ'9Ó :Õ:ˆDØ�a•˜˜a�•×(Ñ(°Ð(Ó6ˆAÜ  §¡Ü!)¬"¨Q«%£Ü%-¬b°«e£_ô6ð 6ô —>’> $Ó.Ð.r(   c                ó   € V R,          # )zŸ
The A parameter of the Matrix.

Examples
========

>>> from sympy.physics.optics import RayTransferMatrix
>>> mat = RayTransferMatrix(1, 2, 3, 4)
>>> mat.A
1
)é    r6   © ©r2   s   &r&   ÚAÚRayTransferMatrix.A�   ó   € ð �D�zÐr(   c                ó   € V R,          # )zŸ
The B parameter of the Matrix.

Examples
========

>>> from sympy.physics.optics import RayTransferMatrix
>>> mat = RayTransferMatrix(1, 2, 3, 4)
>>> mat.B
2
)r6   r*   r7   r8   s   &r&   ÚBÚRayTransferMatrix.Bž   r;   r(   c                ó   € V R,          # )zŸ
The C parameter of the Matrix.

Examples
========

>>> from sympy.physics.optics import RayTransferMatrix
>>> mat = RayTransferMatrix(1, 2, 3, 4)
>>> mat.C
3
)r*   r6   r7   r8   s   &r&   ÚCÚRayTransferMatrix.C­   r;   r(   c                ó   € V R,          # )zŸ
The D parameter of the Matrix.

Examples
========

>>> from sympy.physics.optics import RayTransferMatrix
>>> mat = RayTransferMatrix(1, 2, 3, 4)
>>> mat.D
4
)r*   r*   r7   r8   s   &r&   ÚDÚRayTransferMatrix.D¼   r;   r(   r7   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r!   r1   Úpropertyr9   r=   r@   rC   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r&   r   r   ;   se   ø‡ € ñ5òn)ò/ð ñó ðð ñó ðð ñó ðð ñó ör(   c                   ó*   a € ] tR t^Ìt o RtR tRtV tR# )r   a  
Ray Transfer Matrix for free space.

Parameters
==========

distance

See Also
========

RayTransferMatrix

Examples
========

>>> from sympy.physics.optics import FreeSpace
>>> from sympy import symbols
>>> d = symbols('d')
>>> FreeSpace(d)
Matrix([
[1, d],
[0, 1]])
c                ó4   € \         P                  V ^V^ ^4      # r-   ©r   r!   )r#   Úds   &&r&   r!   ÚFreeSpace.__new__å   ó   € Ü ×(Ñ(¨¨a°°A°qÓ9Ð9r(   r7   N©rE   rF   rG   rH   rI   r!   rK   rL   rM   s   @r&   r   r   Ì   s   ø‡ € ñ÷0:ð :r(   c                   ó*   a € ] tR t^ét o RtR tRtV tR# )r   ax  
Ray Transfer Matrix for refraction.

Parameters
==========

n1 :
    Refractive index of one medium.
n2 :
    Refractive index of other medium.

See Also
========

RayTransferMatrix

Examples
========

>>> from sympy.physics.optics import FlatRefraction
>>> from sympy import symbols
>>> n1, n2 = symbols('n1 n2')
>>> FlatRefraction(n1, n2)
Matrix([
[1,     0],
[0, n1/n2]])
c                óf   € \        \        W34      w  r\        P                  V ^^ ^ W,          4      # r-   ©Úmapr   r   r!   )r#   Ún1Ún2s   &&&r&   r!   ÚFlatRefraction.__new__  s-   € Ü”W˜r˜hÓ'‰ˆÜ ×(Ñ(¨¨a°°A°rµuÓ=Ð=r(   r7   NrU   rM   s   @r&   r   r   é   s   ø‡ € ñ÷6>ð >r(   c                   ó*   a € ] tR tRt o RtR tRtV tR# )r   i
  aê  
Ray Transfer Matrix for refraction on curved interface.

Parameters
==========

R :
    Radius of curvature (positive for concave).
n1 :
    Refractive index of one medium.
n2 :
    Refractive index of other medium.

See Also
========

RayTransferMatrix

Examples
========

>>> from sympy.physics.optics import CurvedRefraction
>>> from sympy import symbols
>>> R, n1, n2 = symbols('R n1 n2')
>>> CurvedRefraction(R, n1, n2)
Matrix([
[               1,     0],
[(n1 - n2)/(R*n2), n1/n2]])
c                ó’   € \        \        WV34      w  rp\        P                  V ^^ W#,
          V,          V,          W#,          4      # r-   rX   )r#   ÚRrZ   r[   s   &&&&r&   r!   ÚCurvedRefraction.__new__(  s;   € Üœ !¨ Ó-‰	ˆˆrÜ ×(Ñ(¨¨a°°RµW¸aµKÀµNÀBÅEÓJÐJr(   r7   NrU   rM   s   @r&   r   r   
  s   ø‡ € ñ÷:Kð Kr(   c                   ó*   a € ] tR tRt o RtR tRtV tR# )r   i-  zº
Ray Transfer Matrix for reflection.

See Also
========

RayTransferMatrix

Examples
========

>>> from sympy.physics.optics import FlatMirror
>>> FlatMirror()
Matrix([
[1, 0],
[0, 1]])
c                ó4   € \         P                  V ^^ ^ ^4      # r-   rQ   )r#   s   &r&   r!   ÚFlatMirror.__new__?  rT   r(   r7   NrU   rM   s   @r&   r   r   -  s   ø‡ € ñ÷":ð :r(   c                   ó*   a € ] tR tRt o RtR tRtV tR# )r   iC  aS  
Ray Transfer Matrix for reflection from curved surface.

Parameters
==========

R : radius of curvature (positive for concave)

See Also
========

RayTransferMatrix

Examples
========

>>> from sympy.physics.optics import CurvedMirror
>>> from sympy import symbols
>>> R = symbols('R')
>>> CurvedMirror(R)
Matrix([
[   1, 0],
[-2/R, 1]])
c                óX   € \        V4      p\        P                  V ^^ RV,          ^4      # )r*   éþÿÿÿ©r   r   r!   )r#   r_   s   &&r&   r!   ÚCurvedMirror.__new__\  ó(   € Ü�A‹JˆÜ ×(Ñ(¨¨a°°B°qµD¸!Ó<Ð<r(   r7   NrU   rM   s   @r&   r   r   C  s   ø‡ € ñ÷0=ð =r(   c                   ó*   a € ] tR tRt o RtR tRtV tR# )r   ia  a%  
Ray Transfer Matrix for a thin lens.

Parameters
==========

f :
    The focal distance.

See Also
========

RayTransferMatrix

Examples
========

>>> from sympy.physics.optics import ThinLens
>>> from sympy import symbols
>>> f = symbols('f')
>>> ThinLens(f)
Matrix([
[   1, 0],
[-1/f, 1]])
c                óX   € \        V4      p\        P                  V ^^ RV,          ^4      # )r*   éÿÿÿÿrg   )r#   Úfs   &&r&   r!   ÚThinLens.__new__{  ri   r(   r7   NrU   rM   s   @r&   r   r   a  s   ø‡ € ñ÷2=ð =r(   c                   óJ   a € ] tR tRt o RtR t]R 4       t]R 4       tRt	V t
R# )r	   i„  aV  
Representation for a geometric ray in the Ray Transfer Matrix formalism.

Parameters
==========

h : height, and
angle : angle, or
matrix : a 2x1 matrix (Matrix(2, 1, [height, angle]))

Examples
========

>>> from sympy.physics.optics import GeometricRay, FreeSpace
>>> from sympy import symbols, Matrix
>>> d, h, angle = symbols('d, h, angle')

>>> GeometricRay(h, angle)
Matrix([
[    h],
[angle]])

>>> FreeSpace(d)*GeometricRay(h, angle)
Matrix([
[angle*d + h],
[      angle]])

>>> GeometricRay( Matrix( ((h,), (angle,)) ) )
Matrix([
[    h],
[angle]])

See Also
========

RayTransferMatrix

c                ó^  € \        V4      ^8X  d@   \        V^ ,          \        4      '       d#   V^ ,          P                  R8X  d   V^ ,          pMI\        V4      ^8X  d   V^ ,          3V^,          33pM$\	        \        R\        V4      ,          4      4      h\        P                  ! W4      # )r*   z`
                Expecting 2x1 Matrix or the 2 elements of
                the Matrix but got %s)r   r*   r   r"   s   &* r&   r!   ÚGeometricRay.__new__¬  s�   € Üˆt‹9˜Œ>œj¨¨a­´&×9Ò9Ø˜•G—M‘M VÔ+Ø˜•7‰DÜ�‹Y˜!Œ^Ø˜!•W�J  a¥ 
Ð+‰DäœZð ))ä+.¨t«9õ)5ó 6ó 7ð 7ô �~Š~˜cÓ(Ð(r(   c                ó   € V ^ ,          # )zà
The distance from the optical axis.

Examples
========

>>> from sympy.physics.optics import GeometricRay
>>> from sympy import symbols
>>> h, angle = symbols('h, angle')
>>> gRay = GeometricRay(h, angle)
>>> gRay.height
h
r7   r8   s   &r&   ÚheightÚGeometricRay.height¸  ó   € ð �A�wˆr(   c                ó   € V ^,          # )zà
The angle with the optical axis.

Examples
========

>>> from sympy.physics.optics import GeometricRay
>>> from sympy import symbols
>>> h, angle = symbols('h, angle')
>>> gRay = GeometricRay(h, angle)
>>> gRay.angle
angle
r7   r8   s   &r&   ÚangleÚGeometricRay.angleÉ  ru   r(   r7   N)rE   rF   rG   rH   rI   r!   rJ   rs   rw   rK   rL   rM   s   @r&   r	   r	   „  s8   ø‡ € ñ%òN
)ð ñó ðð  ñó ör(   c                   óÞ   a € ] tR tRt o RtRR lt]R 4       t]R 4       t]R 4       t	]R 4       t
]R	 4       t]R
 4       t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       tRtV tR# )r
   iß  a&  
Representation for a gaussian ray in the Ray Transfer Matrix formalism.

Parameters
==========

wavelen : the wavelength,
z : the distance to waist, and
w : the waist, or
z_r : the rayleigh range.
n : the refractive index of medium.

Examples
========

>>> from sympy.physics.optics import BeamParameter
>>> p = BeamParameter(530e-9, 1, w=1e-3)
>>> p.q
1 + 1.88679245283019*I*pi

>>> p.q.n()
1.0 + 5.92753330865999*I
>>> p.w_0.n()
0.00100000000000000
>>> p.z_r.n()
5.92753330865999

>>> from sympy.physics.optics import FreeSpace
>>> fs = FreeSpace(10)
>>> p1 = fs*p
>>> p.w.n()
0.00101413072159615
>>> p1.w.n()
0.00210803120913829

See Also
========

RayTransferMatrix

References
==========

.. [1] https://en.wikipedia.org/wiki/Complex_beam_parameter
.. [2] https://en.wikipedia.org/wiki/Gaussian_beam
Nc                óþ   € \        V4      p\        V4      p\        V4      pVe   Vf   \        V4      pM1Ve   Vf   \        \        V4      W4      pMVf   Vf   \        R4      h\        P                  ! WW#V4      # )NzMust specify one of w and z_r.)r   Úwaist2rayleighr   r   r!   )r#   r0   Úzr,   ÚwÚns   &&&&&&r&   r!   ÚBeamParameter.__new__  sq   € Ü˜'Ó"ˆÜ�A‹JˆÜ�A‹JˆàŠ?˜qšyÜ˜#“,‰CØŠ]˜sš{Ü ¤¨£¨WÓ8‰CØŠ[˜QšYÜÐ=Ó>Ð>ä�|Š|˜C¨!°!Ó4Ð4r(   c                ó(   € V P                   ^ ,          # )r6   ©r$   r8   s   &r&   r0   ÚBeamParameter.wavelen   ó   € à�y‰y˜�|Ðr(   c                ó(   € V P                   ^,          # r-   r�   r8   s   &r&   r|   ÚBeamParameter.z$  rƒ   r(   c                ó(   € V P                   ^,          # )r   r�   r8   s   &r&   r,   ÚBeamParameter.z_r(  rƒ   r(   c                ó(   € V P                   ^,          # )é   r�   r8   s   &r&   r~   ÚBeamParameter.n,  rƒ   r(   c                óR   € V P                   \        V P                  ,          ,           # )zÀ
The complex parameter representing the beam.

Examples
========

>>> from sympy.physics.optics import BeamParameter
>>> p = BeamParameter(530e-9, 1, w=1e-3)
>>> p.q
1 + 1.88679245283019*I*pi
)r|   r   r,   r8   s   &r&   r.   ÚBeamParameter.q0  s   € ð �v‰vœ˜$Ÿ(™(�
Õ"Ð"r(   c                óz   € V P                   ^V P                  V P                   ,          ^,          ,           ,          # )zÅ
The radius of curvature of the phase front.

Examples
========

>>> from sympy.physics.optics import BeamParameter
>>> p = BeamParameter(530e-9, 1, w=1e-3)
>>> p.radius
1 + 3.55998576005696*pi**2
)r|   r,   r8   s   &r&   ÚradiusÚBeamParameter.radius?  s)   € ð �v‰v�q˜DŸH™H T§V¡V�O¨aÕ/Õ/Õ0Ð0r(   c                óŒ   € V P                   \        ^V P                  V P                  ,          ^,          ,           4      ,          # )aC  
The radius of the beam w(z), at any position z along the beam.
The beam radius at `1/e^2` intensity (axial value).

See Also
========

w_0 :
    The minimal radius of beam.

Examples
========

>>> from sympy.physics.optics import BeamParameter
>>> p = BeamParameter(530e-9, 1, w=1e-3)
>>> p.w
0.001*sqrt(0.2809/pi**2 + 1)
)Úw_0r   r|   r,   r8   s   &r&   r}   ÚBeamParameter.wN  s.   € ð( �x‰xœ˜Q $§&¡&¨¯©¥/°AÕ!5Õ5Ó6Õ6Ð6r(   c                ó†   € \        V P                  \        V P                  ,          ,          V P                  ,          4      # )a  
 The minimal radius of beam at `1/e^2` intensity (peak value).

See Also
========

w : the beam radius at `1/e^2` intensity (axial value).

Examples
========

>>> from sympy.physics.optics import BeamParameter
>>> p = BeamParameter(530e-9, 1, w=1e-3)
>>> p.w_0
0.00100000000000000
)r   r,   r   r~   r0   r8   s   &r&   r‘   ÚBeamParameter.w_0d  s)   € ô$ �D—H‘Hœb §¡�iÕ(¨¯©Õ5Ó6Ð6r(   c                óR   € V P                   \        ,          V P                  ,          # )z¯
Half of the total angular spread.

Examples
========

>>> from sympy.physics.optics import BeamParameter
>>> p = BeamParameter(530e-9, 1, w=1e-3)
>>> p.divergence
0.00053/pi
)r0   r   r‘   r8   s   &r&   Ú
divergenceÚBeamParameter.divergencex  s   € ð �|‰|œB�˜tŸx™xÕ'Ð'r(   c                óB   € \        V P                  V P                  4      # )zš
The Gouy phase.

Examples
========

>>> from sympy.physics.optics import BeamParameter
>>> p = BeamParameter(530e-9, 1, w=1e-3)
>>> p.gouy
atan(0.53/pi)
)r   r|   r,   r8   s   &r&   ÚgouyÚBeamParameter.gouy‡  s   € ô �T—V‘V˜TŸX™XÓ&Ð&r(   c                ó>   € ^V P                   ,          \        ,          # )as  
The minimal waist for which the gauss beam approximation is valid.

Explanation
===========

The gauss beam is a solution to the paraxial equation. For curvatures
that are too great it is not a valid approximation.

Examples
========

>>> from sympy.physics.optics import BeamParameter
>>> p = BeamParameter(530e-9, 1, w=1e-3)
>>> p.waist_approximation_limit
1.06e-6/pi
)r0   r   r8   s   &r&   Úwaist_approximation_limitÚ'BeamParameter.waist_approximation_limit–  s   € ð& �—‘�~œbÕ Ð r(   r7   )NNr*   )rE   rF   rG   rH   rI   r!   rJ   r0   r|   r,   r~   r.   rŽ   r}   r‘   r–   r™   rœ   rK   rL   rM   s   @r&   r
   r
   ß  sì   ø‡ € ñ-ôd5ð ñó ðð ñó ðð ñó ðð ñó ðð ñ#ó ð#ð ñ1ó ð1ð ñ7ó ð7ð* ñ7ó ð7ð& ñ(ó ð(ð ñ'ó ð'ð ñ!ó ö!r(   c                ól   € \        \        W34      w  rV ^,          V,          \        ,          V,          # )a.  
Calculate the rayleigh range from the waist of a gaussian beam.

See Also
========

rayleigh2waist, BeamParameter

Examples
========

>>> from sympy.physics.optics import waist2rayleigh
>>> from sympy import symbols
>>> w, wavelen = symbols('w wavelen')
>>> waist2rayleigh(w, wavelen)
pi*w**2/wavelen
)rY   r   r   )r}   r0   r~   s   &&&r&   r{   r{   °  s+   € ô$ ”W˜q˜lÓ+�J€AØˆa�4��6”"�9�WÕÐr(   c                ób   € \        \        W34      w  r\        V \        ,          V,          4      # )a>  Calculate the waist from the rayleigh range of a gaussian beam.

See Also
========

waist2rayleigh, BeamParameter

Examples
========

>>> from sympy.physics.optics import rayleigh2waist
>>> from sympy import symbols
>>> z_r, wavelen = symbols('z_r wavelen')
>>> rayleigh2waist(z_r, wavelen)
sqrt(wavelen*z_r)/sqrt(pi)
)rY   r   r   r   )r,   r0   s   &&r&   Úrayleigh2waistr    Æ  s'   € ô" ”w  Ó/�L€CÜ�”B•�w•ÓÐr(   c                óÆ   € \        \        W34      w  rV P                  '       g   VP                  '       d   VP                  '       d   V # T# W,          W,           ,          # )a—  
Conjugation relation for geometrical beams under paraxial conditions.

Explanation
===========

Takes the distances to the optical element and returns the needed
focal distance.

See Also
========

geometric_conj_af, geometric_conj_bf

Examples
========

>>> from sympy.physics.optics import geometric_conj_ab
>>> from sympy import symbols
>>> a, b = symbols('a b')
>>> geometric_conj_ab(a, b)
a*b/(a + b)
)rY   r   Úis_infinite)ÚaÚbs   &&r&   Úgeometric_conj_abr¥   Û  sF   € ô0 Œw˜˜Ó�D€AØ‡}‡}€}˜ŸŸ˜Ø—M—M�MˆqÐ( qÐ(à�s�A•E�{Ðr(   c                óB   € \        \        W34      w  r\        W) 4      ) # )aE  
Conjugation relation for geometrical beams under paraxial conditions.

Explanation
===========

Takes the object distance (for geometric_conj_af) or the image distance
(for geometric_conj_bf) to the optical element and the focal distance.
Then it returns the other distance needed for conjugation.

See Also
========

geometric_conj_ab

Examples
========

>>> from sympy.physics.optics.gaussopt import geometric_conj_af, geometric_conj_bf
>>> from sympy import symbols
>>> a, b, f = symbols('a b f')
>>> geometric_conj_af(a, f)
a*f/(a - f)
>>> geometric_conj_bf(b, f)
b*f/(b - f)
)rY   r   r¥   )r£   rm   s   &&r&   Úgeometric_conj_afr§   ú  s$   € ô6 Œw˜˜Ó�D€AÜ˜a Ó$Ð$Ð$r(   c                óz  € \        \        WV34      w  rp^RW^,          W,
          ,          ,           ,          ^V,          ,           ,          p^\        ^W,          ^,          ,
          W,          ^,          ,           4      ,          pV^W,          ^,          ,
          W,          ^,          ,           ,          pW5V3# )a]  
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)
rl   )rY   r   r   )Ús_inÚz_r_inrm   Ús_outÚmÚz_r_outs   &&&   r&   Úgaussian_conjr®     sŽ   € ôR œ' D°!Ð#4Ó5�O€D�!Ø�"�d Q�Y¨­Õ1Õ1Õ2°Q°qµSÕ8Õ:€EØ	Œ$��T•V˜a•K• F¥H¨q¥=Õ0Ó
1Õ1€AØ˜˜d�f q�[�¨V­X¸­MÕ9Õ:€GØ˜AÐÐr(   c                ó  € \        \        WV34      w  rpW!,          p\        W4      p\        V4      ^8w  d   \	        R4      hRV9   d   \        \        R4      4      hRV9   dj   \        VR,          4      pV^\        ^V^,          ,          V^,          V^,          ,          ,
          4      ,
          ,          p\        WuV4      ^ ,          pM/RV9   d   \        \        R4      4      h\	        \        R4      4      hWxV3# )aš  
Find the optical setup conjugating the object/image waists.

Parameters
==========

wavelen :
    The wavelength of the beam.
waist_in and waist_out :
    The waists to be conjugated.
f :
    The focal distance of the element used in the conjugation.

Returns
=======

a tuple containing (s_in, s_out, f)
s_in :
    The distance before the optical element.
s_out :
    The distance after the optical element.
f :
    The focal distance of the optical element.

Examples
========

>>> from sympy.physics.optics import conjugate_gauss_beams
>>> from sympy import symbols, factor
>>> l, w_i, w_o, f = symbols('l w_i w_o f')

>>> conjugate_gauss_beams(l, w_i, w_o, f=f)[0]
f*(1 - sqrt(w_i**2/w_o**2 - pi**2*w_i**4/(f**2*l**2)))

>>> factor(conjugate_gauss_beams(l, w_i, w_o, f=f)[1])
f*w_o**2*(w_i**2/w_o**2 - sqrt(w_i**2/w_o**2 -
          pi**2*w_i**4/(f**2*l**2)))/w_i**2

>>> conjugate_gauss_beams(l, w_i, w_o, f=f)[2]
f
z,The function expects only one named argumentÚdistzD
            Currently only focal length is supported as a parameterrm   r©   zG
            The functions expects the focal length as a named argument)	rY   r   r{   r   r   ÚNotImplementedErrorr   r   r®   )	r0   Úwaist_inÚ	waist_outÚkwargsr¬   r|   rm   r©   r«   s	   &&&,     r&   Úconjugate_gauss_beamsrµ   K  s  € ôV $'¤w°ÀIÐ0NÓ#OÑ €G�yØÕ€AÜ�xÓ)€AÜ
ˆ6ƒ{�aÔÜÐGÓHÐHØ	�6Ô	Ü!¤*ð .Gó #Hó Ið 	Ià	�ŒÜ�F˜3•KÓ ˆØ�Aœ˜Q˜q !�t�V a¨¥d¨1¨a­4¥iÕ/Ó0Õ0Õ1ˆÜ˜d qÓ)¨!Õ,‰Ø	�6Ô	Ü!¤*ð .Gó #Hó Ið 	Iô œð %Jó Kó Lð 	Là˜ÐÐr(   N)r   r   r   r   r   r   r   r	   r
   r{   r    r¥   r§   Úgeometric_conj_bfr®   rµ   r-   )'rI   Ú__all__Úsympy.core.exprr   Úsympy.core.numbersr   r   Úsympy.core.sympifyr   Ú$sympy.functions.elementary.complexesr   r   Ú(sympy.functions.elementary.miscellaneousr   Ú(sympy.functions.elementary.trigonometricr   Úsympy.matrices.denser   r   Úsympy.polys.rationaltoolsr   Úsympy.utilities.miscr   r   r   r   r   r   r   r   r	   r
   r{   r    r¥   r§   r¶   r®   rµ   r7   r(   r&   Ú<module>rÁ      s×   ðñò.€õ( !ß &Ý &ß 9Ý 9Ý :ß ;Ý .Ý +ôNÐ*ô Nôb:Ð!ô :ô:>Ð&ô >ôB KÐ(ô  KôF:Ð"ô :ô,=Ð$ô =ô<=Ð ô =ôFTÐ%ô TôvJ!�Dô J!ôbò, ò*ò>%ð< &Ð ò-ô`=r(   