<<

ZernikePolynomialsForTheWeb.nb James C. Wyant, 2003 1

Zernike

1 Introduction

Often, to aid in the interpretation of optical test results it is convenient to express wavefront data in form. Zernike polynomials are often used for this purpose since they are made up of terms that are of the same form as the types of aberrations often observed in optical tests (Zernike, 1934). This is not to say that Zernike polynomials are the best polynomials for fitting test data. Sometimes Zernike polynomials give a poor representation of the wavefront data. For example, Zernikes have little value when air turbulence is present. Likewise, fabrication errors in the single point diamond turning process cannot be represented using a reasonable number of terms in the Zernike polynomial. In the testing of conical optical elements, additional terms must be added to Zernike polynomials to accurately represent alignment errors. The blind use of Zernike polynomials to represent test results can lead to disastrous results.

Zernike polynomials are one of an infinite number of complete sets of polynomials in two variables, r and q, that are orthogonal in a continuous fashion over the interior of a unit circle. It is important to note that the Zernikes are orthogonal only in a continuous fashion over the interior of a unit circle, and in general they will not be orthogonal over a discrete set of data points within a unit circle.

Zernike polynomials have three properties that distinguish them from other sets of . First, they have simple rotational symmetry properties that lead to a polynomial product of the form r ρ g θ , where g[q] is a continuous function that repeats self every 2p radians and satisfies the requirement that rotating the coordinate system by an a does not change the form of the polynomial. That is g θ+α = g θ g α . @ D @ D The set of trigonometric functions g θ =±m θ, where m is any@ positiveD integer@ orD zero,@ meetsD these requirements. The second property of Zernike polynomials is that the radial function must be a polynomial in r of degree 2n and contain no power of r less than m. The third property is that r[r] must be even if m is even, and odd if m is odd. @ D The radial polynomials can be derived as a special case of Jacobi polynomials, and tabulated as r n, m, r . Their and normalization properties are given by 1 1 r n, m, ρ r n', m, ρ ρ ρ = KroneckerDelta@ Dn − n' 0 2 n + 1 and

@ D @ D @ D ‡ H L ZernikePolynomialsForTheWeb.nb James C. Wyant, 2003 2

r n, m,1= 1. As stated above, r[n, m, r] is a polynomial of order 2n and it can be written as

n−m 2 n − m − s ! r @n_, m_,Dρ_ := −1 s ρ2 n−s −m s=0 s! n − s ! n − m − s ! H L In practice, the radial polynomials are combined withH sines and cosinesL rather than with a complex exponential. It is convenient to write @ D ‚ H L H L H L rcos n_, m_, ρ_ := r n, m, ρ Cos m θ and

rsin@n_, m_, ρ_D := r@n, m, ρD Sin@m θD The final Zernike polynomial series for the wavefront opd Dw can be written as

@ D nmax@ D @ D ¯¯¯¯¯ n ∆w ρ_, θ_ :=∆w + a n r n, 0, ρ + b n, m rcos n, m, ρ + c n, m rsin n, m, ρ m=1 n=1 where Dw[r, q] is the mean wavefront opd,ji and a[n], b[n,m], and c[n,m] are individual polynomial coefficients. For a symmetricalzy optical system, the wave aberrations @ D j @ D @ D ‚ H @ D @ D @ D @ DLz are symmetrical about the tangential„ planej and only even functions of q are allowed. In general, however, the wavefront is not symmetric,z and both sets of trigonometric k { terms are included.

2 Calculating Zernikes

For the example below the degree of the Zernike polynomials is selected to be 6. The value of nDegree can be changed if a different degree is desired.

The array zernikePolar contains Zernike polynomials in polar coordinates (r, q), while the array zernikeXy contains the Zernike polynomials in Cartesian, (x, y), coordinates. zernikePolarList and zernikeXyList contains the Zernike number in column 1, the n and m values in columns 2 and 3, and the Zernike polynomial in column 4.

nDegree = 6;

i = 0; Do If m == 0, i = i + 1, temp i = i − 1, n, m, r n, m, ρ , i = i + 1, temp i = i − 1, n, m, Factor rcos n, m, ρ , i = i + 1, temp i = i − 1, n, m, Factor rsin n, m, ρ , n, 0, nDegree , m, n, 0, −1 ; @ @ 8 @ D 8 @ D<< 8 @ D 8 @ @ DD< @ D 8 @ @ DD<

zernikePolarList = Array temp, i ; Clear temp ; Do zernikePolar i − 1 = zernikePolarList i, 4 , i, 1, Length zernikePolarList ; @ D @ D x y 2 2 zernikeXyList@ = @Map TrigExpand,D zernikePolarList@@ DD 8. ρ→ x + y@ , Cos θ → D

@ @ D @@ DD 8 @ D

In the tables term # 1 is a constant or term, while terms # 2 and # 3 are terms. Term # 4 represents focus. Thus, terms # 2 through # 4 represent the Gaussian or paraxial properties of the wavefront. Terms # 5 and # 6 are astigmatism plus defocus. Terms # 7 and # 8 represent and tilt, while term # 9 represents third- order spherical and focus. Likewise terms # 10 through # 16 represent fifth-order aberration, terms # 17 through # 25 represent seventh-order aberrations, terms # 26 through # 36 represent ninth-order aberrations, and terms # 37 through # 49 represent eleventh-order aberrations.

Each term contains the appropriate amount of each lower order term to make it orthogonal to each lower order term. Also, each term of the Zernikes minimizes the rms wavefront error to the order of that term. Adding other aberrations of lower order can only increase the rms error. Furthermore, the average value of each term over the unit circle is zero.

2.1.1 Zernikes in polar coordinates

TableForm zernikePolarList, TableHeadings −> , "#", "n", "m", "Polynomial"

# n m Polynomial 0@ 001 88< 8 <

@ D @ D ZernikePolynomialsForTheWeb.nb James C. Wyant, 2003 4

11 3 2 ρ2 −3 + 4 ρ2 Cos 2 θ 12 3 2 ρ2 −3 + 4 ρ2 Sin 2 θ 13 3 1 ρ 3 − 12 ρ2 + 10 ρ4 Cos θ 14 3 1 ρ H3 − 12 ρ2 +L10 ρ4@ SinD θ 15 3 0 −1H+ 12 ρ2 − 30L ρ4 +@20 Dρ6 16 4 4 ρ4HCos 4 θ L @ D 17 4 4 ρ4HSin 4 θ L @ D 18 4 3 ρ3 −4 + 5 ρ2 Cos 3 θ 19 4 3 ρ3 −4@+ 5 ρD2 Sin 3 θ 20 4 2 ρ2 6 −@20 ρD2 + 15 ρ4 Cos 2 θ 21 4 2 ρ2 H6 − 20 ρ2 L+ 15 ρ@4 SinD 2 θ 22 4 1 ρ H−4 + 30 ρ2L− 60 ρ@4 + D35 ρ6 Cos θ 23 4 1 ρ H−4 + 30 ρ2 − 60 ρ4L+ 35 @ρ6 SinD θ 24401−H20 ρ2 + 90 ρ4 − 140L ρ6 +@70 Dρ8 25 5 5 ρ5HCos 5 θ L @ D 26 5 5 ρ5HSin 5 θ L @ D 27 5 4 ρ4 −5 + 6 ρ2 Cos 4 θ 28 5 4 ρ4 −5@+ 6 ρD2 Sin 4 θ 29 5 3 ρ3 10@− 30Dρ2 + 21 ρ4 Cos 3 θ 30 5 3 ρ3 H10 − 30 ρL2 + 21@ρ4 DSin 3 θ 31 5 2 ρ2 H−10 + 60Lρ2 − 105@ ρD4 + 56 ρ6 Cos 2 θ 32 5 2 ρ2 H−10 + 60 ρ2 − 105Lρ4 + 56@ ρ6D Sin 2 θ 33 5 1 ρ H5 − 60 ρ2 + 210 ρ4 −L280 ρ@6 + D126 ρ8 Cos θ 34 5 1 ρ H5 − 60 ρ2 + 210 ρ4 − 280 ρ6 + 126L ρ8@ SinD θ 35 5 0 −1H+ 30 ρ2 − 210 ρ4 + 560 ρ6 − 630L ρ8 +@252Dρ10 36 6 6 ρ6HCos 6 θ L @ D 37 6 6 ρ6HSin 6 θ L @ D 38 6 5 ρ5 −6 + 7 ρ2 Cos 5 θ 39 6 5 ρ5 −6@+ 7 ρD2 Sin 5 θ 40 6 4 ρ4 15@− 42Dρ2 + 28 ρ4 Cos 4 θ 41 6 4 ρ4 H15 − 42 ρL2 + 28@ρ4 DSin 4 θ 42 6 3 ρ3 H−20 + 105Lρ2 −@168Dρ4 + 84 ρ6 Cos 3 θ 43 6 3 ρ3 H−20 + 105 ρ2 − 168L ρ4 +@84 ρD6 Sin 3 θ 44 6 2 ρ2 H15 − 140 ρ2 + 420Lρ4 − 504@ ρD6 + 210 ρ8 Cos 2 θ 45 6 2 ρ2 H15 − 140 ρ2 + 420 ρ4 − 504 ρ6 L+ 210@ρ8 DSin 2 θ H L @ D H L @ D H L @ D ZernikePolynomialsForTheWeb.nb James C. Wyant, 2003 5

46 6 1 ρ −6 + 105 ρ2 − 560 ρ4 + 1260 ρ6 − 1260 ρ8 + 462 ρ10 Cos θ 47 6 1 ρ −6 + 105 ρ2 − 560 ρ4 + 1260 ρ6 − 1260 ρ8 + 462 ρ10 Sin θ 48601− 42 ρ2 + 420 ρ4 − 1680 ρ6 + 3150 ρ8 − 2772 ρ10 + 924 ρ12 H L @ D H L @ D

2.1.2 Zernikes in Cartesian coordinates

TableForm zernikeXyList, TableHeadings −> , "#", "n", "m", "Polynomial"

# n m Polynomial 0001 111x@ 88< 8 <

41 6 4 60 x3 y − 60 x y3 − 168 x3 y x2 + y2 + 168 x y3 x2 + y2 + 112 x3 y x2 + y2 2 − 112 x y3 x2 + y2 2 42 6 3 −20 x3 + 60 x y2 + 105 x3 x2 + y2 − 315 x y2 x2 + y2 − 168 x3 x2 + y2 2 + 504 x y2 x2 + y2 2 + 84 x3 x2 + y2 3 − 252 x y2 x2 + y2 3 43 6 3 −60 x2 y + 20 y3 + 315 x2 y x2 + y2 − 105 y3 x2 + y2 − 504 x2 y x2 + y2 2 + 168 y3 x2 + y2 2 + 252 x2 y x2 + y2 3 − 84 y3 x2 + y2 3 H L H L H L H L 44 6 2 15 x2 − 15 y2 − 140 x2 x2 + y2 + 140 y2 x2 + y2 + 420 x2 x2 + y2 2 − 420 y2 x2 + y2 2 − 504 x2 x2 + y2 3 + 504 y2 x2 + y2 3 + 210 x2 x2 + y2 4 − 210 y2 x2 + y2 4 H L H L H L H L H L H L 45 6 2 30 x y − 280 x y x2 + y2 + 840 x y x2 + y2 2 − 1008 x y x2 + y2 3 + 420 x y x2 + y2 4 H L H L H L H L H L H L 46 6 1 −6x+ 105 x x2 + y2 − 560 x x2 + y2 2 + 1260 x x2 + y2 3 − 1260 x x2 + y2 4 + 462 x x2 + y2 5 H L H L H L H L H L H L H L H L 47 6 1 −6y+ 105 y x2 + y2 − 560 y x2 + y2 2 + 1260 y x2 + y2 3 − 1260 y x2 + y2 4 + 462 y x2 + y2 5 H L H L H L H L 48 6 0 1 − 42 x2 + y2 + 420 x2 + y2 2 − 1680 x2 + y2 3 + 3150 x2 + y2 4 − 2772 x2 + y2 5 + 924 x2 + y2 6 H L H L H L H L H L H L H L H L H L H L H L H L H L H L H L H L

2.2 OSC Zernikes

Much of the early work using Zernike polynomials in the computer analysis of interferograms was performed by John Loomis at the Optical Sciences Center, University of Arizona in the 1970s. In the OSC work Zernikes for n= 1 through 5 and the n=6, m=0 term were used. The n=m=0 term (piston term) was used in interferogram analysis, but it was not included in the numbering of the Zernikes. Thus, there were 36 Zernike terms, plus the piston term used. ZernikePolynomialsForTheWeb.nb James C. Wyant, 2003 7

3 Zernike Plots

A few sample plots are given in this section. More plots can be found at http://www.optics.arizona.edu/jcwyant/Zernikes/ZernikePolynomials.htm.

3.1 Density Plots

zernikeNumber = 8;

temp = zernikeXy zernikeNumber ; DensityPlot If x2 + y2 ≤ 1, Cos 2 π temp 2,1 , x, −1, 1 , y, −1, 1 , PlotLabel → "Zernike #" <> ToString zernikeNumber , ColorFunction → GrayLevel, PlotPoints −> 150, Mesh −> False ; @ D Zernike #8 @ @ H @ DL D 8 < 8 < 1 @ D D

0.5

0

-0.5

-1 -1 -0.5 0 0.5 1 ZernikePolynomialsForTheWeb.nb James C. Wyant, 2003 8

3.2 3D Plots

zernikeNumber = 8;

temp = zernikeXy zernikeNumber ; Graphics3D Plot3D If x2 + y2 ≤ 1, temp, 1 ,If x2 + y2 ≤ 1, Hue temp, 1, 1 , Hue 1, 1, 1 , x, −1, 1 , y, −1, 1 , PlotPoints → 40 ;

@ D @ @ 8 @ D @ @ D @ DD< 8 < 8 < DD

1

0.5 1

0 0.5 -0.5 -1 0 -0.5

0 -0.5

0.5 -1 1 ZernikePolynomialsForTheWeb.nb James C. Wyant, 2003 9

zernikeNumber = 8;

temp = zernikeXy zernikeNumber ; Graphics3D Plot3D If x2 + y2 ≤ 1, temp, 1 , x, −1, 1 , y, −1, 1 , PlotPoints → 40, LightSources −> 1., 0., 1. , RGBColor 1, 0, 0 , @ D 1., 1., 1. , RGBColor 0, 1, 0 , 0., 1., 1. , RGBColor 0, 0, 1 , @ @ @ D 8 < 8 < −1., 0., −1. , RGBColor 1, 0, 0 , −1., −1., −1. , RGBColor 0, 1, 0 , 888 < @ D< 0., −1., −1. , RGBColor 0, 0, 1 ; 88 < @ D< 88 < @ D< 88 < @ D< 88 < @ D< 88 < @ D<

1

0.5 1

0 0.5 -0.5 -1 0 -0.5 0 -0.5 0.5 1 -1 ZernikePolynomialsForTheWeb.nb James C. Wyant, 2003 10

3.3 Cylindrical Plot 3D

zernikeNumber = 8;

temp = zernikePolar zernikeNumber ; gr = CylindricalPlot3D temp, ρ,0,1 , θ,0,2 π , BoxRatios → 1, 1, 0.5 , Boxed → False, Axes → False ;

@ D @ 8 < 8 < 8 < D ZernikePolynomialsForTheWeb.nb James C. Wyant, 2003 11

zernikeNumber = 5;

temp = zernikePolar zernikeNumber ; gr = CylindricalPlot3D temp, Hue temp , ρ,0,1 , θ,0,2 π , BoxRatios → 1, 1, 0.5 , Boxed → False, Axes → False, Lighting → False ; @ D @8 @ D< 8 < 8 < 8 < D ZernikePolynomialsForTheWeb.nb James C. Wyant, 2003 12

Can rotate without getting dark side

zernikeNumber = 5;

temp = zernikePolar zernikeNumber ; gr = CylindricalPlot3D temp, ρ,0,1 , θ,0,2 π , BoxRatios → 1, 1, 0.5 , Boxed → False, Axes → False, LightSources −> 1., 0., 1. , RGBColor 1, 0, 0 , @ D 1., 1., 1. , RGBColor 0, 1, 0 , 0., 1., 1. , RGBColor 0, 0, 1 , @ 8 < 8 < 8 < −1., 0., −1. , RGBColor 1, 0, 0 , −1., −1., −1. , RGBColor 0, 1, 0 , 888 < @ D< 0., −1., −1. , RGBColor 0, 0, 1 ; 88 < @ D< 88 < @ D< 88 < @ D< 88 < @ D< 88 < @ D<

zernikeNumber = 16;

temp = zernikePolar zernikeNumber ; gr = CylindricalPlot3D temp, ρ,0,1 , θ,0,2 π , BoxRatios → 1, 1, 0.5 , Boxed → False, Axes → False, LightSources −> 1., 0., 1. , RGBColor 1, 0, 0 , @ D 1., 1., 1. , RGBColor .5, 1, 0 , 0., 1., 1. , RGBColor 1, 0, 0 , @ 8 < 8 < 8 < −1., 0., −1. , RGBColor 1, 0, 0 , −1., −1., −1. , RGBColor .5,1,0 , 888 < @ D< 0., −1., −1. , RGBColor 1, 0, 0 ; 88 < @ D< 88 < @ D< 88 < @ D< 88 < @ D< 88 < @ D<

3.4 Surfaces of Revolution

zernikeNumber = 8;

temp = zernikePolar zernikeNumber ; SurfaceOfRevolution temp, ρ,0,1 , PlotPoints → 40, BoxRatios → 1, 1, 0.5 , LightSources −> 1., 0., 1. , RGBColor 1, 0, 0 , @ D 1., 1., 1. , RGBColor .5, 1, 0 , 0., 1., 1. , RGBColor 1, 0, 0 , @ 8 < 8 < −1., 0., −1. , RGBColor 1, 0, 0 , −1., −1., −1. , RGBColor .5,1,0 , 888 < @ D< 0., −1., −1. , RGBColor 1, 0, 0 ; 88 < @ D< 88 < @ D< 88 < @ D< 88 < @ D< 88 < @ D<

1

0.5 1 0 0.5 -0.5 -1 0 -0.5 0 -0.5 0.5 -1 1 ZernikePolynomialsForTheWeb.nb James C. Wyant, 2003 15

3.5 3D Shadow Plots

zernikeNumber = 5;

temp = zernikeXy zernikeNumber ; ShadowPlot3D temp, x, − 1 − y2 , 1 − y2 , y, −1, 1 , PlotPoints → 40 ;

@ D è!!!!!!!!!!!!! è!!!!!!!!!!!!! A 9 = 8 < E ZernikePolynomialsForTheWeb.nb James C. Wyant, 2003 16

3.6 Animated Plots

3.6.1 Animated Density Plots

zernikeNumber = 3;

temp = zernikeXy zernikeNumber ; 2 MovieDensityPlot If x2 + y2 < 1, Sin temp + ty2 π ,1 , x, −1, 1 , y, −1, 1 , − → −> −> → t, 7, 4, 1 ,@ PlotPoints 100,D Mesh False, FrameTicks None, Frame False ; A A @H L D E 8 < 8 < 8 < E ZernikePolynomialsForTheWeb.nb James C. Wyant, 2003 17

3.6.2 Animated 3D Shadow Plots

zernikeNumber = 5;

temp = zernikeXy zernikeNumber ; g = ShadowPlot3D temp, x, − 1 − y2 , 1 − y2 , y, −1, 1 , PlotPoints → 40, DisplayFunction → Identity ;

SpinShow g, Frames@ −> 6, D SpinRange −> 0 Degree, 360è!!!!!!!!!!!!! Degreeè!!!!!!!!!!!!! A 9 = 8 < E @ 8

3.6.3 Animated Cylindrical Plot 3D

zernikeNumber = 5;

temp = zernikePolar zernikeNumber ; gr = CylindricalPlot3D temp, Hue Abs temp + .4 , ρ,0,1 , θ,0,2 π , BoxRatios → 1, 1, 0.5 , Boxed → False, Axes → False, Lighting → False, DisplayFunction → Identity ; @ D SpinShow gr, Frames −> 6, @8 @ @ DD< 8 < 8 < SpinRange −> 0 Degree, 360 Degree 8 < D @ 8

3.7 Two pictures stereograms

zernikeNumber = 8;

Print "Zernike #" <> ToString zernikeNumber ; ed = 0.6; temp = zernikeXy zernikeNumber ; @ @ DD f x_, y_ := temp ; x2 + y2 < 1 f x_, y_ := 1 ; x2 + y2 >= 1 @ D plottemp = Plot3D f x, y , x, −1, 1 , y, −1, 1 , Boxed → False, @ D ê H L Axes → False, DisplayFunction → Identity, PlotPoints → 50, Mesh −> False ; @ D ê H L Show GraphicsArray Show plottemp, ViewPoint −> −ed 2, −2.4, 2. , ViewCenter → 0.5 + −ed 2, 0, 0 , @ @ D 8 < 8 < Show plottemp, ViewPoint −> ed 2, −2.4, 2. , ViewCenter → 0.5 + ed 2, 0, 0 , D GraphicsSpacing → 0 , PlotLabel → zernikeXy zernikeNumber ; @ @8 @ 8 ê < 8 ê

H L H L ZernikePolynomialsForTheWeb.nb James C. Wyant, 2003 20

3.8 Single picture stereograms

zernikeNumber = 8;

temp = zernikeXy zernikeNumber ; tempPlot = Plot3D If x2 + y2 < 1, temp, 1 , x, −1, 1 , y, −1, 1 , PlotPoints → 400, DisplayFunction → Identity ; SIRDS tempPlot ; @ D Clear temp, tempPlot ; @ @ D 8 < 8 < D @ D @ D ZernikePolynomialsForTheWeb.nb James C. Wyant, 2003 21

4 Relationship between Zernike polynomials and third-order aberrations

4.1 Wavefront aberrations

The third-order wavefront aberrations can be written as shown in the table below. Because there is no field dependence in these terms they are not true Seidel aberrations. Wavefront measurement using an interferometer only provides data at a single field point. This causes field curvature to look like focus and distortion to look like tilt. Therefore, a number of field points must be measured to determine the Seidel aberrations.

2 thirdOrderAberration = "piston", w00 , "tilt", w11 ρ Cos θ−αTilt , "focus", w20 ρ , 2 2 3 4 "astigmatism", w22 ρ Cos θ−αAst , "coma", w31 ρ Cos θ−αComa , "spherical", w40 ρ ;

88 < 8 @ D< 8 < TableForm thirdOrderAberration 8 @ D < 8 @ D< 8 <<

piston w0 tilt @ ρ Cos θ−αTiltD w11 2 focus ρ w20 2 2 astigmatism ρ Cos θ−αAst w22 3 @ D coma ρ Cos θ−αComa w31 4 spherical ρ w40 @ D @ D

4.2 Zernike terms

First-order wavefront properties and third-order wavefront aberration coefficients can be obtained from the Zernike polynomials. Let the coefficients of the first nine zernikes be given by

zernikeCoefficient = z0,z1,z2,z3,z4,z5,z6,z7,z8 ; The coefficients can be multiplied times the Zernike polynomials to give the wavefront aberration.

wavefrontAberrationList8 = Table zernikeCoefficient zernikePolarList< Range 1, 9 ,4 ; We will now express the wavefront aberrations and the corresponding Zernike terms in a table @ @@ @ D DDD ZernikePolynomialsForTheWeb.nb James C. Wyant, 2003 22

4.3 Table of Zernikes and aberrations

wavefrontAberrationLabels = "piston", "x−tilt", "y−tilt", "focus", "astigmatism at 0 degrees & focus", "astigmatism at 45 degrees & focus", "coma and x−tilt", "coma and y−tilt", "spherical & focus" ;

8 Do < tableData i, 1 = wavefrontAberrationLabels i , tableData i, 2 = wavefrontAberrationList i , i, 1, 9

@ TableForm Array tableData, 9, 2 , TableHeadings → , "Aberration", "Zernike Term" 8 @ D @@ DD @ D @@ DD< 8

z0 − z3 +ρ Cos θ z1 + Sin θ z2 − 2 Cos θ z6 − 2 Sin θ z7 + 3 2 4 ρ 3 Cos θ z6 + 3 Sin θ z7@ +ρ@ 2z3 + Cos 2 θ z4 + Sin 2 θ@@ zDD5 − 6z8 8 +

H @ D @ D @ D @ D L pistonH= Select@ D wavefrontAberration,@ D L H FreeQ #,@ ρ D& ; @ D L

tilt = Collect Select wavefrontAberration, MemberQ #, ρ & , ρ, Cos θ , Sin θ ; @ @ D D

focusPlusAstigmatism = Select wavefrontAberration, MemberQ #, ρ2 & ; @ @ @ D D 8 @ D @ D

@ @ D D ZernikePolynomialsForTheWeb.nb James C. Wyant, 2003 23

coma = Select wavefrontAberration, MemberQ #, ρ3 & ;

spherical = Select wavefrontAberration, MemberQ #, ρ4 & ; @ @ D D

@ @ D D 4.4 zernikeThirdOrderAberration Table

zernikeThirdOrderAberration = "piston", piston , "tilt", tilt , "focus + astigmatism", focusPlusAstigmatism , "coma", coma , "spherical", spherical ;

88 < 8 < TableForm zernikeThirdOrderAberration 8 < 8 < 8 <<

piston z0 − z3 + z8 tilt @ ρ Cos θ zD1 − 2z6 + Sin θ z2 − 2z7 2 focus + astigmatism ρ 2z3 + Cos 2 θ z4 + Sin 2 θ z5 − 6z8 3 coma ρ 3 Cos θ z6 + 3 Sin θ z7 H4 @ DH L @ DH LL spherical 6 ρ z8 H @ D @ D L These tilt, coma, and focus plus astigmatism terms canH be rearranged@ D using the@ equationD L a Cos θ + b Sin θ = a2 + b2 Cos θ−ArcTan a, b .

è!!!!!!!!!!!!!!! 4.4.1 @TiltD @ D @ @ DD

tilt = tilt . a_ Cos θ_ + b_ Sin θ → a2 + b2 Cos θ−ArcTan a, b

2 2 ρ Cos θ−ArcTan z1 − 2z6,z2 − 2z7 è!!!!!!!z1!!!!−!!!!2z6 + z2 − 2z7 ê @ D @ D @ @ DD

"####################################################### @ @ DD H L H L 4.4.2 Coma

coma = Simplify coma . a_ Cos θ_ + b_ Sin θ → a2 + b2 Cos θ−ArcTan a, b

è!!!!!!!!!!!!!!! A ê @ D @ D @ @ DDE ZernikePolynomialsForTheWeb.nb James C. Wyant, 2003 24

3 2 2 3 ρ Cos θ−ArcTan z6,z7 z6 + z7

@ @ DD "############### 4.4.3 Focus This is a little harder because we must separate the focus and the astigmatism.

focusPlusAstigmatism

2 ρ 2z3 + Cos 2 θ z4 + Sin 2 θ z5 − 6z8

focusPlusAstigmatismH @ D = focusPlusAstigmatism@ D L . a_ Cos θ_ + b_ Sin θ_ → a2 + b2 Cos θ−ArcTan a, b

2 2 2 ρ 2z3 + Cos 2 θ−ArcTan z4,z5 z4 + z5 − 6z8 è!!!!!!!!!!!!!!! ê @ D @ D @ @ DD But Cos 2 φ = 2 Cos φ 2 − 1 J @ @ DD "############### N θ1 2 focusPlusAstigmatism = focusPlusAstigmatism . a_ Cos 2 θ_ −θ1_ → 2 a Cos θ− − a @ D @ D 2

1 2 ρ2 2z − z2 + z2 + 2 Cos θ− ArcTan z ,z z2 + z2 − 6z 3 4 5 2 4 5ê 4 @ 5 8 D A E

Let i y j "############### A @ DE "############### z k { 2 2 2 focusMinus =ρ 2z3 − z4 + z5 − 6z8 ;

2 2 2 2 2 2 Sometimes 2 z4 + z5 ρ is added to the focus term to make its absolute value smaller and then 2 z4 + z5 ρ must be subtracted from the astigmatism i "############### y term. This gives a focus term equalj to z k { è!!!!!!!!!!!!!!!!!!! è!!!!!!!!!!!!!!!!!!! I 2M 2 2 I M focusPlus =ρ 2z3 + z4 + z5 − 6z8 ;

For the focus we select the sign that will give the smallest magnitude. i "############### y j z focus = If AbskfocusPlus ρ2 < Abs{ focusMinus ρ2 , focusPlus, focusMinus ;

@ @ ê D @ ê D D ZernikePolynomialsForTheWeb.nb James C. Wyant, 2003 25

It should be noted that most commercial interferogram analysis programs do not try to minimize the absolute valus of the focus term so the focus is set equal to focusMinus.

4.4.4 Astigmatism

astigmatismMinus = focusPlusAstigmatism − focusMinus Simplify

1 2 2 ρ2 Cos θ− ArcTan z ,z z2 + z2 2 4 5 4 5 êê

"############### astigmatismPlusA = focusPlusAstigmatism@ DE − focusPlus Simplify

1 2 −2 ρ2 Sin θ− ArcTan z ,z z2 + z2 2 4 5 4 5 êê

1 2 1 π 2 Since Sin θ− ArcTan z4,z5 is equal to Cos θ− ArcTan z4,z5 + , astigmatismPlus could be written as 2 A @ DE "############### 2 2 π 2 2 1 2 2 astigmatismPlus =−2 ρ Cos θ− ArcTan z4,z5 + z4 + z5 ; @ @ DD 2 @ H 2 @ D LD Note that in going from astigmatismMinus to astigmatismPlus not only are we changing the sign of the astigmatism term, but we are also rotating it 90°. i y "############### We need to select the sign opposite that chosenA in thej focus term. @ D zE k { astigmatism = If Abs focusPlus ρ2 < Abs focusMinus ρ2 , astigmatismPlus, astigmatismMinus ; Again it should be noted that most commercial interferogram analysis programs do not try to minimize the absolute valus of the focus term and the astigmatism is given by astigmatismMinus. @ @ ê D @ ê D D

4.4.5 Spherical

4 spherical = 6 z8 ρ

4.5 seidelAberrationList Table

We can summarize the results as follows. ZernikePolynomialsForTheWeb.nb James C. Wyant, 2003 26

seidelAberrationList := "piston", piston , "tilt", tilt , "focus", focus , "astigmatism", astigmatism , "coma", coma , "spherical", spherical ;

88 < 8 < seidelAberrationList TableForm 8 < 8 < 8 < 8 <<

piston z0 − z3 + z8 2 2 tilt ρ Cosêê θ−ArcTan z1 − 2z6,z2 − 2z7 z1 − 2z6 + z2 − 2z7 2 2 2 2 focus If Abs 2z3 + z4 + z5 − 6z8 < Abs 2z3 − z4 + z5 − 6z8 , focusPlus, focusMinus

2 2 è!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!2 2 !!!!!!!!!!!!!!!!!!!!!!! astigmatism If Abs@ 2z3 + z@4 + z5 − 6z8 < AbsDD2z3H− z4 + zL5 − 6zH 8 , astigmatismPlus,L astigmatismMinus "############### "############### A3 A E 2 A2 E E coma 3 ρ Cos θ−ArcTan z6,z7 z6 + z7 4 "############### "############### spherical 6 ρA z8 A E A E E

@ @ DD "###############

4.5.1 Typical Results

seidelAberrationList . z0 → 0, z1 → 1, z2 → 1, z3 → 1, z4 → 3, z5 → 1, z6 → 1, z7 → 1, z8 → 2 TableForm

piston 1 3 π tilt 2êêρ Cos8 4 +θ <êê focus −10 + 10 ρ2

è!!! 2 1 1 2 astigmatism −2 10 ρ@ Sin θ−D 2 ArcTan 3 3è!!!!!! π coma 3I 2 ρ CosM 4 −θ ρè!!!!!!4 spherical 12 @ @ DD è!!! @ D seidelAberration = Apply Plus, seidelAberrationList 2 ;

seidelAberration . z0 → 0, z1 → 1, z2 → 1, z3 → 1, z4 → 3, z5 → 1, z6 → 1, z7 → 1, z8 → 2 @ D@@ DD π 3 π 1 1 2 1 + −10 + 10 ρ2 + 12 ρ4 + 3 2 ρ3 Cos −θ + 2 ρ Cos +θ − 2 10 ρ2 Sin θ− ArcTan êê 8 4 4 2< 3

è!!!!!! è!!! è!!! è!!!!!! I M A E A E A A EE ZernikePolynomialsForTheWeb.nb James C. Wyant, 2003 27

5 RMS Wavefront Aberration

If the wavefront aberration can be described in terms of third-order aberrations, it is convenient to specify the wavefront aberration by stating the number of waves of each of the third-order aberrations present. This method for specifying a wavefront is of particular convenience if only a single third-order aberration is present. For more complicated wavefront aberrations it is convenient to state the peak-to-valley (P-V) sometimes called peak-to-peak (P-P) wavefront aberration. This is simply the maximum departure of the actual wavefront from the desired wavefront in both positive and negative directions. For example, if the maximum departure in the positive direction is +0.2 waves and the maximum departure in the negative direction is -0.1 waves, then the P-V wavefront error is 0.3 waves.

While using P-V to specify wavefront error is convenient and simple, it can be misleading. Stating P-V is simply stating the maximum wavefront error, and it is telling nothing about the area over which this error is occurring. An optical system having a large P-V error may actually perform better than a system having a small P-V error. It is generally more meaningful to specify wavefront quality using the rms wavefront error.

The next equation defines the rms wavefront error s for a circular pupil, as well as the variance s2 . Dw(r, q) is measured relative to the best fit spherical wave, and it generally has the units of waves. Dw is the mean wavefront OPD.

1 2 π 1 average ∆w_ := ∆w ρρ θ; π 0 0

1 2 π 1 2 standardDeviation@ D ∆w_ := ∆w − average ∆w ρ ρ θ ‡ ‡ π 0 0 As an example we will calculate the relationship between s and the mean wavefront aberrations for the third-order aberrations of a circular pupil. @ D $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Ÿ Ÿ H %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @ DL %%%%%%%% %%%%%%%%%% 2 2 2 meanRmsList = "Defocus", "w20 ρ ", w20 average ρ ,w20 N standardDeviation ρ ,3 , 4 4 4 "Spherical", "w40 ρ ", w40 average ρ ,w40 N standardDeviation ρ ,3 , 4 2 4 2 4 2 "Spherical & Defocus", "w40 ρ −ρ ", w40 average ρ −ρ ,w20 N standardDeviation ρ −ρ ,3 , 98 2 2 @ D2 @2 @ D D< 2 2 "Astigmatism", "w22 ρ Cos θ ", w22 average ρ Cos θ ,w22 N standardDeviation ρ Cos θ ,3 , 8 @ D @ @ D D< 2 2 1 8"Astigmatism & Defocus", "wH22 ρ LCos θ − ", @H LD @ @H LD D< 2 8 @ D @ @ D D @ @ @ D D D< 2 2 1 2 2 1 w22 average ρ Cos θ − ,w22 N standardDeviation ρ Cos θ − ,3 , 9 2 H @ D L 2 3 3 3 "Coma", "w31 ρ Cos θ ", w31 average ρ Cos θ ,w31 N standardDeviation ρ Cos θ ,3 , "Coma & Tilt", ji zy ji zy 3 2 A j @ D zE A 3 2 A j @ D zE E= 3 2 "w31 ρ − ρ Cosk θ ", w31 average{ ρ − ρ Cos θ ,w31 Nk standardDeviation{ ρ − ρ Cos θ ,3 ; 3 3 3 8 @ D @ @ DD @ @ @ DD D< 9 i y i y H L @ D Aj z @ DE A Aj z @ DE E== k { k { ZernikePolynomialsForTheWeb.nb James C. Wyant, 2003 28

¯¯¯¯¯ TableForm meanRmsList, TableHeadings −> , "Aberration", "∆w", "∆w", "RMS" ¯¯¯¯¯ Aberration ∆w ∆w RMS

2 w20 Defocus@ w20 ρ 88< 8 2 0.288675<

2 2 w22 Astigmatism w22 ρ Cos θ 4 0.25 w22 Astigmatism & Defocus w ρ2 Cos θ 2− 1 0 0.204124 w 22 H L 2 22 Coma w ρ3 Cos θ 0 0.353553 w 31 @ D 31 3 2 Coma & Tilt w31 ρ − ρ Cos θ 0 0.117851 w31 H 3 @ D L @ D If the wavefront aberration can be expressed in terms of ZernikeH polynomials,L the@ Dwavefront variance can be calculated in a simple form by using the orthogonality relations of the Zernike polynomials. The final result for the entire unit circle is

nmax n a n 2 1 b n, m 2 + c n, m 2 σ= + ; 2 n + 1 2 2 n + 1 − m *+++++++++++++++++++++++++++++++n=1 ++++++++++++++++++++++++++++++++ m=1 ++++++++++++++++ ++++++++ +++++++ ji zy The following table givesj @theD relationship between@ s Dand the@ ZernikeD polynomialsz if the Zernike coefficients are unity. („ j „ z j z k { 1 zernikeRms = Table If zernikePolarList i, 3 == 0, , 2 zernikePolarList i, 2 + 1 1 A A @@DD , i, Length zernikePolarList ; è!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!! 2 2 zernikePolarList i, 2 + 1 − zernikePolarList i, 3 @@ DD

E 8 @ D

TableForm zernikePolarRmsList, TableHeadings −> , "#", "n", "m", "RMS", "Polynomial" @ @ @ D DD # n m RMS Polynomial 0@ 001 1 88< 8 <

4221 ρ2 Cos 2 θ 6 5221 ρ2 Sin 2 θ 6 è!!!! 6211 ρ −2 +@3 ρD2 Cos θ 2 2 è!!!! 7211 ρ −2 +@3 ρD2 Sin θ 2 2 è!!!! 8201 1 −H 6 ρ2 + 6 ρL4 @ D 5 è!!!! 9331 ρ3HCos 3 θ L @ D 2 2 è!!!! 10 3 3 1 ρ3 Sin 3 θ 2 2 è!!!! 11 3 2 1 ρ2 −3@+ 4 ρD2 Cos 2 θ 10 è!!!! 12 3 2 1 ρ2 −3@+ 4 ρD2 Sin 2 θ 10 è!!!!!! 13 3 1 1 ρ H3 − 12 ρ2 +L10 ρ4@ CosD θ 2 3 è!!!!!! 14 3 1 1 ρ H3 − 12 ρ2 +L10 ρ4@ SinD θ 2 3 è!!!! 15 3 0 1 −1H+ 12 ρ2 − 30 ρ4 +L20 ρ6@ D 7 è!!!! 16 4 4 1 ρ4HCos 4 θ L @ D 10 è!!!! 17 4 4 1 ρ4 Sin 4 θ 10 è!!!!!! 18 4 3 1 ρ3 −4@+ 5 ρD2 Cos 3 θ 2 3 è!!!!!! 19 4 3 1 ρ3 −4@+ 5 ρD2 Sin 3 θ 2 3 è!!!! 20 4 2 1 ρ2 H6 − 20 ρ2 L+ 15 ρ@4 CosD 2 θ 14 è!!!! 21 4 2 1 ρ2 H6 − 20 ρ2 L+ 15 ρ@4 SinD 2 θ 14 è!!!!!! 1 2 4 6 22 4 1 4 ρ H−4 + 30 ρ − 60 ρ L+ 35 @ρ CosD θ è!!!!!! 1 2 4 6 23 4 1 4 ρ H−4 + 30 ρ − 60 ρ L+ 35 @ρ SinD θ 24 4 0 1 1 − 20 ρ2 + 90 ρ4 − 140 ρ6 + 70 ρ8 3 H L @ D 25 5 5 1 ρ5 Cos 5 θ 2 3 H L @ D 26 5 5 1 ρ5 Sin 5 θ 2 3 è!!!! 27 5 4 1 ρ4 −5@+ 6 ρD2 Cos 4 θ 14 è!!!! 28 5 4 1 ρ4 −5@+ 6 ρD2 Sin 4 θ 14 è!!!!!! 1 3 2 4 29 5 3 4 ρ H10 − 30 ρL + 21@ρ DCos 3 θ è!!!!!! 1 3 2 4 30 5 3 4 ρ H10 − 30 ρL + 21@ρ DSin 3 θ H L @ D H L @ D ZernikePolynomialsForTheWeb.nb James C. Wyant, 2003 30

31 5 2 1 ρ2 −10 + 60 ρ2 − 105 ρ4 + 56 ρ6 Cos 2 θ 3 2 32 5 2 1 ρ2 −10 + 60 ρ2 − 105 ρ4 + 56 ρ6 Sin 2 θ 3 2 è!!!! 33 5 1 1 ρ H5 − 60 ρ2 + 210 ρ4 − 280 ρ6 + 126L ρ8@ CosD θ 2 5 è!!!! 34 5 1 1 ρ H5 − 60 ρ2 + 210 ρ4 − 280 ρ6 + 126L ρ8@ SinD θ 2 5 è!!!! 35 5 0 1 −1H+ 30 ρ2 − 210 ρ4 + 560 ρ6 − 630 ρ8 +L252 ρ@10D 11 è!!!! 36 6 6 1 ρ6HCos 6 θ L @ D 14 è!!!!!! 37 6 6 1 ρ6 Sin 6 θ 14 è!!!!!! 1 5 2 38 6 5 4 ρ −6@+ 7 ρD Cos 5 θ è!!!!!! 1 5 2 39 6 5 4 ρ −6@+ 7 ρD Sin 5 θ 40 6 4 1 ρ4 15 − 42 ρ2 + 28 ρ4 Cos 4 θ 3 2 H L @ D 41 6 4 1 ρ4 15 − 42 ρ2 + 28 ρ4 Sin 4 θ 3 2 H L @ D è!!!! 42 6 3 1 ρ3 H−20 + 105 ρ2 − 168L ρ4 +@84 ρD6 Cos 3 θ 2 5 è!!!! 43 6 3 1 ρ3 H−20 + 105 ρ2 − 168L ρ4 +@84 ρD6 Sin 3 θ 2 5 è!!!! 44 6 2 1 ρ2 H15 − 140 ρ2 + 420 ρ4 − 504 ρ6 L+ 210@ρ8 DCos 2 θ 22 è!!!! 45 6 2 1 ρ2 H15 − 140 ρ2 + 420 ρ4 − 504 ρ6 L+ 210@ρ8 DSin 2 θ 22 è!!!!!! 46 6 1 1 ρ H−6 + 105 ρ2 − 560 ρ4 + 1260 ρ6 − 1260 ρL8 + 462@ ρ10D Cos θ 2 6 è!!!!!! 47 6 1 1 ρ H−6 + 105 ρ2 − 560 ρ4 + 1260 ρ6 − 1260 ρL8 + 462@ ρ10D Sin θ 2 6 è!!!! 48 6 0 1 1 −H 42 ρ2 + 420 ρ4 − 1680 ρ6 + 3150 ρ8 − 2772 ρ10 + 924L ρ12 @ D 13 è!!!! H L @ D è!!!!!!

6 Strehl Ratio

While in the absence of aberrations, the intensity is a maximum at the Gaussian image point, if aberrations are present this will in general no longer be the case. The point of maximum intensity is called focus, and for small aberrations is obtained by finding the appropriate amount of tilt and defocus to be added to the wavefront so that the wavefront variance is a minimum.

The ratio of the intensity at the Gaussian image point (the origin of the reference sphere is the point of maximum intensity in the observation plane) in the presence of ZernikePolynomialsForTheWeb.nb James C. Wyant, 2003 31 aberration, divided by the intensity that would be obtained if no aberration were present, is called the Strehl ratio, the Strehl definition, or the Strehl intensity. The Strehl ratio is given by

1 2 π 1 2 strehlRatio := Abs 2 π∆w ρ,θ ρ ρ θ 2 π 0 0 where Dw[r, q] in units of waves. As an example @ D A‡ ‡ E strehlRatio . ∆w ρ, θ →ρ3 Cos θ N

0.0790649 ê @ D @ Dêê where Dw[r, q] is in units of waves. The above equation may be expressed in the form 2 π 1 2 1 2 2 strehlRatio = 2 Abs 1 + 2 π∆w ρ, θ − 2 π ∆w ρ, θ + ∫ ρ ρ θ π 0 0 If the aberrations are so small that the third-order and higher-order powers of 2pDw can be neglected, the above equation may be written as ¯¯¯¯¯ 1 ¯¯¯¯¯¯ 2 strehlRatio ≈ Abs 1 +2π∆w − 2 π 2 ∆w2 A‡ ‡ H 2 @ D @ D L E ¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯¯¯¯ ≈ 1 − 2 π 2 ∆w2 − ∆w 2 2 A ≈ 1 − 2 π σ H L E where s is in units of waves. H L I H L M Thus, when the aberrations are small, the Strehl ratio is independent of the nature of the aberration and is smaller than the ideal value of unity by an amount proportional to the variance of the wavefront deformation. H L

The above equation is valid for Strehl ratios as low as about 0.5. The Strehl ratio is always somewhat larger than would be predicted by the above approximation. A better approximation for most types of aberration is given by

2 strehlRatioApproximation :=− 2 πσ 2 πσ 4 strehlRatioApproximationH ≈ L1 − 2 πσ 2 + + ∫ 2 which is good for Strehl ratios as small as 0.1. H L Once the normalized intensity at diffraction focus has been determined,H L the quality of the optical system may be ascertained using the Marechal criterion. The Marecha1 criterion states that a system is regarded as well corrected if the normalized intensity at diffraction focus is greater than or equal to 0.8, which corresponds to an rms wavefront error

As mentioned above, a useful feature of Zernike polynomials is that each term of the Zernikes minimizes the rms wavefront error to the order of that term. That is, each term is structured such that adding other aberrations of lower orders can only increase the rms error. Removing the first-order Zernike terms of tilt and defocus represents a shift in the focal point that maximizes the intensity at that point. Likewise, higher order terms have built into them the appropriate amount of tilt and defocus to minimize the rms wavefront error to that order. For example, looking at Zernike term #9 shows that for each wave of third-order present, one wave of defocus should be subtracted to minimize the rms wavefront error and find diffraction focus.

7 References

Born, M. and Wolf, E., (1959). , pp. 464-466, 767-772. Pergamon press, New York. Kim, C.-J. and Shannon, R.R. (1987). In "Applied Optics and Optical Engineering," Vol. X (R. Shannon and J. Wyant, eds.), pp. 193-221. Academic Press, New York. Wyant, J. C. and Creath, K. (1992). In "Applied Optics and Optical Engineering," Vol. XI (R. Shannon and J. Wyant, eds.), pp. 28-39. Academic Press, New York. Zernike, F. (1934), Physica 1, 689. ZernikePolynomialsForTheWeb.nb James C. Wyant, 2003 33

8 Index

Introduction...1 Calculating Zernikes...2 Tables of Zernikes...3 OSC Zernikes...6 Zernike Plots...7 Density Plots...7 3D Plots...8 Cylindrical Plot 3D...10 Surfaces of Revolution...14 3D Shadow Plots...15 Animated Plots...16 Animated Density Plots...16 Animated 3D Shadow Plots...17 Animated Cylindrical Plot 3D...18 Two pictures stereograms...19 Single picture stereograms...20 Zernike polynomials and third-order aberrations...21 Wavefront aberrations...21 Zernike terms...21 Table of Zernikes and aberrations...22 Zernike Third-Order Aberration Table...23 Seidel Aberration Table...25 RMS Wavefront Aberration...27 Strehl Ratio...30 References...32 Index...33