+ All Categories
Home > Documents > Sparse Matrix Approximation Method for an Active Optical Control System

Sparse Matrix Approximation Method for an Active Optical Control System

Date post: 05-Oct-2016
Category:
Upload: jan-m
View: 218 times
Download: 1 times
Share this document with a friend
10
Sparse matrix approximation method for an active optical control system Timothy P. Murphy, Richard G. Lyon, John E. Dorband, and Jan M. Hollis We develop a sparse matrix approximation method to decompose a wave front into a basis set of actuator influence functions for an active optical system consisting of a deformable mirror and a segmented primary mirror. The wave front used is constructed by Zernike polynomials to simulate the output of a phase-retrieval algorithm. Results of a Monte Carlo simulation of the optical control loop are com- pared with the standard, nonsparse approach in terms of accuracy and precision, as well as computational speed and memory. The sparse matrix approximation method can yield more than a 50-fold increase in the speed and a 20-fold reduction in matrix size and a commensurate decrease in required memory, with less than 10% degradation in solution accuracy. Our method is also shown to be better than when elements are selected for the sparse matrix on a magnitude basis alone. We show that the method developed is a viable alternative to use of the full control matrix in a phase-retrieval-based active optical control system. © 2001 Optical Society of America OCIS codes: 000.4430, 120.5050, 350.1260, 350.6090. 1. Introduction An active optical system contains adjustable ele- ments to optimize the system performance for a par- ticular set of operating conditions. For example, the adjustable elements can be designed to compensate for time-dependent atmospheric turbulence, for opti- cal aberrations induced by temperature gradients, or for static and dynamic structural effects. The aber- rations of the system, whether induced by the observ- ing media, such as the atmosphere, or by the optical system itself, are a measure of the difference between the ideal wave front and the observed, aberrated wave front. The task of the active optical system addressed here is to first estimate, or sense, the wave front and to fit the wave front to a basis set of actua- tor influence functions, followed by adjustment of the actuators to compensate for, or minimize, these ab- errations. Wave-front sensing in an active optical system can be achieved by Shack–Hartmann sensing, 1 inter- ferometry, 2 curvature sensing, 3 and phase-retrieval methods. 4–7 Each of these wave-front sensing meth- ods attempts to determine either the wave-front error or the gradient of the wave-front error. Wave-front error is defined to be the difference between an ideal reference wave front and the actual wave front. Af- ter the wave-front error is determined, actuators move or deform optical elements to minimize an error metric and improve the quality of imaging. This wave-front correction process may have to be itera- tively repeated for at least three cases: 1 wave- front time dependence, 2 imprecise knowledge of the wave-front response to actuator motion, and 3 errors in the wave-front sensing process itself. The Shack–Hartmann sensor typically provides the gradient of the wave-front error at several hun- dred sample points. In contrast, phase-retrieval techniques provide the wave-front error of the order of tens of thousands of points. Shack–Hartmann sensors have been preferred over phase-retrieval techniques in time-sensitive applications because the sensors can provide the wave-front data faster be- cause of lower computational complexity. To make Shack–Hartmann sensors even faster, Wild et al. 8 have developed algorithms using sparse matrix tech- niques to reduce the time to calculate actuator mo- tions. Interferometry can be used to determine the wave front in the system pupil. Shack–Hartmann and in- terferometric systems both require a separate optical instrument to sense the wave front. Phase retrieval T. P. Murphy is with Scientific Workstations, 718 North Bel- grade Court, Silver Spring, Maryland 20902. R. G. Lyon [email protected] is with NASA Goddard Space Flight Center, Code 935, Building 28, Greenbelt, Maryland 20771. J. E. Dorband and J. M. Hollis are with NASA Goddard Space Flight Center, Code 930, Greenbelt, Maryland 20771. Received 15 February 2001; revised manuscript received 17 July 2001. 0003-693501356505-10$15.000 © 2001 Optical Society of America 10 December 2001 Vol. 40, No. 35 APPLIED OPTICS 6505
Transcript

Sparse matrix approximation method for an activeoptical control system

Timothy P. Murphy, Richard G. Lyon, John E. Dorband, and Jan M. Hollis

We develop a sparse matrix approximation method to decompose a wave front into a basis set of actuatorinfluence functions for an active optical system consisting of a deformable mirror and a segmentedprimary mirror. The wave front used is constructed by Zernike polynomials to simulate the output ofa phase-retrieval algorithm. Results of a Monte Carlo simulation of the optical control loop are com-pared with the standard, nonsparse approach in terms of accuracy and precision, as well as computationalspeed and memory. The sparse matrix approximation method can yield more than a 50-fold increase inthe speed and a 20-fold reduction in matrix size and a commensurate decrease in required memory, withless than 10% degradation in solution accuracy. Our method is also shown to be better than whenelements are selected for the sparse matrix on a magnitude basis alone. We show that the methoddeveloped is a viable alternative to use of the full control matrix in a phase-retrieval-based active opticalcontrol system. © 2001 Optical Society of America

OCIS codes: 000.4430, 120.5050, 350.1260, 350.6090.

1. Introduction

An active optical system contains adjustable ele-ments to optimize the system performance for a par-ticular set of operating conditions. For example, theadjustable elements can be designed to compensatefor time-dependent atmospheric turbulence, for opti-cal aberrations induced by temperature gradients, orfor static and dynamic structural effects. The aber-rations of the system, whether induced by the observ-ing media, such as the atmosphere, or by the opticalsystem itself, are a measure of the difference betweenthe ideal wave front and the observed, aberratedwave front. The task of the active optical systemaddressed here is to first estimate, or sense, the wavefront and to fit the wave front to a basis set of actua-tor influence functions, followed by adjustment of theactuators to compensate for, or minimize, these ab-errations.

Wave-front sensing in an active optical system canbe achieved by Shack–Hartmann sensing,1 inter-

ferometry,2 curvature sensing,3 and phase-retrievalmethods.4–7 Each of these wave-front sensing meth-ods attempts to determine either the wave-front erroror the gradient of the wave-front error. Wave-fronterror is defined to be the difference between an idealreference wave front and the actual wave front. Af-ter the wave-front error is determined, actuatorsmove or deform optical elements to minimize an errormetric and improve the quality of imaging. Thiswave-front correction process may have to be itera-tively repeated for at least three cases: �1� wave-front time dependence, �2� imprecise knowledge ofthe wave-front response to actuator motion, and �3�errors in the wave-front sensing process itself.

The Shack–Hartmann sensor typically providesthe gradient of the wave-front error at several hun-dred sample points. In contrast, phase-retrievaltechniques provide the wave-front error of the orderof tens of thousands of points. Shack–Hartmannsensors have been preferred over phase-retrievaltechniques in time-sensitive applications because thesensors can provide the wave-front data faster be-cause of lower computational complexity. To makeShack–Hartmann sensors even faster, Wild et al.8have developed algorithms using sparse matrix tech-niques to reduce the time to calculate actuator mo-tions.

Interferometry can be used to determine the wavefront in the system pupil. Shack–Hartmann and in-terferometric systems both require a separate opticalinstrument to sense the wave front. Phase retrieval

T. P. Murphy is with Scientific Workstations, 718 North Bel-grade Court, Silver Spring, Maryland 20902. R. G. Lyon�[email protected]� is with NASA Goddard Space FlightCenter, Code 935, Building 28, Greenbelt, Maryland 20771. J. E.Dorband and J. M. Hollis are with NASA Goddard Space FlightCenter, Code 930, Greenbelt, Maryland 20771.

Received 15 February 2001; revised manuscript received 17 July2001.

0003-6935�01�356505-10$15.00�0© 2001 Optical Society of America

10 December 2001 � Vol. 40, No. 35 � APPLIED OPTICS 6505

is an iterative algorithm that uses one or more ob-served images of unresolved point sources, togetherwith knowledge of the system, to determine the wave-front error. The advantages of phase retrieval arethat no separate wave-front sensor hardware are re-quired �i.e., the optical system used for imaging is thesame system that is used for phase retrieval�, andthus the data are collected with a standard focal-plane camera.

Here we address the phase-retrieval case because,typically, the resultant wave front provides tens ofthousands of spatial sample points in the system exitpupil, thereby providing higher-spatial-frequencycontent. The technique we develop is applicable toan active optical system that uses the wave-frontestimation method as part of the control loop. Thelargest gain is realized for a large number of wave-front sample points, such as recovered in phase re-trieval. Correction of the wave front at high spatialfrequencies requires a large number of actuators andtherefore a correspondingly larger system controlmatrix. The control-loop computation time andmemory size both scale with the system control ma-trix size. Hence we are motivated to find a fast,lower memory control method.

As a demonstration, we use a system with a seven-element segmented primary and an active deform-able mirror �DM� to demonstrate the viability of asparse matrix approximation approach as a solutionto minimize the squared error of a phase-retrievedwave front. We specify the matrix size, calculationtime, and wave-front error of this approach and com-pare it with that of the standard full matrix tech-nique. Sparse matrix approximation techniqueshave been employed in electrostatic modeling9 andtomography.10

It is worthwhile to note that other active opticalsystems have been demonstrated that do not rely on

direct wave-front measurement or reconstruction �di-rect control systems�, but use either the wave-frontsensor output directly11 or a nonlinear control algo-rithm based on image criteria12 such as image sharp-ness. In this paper we specifically address an activeoptical system that has an intermediary wave front�indirect control systems� such as the one estimatedfrom phase retrieval.

2. Description of an Active Optical System

A. Segmented Optical Control System

Figure 1 is a schematic of an optical system consist-ing of a segmented primary mirror, a secondary mir-ror, two off-axis parabolas used for collimating andfocusing, a DM, and a CCD focal-plane detector.The segmented primary mirror has actuators to moveeach segment in 3 deg of freedom: piston, tip, andtilt. A segmented primary may be required in a sys-tem with a large aperture so that the weight and sizeof a single element remain manageable. The sec-ondary mirror can also have actuators for alignment.The demagnified pupil is imaged onto the DM. Theactuators of the DM are moved such that an errormetric of the wave front is minimized. The outputwave front of the phase-retrieval algorithm is a dis-cretely sampled wave front embedded in a square,uniformly sampled grid �Figs. 2�a� and 2�b��.

In our model of the system, we consider the two-dimensional wave front lexicographically reorderedas a one-dimensional m vector w, where m is initially512 � 512 in our example. This reordering has noeffect on the physical interpretation of the systemand is done to simplify the notation. In this paperwe adopt the convention that vectors are written inlower-case bold, matrices in upper-case bold. OurDM actuator model assumes small deformations, 2�m at most, relative to the distance to the fixed DM

Fig. 1. Active optical system. Images detected at the focal-plane camera are processed by the phase-retrieval algorithm or wave-frontsensing to estimate the wave front. The wave front is processed by the control software to provide commands for the actuators.

6506 APPLIED OPTICS � Vol. 40, No. 35 � 10 December 2001

boundary, which is at least several millimeters awayfrom the center of any actuator. We applied approx-imation methods for a deformable plate13 to derivethe influence on the wave front, which is due to thejth actuator, of a 349-actuator DM. We find thesparse matrix method insensitive to the form of theinfluence function so long as it is localized. The formused here is given by

rj � exp����x � xj��sin���x � xj� � �4�, (1)

where rj is the m vector, also known as the influencefunction, of the jth actuator; xj is the location of thejth actuator in the pupil plane; �x � xj� ��x � xj� ��x � xj��

1�2 is the distance in m space from the jthactuator location to the point x; and � is a constant inunits of inverse distance. In Eq. �1� we assume alinear model for the influence of the DM actuators onthe wave front; i.e., the actual shape of the surface ofthe DM is a linear superposition of all the actuatorinfluence functions. This approximation is gener-ally valid over the small range of actuator motion,typically a few micrometers. The influence functionof Eq. �1� is typical of a Xinetics-type14,15 DM. Sucha DM has an � of 256 m�1 and a physical spacing of7 mm between each of the 349 actuators. Thus theinfluence of an actuator drops to �9% of its peakvalue at a neighboring actuator. The actuators are

spaced on a square grid with 21 actuators across thepupil. The optical system images the pupil onto theDM so that the edge of the pupil is approximately atthe center of the outermost actuators.

The wave front w�k�, after the kth iteration of cor-rection by the DM, is modeled as

w�k� � w�k�1� � Ra�k�, (2)

where R is the m � n response matrix and a�k� is then vector �n � 349� of the kth iteration of actuatorexcursions. The response matrix R consists of n col-umns of the influence functions, rj, j � 0, . . . , n � 1�,described above. Equation �2� is based on the as-sumption that the DM influence on the wave front isa linear superposition of the influence of each actua-tor. We assume that the initial actuator positionsa�0� are set to zero.

B. Method of Solution

To solve Eq. �2�, we wish to find the vector a thatminimizes the variance of the wave front �w�2. Themean of the wave front w� can be arbitrarily set tozero without loss of information. Throughout thispaper we refer to the relative wave-front error at thekth iteration of the control loop εw, which we define as

εw ��w�k���w�0��

. (3)

The solution of a least-squared-error linear systemis known as the normal equations.16 We refer to theapplication of the normal equations to the active op-tical system as the actuator fitting process. For anactive optical system, the linear least-squared solu-tion is

a�k� � a�k�1� � �RTR��1RTw�k�1�, (4)

where we define

S � �RTR��1RT;

thus

a�k� � a�k�1� � Sw�k�1�, (5)

where S is the n � m solution matrix and the wavefront has 512 � 512 points. For a DM with 349actuators, S has over 91 million elements. If storedin 64-bit floating-point format, S occupies 698Mbytes. Manipulating a data array the size of Sposes practical memory and storage problems. If Sis stored on disk, then the disk reading process willtake several seconds even on the fastest systems. Ifstored in memory, the price of that memory will besubstantial, particularly for a space-based or high-reliability system. Even as an array stored in mem-ory, the time required to read S and execute theproduct Sw can be substantial.

To speed the calculation and reduce the resourcesrequired, we are mindful that �1� much of the dataarray containing the wave front is outside the pupiland equal to zero, and �2� the influence function of

Fig. 2. �a� Example of a Zernike polynomial wave front beforecorrection. �b� Example of a residual wave front after correction.The contrast is enhanced to show the influence of the actuators.

10 December 2001 � Vol. 40, No. 35 � APPLIED OPTICS 6507

any given actuator extends over only a fraction of thepupil.

We now show the methods in which we efficientlyuse only the physically more significant �i.e., larger-magnitude� elements of S and ignore the remainder.

3. Two Sparse Matrix Approximation Methods

In this section we describe an algorithm for creatinga sparse approximation of S. As a first attempt �tri-al algorithm�, we implemented an algorithm that dis-carded those elements of the smallest absolute valuein each row. As we reduced the threshold for dis-carding elements, however, our simulations showedthat the resultant error was nonmonotonic with re-spect to that threshold. We subsequently imple-mented a second algorithm �corrected algorithm� toremedy the nonmonotonic behavior of the trial algo-rithm. We now describe this corrected algorithm indetail.

The first step in reducing the size of matrices R andS is to remove the region around the pupil, which hasthe value of zero for all wave fronts. The zero-valued region around the pupil exists to avoid alias-ing in the phase-retrieval process. For example, ifthe phase-retrieval algorithm produces a 512 � 512sampled wave front, the pupil extends over only thecentral 256 � 256 region �Fig. 2�a��. The reductionof approximately fourfold in the wave-front size is notcounted toward the gains afforded by the algorithm.We used the central 260 � 260 points of the wavefront. Of these 67,600 points, many are still outsidethe pupil, either in the central obscuration or outsidethe primary mirror segments. The total number ofpoints in the pupil is 40,928 for our example, and thematrix dimension m is reduced from 262,144 to67,600 when the elements outside the central regionare removed.

Because of the large size of the full solution matrixS, we created and stored it on a multiprocessor par-allel computer. The details of our parallel computerhardware and software implementation are given inAppendix A.

For the creation of a sparse matrix, we define thefraction of matrix elements to be retained as the den-sity parameter �, where 1 � � � 0. The sparsenessis defined as 1 � �. A row of S is made sparse whenwe remove the 1 � � fraction of matrix elements thatare smaller than a certain threshold. A pair ofthresholds, one each for positive and negative values,is found for each row, such that m� elements remainin that row. The distribution of element values in arow varies from one row to another, so use of a singlethreshold for all the rows would remove a differentnumber of elements from each row. Such an ap-proach concentrates the algorithmic errors in certainactuators. In particular, those rows of S correspond-ing to actuators near the edge of the pupil have adistribution of values quite different from those rowscorresponding to actuators at or near the center of apupil segment. Figure 3 shows the distribution fortwo rows of S �row 38, corresponding to an actuator inthe center of a segment, and row 174, corresponding

to an actuator in the central obscuration�. The prod-uct of a row of S with the corresponding column of Ris unity. Thus introducing error into the rows of Swith the smallest-magnitude elements will introduceerror into those actuators corresponding to the col-umns of R with the greatest-magnitude elements.

Once the thresholds for each row are determined,the algorithm must extract the row elements outsidethe threshold bounds. In addition to the value of arow element, the algorithm must account for the lo-cation of the element in the original row. Ratherthan storing one location for each extracted element,the algorithm stores the locations of strings of con-secutive elements outside the threshold. Thelengths of these strings are stored as well. For ex-ample, if elements 3 through 210 of a row are outsidethe threshold, the algorithm stores 3 and 207 as thelocation and length of the string of elements. Foreach row, the extracted elements, string locations,and string lengths are stored. To facilitate the read-ing of this structure, the total number of extractedelements and total number of strings are also storedin the structure for each row.

An actuator fitting program that uses the sparseapproximation matrix was developed. This pro-gram executes Eq. �5� using the sparse approxima-tion matrix S in place of the full solution matrix S.For each actuator element, the program reads thedata structure for the corresponding row of S fromstorage. The product of the wave front with thesparse row data is executed to yield updated actuatordata.

The algorithm removes those row elements ofsmallest absolute values, such that the sum of theelements removed is as close as possible to zero.Thus two thresholds, one for positive and one for

Fig. 3. Distribution of binned negative values. Distribution ofrows 38 and 174 of S as a function of the bin midpoint. Thedistribution is defined as the number of elements falling in a bindivided by the bin width. After sorting, we binned each sequen-tial 512 elements. The distribution value dk � 512�m�Si,k�512 �Si,k�, where m is 67,600; the number of points in a row i is either38 or 174; and k � 0, 512, 1024, . . . , 67,584. The last distributionvalue, d67,584, is equal to 15�m�Si,k67,599 � Si,67,584�. The bin kmidpoint is 1�2�Si,k�512 � Si,k� and is always negative in thisfigure. To show the difference in distributions, this figure is on alog–log scale. Rows 38 and 174 correspond to actuators in thecenter of a segment and in the central obscuration, respectively.

6508 APPLIED OPTICS � Vol. 40, No. 35 � 10 December 2001

negative elements, are used to remove row elements.It is assumed that at least one element of every rowof S is equal to zero. Let Ui, j be the reordered ele-ments of row i of S, such that

Ui, j � Si,k, k � 0, . . . , m � 1�, (6)

Ui,l�1 � Ui,l, l � 0, . . . , m � 2�. (7)

A positive threshold index pti and a negativethreshold index nti are initially valued such that

Ui,nti� 0, Ui,nti�1 � 0, (8)

Ui,pti� 0, Ui,pti�1 � 0. (9)

The bias Bi, defined as the sum of the elements re-moved from row i, is calculated as

Bi � �k�pti�1

nti�1

Ui,k. (10)

The algorithm proceeds by incremention of either ntiupward or pti downward at each step according to thefollowing rule:

if Bi � 0, pti 3 pti � 1, (11)

if Bi � 0, nti 3 nti � 1, (12)

if Bi � 0, nti 3 nti � 1, pti 3 pti � 1. (13)

The incrementing process continues until the targetnumber of elements outside the thresholds isreached, i.e., int�m�� � m � 1 � pti � nti. Figure 4shows a flow chart of the algorithm. In cases inwhich either threshold index is incremented to the

limiting values, m � 1 for nti and 0 for pti, respec-tively, the algorithm then ignores Bi and continues byincrementing only the threshold index not at the lim-iting value. Once the final values for the thresholdindices are established, the sparse approximationmatrix is created as follows:

Si, j � �Si, j if Si, j � Ui,ntior Ui,pti

� Si, j

0 otherwise. (14)

The matrix S is stored and used as the solution ma-trix in the control-loop actuator fitting algorithm.

4. Monte Carlo Simulation

A Monte Carlo simulation was conducted to estimatethe error introduced by the sparse matrix approxi-mation and to determine the speed and memory re-quired. We applied 100 initial wave-front cases to asimulated optical control loop �Fig. 5� consisting of awave-front simulator and an actuator fitting pro-gram. We generated the cases by assigning randomnumbers to each of the coefficients of Zernike poly-nomials17 fitted across the circular pupil spanningthe aperture. We used 29 Zernike polynomials �Z3–Z32�. The first term, Z0, which represents piston,was not used because wave-front piston is not rele-vant. Terms Z1 and Z2, representing tip and tilt,were not used because these terms depend on theplacement of the point source in the images used forphase retrieval. The coefficients were generatedfrom uniformly distributed random numbers over thearbitrarily chosen range �0.1875 to �0.1875 waves.The bounds of the uniform distribution were suchthat the initial wave-front error for the 100 casesranged from 0.1 to 0.6 waves rms.

The simulated optical control loop ran for four it-erations for each initial wave front with density pa-rameter values of 1.0, 0.3, 0.25, 0.2, 0.15, 0.1, 0.05,0.02, 0.01, and 0.005. Each iteration �Fig. 5� con-sists of a wave-front generation and an actuator fit-ting. The rms wave-front error at each iteration wasrecorded. The wave-front piston was ignored in thewave-front error calculation. In a practical system,care must be taken to ensure that an arbitrary con-stant bias, which is due to the algorithm, does notaccumulate in the actuator vector over several itera-tions. All actuator values and the time to computeEq. �5� were recorded.

We analyzed the sources of computational error inperforming the least-squares calculation with the fullmatrix to provide a lower bound on the sparse ap-proximation method error. We define computa-tional error εc as follows,

εc ��fl� x� � x�

�x�, (15)

where x is the real number result of the computationand the function fl�x� is the floating-point represen-tation of a real number x.

A test of the matrix product SR, which is ideally anidentity matrix, was performed to check the error

Fig. 4. Algorithm flow chart used to find the positive and negativethresholds for row i.

10 December 2001 � Vol. 40, No. 35 � APPLIED OPTICS 6509

analysis. The five sources of numerical error arefirst delineated then described and estimated in Sub-sections 4.A–4.E.

A. �R: Error in the Calibration of R

In a real system, the actuator influence function ma-trix R will have some error εR, even after calibration.In our simulations, an idealized influence functionmodel, Eq. �1�, was used for R, and the result wasstored in a single-precision floating-point format �32bits�. Thus we assume that εR is equal to zero.

B. �dot�RTR�: Error in the Dot Products Composing RTR

Each element of RTR is a dot product of two columnsri and rj of R. The error associated with the dotproduct operation is given in18

�fl�ri � rj� � ri � rj� � mu�ri� � �rj�, (16)

where m is the number of points in the dot product, uis the unit round off of the computer, and �rj� is de-fined as the vector of the absolute values of the ele-ments of the vector rj. To determine εdot, the error inthe dot product, we calculated the ratio of the abso-lute value vector dot product �ri� � �rj� to the absolutevalue of the dot product �ri � rj� for all elements ofRTR. The equation for εdot is as follows:

εdot ��fl�ri � rj� � ri � rj�

�ri � rj�� mu

�ri� � �rj��ri � rj�

. (17)

For 64-bit double precision, u is 2.220 � 10�16. Thenumber of nonzero points m in ri is 40,928. εdot ��RTR� is calculated to be 1.8 � 10�6, the worst case,and is less than 1.8 � 10�9 in more than 99% of allcases.

C. �Ch: Error in the Cholesky Inversion of RTR

The relative error εCh associated with the Choleskymethod for inversion of RTR is

εCh � u�2�RTR�, (18)

where the function �2�X� is the two-norm conditionnumber of a matrix X, given by the ratio of largest tosmallest eigenvalues, 1.818 � 106 in this case. Theeigenvalues of RTR �Fig. 6� were calculated by House-holder reduction to tridiagonal form by the QLmethod with implicit shifts.19 Thus εCh is approxi-mately 4 � 10�10. If 32-bit precision were used forthis calculation, u would be 1.1921 � 10�7 and εChwould be 0.2167, which is unacceptably high.

D. �dot �S�: Error in the Dot Products Comprising S

Each element of S is a dot product of a row of �RTR��1

and a column of RT. Applying Eq. �17� to the dotproduct for S, m is 349; the resultant error εdot�S� isless than 7.7 � 10�14 for �99% of the elements andhas a maximum value of 1.0 � 10�5.

Fig. 5. Simulated optical control loop. The wave-front simulator �1� generates wave-front data �2�. The wave-front error �3� iscalculated from the wave-front data. The actuator fitting program �4� generates an updated actuator vector a�k�1�. The updated actuatorvector is used to generate a corrected wave front �5�. Wave-front data, wave-front error data, and actuator data from each iteration k ofthe control loop are saved for analysis.

6510 APPLIED OPTICS � Vol. 40, No. 35 � 10 December 2001

E. �dot�a�: Error in the Dot Products Comprising a�k�

The dot product of the wave front with a row of Sintroduces an error εdot�a�. Because the wave frontis an input variable, Eq. �17� for εdot�a� cannot bedetermined explicitly.

We tested the numerical error for the entire pro-cess of the formation and use of S by creating thematrix product SR, using S stored on disk in adouble-precision floating point format. Ideally thismatrix product is a 349-square identity matrix. Themaximum error is 1.95 � 10�10 in the diagonal ele-ments and 1.87 � 10�10 in the off-diagonal elements.Note that 97% of the errors are less than 2 � 10�12.The maximum error found in SR is less than thebounds for εdot�R

TR� and εCh. As a cautionary note,the 349 columns of R span less than 1% of the 40,928vector column space of R. Even though the test car-ried out here was far from exhaustive, the sample oferrors produced was well within the error boundscalculated above.

The actuator vector in our simulations is stored in32-bit single-precision floating-point format, whichhas a round-off error of 1.192 � 10�7. Thus theactuator vector storage round-off error will dominatethe other errors for most of the full matrix cases.

5. Results

Five desired characteristics of the sparse matrix ap-proximation were identified:

�1� small increase in error compared with the fullmatrix case;

�2� stability, i.e., monotonic decrease in error withcontrol-loop iteration;

�3� smaller storage size;�4� higher computational speed; and�5� monotonic decrease in error with decreasing

sparseness.

We discuss three types of error introduced by thesparse thresholding algorithm: error in the solutionmatrix; error in the actuator vector; and, most impor-tantly, the relative error in the corrected wave frontbecause the goal of the system is to minimize the rmswave-front error. The relative error is defined as the

rms wave front after correction divided by the initialrms wave front.

The trial thresholding algorithm, based on removalof the elements of lowest absolute value in each row,possesses characteristics �1� through �4� above butfailed to yield characteristic �5� after the first control-loop iteration. Figure 7 shows worse results for adensity parameter of � � 0.2 as compared with thecases for � of 0.15 or 0.1. Such error behavior indi-cates a pathological problem because one cannot beassured that some other � value near 0.2 may yield aneven higher error. Another problem is that the al-gorithm has not provided the desired characteristicthat the accuracy of the method increases as morepoints are retained in the sparse matrix.

We hypothesized that, at some levels of sparseness,the sum of the removed elements in a given row wasnot close enough to zero, creating a bias in the actua-tor corresponding to that row. To check this hypoth-esis, we assessed a row error as

εr �1n �

i�0

n�1 ��i��j�0

m�1

Sij � Sij� , (19)

where Sij is the i, jth element of the full solutionmatrix S, Sij is the i, jth element of the sparse ap-proximation matrix, and �i is the sum of the elementsof the ith column of R. It is necessary to weight thematrix errors by the column weight of R so that er-rors introduced at actuators that have relativelysmall influence on the wave front add proportionallysmall error. The row error is the error in the cor-rection of a constant wave front that is due to thesparse matrix. The row error for the trial thresh-olding algorithm shows a peak at density parameter� � 0.2 as well. This result led us to develop thecorrected algorithm, in which the bias introduced byeach row is minimized.

The results of the matrices created with the cor-rected algorithm show a monotonic increase in rela-tive wave-front error with increasing number ofelements removed �Fig. 8�. Note that the error de-

Fig. 6. Eigenvalues of RTR ordered along the ordinate from leastto greatest. The abscissa contains the dimensionless index of theeigenvalue. The ratio of largest to smallest eigenvalue, 1.818 �106, is the two-norm condition number.17

Fig. 7. Trial algorithm: relative wave-front error for control-loop iteration 1. Error is a function of density parameter �.Wave-front relative error at iteration k is defined in Eq. �3�. Max-imum, minimum, and mean values for 100 wave-front cases areshown. The error bars represent the standard deviation of thedata point ordinate value. A nonmonotonic region of the curve isevident at � � 0.2.

10 December 2001 � Vol. 40, No. 35 � APPLIED OPTICS 6511

creased monotonically with increasing iterationsthrough the simulated control loop �Fig. 9�. The per-formance of the algorithm is stable with respect tochoice of sparseness level and with respect to itera-tion number. After one iteration, the mean relativeerror rises from 0.067 for the full matrix to 0.072 forthe 0.05 sparse matrix, an increase of only �8% inerror for an �95% decrease in matrix element count.After two iterations, the mean relative error risesfrom 0.062 for the full matrix to 0.064 for the 0.02sparse matrix, an increase of �4%. The correctedalgorithm row error �Fig. 10� decreases monotonicallywith increasing number of elements retained.

We examined the errors in actuator vectors for thesparse cases compared with the full case. The ac-tuator error should behave as the wave-front errorwith respect to sparseness and control-loop iterationnumber. Actuator error εa is defined as follows,

εa � �i�0

n�1

�asi � ai�2�i

2

�i�0

n�1

�ai�i�2 �

1�2

, (20)

where asi and ai are the ith actuator values for sparseand full cases, respectively. The weighting of theerror by �i ensures that actuators that are at theedge, or off, the pupil �i.e., have relatively small in-fluence on the wave front� do not dominate the ac-tuator error. The corrected algorithm actuator errorat iteration 1 �Fig. 11� is monotonic except at � � 0.01and � � 0.005, which have mean values of 0.26 and0.22, respectively. At iteration 4 the corrected algo-rithm error �Fig. 12� is monotonic with respect tosparseness and is uniformly lower than at iteration 1.We conclude that the actuator error results behave inthe same manner as the wave-front error results forthe corrected algorithm.

Fig. 8. Corrected algorithm: relative wave-front error forcontrol-loop iteration 1. The error is a function of density param-eter �. See Fig. 7’s caption. The error shows a monotonic de-crease with increasing � and is of smaller magnitude than the firstalgorithm relative wave-front error.

Fig. 9. Corrected algorithm: mean relative wave-front error forcontrol-loop iteration k, 1–4. The error is a function of the densityparameter �. Wave-front relative error at iteration k is defined inEq. �3�. The mean error decreases monotonically with increasingcontrol-loop iterations.

Fig. 10. Corrected algorithm: row error as a function of densityparameter �. Row error is defined in Eq. �19�.

Fig. 11. Corrected algorithm: actuator error for control-loop it-eration 1 as a function of density parameter �. Actuator error isdefined in Eq. �20�.

Fig. 12. Corrected algorithm: mean actuator error for control-loop iteration k, 1–4 as a function of density parameter �. Actua-tor error is defined in Eq. �20�.

6512 APPLIED OPTICS � Vol. 40, No. 35 � 10 December 2001

These results show that, with this sparse technique,an adaptive optical system as described above can ben-efit from a 20-fold decrease in memory usage with littleerror penalty. If two iterations through the controlloop are used, the memory usage benefit is 50-fold.

A. Timing Results

System software timing calls were used to determinethe time to execute the matrix–vector multiplication�Eq. �5��. The time to read the stored data from thedisk was not included. For all cases, there is uncer-tainty associated with the timing results because thevalues returned by timing calls depend on other loadson the operating system. The timing call returnsvalues in 0.01-s increments. Thus the timing re-sults have large relative errors for mean values lessthan 0.1 s �� � 0.02�. The computation time resultsfor the sparse calculations scale linearly with � �Fig.13�. For the full matrix calculation, the matrix isbroken up on a column basis, with 21 or 22 columnshandled at each processor. The calculation time ateach processor was recorded, then summed at theroot processor. We suspected a priori that the over-head of reading the sparse data string locations andlengths would lead to the full matrix calculation timebeing lower than the sparse matrix times extrapo-lated to density parameter � � 1.0. The oppositeproved true, however. The mean time for the fullcalculation was 5.1 s, whereas the � � 0.3 time was0.68 s. Thus the sparse calculation time extrapolatesto 2.3 s for the full case. One possible explanation forthis is that the smaller rows of the sparse matrix fitinto the 512-kbyte level-2 cache of the processors,whereas the full rows �541 kbytes each� do not. For� � 0.05, the mean calculation time was 0.0918 s, lessthan one-fiftieth of the full matrix calculation time.

B. Matrix Size Results

The sparse approximation matrix sizes are shown inFig. 14, which shows the total matrix size and, for the

sparse matrices, the overhead storage associatedwith the data location and length. Overhead stor-age size is defined as the sparse matrix size minus theproduct of � with the full matrix size. The overheadstorage decreases with �, but at a rate slower than thetotal matrix size. For � greater than 0.05, overheadis less than 10% of the total size.

6. Conclusions

We have designed, developed, coded, and MonteCarlo simulated a method of using a sparse matrixapproximation for the solution of a least-squaredwave-front-error-based actuator fitting algorithm.For a single iteration through the control loop, a ma-trix size reduction of 20-fold and a speed advantage of50-fold can be realized at the cost of less than 10%loss of accuracy. Simulations show that, with thismethod, the control loop is stable and that the rela-tive wave-front error decreases monotonically asmore elements are added to the matrix. This can beof great utility in a space-based mission, where mem-ory use is at a premium, or a ground-based system,where speed is at a premium.

Appendix A: Computer System Software andHardware

A parallel computer program that uses C with Mes-sage Passing Interface20 was developed to create thesolution matrix S. Typically, 16 processors wereused in our application. Text files containing themapping of the DM actuators onto the pupil and thesystem parameters are first read from disk. Eachprocessor operates on a single m-element column ofR, or a row of S, at any given time. The matrix R iscreated from these system parameters with rows dis-tributed over the various processors. The symmet-ric matrix RTR is created on a single processor andinverted by Cholesky decomposition.19 RTR�1 isbroadcast to all processors. S is subsequently calcu-lated with the result stored in rows distributed acrossthe processors. We used 64-bit precision becausethe inversion of RTR cannot be done reliably in 32-bitprecision.

The sparse matrix cases were each run on a singleprocessor of a dual-processor Pentium III 500-MHzsystem. The full matrix case was run on 16 proces-sors, four quad processor Pentium III systems, by use

Fig. 13. Corrected algorithm: computation time as a function ofdensity parameter �. See Section 5 and Appendix A for timingresults and computer hardware discussion. The mean values for400 wave-front control iterations are plotted. The ordinate istime in seconds to compute the matrix–vector product Sw�k�. For� � 1, S is replaced by the full matrix S. The error bars representthe standard deviation of the ordinate data value.

Fig. 14. Corrected algorithm: matrix size and overhead as afunction of density parameter �. The overhead is the size of thestorage devoted to sparse data location and length.

10 December 2001 � Vol. 40, No. 35 � APPLIED OPTICS 6513

of the Message Passing Interface library.20 All theseprocessors are part of the Highly Parallel IntegratedVirtual Environment computer.21

T. P. Murphy, R. G. Lyon and J. E. Dorband ac-knowledge the support of the NASA Remote Explo-ration and Experimentation Project and HighPerformance Computing and Communication Pro-gram for this study. J. M. Hollis received supportfrom NASA Research and Technology OperatingPlan 344-02-03-01.

References and Notes1. B. L. Ellerbroek, B. J. Thelen, D. J. Lee, D. A. Carrara, and

R. G. Paxman, “Comparison of Shack–Hartmann wavefrontsensing and phase-diverse phase retrieval,” in Adaptive Opticsand Applications, R. K. Tyson and R. Q. Fugate, ed., Proc.SPIE 3126, 307–320 �1997�.

2. P. Hariharan, Optical Interferometry �Academic, Sydney, Aus-tralia, 1985�.

3. L. Salas, “Variable separation in curvature sensing: fastmethod for solving the irradiance transport equation in thecontext of optical telescopes,” Appl. Opt. 35, 1593–1596 �1996�.

4. R. W. Gerchberg and W. O. Saxton, “A practical algorithm forthe determination of phase from image diffraction plane pic-tures,” Optik �Stuttgart� 35, 237–246 �1972�.

5. R. A. Gonsalves, “Phase retrieval and diversity in adaptiveoptics,” Opt. Eng. 21, 829–832 �1982�.

6. R. G. Lyon, J. E. Dorband, and J. M. Hollis, “Hubble spacetelescope faint object camera calculated point-spread func-tions,” Appl. Opt. 36, 1752–1765 �1997�.

7. J. R. Fienup, “Phase-retrieval algorithms for a complicatedoptical system,” Appl. Opt. 32, 1728–1736 �1993�.

8. W. J. Wild, E. J. Kibblewhite, and R. Vuilleumier, “Sparsematrix wave-front estimators for adaptive-optics systems forlarge ground-based telescopes,” Opt. Lett. 20, 955–957 �1995�.

9. R. Schneider, P. L. Levin, and M. Spasojevic, “Multiscale com-

pression of BEM equations for electrostatic systems,” IEEETrans. Dielectr. Electr. Insul. 3, 482–493 �1996�.

10. M. A. Player, J. Van Weereld, A. R. Allen, and D. A. L. Collie,“Truncated-Newton algorithm for three-dimensional electricalimpedance tomography,” Electron. Lett. 35, 2189–2191 �1999�.

11. E. W. Justh, M. A. Vorontsov, G. W. Carhart, L. A. Beresnev,and P. S. Krishnaprasad, “Adaptive optics with advancedphase-contrast techniques. II. High-resolution wave-frontcontrol,” J. Opt. Soc. Am. A 18, 1300–1311 �2001�.

12. G. W. Carhart, M. A. Vorontsov, M. Cohen, G. Cauwenberghs,and R. T. Edwards, “Adaptive wavefront correction using aVLSI implementation of the parallel gradient descent algo-rithm,” in High-Resolution Wavefront Control: Methods, De-vices, and Applications, J. D. Gonglewski and M. A. Vorontsov,eds., Proc. SPIE 3760, 61–67 �1999�.

13. S. Timoshenko and S. Woinowsky-Krieger, Theory of Platesand Shells, 2nd ed. �McGraw-Hill, New York, 1959�.

14. Xinetics Inc., 37 MacArthur Ave., Devens, Mass. 01432;http:��www.tiac.net�users�xinetics.

15. M. A. Ealey and J. A. Wellman, “Xinetics low cost deformablemirrors with actuator replacement cartridges,” in AdaptiveOptics in Astronomy, M. A. Ealey and F. Merkle, eds., Proc.SPIE 2201, 680–687 �1994�.

16. G. Strang, Linear Algebra and Its Applications �Academic,New York, 1976�.

17. R. Noll, “Zernike polynomials and atmospheric turbulence,” J.Opt. Soc. Am. 66, 207–211 �1976�.

18. G. H. Golub and C. F. Van Loan, Matrix Computations, 3rd ed.�Johns Hopkins U. Press, Baltimore, Md., 1996�.

19. W. H. Press, B. P. Flannery, S. A. Teulkolsky, and W. T.Vetterling, Numerical Recipes in C, 2nd ed. �Cambridge U.Press, Cambridge, UK, 1992�.

20. M. Snir, S. W. Otto, S. Huss-Lederman, D. W. Walker, and J.Dongarra, MPI: The Complete Reference �MIT, Cambridge,Mass., 1997�.

21. For a description of the Highly Parallel Integrated VirtualEnvironment �HIVE�, see http:��newton.gsfc.nasa.gov�thehive�.

6514 APPLIED OPTICS � Vol. 40, No. 35 � 10 December 2001


Recommended