# Phase Shift Design in RIS Empowered Wireless Networks: From Optimization to AI-Based Methods
## 2 RIS Resource Allocation Examples and General Formulation  
In wireless resource allocation involving an RIS, there are two types of resources. One comprises the conventional communication resources, such as a beamforming vector, artificial noise, transmit power, and computation time. The other consists of the RIS coefficients. Each type of resource has its own constraint, and there are possibly additional constraints coupling the two types of resources. Below are three application examples and their problem formulations. In each of the examples, it is assumed that there are \(M\) reflecting elements, and the RIS coefficients are expressed in a vector \(\mathbf{e}:=[e_{1},\ldots,e_{M}]^{H}\in\mathcal{F}\), with \(\mathcal{F}\) being the feasible set of RIS coefficients, and the specific form of \(\mathcal{F}\) will be discussed after the three examples. * Secure beamforming for multiple-input single-output (MISO) systems [20]: As shown in Figure 2(a), the BS communicates with a single-antenna user with the help of an RIS in the presence of a single-antenna eavesdropper. The goal is to maximize the achievable secrecy rate by jointly optimizing the beamformer at the BS and the phase shift coefficients of the RIS under the transmit power constraint at the BS. To be specific, let the channels from the BS to the RIS, from the RIS to eavesdropper, and the beamforming vector at the BS be, respectively, denoted by \(\mathbf{H}\in\mathbb{C}^{M\times N}\), \(\mathbf{h}\in\mathbb{C}^{M\times 1}\), \(\mathbf{g}\in\mathbb{C}^{M\times 1}\), and \(\mathbf{w}\in\mathbb{C}^{N\times 1}\). Then, the secrecy rate maximization problem is given by  
\begin{table}
\begin{tabular}{c l} \hline \hline
**Notation** & **Description** \\ \hline \(M\) & number of reflecting elements in RIS \\ \hline \(K\) & number of users \\ \hline \(\sigma^{2}\) & variance of white Gaussian noise \\ \hline \(\mathbf{H}\) & channels from BS to the RIS \\ \hline \(\mathbf{h}_{r,k}\) & channels from RIS to user \(k\) \\ \hline \(\mathbf{h}_{d,k}\) & channels from BS to user \(k\) \\ \hline \(\  
\[\max_{\mathbf{w},\mathbf{e}} \log_{2}\left(\frac{\sigma^{2}+\left|\mathbf{e}^{H}\operatorname{ diag}\!\left(\mathbf{h}^{H}\right)\mathbf{Hw}\right|^{2}}{\sigma^{2}+\left|\mathbf{e}^{H} \operatorname{diag}\!\left(\mathbf{g}^{H}\right)\mathbf{Hw}\right|^{2}}\right),\] s.t. \[\|\mathbf{w}\|^{2}\leq P_{\max},\] \[\mathbf{e}\in\mathcal{F}, \tag{1}\]  
where \(\sigma^{2}\) is the variance of white Gaussian noise at the user. * MISO uplink communication networks [21]: There are a number of single-antenna mobile users transmitting signals to a multi-antenna BS with the assistance of an RIS as shown in Figure 3b. The objective is to minimize the total uplink transmit power by jointly optimizing the phase shift coefficients of the RIS \(\mathbf{e}\), the transmission power \(x_{k}\) of the user \(k\) under the limited transmission power \(P_{k}\), and the signal-to-interference-and-noise-ratio (SINR) constraints. Let the channels from the BS to the RIS, from the RIS to user \(k\), and from the BS to user \(k\) be, respectively, denoted by \(\mathbf{H}\in\mathbb{C}^{M\times N}\), \(\mathbf{h}_{r,k}\in\mathbb{C}^{M\times 1}\), \(\mathbf{h}_{d,k}\in\mathbb{C}^{N\times 1}\) with \(k\in\{1,\ldots,K\}\). Accordingly, the weighted power minimization problem is given by \[\min_{\mathbf{x},\mathbf{e}} \lambda^{T}\mathbf{x},\] s.t. \[x_{k}\leq P_{k},\ \forall k,\] \[\mathbf{e}\in\mathcal{F},\] \[x_{k}\mathbf{\hat{h}}_{k}\left(\sigma^{2}\mathbf{I}_{N}+\sum_{i \
eq k}x_{i}\mathbf{\hat{h}}_{i}^{H}\mathbf{\hat{h}}_{i}\right)^{-1}\mathbf{ \hat{h}}_{k}^{H}\geq r_{k},\ \forall k,\] (2) where \(\mathbf{\hat{h}}_{k}=\mathbf{h}_{r,k}^{H}\operatorname{diag}\!\left(\mathbf{ e}\right)\mathbf{H}+\mathbf{h}_{d,k}^{H}\in\mathbb{C}^{1\times N}\) is the equivalent channel from user \(k\) to the BS, \(\lambda=[\lambda_{1},\ldots,\lambda_{K}]^{T}\) represents the weights for mobile users, and \(r_{k}\) is the minimum SINR requested by the user \(k\).