Analytical decomposition of Zernike and hexagonal modes over an hexagonal segmented optical aperture

Zernike polynomials are widely used to describe the wavefront phase as they are well suited to the circular geometry of various optical apertures. Non-conventional optical systems, such as future large optical telescopes with highly segmented primary mirrors or advanced wavefront control devices using segmented mirror membrane facesheets, use approximate numerical methods to reproduce a set of Zernike or hexagonal modes with the limited degree of freedom offered by hexagonal segments. In this paper, we present a novel approach for a rigorous Zernike and hexagonal modes decomposition adapted to hexagonal segmented pupils by means of analytical calculations. By contrast to numerical approaches that are dependent on the sampling of the segment, the decomposition expressed analytically only relies on the number and positions of segments comprising the pupil. Our analytical method allows extremely quick results minimizing computational and memory costs. Further, the proposed formulae can be applied independently from the geometrical architecture of segmented optical apertures. Consequently, the method is universal and versatile per se. This work has many potential applications in particular for modern astronomy with extremely large telescopes.


Introduction
The Zernike polynomials (e.g., [1,2]) are commonly used in various fields of optics because they offer an orthonormal basis representing balanced classical optical aberrations defined on the unit disk over which the phase of wavefronts can be decomposed in a unique way. Because they are well adapted to the circular shape of most of the conventional optical systems, the Zernike polynomials became the standard way to describe optical path differences in wavefronts in many fields ranging from precision optical design and testing [3], atmospheric and adaptive optics [4,5], optical cophasing [6], vision science [7,8], or optical communications [9].
Even though the circle is the most common optical aperture shape, they are other important geometries, such as the hexagonal structure. For instance, the next generation of groundbased astronomy imaging telescopes (e.g., the TMT or the ELT projects of more than 30 m diameter [10,11]) will exhibit a segmented primary mirror made of several hundreds of individual hexagonal segments. Control authority for the wavefront is largely assigned to a second stage of optical system and thus on active or adaptive optics element (i.e., small-size deformable mirrors.) In adaptive optics, advanced wavefront control devices such as small-size segmented deformable mirrors [12][13][14][15] made of hexagonal segments are intensively used in astronomy [16][17][18], laser shaping [19], retinal imaging systems [7,20], microscopy [21,22] or laser communication [23].
The importance of the hexagonal geometry led to the development of orthonormal polynomials on the unit hexagon [24,25] and to ad hoc solutions for decomposing Zernike or hexagonal modes adapted to hexagonal segmented optical apertures.
The reproduction of an orthonormal basis onto the aperture of a segmented telescope is essential in order to provide a unique way of decomposing the phase in the aperture plan. Such a decomposition has applications in various domain of optics. It can be used to perform a modal control of an adaptive optic system or to allow high-performance open-loop correction of optical aberrations in a segmented pupil environment. A recent study presented in [26] proposes to analyze the performance of a coronagraphic system under the presence of local piston and tip-tilt on each of the segments. Including in this formalism an analytical formulation of global orthonormal modes over a segmented pupil would allow a more precise description of the effects at stake in this process. In this context, the needs concerning the generation of such basis using only the three degrees of freedom of each segment are many. We need to that end: (1) a versatile method that can provide the decomposition coefficients for any hexagonal segmented aperture; (2) a fast and reliable algorithm; (3) a method providing analytical results that can be used as is for theoretical calculation without loss of generality.
To our knowledge, only numerical methods have been proposed to reproduce a set of Zernike or hexagonal modes for a segmented pupil [27]. The piston, tip, and tilt to apply to each segment is generally obtained either by using a numerical projection of the signal on the first three Zernike modes, or by fitting a plane using a least square minimization. The main drawbacks are that the precision depends on the sampling of the hexagons used to reproduce the mirror, and scaling the process with the number of segments is precluded, meaning that the computational time-consuming calculations must be reprocessed anytime the configuration of the pupil changes.
In this context, we propose a general analytical framework to provide a rigorous Zernike and hexagonal modes decomposition adapted to hexagonal segmented pupils. We provide a unique general solution for the segment piston, tip, and tilt coefficients in order to reproduce accurately an arbitrarily set of Zernike or hexagonal modes. This solution, which naturally scales with the size, positions, rotation and number of segments comprising the mirror, is versatile per se. On the contrary to numerical solutions, the analytical expressions are independent from the physical size of the pupil and can be applied on small deformable mirrors [12,13] as well as on future large optical telescopes [10,11] without loss of precision in the decomposition.. While numerical methods require computational and memory cost which can be impressive, our analytical solution allows extremely quick results whatever the pupil complexity. Finally, the resultant decomposition is mathematically exact which means it can be used as is in analytical calculation implying modal analysis in the presence of a segmented mirror.
In Section 2 we present the rationale and the analytical expression of the Zernike and hexagonal decompositions, and in Section 3 we discuss and evaluate the method.

Analytical expressions of the Zernike and hexagonal decompositions
For pedagogical reasons and because it is considered as a basis for this work, we start by presenting the orthonormal polynomials on the unit hexagon. A set of orthonormal polynomials on the unit hexagon has been proposed using the Gram-Schmidt algorithm [24,25]. These polynomials are denoted H j (x, y), where x and y stand for the coordinates in the pupil plane and j corresponds to the Noll index notation [4] where the Zernike polynomials are sorted by increasing radial order and azimuthal frequency. The cosine polynomials are given an even j and the sine polynomials an odd j. They can be expressed as a linear combination of the Zernike polynomials Z j such as: where the coefficients α i can be found in [24]. These polynomials provide a unique decomposition of a wavefront over an hexagon. In the following, we use them as the basis for the decomposition. In practical cases, tip and tilt are usually set in units of radian. The correspondence between their values expressed in terms of the hexagonal polynomial coefficients, denoted t and T, and the angle on the segment, denoted θ, is given by θ = arctan[2 6 5 t] for tip and θ = arctan[2 6 5 T] for tilt. Now, we address the problems of the projection of the Zernike and hexagonal modes over an hexagonal segmented pupil. Our objective is to calculate the coefficients in piston, tip, and tilt to apply to each segment to reproduce a given Zernike mode Z j , or a given hexagonal mode H j , over a segmented pupil.
A segmented pupil is composed of N segments distributed over M rings around the central segment, where N = 3 × M × (M + 1) + 1. Each segment can be actuated in piston, displacement along the z-axis; in tip, rotation around the y-axis; and in tilt, rotation around the x-axis. Figure 1 presents the variables introduced above for a M = 2 segmented pupil. We denote by R the radius of the disk (or hexagon) on which the Zernike (or hexagonal) mode is applied. We decide in the following of the paper to work with the disk circumscribed to the full segmented pupil (solid orange circle in Fig. 1) in order to completely sample the mode. However, any other value of R can be chosen so that the value is considered as a variable during the analytical calculations. Nevertheless, one has to keep in mind that for a diameter smaller than the circumscribed configurations, the decomposition at the segment boundaries is affected. This effect is out of scope and therefore not taken into account in this study. We also note that the radius of the circumscribed circle is related to the number M of rings comprising the pupil, the size r n center-to-corner of the single segment n and the distance g separating the segments. Its complete expression is given by The area of the single segment n, denoted A n hereafter, is given by A n = 3 √ 3r 2 n /2. The piston, tip, and tilt coefficients of the decomposition are obtained by projecting the Zernike mode Z j respectively onto the hexagonal polynomials H 1 for piston; H 2 for tip; and H 3 for tilt. They are expressed as: where S represents the surface of a single segment. The surface of an hexagon of radius r is defined as x − X n < r and X n and Y n stand for the spatial coordinates of the center of the segment n. For instance, in the situation presented in Fig. 1, The same approach is used to reproduce the hexagonal polynomials H j on a segmented pupil. Substituting Z j by H j in Equations 2-4, we obtain the values for piston, tip, and tilt to apply to each segment. The coefficients are expressed as: For the sake of generality, we take into account a possible rotation of the segment n by an angle θ n around its center. This is included into the previous equations by rotating the modes around the central point of the segment n denoted (X n , Y n ). This implies the following change of variable in Equations 2-7 : The resultant formulae for piston (p n ), tip (t n ) and tilt (T n ) decomposition are listed in Table 1 for the Zernike polynomials, and in Table 2 for the hexagonal polynomials. We note that these formulae only depend on the position of the segment, its radius r n , the radius of the mode R and on the angle θ n . Thus, once analytically calculated, they can be used for any configuration of segmented pupil (e.g. exotic pupil configurations like uneven (X n , Y n ) positions, changing in the segment size r n across the pupil or different orientation θ n of the segments). Table 1. Piston, tip, and tilt coefficients on the segment n for the decomposition of the 10 first Zernike polynomials Z j over a segmented aperture including an arbitrary rotation of the segment by θ n .
Xn Yn rn

Evaluation and discussion
In this section, we discuss a standard error term affecting both numerical methods and our analytical approach: the fitting error. In this context, the performance our method yields over numerical approaches is examine. Finally, we outline some applications that would benefit from a rigorous analytical expression of the Zernike and hexagonal decomposition over an hexagonal pupil.

Fitting error: analytical decomposition
Due to the segmentation and the finite number of degrees of freedom, the reproduction of Zernike or hexagonal modes on a segmented pupil is subject to fitting errors. We propose in this section to calculate analytically the fitting error of a given configuration (i.e. with given parameters r n , θ n R and M). We first define the fitting error at the position (x, y) on the pupil (located on segment n) as the difference between the fitted and the theoretical expressions, first for the Zernike modes as: and the fitting error for the hexagonal polynomials as: The absolute value of the fitting errors |ε| for the ten first Zernike modes are visible in Fig. 2. As for now, we consider a regular pupil, i.e. (X n , Y n ) distributed according to a regular hexagonal grid, with θ n = 0 and r n constants for all the segments. Finally, for the Zernike modes we introduce the mean squared error on the segment n that depends on n and on the index j: and similarly for the hexagonal modes: The results of these two integrals are given in Table 3. As expected, the fitting error for piston, tip and tilt modes is null, meaning that a segmented mirror can perfectly reproduce one of them. For modes 4 to 6 the error is the same for all the segments and only depends on the ratio r n /R. This effect is clearly visible in Fig. 2, where the error figure for modes 4 to 6 is independent from the considered segment. For higher order modes, terms depending on the positions of the segments X n and Y n appear in the equations and the error figure in Fig. 2 is now different from one segment to another. Finally, for modes 9 and 10, a term in cos 6θ n appears in the equations meaning that the error figure now depends on the rotation of the segment because the system has a π/3 symmetry.
To further confirm these analytical expressions, we evaluate the total error over the segmented pupil for a given mode obtained with numerical simulations by creating the corresponding mirror configuration using the formulae from Tables 1 or 2, and by comparing to that of the theoretical value. When considering the Zernike modes, the total error is given by:
while considering the hexagonal modes we have: where the terms appearing before the sums in Equation 13 and Equation 14 are the ratios between the area of one segment and the normalization coefficients of the Zernike or hexagonal polynomials. The comparison between the theoretical fitting errors and the values obtained by means of simulations are presented in Fig. 3, for the Zernike polynomials (left) and for the hexagonal polynomials (right). The error has been calculated for four different configurations, with N = 19, 37, 91, and 1141. As expected, and as it is observable in Fig. 2 and Fig. 3, the larger the number of segments comprising the mirror, the lower the fitting error. The match between simulated fitting errors and analytical predicted expressions is fairly found. For the Zernike modes (Fig. 3, left), various plateaux are observable. While the reason for the first plateau occurring from the Noll index 1 to 3 is trivial, the three others originate from the relation that exist between the pairs of modes 5 and 6, 7 and 8, and 9 and 10 because of the rotation of a centro-symetric polynomials around its center. We note that the correspondence between the mode 4 and the modes 5 and 6 is only fortuitous. Basically, the same trend can be seen in Fig. 3 (right) for the hexagonal modes, and for the same reasons, except for numbers 9 and 10, where the 45˚rotation of the non centro-symetric polynomials provides different results. The very good correspondence between the simulated errors and their expected theoretical values further confirm the validity of the proposed analytical decomposition.

Fitting error: analytical vs. numerical decompositions
In this section, we discuss the performance our method yields over a numerical approach by comparing the fitting error obtained with these two methods. For the numerical method we use the following charts of simulation steps: 1. Calculation of the numerical decomposition coefficients (a) We simulate a unitary discrete pupil with the desired number of segments N. Each segment is given a radius in pixel denoted r sim .
(b) We apply the desired polynomial (Zernike or hexagonal) onto the pupil.
(c) We retrieve each segments comprising the pupil and project their respective signal onto a piston, tip and tilt basis to obtain the decomposition coefficients.

Fitting error estimation
(a) We apply these coefficients to the segments of a new pupil and obtain the fitted hexagonal mode. The radius of these new segments are chosen to be large enough to best avoid the errors introduced by the numerical discretization when calculating the fitting errors.
(b) We numerically compute the difference between the fitted mode and the theoretical one, as expressed in Equation 10.
This process is then repeated for each mode. We present in Fig. 4 (left) the total error σ(H j ) obtained with different values of r sim for the first 10 hexagonal polynomials and in Fig. 4 (right) the corresponding relative error between σ(H j ) and the theoretical fitting error obtained with Eq. 14. The first conclusion is that the smaller the radius r sim of the segment, the greater the error σ H j . This is directly due to the discretization of the segments in a finite number of pixels that leads to a wrong estimation of the coefficients. For a value r sim = 25, the relative error can reach up to 100% error for the modes 4, 5 and 6 which is equivalent to a doubling of the theoretical fitting error. With a bigger value of r sim = 250, this relative error scales down to 1%, which can still not be considered as negligible.
What is also distinguishable in Fig. 4 (left) and not intuitive, is that the numerical method can not perfectly reproduce the first mode H 1 . This is due to the fact that simulated segments are not exactly symmetric with respect to their respective center, as their edge has to be cropped following the boundary equations given in Note 3. This induce non-zero tip-tilt calculated coefficients while there is no tip-tilt on the segments, leading to a wrong estimation of the pupil configuration. Finally, the curves in Fig. 4 (right) show two different regimes separated in two plateaux: one from modes 4 to 6 and another one from 7 to 10. This behavior related to the spatial frequencies we want to decompose in each case. The higher the spatial frequency (i.e. the radial order of the Zernike mode) the lower the importance of the signal at the border of the segment thus leading to a lower relative error.

Discussion and applications
The analytical method presented in this paper allows a much faster Zernike and hexagonal decomposition than numerical methods. Numerical methods are inevitably subject to computational and memory costs that can be impressive in particular when segments require to be highly sampled or when segments are numerous. Our method avoids these fundamental limitations, as well as being totally independent of the pupil configuration. Given any system parameters, the analytical method suffers from a marginal loss in accuracy due to the fitting error compared to that of numerical methods, and the relative error can be significant. Fitting errors affecting numerical methods can be limited by increasing the size of the segment, but it will consequently increase the computation time needed to calculate the coefficients which scales with N × r 2 sim . The analytical method presented in this paper has many potential applications in particular in astronomical instrumentation with highly segmented telescopes (ELTs). For instance, our method could be used both as a complement and an extension of the work presented in [26]. In this study, an analytical error budget is proposed to infer the impact of the cophasing misalignment on the coronagraphic performances. The analytical model proposed in [26] offers the advantage of being low time consuming by avoiding long Monte-Carlo simulation. Complementing this analytical study by our analytical method for the Zernike decomposition is thus a must. So far, the segmented pupil only undergoes local independent piston on each segment. The study could thus benefit from the analytical coefficients of Zernike modes in order to increase the size of the decomposition basis by including global modes over the pupil.

Conclusion
We provide in this paper an analytical formulation of piston, tip, and tilt coefficients to each segment of a segmented pupil to fit either the Zernike modes or the hexagonal polynomials. The decomposition obtained with traditional methods based on numerical calculations are dependent on (1) the pupil configuration and (2) the sampling used for each segment, and are computational time and memory consuming. In case (1), for each modification of the pupil, the numerical process has to be repeated to obtain the new coefficients. For case (2), in order to obtain precise results, the radius of a simulated segment r sim has to be large enough in order to limits the edge effects. The theoretical formulae presented in this paper are based on the continuous limit of the process (r sim → ∞) and naturally offer the advantages of being mathematically exact and entirely independent from the number and positions of the segments comprising the mirror. They can therefore be used for analytical calculations dealing with segmented apertures. Even if mathematically exact, the analytical decomposition over a segmented pupil is subject to fitting errors, but with the lowest possible loss of accuracy compared to numerical methods.
As an example of application, the future of ground-based astronomy in the next decades is bound to the incoming generation of extremely large telescopes, especially for exoplanet direct detection, which is a major driver for present and future observing programs. ELTs represent a major change in dimension, wavefront control and execution time. In this context, phasing optics that correct for the misalignment of individual segments of the primary segmented mirror (798 individual segments of 1.4 m for the 39 m ELT) would benefit from analytical procedures in many areas including: control, phasing, monitoring, performance prediction and evaluation, and system optimization.