## 3 NadamSPGD Algorithm in SLAO
### Conventional SPGD in SLAO  
When using the conventional SPGD in SLAO, the compensation of the wavefront aberration can be described in the following steps. First, random tiny perturbation voltages \(\Delta u^{(k)}=\{\Delta u_{1},\Delta u_{2},\cdots,\Delta u_{97}\}\) that satisfy the Bernoulli distribution are applied to CSDMcontrol voltage vectors \(u^{(k-1)}=\left\{u_{1}^{(k-1)},u_{2}^{(k-1)},\cdots,u_{97}^{(k-1)}\right\}\) simultaneously to obtain the gradient estimation. The disturbances \(\Delta u^{(k)}\) have fixed amplitude, i.e., \(\left|\Delta u^{(k)}\right|=\Delta u\). Then, in brief, by using perturbed indicators values \(\int_{\perp}^{(k)}=\int\left(u^{(k-1)}\pm\Delta u^{(k)}\right)\), the variation of the performance metric can be calculated by \(\Delta J^{(k)}\)= \(I_{+}^{(k)}-J_{-}^{(k)}\). Thereafter, the iterative formula for updating the CSDM control voltages can be expressed as:  
\[u^{(k)}\!=u^{(k-1)}\!+\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!The \(\hat{m}^{(k)}\) is the final form of the Nesterov momentum term in NadamSPGD. It uses the change from the last iteration to calculate the projected position of the variable, and then uses the derivative of the projected position in the calculation of the new position for the variable. By calculating the gradient of the projected position, it is equivalent to adding a correction factor to the acceleration that has been accumulated. Logically speaking, this will produce a superior gradient update. Nesterov momentum is known to reduce the number of iterations required and improve the rate of convergence of the optimization algorithm.  
Furthermore, in order to solve the single gain rate in SPGD, we adjust the adaptive gain rate for different parameters by involving the second momentum term using the hyper-parameter \(v\):  
\[n^{(k)}=vn^{(k-1)}+(1-v)\Big{(}g^{(k)}\Big{)}^{2}, \tag{13}\]  
\[\hat{n}^{(k)}=n^{(k)}/\Big{(}1-v^{k}\Big{)}, \tag{14}\]  
where hyper-parameter \(v\) controls the exponential decay rate of the moving average, and the biased second momentum term \(n^{(k)}\) is then bias-corrected by Equation (14) to avoid being initialized to zero at the start of the search, resulting in the bias-corrected estimate \(\hat{n}^{(k)}\). The \(\hat{n}^{(k)}\) sums up the weighted square results of the past gradients that indicate the uncentered variance of the gradients. During the updating process, we divide \(\hat{n}^{(k)}\) to search the suitable gain rate adaptively. As discussed above, we update CSDM control voltage vectors using NadamSPGD as follows:  
\[u^{(k)}=u^{(k-1)}+\eta\hat{m}^{(k)}/\Big{(}\sqrt{\hat{n}^{(k)}}+\varepsilon \Big{)}, \tag{15}\]  
where \(\eta\) is the learning rate and \(\varepsilon\) is a parameter to avoid division by zero error, usually set to \(10^{-8}\). The implementation of the NadamSPGD algorithm for SLAO is comprehensively described in Algorithm 1.