Expected performance of the Pyramid wavefront sensor with a laser guide star for 40 m class telescopes

Context. The use of artificial laser guide stars (LGS) is planned for the new generation of giant segmented mirror telescopes in order to extend the sky coverage of their adaptive optics systems. The LGS, being a 3D object at a finite distance, will have a large elongation that will affect its use with the Shack–Hartmann (SH) wavefront sensor. Aims. In this paper, we compute the expected performance for a Pyramid WaveFront Sensor (PWFS) using an LGS for a 40 m telescope affected by photon noise, and also extend the analysis to a flat 2D object as reference. Methods. We developed a new way to discretize the LGS, and a new, faster method of propagating the light for any Fourier filtering wavefront sensors (FFWFS) when using extended objects. We present the use of a sensitivity model to predict the performance of a closed-loop adaptive optic system. We optimized a point-source-calibrated interaction matrix to accommodate the signal of an extended object by computing optical gains using a convolutional model. Results. We find that the sensitivity drop, given the size of the extended laser source, is large enough to make the system operate in a low-performance regime given the expected return flux of the LGS. The width of the laser beam is identified as the limiting factor, rather than the thickness of the sodium layer. Even an ideal, flat LGS will have a drop in performance due to the flux of the LGS, and small variations in the return flux will result in large variations in performance. Conclusions. We conclude that knife-edge-like wavefront sensors, such as the PWFS, are not recommended for use with LGS for a 40 m telescope, as they will operate in a low-performance regime, given the size of the extended object.


Introduction
The next generation of Extremely Large Telescopes (ELTs) will offer unprecedented opportunities for ground-based observations.These telescopes are three to four times larger than their predecessors, providing greater resolving power that enables the detection of finer structures than previously possible.This makes ELTs a promising option for direct imaging of exoplanets and studying their atmospheric composition, potentially leading to the detection of biomarkers (Snellen et al. 2013).The lightgathering capability of these new telescopes will be an order of magnitude greater than the previous generation, allowing for the observation of more distant and faint objects, needed to study the early stages of the universe (Gilmozzi & Spyromilio 2007).
The resolving power of the ELTs will be limited by the atmospheric coherence length r 0 , which is typically between 10-15 cm.Without atmospheric compensation, ELTs would perform no better than a home telescope.Adaptive optics (AO) is used to overcome this limitation (Hardy et al. 1977).AO consists of three main components: a wavefront sensor (WFS), which measures phase aberrations introduced by the atmosphere; a deformable mirror (DM), which corrects these disturbances by deforming its surface; and a real-time computer (RTC), which processes the measurement from the WFS and sends the corresponding signal to the DM at high speed.
To measure atmosphere distortions, a guide star is necessary.Laser guide stars (LGS) have been used for over 30 years to compensate for the lack of natural guide stars (NGS) bright enough to provide good sky coverage for AO systems (Primmerman et al. 1991).LGSs are generated using a laser to excite sodium atoms present in a layer about 20 km thick at approximately 90 km above sea level (Foy & Labeyrie 1985).Due to beam divergence, atmospheric conditions, and the thickness of the sodium layer, the laser beacon in the sky is a cylindrical volume with a width in the order of one arcsec and a height of 20 km, making it a 3D object.
The Shack-Hartmann (SH) wavefront sensor is a popular choice for measuring wavefront aberrations.The SH WFS is a focal plane sensor that measures the gradient of the incoming phase of the wavefront.It uses a grid of micro-lenses, with each lens sampling a portion of the wavefront and producing an image of the source.The position of each image is proportional to the average gradient of the portion of the incoming phase of the wavefront.However, for a 40 m telescope with an 80 x 80 subaperture SH WFS considering a side launch telescope, the LGS spot is four times wider and up to sixty times larger than the diffraction-limited spot of each subaperture.This means that to correctly sample the laser spot, the detector of the SH must have a large number of pixels (e.g.1600 x 1600) (Fusco et al. 2019).This wavefront sensor is currently being used in the design of some of the ELT first light instruments, such as the High Angular Resolution Monolithic Optical and Near-infrared Integral field spectrograph (HARMONI) (Thatte et al. 2016) and the Multiconjugate adaptive Optics Relay For ELT Observations (MOR-FEO) (Ciliegi et al. 2022).
The pyramid wavefront sensor (PWFS) (Ragazzoni 1996) is a pupil plane WFS from the family of the Fourier Filtering WFS (FFWFS).Its working principle is similar to the Foucault knifeedge test, but instead of blocking part of the light, the PWFS uses a glass pyramid to split the light in the focal plane and generate four images of the entrance pupil each of which with a specific intensity pattern that encodes phase information.Given the difficulties of the SH WFS with LGS, the PWFS has been proposed as an alternative (Le Roux 2010; Pinna et al. 2011;Quiros-Pacheco et al. 2013;Blain et al. 2015;Esposito et al. 2016), given its higher sensitivity and lower demand on pixels.An equivalent 80 x 80 subaperture PWFS would need a detector no bigger than 240 x 240 pixels, making it possible to use fast, low-noise detectors.
Modulation of the PWFS is a commonly used technique for NGS, where a known oscillating aberration (typically tip-tilt) is introduced which allows adjusting the properties of the PWFS: an increase in modulation radius gives a higher dynamic range at the cost of lower sensitivity (Vérinaud 2004;Fauvarque et al. 2016).The integration time of the detector has to be an integer multiple of the period of the oscillation.This produces a signal equivalent to having many incoherent point sources arranged in a circle (assuming circular modulation, a static atmosphere during integration and no anisoplanatism).
The SH WFS with LGS for a 40 m telescope will need a detector with too many pixels to cope with the dynamic required to sense LGS spots, affecting the associated sensitivity.We were therefore interested in investigating the performance of the PWFS when using an LGS, given its higher sensitivity when using an NGS and its lower demand on pixels.The performance will be measured as the Strehl ratio obtained in an AO loop for different return fluxes of the guide sources.To do this, we first have to understand the properties of the LGS, and how this artificial star shapes the signal that we measure with the PWFS.As the computing requirements are high (in terms of memory and time) we had to develop new techniques that allowed us to simplify the simulations.These simulations were based on the endto-end physical optics models from OOMAO (Conan & Correia 2014).
The main objective of this work is to study the performance of the PWFS for different sources: NGS, LGS-2D and LGS-3D, and different telescope sizes from 8 to 40 m.The main focus is to test the influence of photon noise in closed-loop operation and to compare the end-to-end (E2E) results with predictions using linear models, and finally be able to compute the expected performance for a 40 m telescope.
One of the main difficulties for computing the performance was the size of the simulations.Considering a side launch LGS, by using a geometrical approach it is possible to compute that the extension of its image in a 40 m telescope is about 20 arcsec, taking into account both the angular size and the depth of field.If using 2.4 pixels per λ/D (i.e.1.2 x Shannon), and an observing wavelength of 589 nm, those 20 arcsec correspond to just under 16,000 pixels.Leaving space for diffraction or atmospheric effects, the matrices that would be needed to propagate have approximately 20,000 x 20,000 complex, double-precision entries for each sample of the LGS.The interaction matrix for an 80x80 deformable mirror would need around 11,000 frames to be computed.Even for good computers, this calibration process might take months or even years.
To achieve the goal of computing the performance of the 40 m telescope, in Sect. 2 we present the mathematical formalism we use to process the raw data from the PWFS, and introduce an analytical model that we will use to predict the performance for the 40 m telescope, instead of having to do the full end-toend simulations.This model requires the interaction matrix of the system, therefore Sect. 3 is about how we simulate the LGS, such that we are able to build an end-to-end interaction matrix.Sect. 4 presents some of the issues and alternatives for the computation of the interaction matrix both in simulation and for a real telescope.Sect. 5 is about how to use a convolutional model to optimize the interaction matrix for the LGS, from the one calibrated using a point source.Finally, in Sect.6 we show endto-end closed-loop simulations of smaller telescopes (8 and 16 meters) to validate the predictions of the analytical noise model.With the validated model, we are then able to extrapolate the results and compute the expected performance of the AO loop for the 40 m telescope.

Signal and reconstruction
The framework we used for the signal processing of the PWFS in this work is the one presented in Chambouleyron et al. (2023).Given an input phase ϕ, we processed the raw signal from the PWFS I(ϕ) to obtain the reduced intensities ∆I(ϕ).For the reference intensity I 0 we used the signal of the PWFS corresponding to a flat wavefront.We built the interaction matrix D = [δI(ϕ 1 ), . . ., δI(ϕ N ))] using the push-pull method inputting an orthogonal basis [ϕ 1 , . . ., ϕ N ] in the phase space corresponding to Karhunen-Loève modes.The full notation can be found in App.A The reconstructor can then be obtained as the pseudo-inverse of D as D † = (D t D) −1 D t .Assuming a small phase regime and the linearity of the PWFS, the modal reconstruction of the phase ϕ ′ can be obtained with the following matrix-vector multiplication (1)

Noise propagation
Noise in the AO loop is given by two distinct terms: read-out noise (RON) and photon noise.The residual variance due to noise for each corrected mode is given by the sum of both noise contributions.In this work, we will use the analytical model developed in Chambouleyron et al. (2023), and the specific notation can be observed in App.B. As the detectors needed for the PWFS are small, it is possible to use ultra-low noise detectors with sub-electron RON (Gach et al. 2011), meaning that we can neglect read-out-noise, therefore it is possible to assume that the only contribution to noise is photon noise.Even if detector noise would have a significant impact, photon noise is a fundamental limit that is independent of the technology being used.With the analytical model it is possible to compute a sensitivity to photon noise s γ (ϕ i ) (See Chambouleyron et al. (2023), Eq. 23 or App.B, Eq.B.3), which encodes the robustness of the system to photon for an 8 m telescope with a 4λ/D modulated NGS.The solid line corresponds to the residual phase variance σ 2 noise using sensitivity analysis from equations 2 and 3, and the markers correspond to the mean of 200 end-to-end iterations, with the errorbar the standard deviation of the residual variance.For reference, at magnitude 10, N ph = 4.5 × 10 4 photons.
noise when measuring the amplitude of mode ϕ i with the PWFS.If we have a frame with N ph photons, the total residual variance introduced by photon noise at that measurement is . (2) To compare this approximated model with E2E simulations, we simulated 200 realizations with no atmosphere (i.e. a flat wavefront) of an open loop AO system with no controller for a 4 λ/D modulated NGS with magnitudes from 5 to 20 to observe the effects of photon noise in the residual variance.We found good agreement between the E2E simulation and the sensitivity model, as it can be seen in Fig. 1, with the predicted residual variance as the red line and the E2E simulations as the orange markers.
We needed to see if our noise model works in a closed loop, taking into account its temporal properties.The controller used was a discrete integrator in the feedback path with gain α.The dynamics of the DM were modeled as a Zero-Order Hold (ZOH) and the WFS as a ZOH with a time delay of one period T .An additional time delay of one period was assumed for the computation of the signal.Taking α = 0.3 and a sampling frequency F = 1 kHz, we can integrate the magnitude squared of the noise transfer function over the bandwidth to obtain the total noise σ 2 noise that is propagated through the AO loop.Solving the integral we get with δ = 0.33 (See the details in App.C).To compare the model with the E2E simulations, we simulated 200 realizations of a closed loop for a flat wavefront.We found good agreement LGS Na Layer Fig. 2. Schematic of the LGS and the image formation.The drawing is not to scale and proportions were altered for ease of understanding.
with the sensitivity analysis combined with the control theory, as can be observed in Fig. 1.The light green line represents the residual variance predictions and the E2E results as the bluish green markers, showing good agreement between simulation and theory.The uppermost point of the closed loop E2E simulation deviates from the expected behavior.This might be because of three reasons: the non-linearities of the pyramid decrease the sensitivity, which increases the overall noise propagated, photon noise sensitivity assumes that the illumination pattern in the detector is similar to the reference intensity, therefore for large residual phase variances, the sensitivity might not accurately predict the propagation of noise, and the non-linearities of the pyramid having an effect on the control loop which were not taken into account when computing the NFT.The first two affect both the open and closed loop cases, therefore the latter is the most plausible explanation of the deviation of the uppermost point of the closed loop.
To be able to compute the sensitivity of the system, we have to compute the interaction matrix.The next section is about how we simulated the LGS, such that we can then build an end-to-end interaction matrix.

LGS geometry
A simple schematic of the LGS and how its image interacts with the PWFS can be observed in Fig. 2. The focal plane image of the LGS is not a perfect point source but rather has a width of around 1 arcsec and can be elongated in the order of tens of arcsec in one axis for a 40 m telescope due to the thickness of the sodium layer and the laser being launched from the side of the primary mirror.To understand the effects of this elongation, Fig. 3 shows how tip, tilt, and positive and negative focus impact the distribution of light in the detector of the PWFS.For each portion of the elongated LGS, the light distribution on the sensor will be a combination of these effects.To understand the light distribution on the detector of the PWFS shown in the bottom row of Fig. 4, it is easier to divide the LGS into two halves.The top half is focused before the tip of the pyramid, skewing the light in the detector inwards, but due to the elongation, this portion mainly interacts with the upper faces of the pyramid, therefore the light gets refracted to the bottom pupils.Similarly, for the bottom half the light is focused after the tip of the pyramid and shifted toward the lower faces, making the light distribution on the detector skew outwards and to the top pupils.This effect is dependent on the telescope size, being more important for bigger telescopes, as for the 40 m telescope there is almost half of the pixels with little to no illumination.An interesting case is to reduce the thickness of the sodium layer to zero, essentially obtaining an artificial guide star with no thickness, whose size would be determined by the width of the sodium laser and the atmospheric conditions, as can be observed in the left row in Fig. 4.This case is interesting as it allows us to observe which elongation (x/y or along z) has a bigger impact on the PWFS sensitivity.Also, it allows us to obtain an upper bound on the performance of the system regarding noise propagation.An instrument can be built considering the Z elongation of the LGS, interacting with it as if it were only a 2D object.This case will be denoted LGS-2D, and when using the full 3D structure of the laser beacon it will be called LGS-3D.
One interesting aspect to consider is the dependence of the elongation of the LGS on the Zenith angle.Both the angular size ∆α and the extension normal to the focal plane ∆z are proportional to the cosine of the Zenith angle (see App. D), which means that the worst-case scenario for the LGS-3D corresponds when observing directly up.The more the zenith angle increases, the more similar the LGS-3D is to the LGS-2D.
It is important to consider that the size of the LGS acts similarly to the modulation with an NGS, as each sodium atom that emits light acts as a point source, and their contribution to the pyramid signal is incoherent with every other atom.One difference with the NGS, which usually is operated with modulation of a few λ/D (Schwartz et al. 2020), is the magnitude of this equivalent modulation, as 1 arcsec is equivalent to 65 λ/D for an 8 m telescope, and around 330 λ/D for a 40 m, considering for both cases λ = 589 nm.This equivalent modulation is responsible for lowering the sensitivity of the instrument (Quiros-Pacheco et al. 2013).

LGS sampling
To simulate a LGS it is necessary to discretize the sodium layer into samples.These samples correspond to individual point sources propagated through the PWFS, so that the PWFS signal is the incoherent sum of the signal produced by each sample.Previously, a common approach was to uniformly sample the LGS (Le Roux 2010; Quiros-Pacheco et al. 2013;Blain et al. 2015;Esposito et al. 2016;Viotto et al. 2018), dividing the sodium layer into regularly spaced slices, each of which containing regularly spaced point sources.Then, using a sodium density profile, the contribution of each layer was scaled to take into account the relative distribution of sodium atoms.There are several issues with this method of simulating an LGS: (i) Many points have little contribution to the signal but are equally expensive computationally.(ii) Large portions of the LGS are not sampled, therefore it is difficult to test real-like sodium profiles (iii) The periodicity of the samples can introduce unwanted structures given by the symmetry and periodicity of the grid used for sampling.
Instead, in this work a Monte Carlo approach was used to simulate the LGS.To do this, the three coordinates of each sample were randomly drawn from sets that followed a specific prob- ability density function.The X coordinate was drawn from a set that followed a Gaussian distribution centered at zero, with a Full Width at Half Maximum (FWHM) of the equivalent of 1 arcsec at 90 km, as can be observed in the left plot in Fig. 5.The Y coordinate had the same FWHM but was centered at the side of the telescope, to simulate a laser being launched from the side of the primary mirror, as can be observed on the middle plot in Fig. 5.For the Z coordinate, the relative distribution of the sodium atoms can be used as a probability density function, and generate a random set of samples that follows that distribution, as can be observed on the right plot in Fig. 5. Fig. 6 shows an example of the complete sampling of an LGS, where the color of each sample represents the relative density of samples, normalized such that the greatest probability is 1.The top image shows the physical location of each sample in the sodium layer, with a corner cut out such that is possible to observe the structure on the inside of the LGS.The bottom image shows the relative angular position of each sample as observed by the telescope (translated such that the center of mass is at the center), where it is possible to observe the elongation of the LGS.
Throughout this work, seven different sodium profiles are tested when possible, given the extensive simulation times needed to test each one.These sodium profiles correspond to typical conditions, each of which presents a distinctive characteristic, as presented in Fig. 2 of Pfrommer & Hickson (2014).

A new, faster technique to simulate an LGS: ROI Propagation
Building an interaction matrix can be a lengthy process, as we have to simulate two complete end-to-end propagations for each mode, taking into account the signal of each and every sample.If we consider the resolution of the telescope, the field of view and the number of corrected modes, it is possible to compute that the time to build an interaction matrix grows as the sixth power of the diameter.With this in mind, we developed a new technique we call Region of Interest (ROI) Propagation that tackles the problem of the large field of view needed to simulate the LGS.It is based on the fact that each individual sample of the LGS interacts with a small portion of the pyramid (Oyarzún et al. 2022).The general idea of the method is instead of using the full field of view needed to accommodate the LGS, we take only the portion of the pyramid the sample would interact with.To do this, we translate and crop the pyramid phase mask to compensate for the tip and tilt of the sample.To simulate the LGS-3D, we add the focus coefficient of each sample, given by its distance from the telescope.For the 2D version, this step is skipped.Finally, we propagate each sample individually and incoherently sum the PWFS signals of all the LGS samples to obtain the final signal.
To explain the mathematical basis of this method, let's consider the incoming wavefront of a single sample.This wavefront will have contributions to its phase coming from the atmosphere ϕ atm , the height of the sample ϕ f ocus , and its position in the sky ϕ til−tilt with respect to the pointing of the telescope.At first, let's only consider the contributions of the atmosphere and the height of the sample.The wavefront can be expressed as ψ(x, y) = I p (x, y)e i(ϕ atm (x,y)+ϕ f ocus (x,y)) , (4) with x and y the coordinates of the entrance pupil and I p the pupil indicative function.A simplified form of the wavefront at the focal plane Ψ can be obtained by taking the Fourier transform of the wavefront at the pupil plane (5) Now, considering that the sample is located at an angle displacement of (α, β) with respect to the pointing of the telescope, the wavefront at the focal plane is displaced by that amount, This wavefront is then affected by the phase mask m characterized by m(u, v) = e iϕ mask (u,v) , and then, considering x ′ and y ′ the coordinates of the detector plane, the light distribution of the pupil images I(x ′ , y ′ ) is obtained by taking the Fourier transform of the combination of the wavefront at the focal plane and the phase of the mask Using the properties of the Fourier transform, the previous expression can be expressed as As we get back Ψ(u, v), it means that instead of having to simulate the complete field of view for each sample, the phase mask can be shifted to take into account the position of each sample with respect to the pointing of the telescope, and the field of view can be adapted for each sample such that it is big enough to contain the complete image of the star.
To illustrate how this works, Fig. 7 shows an example for a 40 m telescope of three samples at 400 (top), 3000 (middle) and 6000 (bottom) meters away from the plane of focus, located at 90 km from the telescope, where the left column shows the image of the sample in the focal plane, the middle column shows the region of interest of the pyramidal mask the sample is interacting with and on the right column the image of the pupils in the detector plane.
Special care has to be taken when including atmospheric turbulence, to contain the complete image of the sample within the selected field of view.Fig. 8 shows how this method handles seeing limited samples.
To check if this new method produced the same signal as the complete E2E considering the full FoV for each propagation, we simulated both a propagation for a flat wavefront and another with atmospheric conditions for an 8 m telescope.We then normalized the images and computed the difference, finding that for each case both methods produce practically the same signal.Fig. 9 shows the images obtained in each simulation, where the right column corresponds to the difference between the two methods.To give a metric of how similar these methods are, we took the RMS of the difference of the atmosphere-affected pupils I(ϕ) and we found an RMS value less than 0.1 % of the average pixel value.For this simulation, the new method was computed over 30 times faster.As the telescope size gets bigger, this new method provides even greater speedup with respect to the full FoV method.
It is important to remark that even with this new method, a full end-to-end interaction matrix for the 40 m telescope is too demanding both in time and computational resources: we could not perform with our current hardware, as it would have taken months to compute.Nevertheless, in the next section, we used it to speed up the E2E simulations of smaller telescopes up to 24 m in diameter, to explore an alternative calibration procedure that would allow us to obtain an approximation of the interaction matrix for the 40 m telescope, by using one calibrated using a point source.

Optical gains
When calibrating the interaction matrix for a real instrument, it can be challenging to use an LGS-like source.Therefore, it is necessary to test an ideal case where we can calibrate on an LGS and a more realistic case where we use a point source for calibration.To be able to compare the signal obtained from these two calibration procedures, we can use the interaction matrix of each to observe differences in signal intensity and composition.To compare two signals, a reference signal a, and a test signal b, the interaction matrix calibrated using source a is used as the reconstructor and the interaction matrix calibrated using source b as the signal (recall equation 1, but instead of a vector  of measurements ∆I(ϕ) we use the complete interaction matrix calibrated using source b).Using this we obtain what we call a Modal Transform Matrix (MTM).Mathematically, where the diagonal of the MTM, known as optical gains (OG) (Korkiakoski et al. 2008;Deo et al. 2018;Chambouleyron et al. 2021), corresponds to the intensity of the signal obtained using b as a guide star when compared to a, and the non-diagonal terms correspond to mode confusion (i.e. the difference in the structure of the signal).As an example, if MT M a→b (i, i) = 0.7, that means you lose 30% of the signal intensity for mode ϕ i if you change from source a to b.
Using the ROI Propagation technique, we computed the endto-end interaction matrix D LGS for the first 350 KL modes for 8, 16 and 24 m telescopes.We used only 350 modes for this test, given that for the 24 m telescope this process took days to compute.Using an NGS with 4 λ/D modulation as a reference, we computed the MT M NGS →LGS and for each telescope diameter we got a matrix that was mainly diagonal, as it can be seen in Fig. 10, where we show the example of the 8 m telescope.This diagonal structure means that the signal coming from an LGS has almost the same structure as the NGS, but is attenuated by the value in the diagonal.
This attenuation of the signal comes from the spreading of the light of the LGS over a larger area of the pyramid than the NGS.The pyramid mainly produces a signal from the light that interacts with its edges and for the LGS, a large portion of the light falls in the faces of the pyramid, which from the point of view of the rays of light is just an inclined plane of glass.As this produces no filtering, there is no signal.
The fact that the signal from the LGS is closely related to the NGS's means that it is possible to build the interaction matrix using a point source as a reference, and then optimize it for the LGS by multiplying it by a diagonal matrix whose elements are the optical gains OG NGS →LGS .

D
LGS ≈ D NGS OG NGS →LGS . (11) This not only gives an interesting alternative to compute the interaction matrix for the LGS in simulation, but it also has implications in a real telescope, as the calibration source would most likely be a point source.The interaction matrix for the point source D NGS is relatively easy to obtain in a real scenario, but the optical gains needed to optimize the reconstructor for the LGS might not be, as they depend on the ever-evolving structure of the sodium layer, making the pre-computation of these values not too effective.
One way to have access to an approximate interaction matrix for the LGS with a real telescope, and therefore to the optical gains, would be with the introduction of a gain scheduling camera and the use of a convolutional model, as proposed in Chambouleyron et al. (2021), where the focal plane image of the guide star is used to estimate it.In the next section, we show that it is possible to use this technique with an extended object such as an LGS to obtain the optical gains.Using this method it is also possible to keep track of the evolving structure of the sodium layer, optimizing the reconstructor to accommodate the changes in the LGS.

Accessing the optical gains by means of a convolutional model
The convolutional model introduced by Fauvarque et al. ( 2019) can predict the signal of a Fourier filtering wavefront sensor by means of computing its impulse response (IR) (signal when introducing Dirac's delta in phase).This model makes assumptions on linearity, which are a simplification of complete E2E propagation.This makes its predictions less accurate, but much more efficient.If we have an FFWFS characterized by a mask m and the focal plane image of the source ω interacting with the mask (Fig. 4 top), the IR can be computed as where − is the conjugate operator and ˆthe Fourier transform.Using this tool, the reduced intensity of a FFWFS can be obtained as where ⋆ denotes the convolution operation and I p the pupil indicative function.To be able to use this tool, a single focal plane image of the LGS has to be computed to get the impulse response, and with that, each column of the interaction matrix can be obtained by a single convolution, reducing the time needed to compute it almost 2N times, where N is the number of samples used.
As the convolutional model has mainly been tested with 2D modulated NGS, we first had to test the validity of using this model with an extended 3D object, such as an LGS.To do this, we used the convolutional model to re-compute the interaction matrices D Conv for the 8, 16, and 24 m telescopes we had previously computed using end-to-end methods.We then compared them by computing the Modal Transfer Matrix.The MT M LGS →Conv for each telescope diameter was similar to the  identity, meaning that the convolutional model accurately predicts the structure and intensity of the signal produced by the LGS.Fig. 11 shows the MT M LGS →Conv for the 16 m telescope.Now, by using the convolutional model we can predict the values for the optical gains needed to optimize the reconstructor, and compare them to the optical gains computed using the full E2E methods, as seen in Fig. 12.The optical gains predicted by the convolutional model closely match the ones obtained using the E2E simulation, meaning that the model can be used to compute the values needed to optimize the reconstructor such that it can properly use the signal of the LGS.
From Fig. 12 it is possible to observe that the convolutional model struggles to estimate correctly the optical gains at the first few modes, corresponding to low spatial frequency.This could have a large impact on Tip, Tilt and Focus, but as we are dealing with an LGS, we won't be measuring those modes.The model also has a problem recovering the value of the optical gains for specific modes across all telescope sizes (e.g.mode 211 is predicted with a lower value).These modes have their intensity localized more on the edges of the pupil.This causes problems with the convolutional model, as the discontinuity of the pupil indicative function is considered as signal, which is exaggerated for modes that have more energy at the edges.
We recommend using the convolutional model just to compute the values of the optical gains, and with them optimize the interaction matrix to the LGS, instead of using the interaction matrix obtained with the model directly.This is because the model has issues with the discontinuities in the pupil indicative function, predicting an excess of signal in the edges of the pupil images.This is especially noticeable for low spatial frequencies.If the interaction matrix obtained with the convolutional model is used, then it is probable that the corrections at the center of the pupil might behave properly, but a large accumulation of phase might occur at the edges.
The optical gains change for each telescope size.This is because as the telescope size gets bigger the relative size of the LGS gets bigger with respect to a diffraction-limited spot, as 1 arcsec is equivalent to 65 λ/D for an 8 m telescope and almost 200 λ/D for a 24 m one.This is responsible for decreasing the amount of light of the LGS that is split by the edges of the PWFS, and it is mainly in the edges where the signal of the PWFS is coming from, lowering the strength of the signal.This results in a decrease in optical gain as the diameter of the telescope increases.
On a real telescope, introducing a gain-scheduling camera would allow obtaining focal plane images of the LGS, and then using the convolutional model it would be possible to compute the interaction matrix for the LGS.It can then be used to compute the optical gains needed to update the point source calibrated interaction matrix using equation 11.
With this tool, now it is possible to compute the optical gains needed to optimize the reconstructor calibrated with a point source to accommodate the signal of an LGS for a 40 m tele-We computed the optical gains for 5100 modes for every sodium profile for the LGS-3D, and for the LGS-2D, and plotted them in Fig. 13.It is possible to observe that the optical gains for the LGS-3D are smaller than for the LGS-2D, which is expected, given its larger size.On average, the optical gains for the LGS-3D are 2.5 times smaller, meaning that the equivalent size of the LGS-3D is about 2.5 times larger than the LGS-2D.
The values of the optical gains vary up to 40 % when changing the sodium profile, which implies that it would be best if an online system is continuously updating these values, given that in the worst-case scenario the gain could be up to 40% off.The frequency that the gain-scheduling camera should take images to update the optical gains should follow the time scale of the changes in the sodium layer, which typically is in the order of a few minutes (Pfrommer & Hickson 2014).
Optical gains encode the strength of the signal when compared to the signal obtained with an NGS, which also implies a loss in sensitivity.These quantities, optical gain and sensitivity are proportional to each other, meaning that, for example, for a given mode ϕ i an optical gain of 0.3 implies that the WFS has 30 % of the sensitivity when using a NGS.Considering equation 2, this means around 11 times more residual variance being introduced.
When going from an NGS to an LGS-2D, there is a reduction in the intensity of the signal of around 10-30 times for low-order modes (<1000) and around 5-10 times for higher-order.Then if we take into consideration the thickness of the sodium layer, i.e. going from the LGS-2D to the LGS-3D, then there is a drop Fig. 13.Optical gains for a 40 m telescope needed to optimize the reconstructor.In green are the optical gains for the LGS-2D, and in blue for the LGS-3D.The solid line corresponds to the average optical gain across all sodium profiles and the shaded region is limited by the maximum and minimum optical gain at each mode in the intensity of the signal of about 2.5 times.This suggests that the biggest drawback on the PWFS sensitivity with extended objects is the width of the laser source, rather than the thickness of the sodium layer.Now that we have shown that the convolutional model can be used to compute the optical gains, it only takes a fraction of the time to build the interaction matrices for extended objects.In the next section, we will use these to perform end-to-end closedloop simulations of smaller telescopes, and then, in combination with the sensitivity model to predict the expected performance for the 40 m telescope.

End-to-end simulations
We performed E2E simulations of a closed-loop control system for a 4 λ/D modulated NGS, the LGS-2D and LGS-3D for 8 and 16 m telescopes.These simulations had two main purposes: first, we wanted to test if the point source calibration, optimized using the convolutional model would work in a closed loop for the extended objects, and second to test if the analytical model would predict the performance of the AO loop.
The simulation parameters are found in table 1.For the throughput of the telescope, we chose to use 100 %, as it will later be easier to adapt these results when estimations of the actual efficiency of the system are computed.For the zenith angle we chose 0 degrees because it will show the biggest difference between the LGS-2D and LGS-3D.Choosing a higher zenith angle would make the difference smaller, as discussed in Sec. 3. To select the number of samples of the LGS, we simulated the sensitivity to photon noise for a 16 m telescope.We tested samples ranging from 100 to 100, 000 and we found that beyond 10, 000 samples, the values of the sensitivities did not change, therefore we picked that amount for the rest of the simulations.
The cone effect will have a large impact on the residual phase when using a single LGS, and for that reason, the ELT will use multiple lasers for tomographic reconstruction of the wavefront (Thatte et al. 2016;Ciliegi et al. 2022).But, as it is not correlated with photon noise, we chose to use a single ground layer to discard its effects, as it is outside the scope of this work.For the same reason, we chose to use a static atmosphere, because the moving atmosphere would interfere with the measurements of the impact of photon noise.The detectors for the PWFS we used had enough pixels such that aliasing would have a minimum impact.For this reason, the 8 m telescope had 60 x 60 subapertures and the 16 m telescope had 80 x 80 subapertures.As we tested the performance for different telescope sizes, we used a DM pitch of 50 cm as a constant across all simulations.This meant that for the 8 m telescope, we used 17 actuators across the pupil and for the 16 m, 33.For the science wavelength, we chose to be the same as the sensing wavelength.The residual phase due to noise will depend on the science wavelength, but the differences between the NGS and the extended objects will remain the same.The interaction matrices for the extended objects were built using the convolutional approach to compute the optical gains and then optimize an interaction matrix calibrated using a point source to accommodate the signal coming from the LGS, as de-scribed in Sec. 4 and 5.By iterating we found that it is best to use a high modulation (> 20 λ/D) for the point source calibrated interaction matrix, for the PWFS to be in a similar sensing regime as with the extended objects.
As a real LGS gives no information about the global tip or tilt and has problems with the focus term given the evolving structure of the sodium layer, we ran in parallel a noiseless AO loop that controlled tip, tilt and focus.This also implied that we did not consider the sensitivities for these three modes in the predictions of the total noise transmitted through the loop.
Due to computational limitations, we were able to perform E2E simulations of the closed loop for a maximum telescope diameter of 16 m.For this reason, we tested the predictive capabilities of the sensitivity method by simulating the E2E closed loop for 8 and 16 m telescopes.These results are shown in Fig. 14, where the solid lines correspond to the theoretical performance predicted using the sensitivity analysis, including the fitting error, and the markers correspond to 20 realizations for different atmospheric phase screens.The top plot corresponds to the simulation using the 8 m telescope and the bottom plot to the 16 m.A vertical yellow stripe was added from magnitudes 7 to 9, to represent the expected return fluxes for the laser guide stars for the ELT.
The first result from these figures is that it is possible to close the loop for the extended objects using the calibration procedure utilizing the convolutional model and applying optical gains to optimize the point source calibrated interaction matrix and be able to obtain almost the same performance at high flux as the NGS.This indicates that by introducing a gain scheduling camera it would be possible to compute these optical gains and to have an online method of optimizing the reconstructor that follows the changing density profile of the sodium layer.
Given its higher sensitivity, an NGS can be used for up to three magnitudes more than for the extended objects for the 8 m telescope and for four to five magnitudes more in the 16 m telescope for the LGS-2D and LGS-3D respectively.In fact, the limiting magnitude for the NGS will only have a small to no dependence on the diameter of the telescope used.This is because, even though bigger telescopes collect more light, they also need more actuators to maintain the same actuator pitch, and these two effects cancel each other.For the LGS-2D, the increase in light collected gets almost exactly canceled by the increase in the relative size of the laser width which decreases the sensitivity, but as bigger telescopes need more actuators, increasing the diameter of the telescope decreases the limiting magnitude.For the LGS-3D the effect of the increase in relative size of the laser width and the increasing extension of the source makes the limiting magnitude decrease faster than for the LGS-2D.This effect can be seen in figure 14, as the two curves for the extended object separate and move to the left.
When comparing the E2E results with the sensitivity analysis, it is possible to observe that the noise models accurately predict the performance of the closed loop system.What is interesting to note is that the computation time needed to obtain these solid curves is thousands of times less than the full E2E method to obtain the markers, as we can use the convolutional model to compute the sensitivity of the PWFS using extended objects.

Extrapolating to 40 m
Now that we have shown that the sensitivity analysis can be used to predict the performance of the E2E closed-loop simulations, which would otherwise take hundreds or even thousands of hours to compute, we can now predict the expected performance for the 40 m telescope.To do this, we first built the interaction matrix for the 40 m telescope for an NGS for 5000 KL modes.This process, even though it was slow could be computed in a matter of hours.Then, we computed the reference intensity and a single focal plane image of the LGS as seen through the 40 m telescope.With the focal plane image, we could compute the optical gains using the convolutional model and then obtain the interaction matrix optimized for the LGS.With the calibration ready, we could get the sensitivities and compute how noise would propagate through the system.Fig. 15 shows the expected performance of the PWFS for the three tested sources for a 40 m telescope.In this plot it is possible to observe that the limiting magnitude of the NGS remains approximately constant with respect to the 8 and 16 m telescope cases, with a limiting magnitude 4.5 to 6.1 higher than for the extended objects.The difference in limiting magnitude for the LGS-2D and LGS-3D is 1.6 magnitudes and both extended objects have a drop in performance at around magnitude 8-9.As stated before, the simulated throughput of the system is 100 %, but if taking 25 or 50 %, then both extended objects will be operating in a condition where slight changes in Fig. 15.Sensitivity predictions of closed-loop performance for a 40 m telescope.For the LGS-3D the solid line corresponds to the average performance across all sodium profiles and the shaded region is limited by the maximum and minimum performance given all sodium profiles.the return flux of the LGS will mean large drops in performance, with the LGS-3D the most affected.
It is interesting to note that even for the 8 m telescope (e.g. the VLT) the performance of the AO loop starts to drop at the expected return fluxes.This result implies that it might not be advisable for the VLT or ELT to use these kinds of wavefront sensors (knife-edge like WFS) with extended guide objects such as an LGS, given that the size of these objects reduces the sensitivity up to a point where the flux of the LGS is a limiting factor in the performance, as small variations in return flux might result in large drops in performance for both the LGS-2D and LGS-3D, the latter being the most affected.As we only tested for photon noise, this is a fundamental limit for the performance.If adding read-out noise, even if it has a small contribution, it will lower even further the performance.

Conclusion
In this work, we computed the expected performance of the AO loop for a PWFS using an LGS for a 40 m telescope.To do this, we used a sensitivity model to predict the residual phase due to photon noise, which when combined with control theory could predict the residual variance in closed-loop operation.For this model, we needed access to the interaction matrix calibrated for each source.
To compute end-to-end interaction matrices, we introduced a new way to discretize an LGS and developed a new method on how to simulate extended objects for any FFWFS, which we called the ROI Propagation.With this method we could simulate the light propagation and obtain the signal of the wavefront sensor in a fraction of the time compared with traditional methods, yielding the same results and maintaining the E2E nature of the full field of view propagation.As even with this new method we could not simulate the 40 m telescope, we used it to show that it was possible to compute the interaction matrix for a point source, and then use optical gains to optimize it for the extended object.This procedure is not only useful for simulation purposes but also for a real telescope, where the calibration source will be most likely a point source.
To obtain these optical gains proposed the use of a scheduling camera, which by using a convolutional model could use focal plane images of the source to compute the optical gains needed to optimize the interaction matrix for the extended object.We showed that the convolutional model accurately predicted the value of these optical gains, by comparing the values obtained using E2E simulations and the ones obtained using the model.
Finally, we performed simulations of a closed loop for 8 and 16 m telescopes and determined that it was possible to close the loop using the optimized point source calibrated interaction matrix.Also, we found good agreement between the results obtained using the E2E methods and the sensitivity model.With this, we could predict the performance of the PWFS when using an extended guide star for a 40 m telescope.We found that for both the LGS-2D and the LGS-3D the loss in sensitivity means that they will be operating in a region where the flux of the LGS will generate a drop in performance.Small variations in the return flux of the LGS will result in large variations of performance, an effect that would also happen for smaller telescopes.
An interesting alternative would be to design a translation invariant WFS, such that the size of the source would have a minor impact on the performance.With a higher sensitivity, it would be possible to run the loop at higher frequencies or observe at smaller wavelengths.A translation-invariant WFS could be, for example, a repeating phase mask, in which a specific pattern is repeated in space.As the pattern repeats, the position of each sample (and therefore the size of the source) will have a minimum impact.An issue with it would be the diffraction effects and therefore the possible loss of light.
With this, we conclude that the use of knife edge-like wavefront sensors might not be a good alternative for LGS wavefront sensing for 8 to 40 m telescopes, as even if the instrument is capable of dealing with the Z-extension of the source, the width of the laser beam is enough to lower the sensitivity such that photon noise decreases the performance of the AO loop considerably at the expected return flux of the LGS. with s the Laplace's transform variable that can be expressed as s = jω with j the imaginary unit and ω the angular frequency, for the purposes of computing the gain of the system.
As the forward path for the noise is equal to the loop transmission, the Noise Transfer Function NT F(s) can be expressed as As photon noise is white noise it has uniform Power Spectral Density (PSD), therefore we can integrate the magnitude squared of the NTF over the bandwidth to obtain the total noise that is propagated through the AO loop

Appendix D: Geometry of the LGS
Approximating the sodium layer to be plane-parallel, starting at a height h l and ending at h h (h l < h h ), pointing the telescope at a zenith angle θ it's possible to compute that the approximate angular size ∆α of a side-launch LGS as Then, considering an effective focal length f , the extension normal to the focal plane ∆z can be computed as Assuming that the effective focal length of the telescope is much smaller than the distance to the sodium layer, we can perform a Taylor approximation of the denominator therefore, the approximate expression for the normal extension of the LGS is .4)

Fig. 1 .
Fig. 1.Evolution with respect to the magnitude of the guide star of the residual phase variance due to photon noise in open and closed loop for an 8 m telescope with a 4λ/D modulated NGS.The solid line corresponds to the residual phase variance σ 2noise using sensitivity analysis from equations 2 and 3, and the markers correspond to the mean of 200 end-to-end iterations, with the errorbar the standard deviation of the residual variance.For reference, at magnitude 10, N ph = 4.5 × 10 4 photons.

Fig. 3 .
Fig. 3. Illustration of the effects of positive, zero and negative focus (top row) and tip and tilt (bottom row) on the light distribution in the detector of the PWFS.The light cone is represented by the color blue and the glass pyramid by the cyan object.

Fig. 4 .
Fig. 4. From left to right, the simulations correspond to a 4λ/D modulated NGS for a 40 m telescope, LGS-2D, and LGS-3D for 8, 16 and 40 m telescopes.Top row: focal plane images.The scale was normalized such that the maximum pixel value in each image would be one; middle row: focal plane images with a logarithmic stretch for better visualization; bottom row: Intensities in the detector of the wavefront sensor for a flat wavefront.The intensities are normalized such that the maximum pixel value is one.Note that the field of view for the NGS corresponds to 0.4 arcsec, meanwhile, for the extended sources, the field of view is 30 arcsec.The last column includes a color bar that is valid for the whole row.

Fig. 5 .
Fig.5.Probability density functions and sample histograms for the coordinates of each sample.The X and Y coordinates are randomly drawn from Gaussian distributions, whose width depends on the width of the laser beam, and the center of the Y distribution is on the edge of an 8 m telescope.The Z coordinate is randomly drawn from a probability density function that follows the sodium profile.

Fig. 6 .
Fig. 6.Top image: Position of each sample of the LGS in the sky for a 40 m telescope with the laser pointing parallel to the pointing of the telescope; bottom image: relative angular position of each sample with respect to the center of mass of the set of samples.The color of each sample corresponds to its probability density with respect to the most probable sample.A corner from both images was cut to show the inside of the LGS.The shadow on the bottom is there to show how the corner was cut from the LGS to show the inside and to show the dimensions of the source.

Fig. 7 .
Fig. 7. Example for a flat wavefront of three samples propagated using the ROI Propagation technique for a 40 m telescope.From top to bottom, the samples are at 400, 3000 and 6000 meters away from the plane of focus.

Fig. 8 .
Fig.8.Three examples of seeing limited samples propagated using the ROI Propagation technique for a 30 m telescope.From top to bottom, the samples are 400, 3000 and 6000 meters away from the plane of focus.

Fig. 9 .
Fig. 9. Left column: Full simulation considering the complete FoV for each sample; middle column: ROI Propagation; right column: 100 times the difference between the two.Top row: Intensity for a flat wavefront; bottom row: intensity considering atmosphere

Fig. 11 .
Fig. 11.MT M LGS →Conv matrix obtained using equation 10 when simulating a LGS for a 16 m telescope.

Fig. 14 .
Fig. 14.Strehl ratio for E2E simulations (markers) and sensitivity predictions (solid lines) of closed-loop performance for 8 (top plot) and 16 m (bottom plot) telescopes.σ 2 noise corresponds to the residual variance predicted by fitting error and photon noise for NGS, LGS-2D and LGS-3D.The yellow stripe corresponds to the expected return flux of the laser guide stars for the ELT.