
where
\(\mathrm {\overline{SR}}_{\mathrm {PGP}} \)  is given by (REF ). The maximization problem \( (\mathcal {P}3) \)  is non-convex with respect to \( {\Phi }\)  while it is subject to a unit-modulus constraint regarding \( \tilde{\phi }_{n} \) . A local optimal solution to this problem can be obtained by applying the projected gradient ascent algorithm until converging to a stationary point, which means that, at every step, we project the solution onto the closest feasible point satisfying the unit-modulus constraint concerning \( \tilde{\phi }_{n} \)  [1]}. Specifically, at step \( l \) , the phases are included in the vectors \( {\mathbf {s}}_{l} =[\tilde{\phi }_{l,1}, \ldots , \tilde{\phi }_{l,N}]^{.The next step of the iteration towards convergence increases \mathrm {\overline{SR}}_{g_{k},\mathrm {l}} , and is described by{\begin{@align}{1}{-1}\tilde{{\mathbf {s}}}_{l+1}&={\mathbf {s}}_{l}+\mu {\mathbf {q}}_{l},~{\mathbf {s}}_{l+1}=\exp \left(j \arg \left(\tilde{{\mathbf {s}}}_{l+1}\right)\right),\end{@align}}where the parameter  \mu  describes the step size and  {\mathbf {q}}_{l}  expresses the ascent direction at step  l . For the computation of the suitable step size at each iteration, we apply the backtracking line search \cite {Boyd2004}. Note that  {\mathbf {q}}_{l}= {\mathrm {\overline{SR}}_{\mathrm {PGP}}}{{\mathbf {s}}_{l}^{*}}=\frac{\bar{K}}{\ln 2}\sum _{g=1}^{G} { \bar{\gamma }_{g,\mathrm {PGP}}}{{\mathbf {s}}_{l}^{*}}  is provided by Proposition \ref {Prop:optimPhase} below. The projection problem  \min _{|\phi _{n} |=1, n=1,\ldots ,N}\Vert {\mathbf {s}}-\tilde{{\mathbf {s}}}\Vert ^{2}  under the unit-modulus constraint provides the solution of the problem described by (\ref {sol2}).In Algorithm \ref {Algoa1}, we present the outline of this procedure.\begin{algorithm}\caption {Projected Gradient Ascent Algorithm for the IRS Design}1. \textbf {Initialisation}:  {\mathbf {s}}_{0} =\exp \left(j\pi /2\right){\mathbf {\mathrm {1}}}_{N},  {\Phi }_{0}=\text{diag}\left({\mathbf {s}}_{0}\right) ,  \mathrm {\overline{SR}}_{\mathrm {PGP}}^{0}=f\left({\Phi }_{0}\right)  given by (\ref {Maximization1});  \epsilon >0 \\2. \textbf {Iteration}  l : \textbf {for}  l=0,1,\dots ,  do\\3. {\mathbf {q}}_{l}= \frac{\bar{K}}{\ln 2}\sum _{g=1}^{G} { \bar{\gamma }_{g,\mathrm {PGP}}}{{\mathbf {s}}_{l}^{*}} , where { \bar{\gamma }_{g,\mathrm {PGP}}}{{\mathbf {s}}_{l}^{*}}  is given by Proposition \ref {Prop:optimPhase};\\4. \textbf {Find}  \mu  by backtrack line search( f\left({\Phi }_{0}\right),{\mathbf {q}}_{l},{\mathbf {s}}_{l}) \cite {Boyd2004};\\5.  \tilde{{\mathbf {s}}}_{l+1}={\mathbf {s}}_{l}+\mu {\mathbf {q}}_{l} ;\\6.  {\mathbf {s}}_{l+1}=\exp \left(j \arg \left(\tilde{{\mathbf {s}}}_{l+1}\right)\right) ;  {\Phi }_{l+1}= \text{diag}\left({\mathbf {s}}_{l+1}\right) ;\\7.  \mathrm {\overline{SR}}_{\mathrm {PGP}}^{l+1}=f\left({\Phi }_{l+1}\right) ;\\8. \textbf {Until}  \Vert  \mathrm {\overline{SR}}_{\mathrm {PGP}}^{l+1}- \mathrm {\overline{SR}}_{\mathrm {PGP}}^{l}\Vert ^{2} <\epsilon ; \textbf {Obtain}  {\Phi }^{\star }={\Phi }_{l+1};\\9. \textbf {end for}\end{algorithm}}\)
