## 3 NadamSPGD Algorithm in SLAO
### Conventional SPGD in SLAO
``` Pseudo Code of the NadamSPGD Algorithm Input: The learning rate \(\alpha\), the hyper-parameters \(\mu\) and \(v\), the constant \(\varepsilon\), the amplitude of random perturbation voltages \(\Delta u\), and the maximal number of iterations \(N\). Output: Calculated the control voltage vectors of CSDM \(u=\{u_{\_}1,u_{\_}2,\ldots,u_{\_}{97}\}\). 1: Initialize control voltage vectors \(u^{(0)}\), the 1 st momentum term \(m^{(0)}\), the 2 nd momentum term \(n^{(0)}\)
2:for\(k=1,\ldots,N\)do
3: Randomly generate the perturbed voltages obeying the Bernoulli distribution \(\Delta u^{(k)}\)
4: Obtain the evaluation functions under perturbation voltage \(J_{\_}{\pm}^{(k)}=J\Big{(}u^{(k-1)}\pm\Delta u^{(k)}\Big{)}\)
5: Obtain the change of the evaluation function \(\Delta J^{(k)}=J_{\_}+J_{\_}-J_{\_}-J_{\_}-J_{\_}-J_{\_}-J_{\_}-J_{\_}-J_{\_}-J_{\_}-J_{\_}



## 4 Simulation and Experiment

### Simulation Analysis

Zernike polynomials are widely used to describe the distorted wavefront caused by atmospheric turbulence. The wavefront \(\varphi_{0}(r,\theta)\) can be considered as the two-dimensional functions decomposed by Zernike polynomials in polar coordinates [40]:

\[\varphi_{0}(r,\theta)=a_{0}+\sum_{i=1}^{\infty}a_{i}Z_{i}(r,\theta), \tag{16}\]

where \(a_{i}\) is the coefficient of the \(i\)th Zernike polynomial. The 0 th term and \(Z_{1}(r,\theta)\), \(Z_{2}(r,\theta)\) represent the piston and tilt aberrations along the X and Y directions, respectively, and can be corrected by BSU directly. In our simulations, the wavelength \(\lambda\) is set to 635 nm and \(D/r_{0}=10\), then the 3 rd to 35 th terms in Zernike polynomials are added as the distorted wavefront to imitate atmosphere turbulence. The randomly generated initial Zernike coefficients from \(a_{3}-a_{35}\) are given in Figure 3a. The corresponding distorted phase of the original wavefront and the original point spread function (PSF) are shown in Figure 3b,c, respectively. The original wavefront is seriously distorted, and the initial ME is 0.2277. In the next simulations, the voltages of the 97-element CSDM are algorithmically calculated to compensate this wavefront aberration to compare the performance of algorithms. To facilitate our observation, the simulation results treat the optimization objective as ME. Since the calculation time is related to the performance of hardware systems, the performance improvement of algorithms is generally evaluated by comparing the number of iterations. In our study, we follow this common practice [16; 17; 18; 19; 20; 21]. In Figure 4, the corresponding residual wavefront aberration and PSFs correction results under different iterations with NadamSPGD are presented. The ME increases from 0.2277 to 0.9099 after 400 iterations, that is, four times before compensation. Clearly, most of the distortions have been well compensated by NadamSPGD. Figure 3: Random set of simulated data: (a) initial Zernike coefficients of the wavefront aberration; (b) corresponding distorted phase of the original wavefront; (c) corresponding original PSF. Next, we further verify the performance improvement of the proposed algorithm by simulations. Considering the randomness of algorithms, we execute each simulation 100 times. The optimization curves of ME and system BER based on SPGD and NadamSPGD with the number of iterations under their optimal parameters are illustrated in Figure 5. The learning rate \(\alpha=0.1\), the hyper-parameters \(\mu=0.999\) and \(v=0.99\), \(\mu^{(k)}\!=\!\mu\left(1-0.5\times 0.96^{k/250}\right)\) as suggested in Reference [29], the constant \(\varepsilon=10^{-8}\), the amplitude of random perturbation voltages \(\Delta u=0.5\), the quantum efficiency \(\delta=1\), \(N_{p}\!=\!12\) and the BER is calculated according to Equation (8). From Figure 5, both SPGD and our algorithm can effectively compensate the aberration, improve the ME, and decrease the system BER. We treated 0.8 as the index of ME to observe and compare the feature of the two algorithms intuitively [41].