<<

This article was downloaded by: [65.121.24.70] On: 02 November 2011, At: 12:16 Publisher: Taylor & Francis Informa Ltd Registered in England and Wales Registered Number: 1072954 Registered office: Mortimer House, 37-41 Mortimer Street, London W1T 3JH, UK

Journal of Modern Publication details, including instructions for authors and subscription information: http://www.tandfonline.com/loi/tmop20 Zernike : a guide Vasudevan Lakshminarayanan a b & Andre Fleck a c a School of Optometry, University of Waterloo, Waterloo, Ontario, Canada b Michigan Center for Theoretical Physics, University of Michigan, Ann Arbor, MI, USA c Grand River Hospital, Kitchener, Ontario, Canada Available online: 04 Apr 2011

To cite this article: Vasudevan Lakshminarayanan & Andre Fleck (2011): Zernike polynomials: a guide, Journal of Modern Optics, 58:7, 545-561 To link to this article: http://dx.doi.org/10.1080/09500340.2011.554896

PLEASE SCROLL DOWN FOR ARTICLE

Full terms and conditions of use: http://www.tandfonline.com/page/terms-and-conditions This article may be used for research, teaching, and private study purposes. Any substantial or systematic reproduction, redistribution, reselling, loan, sub-licensing, systematic supply, or distribution in any form to anyone is expressly forbidden. The publisher does not give any warranty express or implied or make any representation that the contents will be complete or accurate or up to date. The accuracy of any instructions, formulae, and drug doses should be independently verified with primary sources. The publisher shall not be liable for any loss, actions, claims, proceedings, demand, or costs or damages whatsoever or howsoever caused arising directly or indirectly in connection with or arising out of the use of this material. Journal of Modern Optics Vol. 58, No. 7, 10 April 2011, 545–561

TUTORIAL REVIEW Zernike polynomials: a guide Vasudevan Lakshminarayanana,b*y and Andre Flecka,c aSchool of Optometry, University of Waterloo, Waterloo, Ontario, Canada; bMichigan Center for Theoretical Physics, University of Michigan, Ann Arbor, MI, USA; cGrand River Hospital, Kitchener, Ontario, Canada (Received 5 October 2010; final version received 9 January 2011)

In this paper we review a special set of orthonormal functions, namely Zernike polynomials which are widely used in representing the aberrations of optical systems. We give the recurrence relations, relationship to other special functions, as well as scaling and other properties of these important polynomials. Mathematica code for certain operations are given in the Appendix. Keywords: optical aberrations; Zernike polynomials; special functions; aberrometry

1. Introduction the Zernikes will not be orthogonal over a discrete set The Zernike polynomials are a sequence of polyno- of points within a unit circle [11]. However, Zernike mials that are continuous and orthogonal over a unit polynomials offer distinct advantages over other poly- circle. A large fraction of optical systems in use today nomial sequences. Using the normalized Zernike employ imaging elements and pupils which are circu- expansion to describe aberrations offers the advantage lar. As a result, Zernike polynomials have been that the coefficient or value of each mode represents adopted as a mathematical description of optical the root mean square (RMS) wavefront error attrib- wavefronts propagating through such systems. An utable to that mode. The Zernike coefficients used to optical wavefront can be thought of as the surface of mathematically describe a wavefront are independent equivalent phase for radiation produced by a mono- of the number of polynomials used in the sequence. chromatic light source. For a point source at infinite This condition of independence or , distance this surface is a plane wave. An example is means that any number of additional terms can be shown in Figure 1 with an aberrated wavefront for added without impact on those already computed. comparison. The mathematical description, offered by Coefficients of larger magnitude indicate greater con- Zernike polynomials, is useful in defining the magni- tribution of that particular mode to the total RMS tude and characteristics of the differences between the wavefront error of the system and thus greater image formed by an optical system and the original negative impact on the optical performance of the object. These optical aberrations can be a result of system.

Downloaded by [65.121.24.70] at 12:16 02 November 2011 optical imperfections in the individual elements of an Having stated the advantages of Zernike polyno- optical system and/or the system as a whole. First mials in describing wavefront aberrations over a unit employed by F. Zernike, in his phase contrast circle it should also be clearly noted that Zernike method for testing circular mirrors [3], they have polynomials are not always the best polynomials for since gained widespread use due to their orthogonality fitting wavefront test data. In certain cases, Zernike and their balanced representation of classical aberra- polynomials may provide a poor representation of the tions yielding minimum variance over a circular pupil wavefront. Some of the effects of air turbulence in [4–9]. astronomy and effects of fabrication errors in the The Zernike polynomials are but one of infinite production of optical elements may not be well number of complete sets of polynomials, with two represented by even a large expansion of the Zernike variables, that are orthogonal and continuous over the sequence. In the testing of conical optical elements interior of a unit circle [10]. The condition of being or irregular ocular optics, such as a condition known continuous is important to note because, in general, as keratoconus (literally a cone shaped cornea),

*Corresponding author. Email: [email protected] yVL is also with the departments of Physics and Electrical Engineering at the University of Waterloo.

ISSN 0950–0340 print/ISSN 1362–3044 online ß 2011 Taylor & Francis DOI: 10.1080/09500340.2011.554896 http://www.informaworld.com 546 V. Lakshminarayanan and A. Fleck

Figure 1. A plane wave (perfect wavefront) and an aberrated wavefront subdivided into smaller wavefronts where the local slope determines the location of a ray tracing projection of the sublet (subdivided wavelet). This is the operating principle of wavefront sensors [1]. (The color version of this figure is included in the online version of the journal.)

additional terms must be added to Zernike polyno- mials to accurately represent alignment errors and even in so doing, the description of the optical quality may be incomplete [12]. In any system with noncircular pupils, the Zernike circle polynomials will not be orthogonal over the whole of the pupil area and thus may not be the ideal sequence.

2. Mathematical basis In general, the function describing an arbitrary wavefront in polar coordinates (r, ), denoted by W(r, ), can be expanded in terms of a sequence of polynomials Z that are orthonormal over the entire surface of the circular pupil:X m m Wðr, Þ¼ Cn Zn ðr, Þ, ð1Þ Downloaded by [65.121.24.70] at 12:16 02 November 2011 n, m

where C denotes the Zernike amplitudes or coefficients Figure 2. Cartesian (x, y) and polar (r, ) coordinates of a and Z the polynomials. The coordinate system is point Q in the plane of a unit circle representing the circular shown in Figure 2. exit pupil of an imaging system [6]. The Zernike polynomials expressed in polar coor- dinates (X ¼ r sin , Y ¼ r cos ) are given by the complex combination: clockwise from the y-axis. This is consistent with Zmðr, ÞiZmðr, Þ¼Vmðr cos , r sin Þ n n n aberration theory definitions, but different from the m ¼ Rn ðrÞ expðimÞ, conventional mathematical definition of polar coordi- which leads to nates. The convention employed is at the discretion of Zmðr, Þ¼RmðrÞ cos m for m 0, the author and may differ depending on the applica- n n m m m tion. The radial function, Rn ðrÞ, is described by: Zn ðr, Þ¼Rn ðrÞ sin m for m 5 0, ð2Þ where r is restricted to the unit circle (0 r 1), ðnXmÞ=2 ð1Þl ðn lÞ! RmðrÞ¼ rn2l: ð3Þ meaning that the radial coordinate is normalized by n l! 1 ðn þ mÞl ! 1 ðn mÞl ! the semi-diameter of the pupil, and is measured l¼0 2 2 Journal of Modern Optics 547

visual/ophthalmic optics; it is nothing but the ordinary spectacle correction that is commonly prescribed by optometrists. Furthermore, the radial order n ¼ 1is equivalent to prism terms that are prescribed in spectacles as well. The normalization has been chosen to satisfy m Rn ð1Þ¼1 for all values of n and m. This gives a normalization constant described by: 1=2 m 2ðn þ 1Þ Nn ¼ , ð4Þ 1 þ m0

where m0 is the Kronecker delta (m0 ¼ 0 for m 6¼ 0). The algebraic form of the first 10 orders of Zernike polynomials which correspond to the surface plots of Figure 4 are shown in Tables 1 and 2, in both polar and Cartesian form, for comparison. In Cartesian coordi- nates, the 0 r 1 limit becomes x2 þ y2 1, and the recursion relationship for the sequence in Cartesian form is given by [13]: ! ! Xq XM MXJ n 2M M j m iþj Zn ðx, yÞ¼ ð1Þ i¼0 j¼0 k¼0 2i þ p k ðn j Þ! xy, ð5Þ j!ðM j Þ!ðn M j Þ! where n n jsj M ¼ m , p ¼ ðs þ 1Þ, 2 2 2 s q ¼ðd sMod½n,2Þ , s ¼ sgnðd Þ, d ¼ n 2m, 2 ¼ 2ði þ kÞþp, ¼ n 2ði þ j þ kÞp:

As can be seen from the relationship above and the expanded form shown in Tables 1 and 2, representa-

Downloaded by [65.121.24.70] at 12:16 02 November 2011 tion of the polynomials in polar form offers some advantage in efficiency by nature of its circular symmetry. Tables of Zernikes are given, for example, Figure 3. (a) The Zernike radial function for m ¼ 0, n ¼ 2 (defocus), 4 (), 6, 8 [6]. (b) The Zernike by Born and Wolf [4] and in the article by Noll [9]. radial function for m ¼ 1, n ¼ 1, 3, 5, 7. (c) The Zernike radial However, there is a difference between the two: function for m ¼ 2, n ¼ 2, 4, 6, 8 [6]. each of Noll’s polynomials should be multiplied by a factor 1/(2(n þ 1))1/2 to get the terms given by Born and Wolf. Although different indexing schemes exist for the The radial function is plotted in Figure 3 for the Zernike polynomial sequence, the recommended first four radial orders for the angular frequency 1, 2 double indexing scheme is portrayed [14,15]. and 3. The first 10 orders of the Zernike polynomial Occasionally a single indexing scheme is used for sequence are shown as surface plots in Figure 4. describing the Zernike expansion coefficients. Since the The first three radial orders, r ¼ 0, 1, 2 are called low polynomials depend upon two parameters n and m, order aberrations and radial orders 3 and above ordering of a single indexing scheme is arbitrary. are called higher order aberrations. It should be To obtain the single index j, it is convenient to lay out noted that the radial order 2 is of special interest in the polynomials in a pyramid with row number n and 548 V. Lakshminarayanan and A. Fleck Downloaded by [65.121.24.70] at 12:16 02 November 2011

Figure 4. Surface plots of the Zernike polynomial sequence up to 10 orders. The name of the classical aberration associated with some of them is also provided. (The color version of this figure is included in the online version of the journal.)

column number m. The single index, j, starts at the top where j ¼½nðn þ 2Þþm=2, n ¼ roundup ½ð3 þð9þ and the corresponding single indexing scheme, with 8j Þ1=2Þ=2 and m ¼ 2j nðn þ 2Þ: index variable j, is shown in Table 3. In this article we will deal exclusively with the In the single index scheme: double indexed Zernike polynomials. Some older literature does use the single index scheme and because m Zjðr, Þ¼Zn ðr, Þð6Þ of the variety of indexing schemes that are available Journal of Modern Optics 549

Table 1. Algebraic expansion of the Zernike polynomial sequence, orders one through seven [2]. Downloaded by [65.121.24.70] at 12:16 02 November 2011

0 0 and have been employed in the past, care should be where jj0 ¼ 1ifj ¼ j , jj0 ¼ 0ifj 6¼ j . This can be taken when comparing results from different journal separated into its radial orthogonality component articles and software packages. given by: ð 1 m m 1 Rn ðrÞRn0 ðrÞr dr ¼ nn0 ð8Þ 0 2ðn þ 1Þ 3. Orthonormality and angular orthogonality component: 8 8 The orthonormality of the Zernike polynomial 0 > cos m cos m > pð1 þ m0Þmm0 sequence is expressed by: > > > > ð <> 0 <> ð ð ð ð 2p sin m sin m pmm0 1 2p 1 2p d> ¼ > ð9Þ ð Þ 0 ð Þ ¼ 0 ð7Þ > 0 > Zj r, Zj r, r dr d r dr d jj , 0 > cos m sin m > 0 0 0 0 0 > > :> :> sin m cos m0 0 Downloaded by [65.121.24.70] at 12:16 02 November 2011 550 Table 2. Algebraic expansion of the Zernike polynomial sequence, orders seven through 10 [2]. .Lkhiaaaa n .Fleck A. and Lakshminarayanan V. Journal of Modern Optics 551

Table 3. Relationship between single and double index Bessel function, J, schemes to third order. ð 1 m Angular frequency, m Rn ðrÞJmðxrÞr dr Radial 0 J ðxÞ order, n 3 2 10123 ¼ð1ÞðnmÞ=2 nþ1 , x 0 j¼0 X1 ð1Þl 1 j¼1 j¼2 where J ðxÞ¼ x2lþm, ð13Þ m 22lþml!ðm þ 1Þ! 2 j¼3 j¼4 j¼5 l¼0 3 j¼6 j¼7 j¼8 j¼9 which has applications in the Nijboer–Zernike theory of and aberrations [7]. The relationship between Zernike and Jacobi polynomials, P, is given The sign of the angular frequency, m, determines the by [2, 4]: angular parity. The polynomial is said to be even when m ðnmÞ=2 m ðm,0Þ 2 m 0 and odd when m 5 0. Rn ðrÞ¼ð1Þ r PðnmÞ=2ð1 r Þ, ð14Þ where 1 Xn n þ n þ 4. Recurrence relations Pð,Þ ¼ ðx 1Þnðx þ 1Þm n 2 m n m The relationship between different Zernike modes is m¼0 given by the following recurrence relations: ð15Þ between Zernike and the , F, m 1 mþ1 mþ1 Rn ðrÞ¼ ðn þ m þ 2ÞRnþ1 ðrÞþðn mÞRn1 ðrÞ , through: 2ðn þ 1Þr ! ð10Þ 1 ðn þ mÞ nm 2 2 m m m Rn ðrÞ¼ð1Þ r 2F1 m n þ 2 Rnþ2ðrÞ¼ 2 n þ m þ 2 n m ðn þ 2Þ m2 , , m þ 1, r2 , ð16Þ 2 2 ðn þ mÞ2 ðn m þ 2Þ2 4ðn þ 1Þr2 n n þ 2 where 2 2 1 m n m m X n ð Þ ð Þ ð Þ ðaÞnðbÞn x Rn r Rn2 r , 11 F ða, b; c; xÞ ð17Þ n 2 1 ðcÞ n n¼0 n !

1 d½Rmþ1ðrÞRmþ1ðrÞ and, between Zernike and the Legendre polynomials, m mþ2 nþ1 n1 ð12Þ Rn ðrÞþRn ðrÞ¼ : P, through: n þ 1 dr Downloaded by [65.121.24.70] at 12:16 02 November 2011 Xn=2 The recurrence procedure can be started using n i n 2n 2i n2i PnðrÞ¼2 ð1Þ r , ð18Þ m m n RmðrÞ¼r . Ideally, a recurrence procedure should be i¼0 i numerically stable and free of errors which propagate where n is even. and are magnified as the recurrence proceeds [16,17]. The aberration of a general optical system with a For the Zernike recurrence relation above it is found point object can also be represented by a wave that the recurrence procedure is not absolutely stable in aberration polynomial of the form: all cases and that, as m increases, small errors in high 2 order terms (m 410) can become magnified. Forbes WðX, YÞ¼W1 þ W2X þ W3Y þ W4X þ W5XY 2 3 2 2 [18] has shown how to dramatically improve numerical þ W6Y þ W7X þ W8X Y þ W9XY stability of the Zernike expansion to high order. 3 4 3 þ W10Y þ W11X þ W12X Y þ; ð19Þ here X and Y are co-ordinates in the entrance pupil. 5. Relationship to other polynomial sequences This Taylor series can be represented very simply as: The relationship between the Zernike polynomials and Xn¼k mX¼n nm m other polynomial sequences can be derived. Of partic- WðX, YÞ¼ Wnðnþ1Þ X Y : ð20Þ 2 þmþ1 ular importance is the formulation with respect to the n¼0 m¼0 552 V. Lakshminarayanan and A. Fleck

Table 4. Functions generated from Gram–Schmidt orthogonalization of a power series [2].

Functions Series Interval Weight Norm

Legendre f1, r, r2, r3, ...g1 r 1 1 2/(2nþ1) Shifted Legendre 00 0 r 1 1 1/(2nþ1) 00 2 1=2 n Chebyshev I 1 r 1 ð1 x Þ p=ð2 0Þ 00 2 1=2 n Shifted Chebyshev I 0 r 1 ½xð1 x Þ p=ð2 0Þ Chebyshev II 00 1 r 1 ð1 x2Þ1=2 /2 Associated Laguerre 00 0 r 5 1 rker ðn þ kÞ!=n! Hermite 00 1 5 r 5 1 er2 2np1=2n! Zernike radial frm, rmþ2, rmþ4, ...g 0 r 1 r 1/(2nþ2)

Any Zernike term can be expressed as a combination 7. Transformations of Zernike coefficients of Taylor terms and vice versa. Malacara, for example, The mathematical basis by which Zernike coefficients provides the matrix transformation relations for con- can be transformed analytically with regard to con- versions up to the 45th term [19]. centric scaling, rotating and translating both circular The Zernike coefficients represent combinations of and elliptical pupils has been developed by several primary (Seidel) and higher-order aberrations through groups [22–27]. Using the matrix method, the wave- the expression [20,21]: hjZ X X front can be expressed as an inner product of , a row vector with the Zernike polynomials: Cnm ¼ TnmklSkl, ð21Þ l¼n k¼0 ð Þ ð Þ nmax nmax 1 nmax 2 ðnmax2Þ nmax2 hjZ ¼ Zn Zn 1 Zn 2 Zn Zn where l m is even, max max max max max n 1 n 2l Z max Z max ð24Þ ðn þ sÞl!2 nmax1 nmax Tnmkl ¼ ð1 þ ÞðlþmÞ!ðlmÞ! m0 2 2 and jiC , a column vector with the corresponding ðnXmÞ=2 ð1Þsðn sÞ! Zernike coefficients: nþm nm s!ð sÞ!ð sÞ!ðn 2s þ k þ 2Þ Cnmax s¼0 2 2 nmax ð22Þ ðnmax1Þ C nmax1 and n m must be even as well. Cðnmax2Þ In addition, the other special functions can be nmax2 generated by performing a Gram–Schmidt orthogo- Cðnmax2Þ nmax nalization of a power series (see [2]; Table 4). jiC ¼ ð25Þ . . Cnmax2 Downloaded by [65.121.24.70] at 12:16 02 November 2011 nmax 6. Wavefront error Cnmax1 A common metric of wavefront flatness for the nmax1 Cnmax wavefront, W(r, ), defined in Equation (1) is the nmax RMS wavefront error, , or wavefront variance, 2, ð with a form comparable to Equation (1): 1 1=2 X X 2 m m ¼ RMSw ¼ ðWðx,yÞWÞ dxdy , ð23aÞ Wð, Þ¼ c Z ð, Þ¼hiZjc , A n n ð26Þ pupil n m where A is the pupil area and W is the mean wavefront where 0 ð ¼ r=r0Þ1. In this formalism the optical path difference. Zernike polynomials can be written as: The wavefront error or variance can also be com- puted from a vector of the Zernike amplitudes using: hjZ ¼h Mj½½R½N, ð27Þ ! 1=2 where XN 2 n in n iðn 1Þ n ¼ Cj , ð23bÞ hjM ¼ max e max max 1e max max j¼3 2eiðnmax2Þ nmax eiðnmax2Þ ... nmax einmax , where the first few terms representing the ð28Þ pseudo-aberrations of , tip and are ignored. Journal of Modern Optics 553 2 3 Rnmax 000 0 where is a diagonal matrix with elements n.An 6 nmax 7 s s 6 ðnmax1Þ 7 example of this scaling matrix to third order is shown 6 0 R 00 0 7 6 nmax1 7 below [27]: 6 ðn 2Þ 7 6 00R max 0 0 7 2 3 6 nmax2 7 3 ½¼R 6 7, s 000000000 00 0Rðnmax2Þ 0 6 nmax 7 6 7 6 7 6 0 2 000000007 6 ...... 7 6 s 7 6 ...... 7 6 7 4 ...... 5 6 00s 00000007 6 7 0000 Rnmax 6 0003 0000007 nmax 6 s 7 6 7 ð29Þ 6 00001000007 ½ ¼ 6 :7 ð34Þ s 6 000002 00007 2 3 6 s 7 R 000 0 6 7 nmax 6 000000s 0007 6 7 6 7 6 0 R 00 0 7 6 00000003 007 6 nmax1 7 6 s 7 6 7 4 2 5 6 00Rn 2 0 0 7 00000000 0 6 max 7 s ½¼N 6 00 0R 0 7 0000000003 6 nmax 7 s 6 7 6 ...... 7 4 ...... 5 00 00 R 7.2. Translated pupil (see Figure 5(b)) nmax ð30Þ For a translation of this scaled wavefront by rt at , as depicted in Figure 5(b), the translation transfor- t and [ ] is the transformation matrix specific to the type mation is described by factor ¼ r =r which gives: of transformation being considered. The conversion t t 0 0 0 matrix, [C], which yields the new set of Zernike expðiÞ¼s expði Þþt expðitÞ, ð35Þ coefficients in terms of the original set is then given and after expansion and use of the binomial theorem: by [28]: 1 ðnþXmÞ=2 ðnXmÞ=2 nþm nm ½¼C ½N 1 ½R 1 ½ ½R ½N : ð31Þ ð Þ¼ 2 2 exp im n 2 p¼0 q¼0 p q npq pþq ðe þ 1Þ ðne 1Þ exp½i2ðp qÞ 0n exp½iðm 2p þ 2qÞ0: 7.1. Scaled pupil (see Figure 5(a)) e ð36Þ For a change in the size of wavefront from r0 to rs as depicted in Figure 5(a), the angular coordinate remains An example of this translation and scaling transfor- unchanged with ¼ 0 but the radial coordinate is mation matrix to third order is shown below [27]: 2 3 3 s 00000000 0 6 2 i 2 2 i 7 3 te t 0 te t 00 0 0 0 Downloaded by [65.121.24.70] at 12:16 02 November 2011 6 s s s 7 6 2 i2t it 2 it 2 i2t 7 6 3s e 2ste s 2s 0 ste 0 s e 007 6 t t t 7 6 0003 00 0 0 0 07 6 s 7 6 3e3it 2e2it eit 3eit 1 2 eit 3eit 2ei2t 3ei3t 7 ½ ¼ 6 t t t t t t t t t :7 ð37Þ t 6 2 it 2 2 it 7 6 0002s te 0 s 02s te 007 6 2 2it it 2 it 2 i2t 7 6 000st e 0 ste s 2st 2ste 3st e 7 6 3 7 6 0000000s 007 4 2 it 2 2 it 5 0000000s te s 3s te 3 000000000s

scaled by factor ¼ r =r giving ¼ 0 and: s s 0 s 7.3. Rotated pupil (see Figure 5(c)) 0 0 expðiÞ¼s expði Þ: ð32Þ A rotation by r, as depicted in Figure 5(c), gives:

This, in turn, changes the terms of hj M by: n 0n 0 expðimÞ¼expðimrÞ expðim Þ, ð38Þ n n 0n 0 expðimÞ¼s expðim Þ, ð33Þ 554 V. Lakshminarayanan and A. Fleck

Figure 5. Transformation types: (a) scaling of a circular pupil from r0 to rs.(b) Translation of circular pupil a distance rt at angle t.(c) Rotation of a circular pupil at angle r.(d) Transformation for elliptical pupil with major radius rma, minor radius rmi and rotation angle e.

with rotation transformation matrix example, to third wavefront is measured off axis or with a pupil rotated order, shown below: with respect to an axis orthogonal to the optical axis of 2 3 the system, the pupil projected onto a flat surface ei3r 000000000 Downloaded by [65.121.24.70] at 12:16 02 November 2011 6 7 (sensor) will be elliptical. In this case, the Zernike 6 i2r 7 6 0e 000000007 polynomials and coefficients will describe a wavefront 6 7 6 00eir 00000 0 07 extrapolated to areas for which there is no informa- 6 7 6 7 6 000eir 00 0 0 0 07 tion. The solution adopted [27,28] is to mathematically 6 7 6 7 stretch the elliptical wavefront into a circle, thus 6 00001000007 ½ ¼ 6 7: correcting for the extrapolation. For the elliptical r 6 7 6 00000100007 pupil, shown in Figure 5(d ), this gives: 6 i 7 6 000000er 00 07 6 7 ðnþXmÞ=2 ðnXmÞ=2 nþm nm 6 ir 7 1 6 0 0 0 0 000e 007 n expðimÞ¼ 2 2 6 7 2n q 4 00000000ei2r 0 5 p¼0 q¼0 p i3 npq pþq 000000000er ðe þ 1Þ ðe 1Þ 0n 0 ð39Þ exp½i2ðp qÞe exp½iðm 2p þ 2qÞ : ð40Þ 7.4. Elliptical pupil (see Figure 5(d)) A measurement of a model eye showing the impact on As stated earlier, the Zernike polynomials are contin- the Zernike coefficients of using both a circular pupil uous and orthogonal over a unit circle. When a and elliptical pupil is shown in Figure 6 [29]. In this Journal of Modern Optics 555

8. Primary aberrations As noted earlier, the primary aberrations of ocular prescriptions, (usually written as Sphere combined with a cylindrical power and specifying the axis of the cylinder) through a pupil of radius, r0, can be computed from the Zernike amplitudes using: cyl cyl ¼ 2ðJ2 þ J2 Þ1=2, sphere ¼ M , 0 45 2 ð41Þ cyl=2 þ J axis ¼arctan 0 , J45 where:

1=2 1=2 4ð3 Þ 0 2ð6 Þ 2 M ¼ 2 C2, J0 ¼ 2 C2, r0 r0 1=2 2ð6 Þ 2 J45 ¼ 2 C2 : r0

9. Zernike polynomials using For large values of the radial order n, the conventional representation of the radial function of the Zernike polynomials given in Equation (3) can produce unac- ceptable numerical results. In order to deal with this a possible solution is to convert the Zernike coefficients to a Fourier representation and do a numerical FFT computation [30–32]. The wavefront can be expressed as:

2 NX1 2pi Wðr, Þ¼ a ðk, ’Þ exp k r , ð42Þ j N j¼0 where k and r are the position vectors in polar coordinates in the spatial and the frequency domains, respectively, and N2 is the total number of wavefront Downloaded by [65.121.24.70] at 12:16 02 November 2011 Figure 6. (a) A measurement of an aberrated wavefront with sampling points. The relationship between Zernike a circular pupil and an elliptical pupil overlayed by the coefficients and Fourier coefficients is then given by: dashed line. (b) The measured wavefront from the elliptical 2 aperture. (c) The change in the first 28 Zernike coefficients 1 NX1 (up to six orders) as a result of the change in pupil shape [27]. c ¼ a ðk, ’ÞUðk, ’Þ, ð43Þ j p l j (The color version of this figure is included in the online l¼0 version of the journal.) where Uj is the Fourier transform of the Zernike polynomials and given by: ðð example, the wavefront is measured with a circular Ujðk, ’Þ¼ PðrÞZjðr, Þ expð2pik rÞ dr entrance pupil and an elliptical entrance pupil pro- duced by rotating the circular aperture 40. The long J ð2pkÞ ¼ð1Þn=2þjjm ðn þ 1Þ1=2 nþ1 axis of the ellipse is equal to the diameter of the k circular pupil. As expected, the change in pupil shape 21=2 cosjjm ðm 4 0Þ does not impact the defocus term, whereas the unex- 1 ðm ¼ 0Þ pected discrepancies for primary astigmatism, vertical 21=2 sinjjm ðm 5 0Þð44Þ and secondary astigmatism are thought to be a

result of some small, residual misalignment. and Jn is the nth-order Bessel function of the first kind. 556 V. Lakshminarayanan and A. Fleck

Fourier full reconstruction has been demonstrated to be more accurate than Zernike reconstruction from sixth to tenth order for random wavefront images with low to moderate noise levels [33]. However, experi- mentally, Zernike-based reconstruction algorithms have been found to outperform Fourier wavefront reconstruction to fifth order, in terms of the residual RMS error [34]. See [13] regarding numerical stability.

10. Zernike annular polynomials For a unit annulus with obscuration ratio , shown in Figure 7(a), the wavefunction in Equation (1) can be expanded in terms of this additional variable [35]: X m m Wðr, ; Þ¼ Cn Zn ðr, ; Þ, ð45Þ n,m where r 1 and 0 2p. The orthogonality condition of the radial polynomial sequence for an annulus is then given by: ð 1 2 m m 1 Rn ðr; ÞRn0 ðr; Þr dr ¼ nn0 : ð46Þ 2ðn þ 1Þ The annular polynomials, obtained from the circle polynomials using the Gram–Schmidt orthogonaliza- tion process, differ only in their normalization and that they are orthogonal over an annulus, not a circle. Comparing the m ¼ 0, angularly independent, radial functions for circular and annular Zernike polynomials (Figure 7(b) and (c)) clearly shows the similarities and radial extent.

11. Gram–Schmidt orthogonalization for apertures of arbitrary shape An aperture of arbitrary shape can have an orthonor-

Downloaded by [65.121.24.70] at 12:16 02 November 2011 mal basis set that is generated from the circular Zernike polynomials apodized by a mask using the Gram–Schmidt orthogonalization technique [20,36]. In general, orthogonality is defined with respect to the inner product: Ð dr f ðrÞ gðrÞ HðrÞ f, g ¼ Ð , ð47Þ dr HðrÞ Figure 7. (a) Diagram of annular pupil. (b) The Zernike where H is a zero-one valued function that defines the circle radial polynomial for m ¼ 0, n ¼ 2, 4, 6, 8. (c) The aperture. For a basis of arbitrary shape defined by the Zernike annular radial polynomial with ¼ 0.5, m ¼ 0, n ¼ 2, vectors fV1 ... Vng, Gram–Schmidt orthogonalization 4, 6, 8 [6]. is represented by:

n1 0 0 X (hence Vn ¼ V =jjV jj) and fZ1 ...Zng is the circular 0 0 n n V ¼ Zn þ D nmVm, ð48Þ 0 n Zernike basis. For an orthogonal basis set, Dnm can be m¼1 calculated and shown to be given by: where fV0 ... V0 g are the set of orthonogonal but 1 n 0 not orthonormal vectors of the arbitrary shape Dnm ¼hiZn, Vm ð49Þ Journal of Modern Optics 557

for each m 5 n. Expressing the new basis fV1 ... Vng in [10] Wyant, J. Basic Wavefront Aberration Theory for terms of the circular Zernike polynomials then gives: Optical Metrology. Applied Optics and Optical Engineering; Academic Press: New York, 1992; Vol. XI. Xn [11] Goodwin, E.P.; Wyant, J.C. Field Guide to Vi ¼ CimZm, ð50Þ Interferometric Optical Testing; SPIE Press: m¼1 Bellingham, WA, 2006. where C is the transformation matrix. [12] Smolek, M. Invest. Ophthalmol Visual Sci. 2003, 44, 4676–4681. [13] Carpio, M.; Malacara, D. Opt. Commun. 1994, 110, 514–516. [14] Thibos, L.N.; Applegate, R.A.; Schwiegerling, J.T.; 12. Conclusions Webb, R.; VSIA Standards Taskforce members. The Zernike polynomials are very well suited for Standards for Reporting the of mathematically describing wavefronts or the optical Eyes. In Vision Science and its Applications, TOPS path differences of systems with circular pupils. The Volume #35; Lakshminarayanan, V., Ed.; Optical Zernike polynomials form a complete basis set of Society of America: Washington DC, 2000; pp 232–245. functions that are orthogonal over a circle of unit [15] Campbell, C.E. Optom. Vision Sci. 2003, 80, 79–83. radius. In this paper, the most important properties of [16] Abramowitz, M.; Stegun, I.A. Handbook of Mathematical Functions; Dover: New York, 1972. the Zernike polynomials have been reviewed including [17] Kinter, E. Opt. Acta 1976, 23, 499–500. the generating functions of the Zernike polynomials, [18] Forbes, G.W. Opt. Express 2010, 18, 13851–13862. relationships to other polynomial sets, the orthonorm- [19] Malacara, D. Optical Shop Testing, 2nd ed.; Wiley, New ality conditions as well as transformations. It is meant York, 1992; pp 455–499. to constitute a reasonable introduction into this [20] Tyson, R.K. Opt. Lett. 1982, 7, 262–264. exceptionally useful polynomial set with figures that [21] Conforti, G. Opt. Lett. 1983, 8, 407–408. have been combined from multiple sources to provide a [22] Goldberg, K.A.; Geary, K. J. Opt. Soc. Am. A 2001, 18, useful resource. No detailed comparisons with alter- 2146–2152. native methods of describing wavefronts have been [23] Schwiegerling, J. J. Opt. Soc. Am. A 2002, 19, included nor has any discussion of various methods of 1937–1945. [24] Dai, G. J. Opt. Soc. Am. A 2006, 23, 539–543. wavefront measurement. A comprehensive introduc- [25] Campbell, C.E. J. Opt. Soc. Am. A 2003, 20, 209–217. tion to these topics is provided by Tyson [37]. [26] Bara, S.; Arines, J.; Ares, J.; Prado, P. J. Opt. Soc. Am. A 2006, 23, 2061–2066. [27] Lundstrom, L.; Unsbo, P. J. Opt. Soc. Am. A 2007, 24, 569–577. References [28] Atchison, D.A.; Scott, D.H. J. Opt. Soc. Am. A 2002, 19, 2180–2184. [1] Thibos, L.N. J. Refractive Surg. 2000, 16, 363–365. [29] Shen, J.; Thibos, L. Clin. Exp. Optom. 2009, 92, [2] Advanced Medical Optics/WaveFront Sciences. http:// 212–222. www.wavefrontsciences.com (accessed 2010). [30] Prata, A.; Rusch, W.V.T. Appl. Opt. 1989, 28, 749–754.

Downloaded by [65.121.24.70] at 12:16 02 November 2011 [3] Zernike, F. Mon. Not. R. Astron. Soc. 1934, 94, 377–384. [31] Dai, G. Opt. Lett. 2006, 31, 501–503. [4] Born, M.; Wolf, E. , 7th ed.; Oxford [32] Janssen, A.; Dirksen, P. J. Eur. Opt. Soc. 2007, 2, 07012. University Press: New York, 1999. [33] Dai, G. J. Refractive Surg. 2006, 22, 943–948. [5] Bhatia, A.B.; Wolf, E. Proc. Cambridge Phil. Soc. 1954, [34] Yoon, G.; Pantanelli, S.; MacRae, S. J. Refractive Surg. 50, 40–48. 2008, 24, 582–590. [6] Mahajan, V.N. Orthonormal Polynomials in Wavefront [35] Mahajan, V. J. Opt. Soc. Am. 1981, 71, 75–85. Analysis. In Handbook of Optics, 3rd ed.; McGraw-Hill: [36] Upton, R.; Ellerbroek, B. Opt. Lett. 2004, 29, New York, 2010; Vol 2, Part 3, Chapter 11. 2840–2842. [7] Nijboer, B.R.A. Physica 1947, 13, 605–620. [37] Tyson, R. Principles of , 3rd ed.; CRC [8] Mahajan, V.N. Optical Imaging and Aberrations, Part II: Press: New York, 2010. Wave Diffraction Optics; SPIE Press: Bellingham, WA, [38] Wyant, J.C. Zernike Polynomials for the Web; 2004. http://www.optics.arizona.edu/jcwyant/zernikes (accessed [9] Noll, R.J. J. Opt. Soc. Am. 1976, 66, 207–211. 2010). 558 V. Lakshminarayanan and A. Fleck

Appendix 1. Mathematica code 1. Code to generate table of Zernike polynomials (note that the indexing scheme is slightly different – the TableForm command, shown below, in either polar or Cartesian coordinates shows the indexing scheme) [37]

(a) For table in polar coordinates:

(b) For table in Cartesian coordinates:

2. For a cylindrical plot:

3. For wavefront aberrations: Downloaded by [65.121.24.70] at 12:16 02 November 2011 Journal of Modern Optics 559

4. For concentric scaling: From: http://demonstrations.wolfram.com/ZernikeCoefficientsForConcentricCircularScaledPupils/ Downloaded by [65.121.24.70] at 12:16 02 November 2011 560 V. Lakshminarayanan and A. Fleck

5. For conversion of Zernike coefficients for scaled, translated or rotated pupils [27] corresponding to the coordinate system depicted in Figure 5: Downloaded by [65.121.24.70] at 12:16 02 November 2011 Journal of Modern Optics 561

6. For interactive display and plotting including annular pupils: http://demonstrations.wolfram.com/ZernikePolynomialsAndOpticalAberration/ Downloaded by [65.121.24.70] at 12:16 02 November 2011