Gaussian Optics

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
class sympy.physics.gaussopt.BeamParameter[source]

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

References

[1] http://en.wikipedia.org/wiki/Complex_beam_parameter

Examples

>>> from sympy.physics.gaussopt 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.gaussopt import FreeSpace
>>> fs = FreeSpace(10)
>>> p1 = fs*p
>>> p.w.n()
0.00101413072159615
>>> p1.w.n()
0.00210803120913829
divergence[source]

Half of the total angular spread.

Examples

>>> from sympy.physics.gaussopt import BeamParameter
>>> p = BeamParameter(530e-9, 1, w=1e-3)
>>> p.divergence
0.00053/pi
gouy[source]

The Gouy phase.

Examples

>>> from sympy.physics.gaussopt import BeamParameter
>>> p = BeamParameter(530e-9, 1, w=1e-3)
>>> p.gouy
atan(0.53/pi)
q[source]

The complex parameter representing the beam.

Examples

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

The radius of curvature of the phase front.

Examples

>>> from sympy.physics.gaussopt import BeamParameter
>>> p = BeamParameter(530e-9, 1, w=1e-3)
>>> p.radius
0.2809/pi**2 + 1
w[source]

The beam radius at \(1/e^2\) intensity.

See also

w_0
the minimal radius of beam

Examples

>>> from sympy.physics.gaussopt import BeamParameter
>>> p = BeamParameter(530e-9, 1, w=1e-3)
>>> p.w
0.001*sqrt(0.2809/pi**2 + 1)
w_0[source]

The beam waist (minimal radius).

See also

w
the beam radius at \(1/e^2\) intensity

Examples

>>> from sympy.physics.gaussopt import BeamParameter
>>> p = BeamParameter(530e-9, 1, w=1e-3)
>>> p.w_0
0.00100000000000000
waist_approximation_limit[source]

The minimal waist for which the gauss beam approximation is valid.

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.gaussopt import BeamParameter
>>> p = BeamParameter(530e-9, 1, w=1e-3)
>>> p.waist_approximation_limit
1.06e-6/pi
class sympy.physics.gaussopt.CurvedMirror[source]

Ray Transfer Matrix for reflection from curved surface.

Parameters :R : radius of curvature (positive for concave)

Examples

>>> from sympy.physics.gaussopt import CurvedMirror
>>> from sympy import symbols
>>> R = symbols('R')
>>> CurvedMirror(R)
[   1, 0]
[-2/R, 1]
class sympy.physics.gaussopt.CurvedRefraction[source]

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

Examples

>>> from sympy.physics.gaussopt import CurvedRefraction
>>> from sympy import symbols
>>> R, n1, n2 = symbols('R n1 n2')
>>> CurvedRefraction(R, n1, n2)
[               1,     0]
[(n1 - n2)/(R*n2), n1/n2]
class sympy.physics.gaussopt.FlatMirror[source]

Ray Transfer Matrix for reflection.

Examples

>>> from sympy.physics.gaussopt import FlatMirror
>>> FlatMirror()
[1, 0]
[0, 1]
class sympy.physics.gaussopt.FlatRefraction[source]

Ray Transfer Matrix for refraction.

Parameters :

n1 : refractive index of one medium

n2 : refractive index of other medium

Examples

>>> from sympy.physics.gaussopt import FlatRefraction
>>> from sympy import symbols
>>> n1, n2 = symbols('n1 n2')
>>> FlatRefraction(n1, n2)
[1,     0]
[0, n1/n2]
class sympy.physics.gaussopt.FreeSpace[source]

Ray Transfer Matrix for free space.

Parameters :distance :

Examples

>>> from sympy.physics.gaussopt import FreeSpace
>>> from sympy import symbols
>>> d = symbols('d')
>>> FreeSpace(d)
[1, d]
[0, 1]
class sympy.physics.gaussopt.GeometricRay[source]

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.gaussopt import GeometricRay, FreeSpace :

>>> from sympy import symbols, Matrix :

>>> d, h, angle = symbols(‘d, h, angle’) :

>>> GeometricRay(h, angle) :

[ h] :

[angle] :

>>> FreeSpace(d)*GeometricRay(h, angle) :

[angle*d + h] :

[ angle] :

>>> GeometricRay( Matrix( ((h,), (angle,)) ) ) :

[ h] :

[angle] :

angle[source]

The angle with the optical axis.

Examples

>>> from sympy.physics.gaussopt import GeometricRay
>>> from sympy import symbols
>>> h, angle = symbols('h, angle')
>>> gRay = GeometricRay(h, angle)
>>> gRay.angle
angle
height[source]

The distance from the optical axis.

Examples

>>> from sympy.physics.gaussopt import GeometricRay
>>> from sympy import symbols
>>> h, angle = symbols('h, angle')
>>> gRay = GeometricRay(h, angle)
>>> gRay.height
h
class sympy.physics.gaussopt.RayTransferMatrix[source]

Base class for a Ray Transfer Matrix.

It should be used if there isn’t 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]))

References

[1] http://en.wikipedia.org/wiki/Ray_transfer_matrix_analysis

Examples

>>> from sympy.physics.gaussopt import RayTransferMatrix, ThinLens
>>> from sympy import Symbol, Matrix
>>> mat = RayTransferMatrix(1, 2, 3, 4)
>>> mat
[1,  2]
[3,  4]
>>> RayTransferMatrix(Matrix([[1, 2], [3, 4]]))
[1,  2]
[3,  4]
>>> mat.A
1
>>> f = Symbol('f')
>>> lens = ThinLens(f)
>>> lens
[   1, 0]
[-1/f, 1]
>>> lens.C
-1/f
A[source]

The A parameter of the Matrix.

Examples

>>> from sympy.physics.gaussopt import RayTransferMatrix
>>> mat = RayTransferMatrix(1, 2, 3, 4)
>>> mat.A
1
B[source]

The B parameter of the Matrix.

Examples

>>> from sympy.physics.gaussopt import RayTransferMatrix
>>> mat = RayTransferMatrix(1, 2, 3, 4)
>>> mat.B
2
C[source]

The C parameter of the Matrix.

Examples

>>> from sympy.physics.gaussopt import RayTransferMatrix
>>> mat = RayTransferMatrix(1, 2, 3, 4)
>>> mat.C
3
D[source]

The D parameter of the Matrix.

Examples

>>> from sympy.physics.gaussopt import RayTransferMatrix
>>> mat = RayTransferMatrix(1, 2, 3, 4)
>>> mat.D
4
class sympy.physics.gaussopt.ThinLens[source]

Ray Transfer Matrix for a thin lens.

Parameters :f : the focal distance

Examples

>>> from sympy.physics.gaussopt import ThinLens
>>> from sympy import symbols
>>> f = symbols('f')
>>> ThinLens(f)
[   1, 0]
[-1/f, 1]
sympy.physics.gaussopt.conjugate_gauss_beams(wavelen, waist_in, waist_out, **kwargs)[source]

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.gaussopt 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*(-sqrt(w_i**2/w_o**2 - pi**2*w_i**4/(f**2*l**2)) + 1)
>>> 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
sympy.physics.gaussopt.gaussian_conj(s_in, z_r_in, f)[source]

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.gaussopt 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)
sympy.physics.gaussopt.geometric_conj_ab(a, b)[source]

Conjugation relation for geometrical beams under paraxial conditions.

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

Examples

>>> from sympy.physics.gaussopt import geometric_conj_ab
>>> from sympy import symbols
>>> a, b = symbols('a b')
>>> geometric_conj_ab(a, b)
a*b/(a + b)
sympy.physics.gaussopt.geometric_conj_af(a, f)[source]

Conjugation relation for geometrical beams under paraxial conditions.

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.

Examples

>>> from sympy.physics.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)
sympy.physics.gaussopt.geometric_conj_bf(a, f)

Conjugation relation for geometrical beams under paraxial conditions.

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.

Examples

>>> from sympy.physics.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)
sympy.physics.gaussopt.rayleigh2waist(z_r, wavelen)[source]

Calculate the waist from the rayleigh range of a gaussian beam.

Examples

>>> from sympy.physics.gaussopt import rayleigh2waist
>>> from sympy import symbols
>>> z_r, wavelen = symbols('z_r wavelen')
>>> rayleigh2waist(z_r, wavelen)
sqrt(wavelen*z_r)/sqrt(pi)
sympy.physics.gaussopt.waist2rayleigh(w, wavelen)[source]

Calculate the rayleigh range from the waist of a gaussian beam.

Examples

>>> from sympy.physics.gaussopt import waist2rayleigh
>>> from sympy import symbols
>>> w, wavelen = symbols('w wavelen')
>>> waist2rayleigh(w, wavelen)
pi*w**2/wavelen

Previous topic

Physics Module

Next topic

Hydrogen Wavefunctions

This Page