# Optimization of Phase-Only Computer-Generated Holograms Based on the Gradient Descent Method
## 2 Theory  
### Gradient Descent Method for Optimizing Phase-Only CGHs  
In the gradient descent method, an iterative optimization algorithm is applied to identify a local minimum of a given function. To find a local minimum, one takes steps toward the opposite direction of the gradient of the function with a certain step length. Thus, there are two essential components in the gradient descent method. First, the direction of the iteration must be determined, and second, the step length of the iteration should be determined. The formulated description of the gradient descent method is given by  
\[\theta_{t+1}=\theta_{t}-\gamma_{t}\
abla F(\theta_{t}) \tag{1}\]where \(t\) is the iteration number, \(\gamma_{t}\) is the step length coefficient for iteration, and \(\
abla F(\theta_{t})\) is the gradient of the function \(F(\theta)\). In this study, we optimize Fourier-transform-type phase-only CGHs, in which the Fourier transform of the CGH phase distributions provides the reconstructed images. The phase distribution of the CGH is denoted by \(\theta_{pq}\), where \(p\) and \(q\) represent the coordinates of the hologram pixels and \(P\) and \(Q\) are the numbers of rows and columns of the hologram. The amplitude and phase distributions of the reconstructed image are denoted by \(a_{mn}\) and \(\phi_{mn}\), respectively, where \(m\) and \(n\) represent the coordinates of the pixels in the reconstructed image, and \(M\) and \(N\) are the numbers of rows and columns of the reconstructed image. The relationships between the phase-only CGH and the reconstructed image are given by:  
\[a_{mn}e^{i\phi_{mn}}=\mathcal{F}\left\{e^{i\beta_{pq}}\right\}=\sum_{P}^{P} \sum_{q}^{Q}e^{i\beta_{pq}}e^{-j2\pi\left(\frac{np}{P}+\frac{nd}{Q}\right)} \tag{2}\]  
\[\mathcal{F}^{-1}\{a_{mn}e^{i\phi_{mn}}\}=\frac{1}{MN}\sum_{m}^{M}\sum_{n}^{N} a_{mn}e^{i\phi_{mn}}e^{j2\pi\left(\frac{np}{M}+\frac{nd}{N}\right)} \tag{3}\]  
The intensity distribution of the reconstructed image, denoted by \(I_{mn}\), is given by:  
\[I_{mn}=a_{mn}^{2} \tag{4}\]  
The GS algorithm is illustrated in Figure 1. Two constraints are applied in each iteration; one constraint applies to the reconstructed image, and the second constraint applies to the hologram. As mentioned in Section 1, the GS algorithm is mathematically equivalent to the gradient descent method, which minimizes the MSE defined for the amplitude distribution of the reconstructed image [24]:  
\[E_{GS}=\frac{1}{MN}\sum_{m}^{M}\sum_{n}^{N}(\hat{a}_{mn}-a_{mn})^{2} \tag{5}\]  
where \(\hat{a}_{mn}\) is the amplitude distribution of the target image. The gradient of the MSE is calculated with respect to the complex-amplitude of the phase-only CGH, which is \(g_{pq}=e^{i\theta_{pq}}\). Thus, the gradient is given by \(\partial E_{GS}/\partial g_{pq}\). A constant value is used for the step length coefficient \(\gamma_{t}\). The phase distribution of the CGH \(\theta_{pq}\) is extracted from the complex-amplitude distribution \(g_{pq}\). In this study, the MSE is defined for the intensity distribution of the reconstructed image and the gradient of the MSE is calculated with respect to the phase distribution of the CGHs. Because the intensity distribution is optimized directly, the proposed technique might control the intensity distribution of the  
Figure 1: Flow chart for the Gerchberg-Saxton (GS) algorithm. reconstructed image more precisely than the GS algorithm. The phase distribution of the CGHs is directly provided. When the intensity distribution of the target image is denoted by \(\hat{I}_{mn}\), the MSE is defined as:  
\[E=\frac{1}{MN}\sum\limits_{m}^{M}\sum\limits_{n}^{N}(\hat{I}_{mn}-I_{mn})^{2} \tag{6}\]  
The gradient of the MSE with respect to the phase distribution, \(\partial E/\partial\theta_{pq}\), is calculated by the chain rule.