Real-time Experimental Demonstrations of a Photonic Lantern Wave-front Sensor

The direct imaging of an Earth-like exoplanet will require sub-nanometric wave-front control across large light-collecting apertures to reject host starlight and detect the faint planetary signal. Current adaptive optics systems, which use wave-front sensors that reimage the telescope pupil, face two challenges that prevent this level of control: non-common-path aberrations, caused by differences between the sensing and science arms of the instrument; and petaling modes: discontinuous phase aberrations caused by pupil fragmentation, especially relevant for the upcoming 30 m class telescopes. Such aberrations drastically impact the capabilities of high-contrast instruments. To address these issues, we can add a second-stage wave-front sensor to the science focal plane. One promising architecture uses the photonic lantern (PL): a waveguide that efficiently couples aberrated light into single-mode fibers (SMFs). In turn, SMF-confined light can be stably injected into high-resolution spectrographs, enabling direct exoplanet characterization and precision radial velocity measurements; simultaneously, the PL can be used for focal-plane wave-front sensing. We present a real-time experimental demonstration of the PL wave-front sensor on the Subaru/SCExAO testbed. Our system is stable out to around ±400 nm of low-order Zernike wave-front error and can correct petaling modes. When injecting ∼30 nm rms of low-order time-varying error, we achieve ∼10× rejection at 1 s timescales; further refinements to the control law and lantern fabrication process should make sub-nanometric wave-front control possible. In the future, novel sensors like the PL wave-front sensor may prove to be critical in resolving the wave-front control challenges posed by exoplanet direct imaging.


INTRODUCTION
From the ground, planar wavefronts from distant stars are warped due to Earth's turbulent atmosphere, and can become further distorted by the imperfect and unstable optics of astronomical instruments.In astronomy, these challenges motivate adaptive optics (AO), a technique which combines wavefront sensors (WFSs) and deformable mirrors (DMs) to actively flatten incoming wavefronts.Using AO, modern observing facilities have imaged exoplanets, uncovered circumstellar environments, examined the galactic center, and probed the structure of active galactic nuclei.Beyond astronomy, AO finds applications in free-space optical communications, microscopy, and remote sensing, all of which must contend with the propagation of light through inhomogeneous and dynamic media.
One of the primary goals for astronomy in the upcoming decade will be the direct imaging of an Earth-like exoplanet, and the characterization of any potential biological signatures: a scientific and technical feat whose importance was reiterated by the Astro 2020 decadal survey (National Academies of Sciences, Engineering, and Medicine 2021), and whose challenges are now driving the development of new technologies.One of the primary hurdles is the suppression of light from the host star, which will outshine an Earth-like companion by a factor of 10 10 in the visible (Traub & Oppenheimer 2010).To do so, we require coronagraphs or external starshades to blot out starlight, paired with wavefront control which must flatten incoming wavefronts at subnanometer precision.Such stringent demands cannot be met by conventional AO, which use sensors (e.g.Shack-Hartmann, pyramid) located in a conjugate pupil separate from the science focal plane and therefore suffer from non-common-path aberrations (NCPAs): instrumental aberrations that appear exclusively either in the science or sensing arms of the instrument (Martinez, P. et al. 2012).Additional complications include the low-wind effect (LWE), where the temperature gradients in a segmented aperture lead to aberrations that are discontinuous at segment boundaries (N´Diaye, M. et al. 2018), and petaling, in which the same kind of aberrations arise due to drifting misalignments in telescopes with fragmented primaries.Both are challenging to correct with general purpose sensors which re-image the pupil; petaling is of particular concern for the upcoming 30 m-class telescopes, which will provide the best chance of directly imaging Earth-like exoplanets from the ground.
We can avoid these difficulties by using wavefront sensors that operate in the science focal plane.This can be enabled in two ways: through phase diversity (e.g.COFFEE (Sauvage et al. 2012), and related algorithms such as F&F (Korkiakoski et al. 2014) and DrWho (Skaf, Nour et al. 2022)); or through purpose-built sensing optics such as phase holograms, asymmetric pupil masks, and dephased pinhole masks (e.g.cMWFS, APF-WFS, ZELDA, vAPP (Wilby et al. 2017;Martinache 2013;N'Diaye et al. 2014;Bos, S. P. et al. 2019)), sometimes coupled with non-linear phase retrieval algorithms.In this work we consider an alternate architecture that works with standard linear phase retrieval algorithms, using a photonic lantern (PL): a slowly transitioning waveguide which efficiently couples multi-modal light into multiple single-moded outputs (Leon-Saval et al. 2005;Birks et al. 2015).Importantly, when used to couple the aberrated telescope beam in the focal plane, PLs already have utility in several high-contrast imaging applications, including spectro-imaging and starlight nulling.PLs are also uniquely suited to couple aberrated telescope light into highly stable diffractionlimited spectrometers (Lin et al. 2021), enabling direct exoplanet spectroscopy, and can serve as a gateway into a wider ecosystem of astrophotonic devices such as arrayed waveguide gratings and photonic integrated circuits (Jovanovic et al. 2023).Simultaneously, lowspatial-frequency aberrations such as NCPAs and LWE modes can be sensed in the true science focal plane by monitoring the fluxes of the lantern's outputs.By construction, the photonic lantern wavefront sensor (PLWFS), at least in a single monochromatic channel, is a low-order sensor, with a maximum number of sensed modes equal to the number of lantern ports (or twice that if polarizations can be separated) (Lin et al. 2022(Lin et al. , 2023)).Accordingly, we envision that in practical ground-based applications the PLWFS will be most useful as a second-stage system, correcting the low-order NCPAs and petalling aberrations left over by a first-stage pupil-plane WFS control loop.
Previous numerical modelling (Lin et al. 2022(Lin et al. , 2023) ) and experimental results (Corrigan et al. 2018;Norris et al. 2020) have made important progress in developing the PLWFS.However, unknowns, such as the PLWFS's linearity, dynamic range, and stability, especially as part of a real-time AO system, have so far prevented the PLWFS from being realistically considered.The next step -a real-time demonstration of the PLWFS as part of a modern AO system -would verify the PLWFS as a future pathway to wavefront sensing in the true science focal plane, one that is further unique due to the non-WFS capabilities that PLs can simultaneously provide, including starlight nulling, spectro-imaging, and high-resolution spectroscope injection.In this work, we take this step, using the SCExAO testbed at Subaru telescope.Our results place the PLWFS firmly on the path to eventual integration with the next generation of astronomical instruments, which will ultimately enable the imaging and characterization of an Earth-like exoplanet.

Testbed setup
We used the near-infrared testbed on SCExAO (Lozi et al. 2020;Jovanovic et al. 2016) to demonstrate realtime control with the PLWFS.Microscope images of the 19-port PL used in this work, as well as a picture of the lantern mounted in the SCExAO testbed, are shown in Figure 1.A simplified diagram of the SCExAO beampath, containing only optics relevant for our tests, is given in the top panel of Figure 2, while an overview of the closed loop calibration and control process is shown at the bottom.Our light source is a supercontinuum white light laser, with a narrowband 1550 ± 50 nm filter, which is then collimated onto a 50×50 actuator DM and apodized using a set of Gaussian beam-shaping lenses.We use these lenses only because the downstream optics of the fiber injection unit were sized for the smaller apodized beam.The beam is then divided by a 90:10 beam splitter, which sends 10% of the light through to SCExAO's internal NIR camera (FLI C-Red 2) for monitoring of the point-spread function.The remaining 90% of the light is sent into the fiber injection unit: a 4-axis translation stage (shown in Figure 1, middle) that al-

Software
To calibrate and close the PLWFS loop, we use the Compute And Control for Adaptive Optics (CACAO) package.Figure 2 (bottom) gives an overview of the software steps required to close the loop.The raw frame taken from the CRED1 detector must be processed before it can be used for AO control.This includes dark subtraction, photometry extraction, image normalization, and reference subtraction.Initial data processing converts the full-frame detector image into a 19dimensional vector, which we then multiply against the control matrix.The output is then fed into a leaky integrator; the output mode values are converted back to a 50 × 50 displacement map which is then sent out to the SCExAO DM.To compute the control matrix, we measure the response of the PLWFS to a set of aberration modes (Zernike, petaling, Hadamard, etc.) and calculate the pseudo-inverse, setting our regularization parameter to 0.1.The loop was run at 1 kHz, but in principle could be run even faster; because the computations for linear phase retrieval with only a few modes are lightweight, control speed is limited by hardware, not software.

Photonic lantern
The lantern in our demonstration was manufactured at the Sydney Astrophotonics Instrumentation Laboratory (SAIL) using a tapered-fiber process: a custom multicore fiber with 19 single-mode channels (hexagonal array, 6.5 µm core diameter, 60 µm core spacing, numerical aperture 0.14) was inserted into a lower-index fluorine glass capillary, and then one end was heated and drawn to form a tapered structure.The left and right panels of figure 1 show the endface geometries of the PL.

Closed-loop correction of static aberrations
We first closed the loop on the first 5 non-piston Zernike modes, at a frequency of 1 kHz using a leaky integrator control law, with leak = 0.99 and gain = 0.2.We choose this few-mode, low-spatial-frequency basis both because the PLWFS is a few-mode sensor, and because most of the power in instrumental aberrations will appear in the first few Zernike modes (Sauvage et al. 2007).To test the loop, we injected a fixed amount of a single Zernike mode, scanning in both mode amplitude and mode index.At each point in the scan, after injecting the WFE and letting the loop settle, we sampled the closed-loop correction 20 times over the course of 2 seconds.This procedure is idealized in the sense that it neglects the effect of AO residuals, which will degrade the performance of the sensor in real-world operation; nevertheless, we believe that a comprehensive treatment of WFS performance in the presence of realistic AO residuals (e.g. as was done in Engler et al. (2022) for the pyramid) outside the scope of this work.We plan on pursuing such characterizations with future on-sky tests.
Figure 3 shows the correction of three Zernike modes over a range of static injected mode amplitudes; the other two modes show similar behavior and are omitted for brevity.We note that the loop was able to consistently correct ∼95% of the injected WFE, which is the expected amount of correction when setting leak = 0.99 and gain = 0.2 (see §B).Furthermore, the loop re- mained stable out to around ±1.6 radians of RMS WFE, or about 400 nm at our injection wavelength.
The dynamic range was limited by tilt.However, it is important to note that precise loop properties are sensitive to lantern alignment, and that we did not apply a rigorous optimization to align the lantern in the best location for WFSing (which may not be at the lantern's center, or even in focus).Nevertheless, our estimate of dynamic range falls in the middle of the predicted lower and upper limits from prior simulations (Lin et al. 2023), which suggested that a 19-port lantern sensing the first 5 non-piston Zernikes would have good linearity out to at least 0.5 radians and would be limited by degeneracies, arising from nonlinearity, beyond 2.3 radians.Figure 3 also shows aliasing between the two astigmatism modes (and to a lesser extent, the two tilt modes), which was not shown in simulations; it is unclear if this result is specific to our particular 19-port lantern, or if it can be reduced by adjusting the alignment.
We also consider the correction of petaling/LWE modes, an additional source of aberration besides NCPAs which will be particularly problematic for the upcoming 30-m telescopes, and are difficult to sense with conventional pupil-plane sensors.The SCExAO pupil is divided by spiders into four aperture segments, giving a total of 12 LWE modes: a local piston and two local tilt modes per aperture segment.These 12 LWE modes correspond to 11 degrees of freedom, since overall piston has no effect.We find that out of these 11 degrees, our 19port PLWFS is able to sense 8 of them, including all 4 segment pistons; more modes might be recovered by tweaking alignment or by using a higher mode-count lantern.all four piston modes, but with a slight undercorrection of ∼5-10%, perhaps due to cross-talk.Unlike our previous test, we observe no loop instabilities over the entire mode amplitude range of -2 to 2 radians, for any of the segment piston modes.

Dynamic aberrations
While the PLWFS can suppress static aberrations in closed-loop operation, in practice instrumental aberrations evolve temporally due to mechanical drifts, thermal expansion, and gravity vector changes caused by the slewing telescope.Excluding vibrations, the tempo-ral evolution is typically on the timescale of seconds to minutes (Martinez, P. et al. 2012(Martinez, P. et al. , 2013)).Accordingly, we tested the loop next by injecting time-evolving low order WFE with a decorrelation timescale of 1 s.This artificial WFE was composed from the first 7 non-piston Zernike modes (tilt, defocus, astigmatism, and coma); each mode amplitude is independently updated at a rate of 1 kHz according to an autoregressive formula, setting a per-mode amplitude of 0.05 radians RMS.For more details, see §A.To calibrate the loop, we measured the sensor response matrix against the first 20 non-piston Zernike modes, and used a singular value decomposition to compute the control modes of the system.In all, we found 12 control modes, constructed from independent linear combinations of the first 20 Zernikes.Note that we cannot recover a full 19 modes with a 19-port PLWFS because we lose one degree of freedom to image normalization and another to a global piston-like mode (Lin et al. 2022); beyond that, there is no guarantee a priori that the 19 lantern outputs will behave independently for a given aberration basis.We then logged the PLWFS output in both open and closed loop; the closed-loop leak was 0.99.The ratio of the open-and closed-loop power spectral densities (PSDs), which we estimated from the collected time-series data, approximates the squared modulus of the system's rejection transfer function.We plot the experimentally measured transfer functions for the first control mode in Figure 5 at different gains, along with the transfer functions expected by a theoretical model for our closed-loop system, set entirely by system latency, detector framerate, leak, and gain.Our model transfer function is presented in §B.All measured transfer functions in Figure 5 agree with models, and show successful rejection of the slowly varying components of the injected WFE.We find 0 dB frequencies of 15, 23, and 32 Hz, and rejection at 1 Hz of roughly 4×, 10×, and 12×, for gains of 0.03, 0.1, and 0.2, respectively.We also note that these transfer functions can be recovered by comparing open-and closedloop PSDs, even without injecting artificial WFE (rely-ing solely on the actual system instabilities), implying that the PLWFS can actively correct the ambient WFE of the SCExAO testbed.

Stability
In a perfectly stable AO system, measurement of the response matrix only needs to happen once; in reality, an accumulation of slight changes in WFS optical properties (e.g.caused by drifts) will require eventual re-calibration.In this subsection, we present a rudimentary estimate of the average drift rate of the PL response matrix, separate from drift inherent to the SCExAO testbed.The basis of our test is as follows.Suppose at some initial time, the response matrix of the PLWFS, A 0 , is measured, and the control matrix A + 0 is computed.Then, A + 0 A 0 = I, where I is the identity matrix.However, later measurements of the response matrix, denoted A n , will deviate from A 0 , and thus the product A + 0 A n will drift from I.This accumulated miscalibration error, err n , can be quantified as where |M | denotes the Frobenius norm of matrix M .
We applied this test to the PLWFS, over the course of one week.In practice, we first measured the reference response and control matrices, A 0 and A + 0 , for 11 control modes.At roughly the same time on later days, we then re-aligned the PL injection, closed the loop using the reference control matrix, and used cacao's built-in selfRM function to measure A + 0 A n directly.selfRM works by manually injecting a small amount of each control mode, in sequence, into the system while the loop is closed, and recording the applied correction.After one week, we compute an accumulated miscalibration error of ∼ 1.4.On average, this corresponds to an accumulated per-mode error of 1.4/11 ≈ 0.13 (13%, since each column of A + 0 A n should have a norm of 1) over the course of the week, or a per-mode drift of around 2% per day.This measurement of long-term stability (separate from diurnal stability) is a lower bound since we currently cannot completely compensate for the drifting bulk optics on the SCExAO testbed.Thus, the accumulated miscalibration error we measure is at least partially attributable to testbed instability; nevertheless, our results confirm that we can still close the wavefront control loop using a week-old calibration.

DISCUSSION AND CONCLUSION
The PLWFS offers a novel approach to focal-plane wavefront sensing, enabling both the correction of NC-PAs and petaling modes, which currently limit achievable contrast in exoplanet direct imaging, as well as a host of additional high-contrast applications such as starlight nulling and high-resolution spectrometer injection.We present the first real-time demonstration of the photonic lantern wavefront sensor, and verify its ability to correct both low-order Zernike modes and LWE/petaling modes from the science path focal plane.We further confirm the system's ability to track and correct dynamic Zernike WFE which varies on a timescale of ∼ 1s, representative of quasistatic NCPAs -currently one of the main limiting factors in achieving higher contrasts.Our control method has the added benefit of simplicity, using conventional linear phase retrieval and thus easily integrable into existing AO systems.However, future work still needs to be done before a PLWFS can be adopted in next-generation highcontrast imaging instruments.For one, we require a better understanding of how PL geometry and the overall system alignment impacts the properties of the AO system.In terms of practicality, we must also measure the PLWFS's WFE sensitivity and limiting magnitude in realistic conditions.In regards to the latter, we expect that the PLWFS should be able to work with fainter guide stars than conventional pupil-plane AO systems, because PLs have relatively high coupling efficiencies and concentrate collected light into fewer pixels.In the near future, we hope to take the PLWFS on-sky, and to leverage spectral dispersion and/or polarization to increase the amount of wavefront information provided by the lantern.Eventually, we believe that the PLWFS, and the wider ecosystem of astrophotonic devices, will ultimately play a critical part in the successful direct imaging and characterization of another Earth.This material is based upon work supported by the National Science Foundation Graduate Research Fellowship Program under Grant No. DGE-2034835.Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.This work was also supported by the National Science Foundation under Grant Nos.2109232 and 2308361.To simulate dynamic WFE, we continuously apply a dynamic phase map composed from the first 7 non-piston Zernike modes (tilt, defocus, astigmatism, and coma) to a DM channel separate from the closed loop channel.Denote z j n as the amplitude of mode j at timestep n.We use the following autoregressive formula to update the mode amplitudes: z n+1 j = e −1/tc z n j + a j 1 − e −2/tc m n .(A1) Here, n superscripts denote timestep while j subscripts denote mode index.t c is the decorrelation time in frames, a j is the desired average mode amplitude for mode j in units of radians RMS, and m n is the nth draw of a Gaussian distributed random variable with mean µ = 0 and standard deviation σ = 1.In this particular test, we set t c = 1000 frames and a j = 0.05 radians RMS, for all modes.The overall phase map was updated at a rate of 1 kHz.

B. MODELLED REJECTION TRANSFER FUNCTION
A classic AO loop using linear phase retrieval and a leaky integrator control law has the following complex-valued rejection transfer function for mode j: h rej,j (f ) = 1 + g j sinc(T e f )e −πif (Te+2τ ) 1 − l j e −2πiTef −1 . (B2) Here, sinc(x) ≡ sin(πx)/πx.This transfer function model is determined by four parameters: the modal gain g j , the modal leak l j , the detector integration time T e , and the loop latency τ .The leakage term l j is defined such that l j = 1 corresponds an ordinary (i.e.non-leaky) integrator.For our PLWFS tests on SCExAO, the detector integration time is 1 ms and the loop latency was independently measured using CACAO to be 2.7 ms.The leak was set to 0.99 for all tests.

FewFigure 1 .
Figure 1.End face and side views of the 19-port PL used for our wavefront sensing tests.End views are taken using a microscope at 792× magnification, and are approximately to scale relative to each other.To increase the visibility of the singlemode cores, visible light was injected through the lantern during imaging for the multicore end, and reverse injected during imaging of the few-mode fiber end.lows us to change the focal ratio of the injection as well as reposition the lantern in the focal plane.Finally, the 19 single-mode lantern output spots are imaged onto a detector (FLI C-Red 1).

Figure 3 .
Figure 3. Correction applied by closed loop, as a function of the amount of static Zernike aberration injected into the system.The sign of the y axis has been flipped for clarity (in a perfect system, the injection and correction mode amplitude would sum to 0).The left, middle, and right panels show the loop behavior when injecting tilt, defocus, and astigmatism, respectively.For each injected mode amplitude, 20 measurements of the closed loop correction were taken; vertical bars show the standard deviation.The diagonal dashed grey lines show the line y = 0.95x, following the expected correction of a static aberration for our chosen loop parameters.Hatching shows regions where the loop becomes unstable.

Figure 4 .
Figure 4. Left: correction applied by closed loop, as a function the amount of static LWE piston aberration artificially injected into the system.We only show correction of the first two piston modes for brevity; the correction of the other two modes behaves similarly.Right: a comparison between an example LWE piston mode and the associated correction applied by the PLWFS loop.Numbers in the rightmost panel show how the piston segments are indexed.

Figure 5 .
Figure 5. Colored lines: experimentally measured squared modulus of the AO system's rejection transfer function (equal to the ratio between the closed and open loop power spectral distributions) for the first control mode, at different leaky integrator gains.Transfer functions for other control modes look similar.Dashed black lines: theoretically expected squared modulus of the rejection transfer function, at different gains.