Next, we will design the phase shifts of the RIS. If \(N=1\) , the phase shifts can be set arbitrarily[1]}. Therefore, we only consider the case \(N>1\)  in the following.
From Theorem REF , we can see that the only phase shifts related variable is \(\left|f_k\left(\mathbf {\Phi }\right)\right|^2\) . We can treat \(\left|f_k\left(\mathbf {\Phi }\right)\right|^2\)  as a new variable \(x\)  where \(0\le x \le N^2\)[1]}. Then, we can rewrite the numerator and denominator of SNR in Theorem REF  as \(E_{k}^{(\text{signal})}=\left(s_{1} x+s_{2}\right)^{2}\)  and \(E_{k}^{(\text{leakage})}+\frac{\sigma ^{2}}{p} E_{k}^{(\text{noise})}=t_{1} x+t_{2}\) , respectively. The detailed expressions of \(s_1, s_2, t_1, t_2\)  are omitted here, since it can be readily obtained from Theorem REF . As a result, the SNR in Theorem REF  can be rewritten as
\(\mathrm {SNR}_{k}\left(x\right)=\frac{\left(s_{1} x+s_{2}\right)^{2}}{t_{1} x+t_{2}}.\) 
