Optimal Beamforming of RIS-Aided Wireless Communications: An Alternating Inner Product Maximization Approach

Extracted source text · arXiv 2405.06442

%\documentclass[lettersize,journal]{IEEEtran}
%\documentclass[journal,12pt,draftclsnofoot,onecolumn,english]{IEEEtran}

\documentclass[10pt, doublecolumn]{IEEEtran}

\usepackage{amsmath,amsthm,amssymb}

\usepackage{algorithmic}
\usepackage{algorithm}
%\usepackage{algpseudocode}

\usepackage{mathtools}
\usepackage{amsfonts}

\usepackage{graphicx}
\usepackage{subfigure}
\usepackage{float}

\usepackage{epstopdf}

\usepackage{tabularx}

\usepackage{cite}

\usepackage{hyperref}

\usepackage{cuted}
\usepackage{multicol}

\usepackage{stfloats}
\usepackage{pstricks}
\usepackage{xcolor}
\usepackage{booktabs}

\usepackage{cases}

\usepackage{url}
%\hyphenation{op-tical net-works semi-conduc-tor IEEE-Xplore}
%\DeclareMathOperator*{\argmin}{arg\,min}
%% updated with editorial comments 8/9/2021
%\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
%    T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}

%\usepackage[nodisplayskipstretch]{setspace} \setstretch{1.5}
\allowdisplaybreaks

\newtheorem{example}{Example}

\newtheorem{thm}{Theorem}
\newtheorem{cor}[thm]{Corollary}
\newtheorem{lem}[thm]{Lemma}
\newtheorem{prop}[thm]{Proposition}
\theoremstyle{definition}
\newtheorem{defn}{Definition}
\theoremstyle{remark}
\newtheorem{rem}{Remark}

\newcounter{nestedstate}[algorithm]
\renewcommand{\thenestedstate}{\arabic{algorithm}.\arabic{nestedstate}}
\newcommand{\nestedstate}{\refstepcounter{nestedstate}\STATE\textbf{\thenestedstate} }
%\numberwithin{equation}{section}


\begin{document}
%\begin{sloppypar}
\newtheorem{Remark}{Remark}
\newtheorem{remark}{Remark}
\renewcommand{\algorithmicrequire}{\textbf{Input:}} 
\renewcommand{\algorithmicensure}{\textbf{Output:}}

\title{Optimal Beamforming of RIS-Aided Wireless Communications: An Alternating Inner Product Maximization Approach}

\author{Rujing~Xiong,~\IEEEmembership{Student Member,~IEEE,}
Tiebin~Mi,~\IEEEmembership{Member,~IEEE,}
Jialong~Lu,~\IEEEmembership{Student Member,~IEEE,}
Ke~Yin,
Kai~Wan,~\IEEEmembership{Member,~IEEE,}
Fuhai~Wang,~\IEEEmembership{Student Member,~IEEE,}
Robert~Caiming~Qiu,~\IEEEmembership{Fellow,~IEEE,}
        % <-this % stops a space
%\thanks{A short version of this paper was submitted to the 2024 IEEE Wireless Communications and Networking Conference (WCNC).}
\thanks{R.~Xiong, T.~Mi, J.~Lu, K.~Wan ,F.~Wang and R.~C.~Qiu are with the School of Electronic Information and Communications, Huazhong University of Science and Technology, Wuhan 430074, China (e-mail:~{\{rujing, mitiebin, m202272434, kai\_wan, wangfuhai, caiming\}@hust.edu.cn)}.}
\thanks{K.~Yin is with the Center for Mathematical Sciences, Huazhong University of Science and Technology, Wuhan 430074, China (e-mail: kyin@hust.edu.cn).}
\thanks{A short version of this paper was presented in the 2024 IEEE Wireless Communications and Networking Conference (WCNC 2024).}
%\thanks{Manuscript received xxx, 2023; revised xxx, 2023.}
}


% The paper headers
%\markboth{Journal of \LaTeX\ Class Files,~Vol.~14, No.~8, August~2021}%
%{Shell \MakeLowercase{\textit{et al.}}: A Sample Article Using IEEEtran.cls for IEEE Journals}

%\IEEEpubid{0000--0000/00\$00.00~\copyright~2021 IEEE}
% Remember, if you use this you must call \IEEEpubidadjcol in the second
% column for its text to clear the IEEEpubid mark.

\maketitle

\begin{abstract}

This paper investigates a general discrete $\ell_p$-norm maximization problem, with the power enhancement at steering directions through reconfigurable intelligent surfaces (RISs) as an instance. We propose a mathematically concise iterative framework composed of alternating inner product maximizations, well-suited for addressing $\ell_1$- and $\ell_2$-norm maximizations with either discrete or continuous uni-modular variable constraints. The iteration is proven to be monotonically non-decreasing. Moreover, this framework exhibits a distinctive capability to mitigate performance degradation due to discrete quantization, establishing it as the first post-rounding lifting approach applicable to any algorithm intended for the continuous solution. Additionally, as an integral component of the alternating iterations framework, we present a divide-and-sort (DaS) method to tackle the discrete inner product maximization problem. In the realm of $\ell_\infty$-norm maximization with discrete uni-modular constraints, the DaS ensures the identification of the global optimum with polynomial search complexity. We validate the effectiveness of the alternating inner product maximization framework in beamforming through RISs using both numerical experiments and field trials on prototypes. The results demonstrate that the proposed approach achieves higher power enhancement and outperforms other competitors.  Finally, we show that discrete phase configurations with moderate quantization bits (e.g., 4-bit) exhibit comparable performance to continuous configurations in terms of power gains.


%Furthermore, we focus on the discrete inner product maximization problem and introduce a divide-and-sort (DaS) algorithm to reach global optimality with polynomial search complexity. The DaS-based alternating (DaS-A) algorithm is then generalized for the iterative work. What notably distinguishes the DaS-A algorithm is its ability to enhance the optimality of results built upon existing optimization algorithms, a capability referred to as lifting. Numerical evaluations and experiments over real prototype also demonstrate the efficiency of the proposed DaS and DaS-A algorithms. Finally, by using the proposed algorithms, we show that over some resolution quantization level on each RIS unit (4-bit and above), there is no noticeable difference in power gains between continuous and discrete phase configurations.

\end{abstract}

\begin{IEEEkeywords}
$\ell_p$-norm maximization, reconfigurable intelligent surfaces (RISs), discrete phase configuration, uni-modular constraints, post-rounding lifting, prototype experiment.
\end{IEEEkeywords}

\section{Introduction}\label{Section1}
\IEEEPARstart{T}{he} reconfigurable intelligent surface (RIS) technique has recently demonstrated its great potential for reconfiguring wireless propagation environments \cite{cui2014coding,basar2019wireless,di2020smart}. 
The advantage, as compared to other competitive technologies, lies in the fact that RISs provide opportunities for the so-called passive relays. Specifically, RISs consist of a large number of carefully designed electromagnetic units and result in electromagnetic waves with dynamically controllable behaviors such as amplitude, phase, and polarization. Moreover, RIS operates passively, leading to reductions in both hardware costs and energy consumption. 


RIS has attracted considerable attention in various wireless systems, including multi-antenna and/or multi-user communication~\cite{di2020hybrid,chen2023channel}, physical-layer security~\cite{yang2020secrecy,cui2019secure}, orthogonal frequency division multiplexing-based wideband communication~\cite{lin2020adaptive,yang2020intelligent}, unmanned aerial vehicle communication and networks ~\cite{li2020reconfigurable,mu2021intelligent}, simultaneous wireless information and power transfer systems~\cite{pan2020intelligent,wu2020joint}, mobile edge computing~\cite{bai2020latency,mao2022reconfigurable}, wireless sensing and location~\cite{elzanaty2021reconfigurable,chen2022efficient}, etc.


In reality, achieving the proper configuration of RISs is constrained by various limitations. Among these, one remarkable hardware restriction is the adoption of extremely low quantization bits \cite{xiong2023ris,arun2020rfocus,tran2020demonstration, pei2021ris,dai2020reconfigurable,rains2022high,kishiyama2021research}. The basic control module of reflecting units typically relies on varactors or positive intrinsic-negative (PIN) diodes. The use of varactors presents a challenge due to analog control, resulting in a degradation of phase accuracy and response time. On the other hand, integrating PIN diodes in multi-bit reflecting units increases design complexity and hardware costs. As a result, the 1-bit phase configuration quantization remains the primary choice in the majority of current prototypes. 


In many applications, beamforming through RIS can be formulated as maximizing the power at specific steering directions\cite{wu2019intelligent,wu2023intelligent}. The optimization of phase configurations encounters two critical constraints. The first restriction is the uni-modular phase configuration, originating from the resonant nature of electrical circuits. This constraint imposes non-convexity onto the feasible set. The second involves discrete phase configuration for practical implementations, further reducing the feasible region into a discrete set. Mathematically, this beamforming functionality represents an instance of $\ell_2$-norm maximization problem with discrete uni-modular constraints, formulated as
\begin{equation*}
  (Q_2) \qquad \max_{ \mathbf{\Omega} \in \Delta^n } \lVert \mathbf{A} e^{j \mathbf{\Omega} } \rVert_2,
\end{equation*}
where $\mathbf{A} \in \mathbb{C}^{m \times n}$ represents the channel information and $e^{j \mathbf{\Omega}} = [e^{j \Omega_1}, \cdots, e^{j\Omega_n}]^T$ denotes the phase configurations. The feasible set is denoted as $\Delta = \left\{ 0, \delta, \ldots, (2^B-1) \delta \right\}$, where $B$ represents the number of quantization bits and $\delta= 2 \pi / 2^B$. 


This paper addresses a general $\ell_p$-norm maximization problem ($p=1, 2, \infty$), given by
\begin{equation*}
  (Q_p) \qquad \max_{ \mathbf{\Omega} \in \Delta^n } \lVert \mathbf{A} e^{j \mathbf{\Omega} } \rVert_p .
\end{equation*}
It is essential to recognize that discrete optimization problems $(Q_p)$ tend to fall within the universal (NP-hard) category, requiring expensive exponential search techniques. Notably, the continuous counterpart of $(Q_2)$ remains strongly NP-hard in general \cite{zhang2006complex, soltanalian2014designing}. Various methods have been developed to address the (continuous) uni-modular constraint~\cite{liang2016unimodular,yang2021beamforming,wang2022sca,kumar2022novel,wu2019intelligent,cui2019secure,zhou2020robust,shen2019secrecy,bai2021reconfigurable,salem2022active,absil2008optimization,yu2019miso}. Among these methods, semidefinite relaxation-semidefinite program (SDR-SDP) and manifold optimization (Manopt) stand out as representative approaches. 



In the SDR-SDP approach~\cite{wu2019intelligent,cui2019secure,zhou2020robust}, the continuous counterpart of $(Q_2)$ is equivalent to semidefinite programming with the variable being a rank one positive semidefinite matrix. The uni-modular constraint is implemented through imposing restrictions on the diagonal elements of the matrix variable. By relaxing the rank-one constraint, the problem evolves into a well-defined semidefinite programming, which can be solved using an interior-point algorithm. It is noteworthy that while SDR-SDP can handle many nonconvex quadratically constrained quadratic programs, it is not applicable to address $(Q_1)$ and $(Q_\infty)$.


The Manopt approach~\cite{absil2008optimization,yu2019miso} deals directly with optimization over Riemannian manifolds. Most well-defined manifolds are equipped with computable retraction operators, providing an efficient method of pulling points from the tangent space back onto the manifold. In the context of $(Q_2)$, the feasible set of its continuous counterpart comprises a product of $n$ complex tori, forming an embedded submanifold of $\mathbb{C}^n$. Within the Manopt framework, there exists a straightforward way to project the Euclidean gradient $-2 A^H A x$ to the Riemannian gradient of the product manifold of $n$ tori. However, even with Manopt, there is no guarantee of finding a global minimizer due to the nonconvex nature of $(Q_2)$, as well as the nonconvex and nonsmooth characteristics of $(Q_1)$ and $(Q_\infty)$.



In accommodating the discrete configuration constraint, the most straightforward approach involves \emph{hard} rounding the solution to its continuous counterpart \cite{wang2020intelligent,zheng2020intelligent,you2020channel,qiao2020secure}. However, hard rounding may lead to performance degradation~\cite{wu2019beamforming}, and in the worst-case scenario, it can even result in arbitrarily poor performance~\cite{zhang2022configuring}. Moreover, only a limited number of algorithms have been developed to reduce the search set from exponential to polynomial complexity~\cite{di2020hybrid,zhang2022configuring,ren2022linear}, enabling the direct search of optimal discrete solutions. Discovering such algorithms can often be highly problem-specific and exceptionally challenging.


An overlooked strategy is the post-rounding lifting approach, which addresses the performance degradation caused by hard rounding. This method becomes particularly crucial when dealing with extremely low-bit phase configurations, where the loss due to hard rounding can be significant. Despite its potential effectiveness, this strategy is completely disregarded in existing literature. To our knowledge, there are no related approaches currently employing this strategy.


The main contributions can be summarized as follows:
\begin{itemize}
\item Leveraging the inherent structure of $(Q_p)$, we propose a mathematically concise iterative framework composed of alternating inner product maximizations. This framework is designed to address $\ell_1$- and $\ell_2$-norm maximization with either discrete or continuous uni-modular constraints. Within the iteration, one step guarantees the exact satisfaction of uni-modular constraints, whether they are discrete or continuous. The iteration is proven to be monotonically non-decreasing and exhibits effectiveness in handling large-scale problems. Moreover, it possesses the unique capability to mitigate performance degradation resulting from the hard rounding of continuous solutions. Remarkably, our proposed iteration turns out to be the first post-rounding lifting approach applicable to all algorithms designed for continuous solutions.


%This feature makes the iteration an effective post-rounding lifting approach for any continuous algorithm, including SDR and Manopt. 


\item We introduce a divide-and-sort (DaS) method to address the discrete inner product maximization problem, which constitutes a crucial step in the proposed iterative framework \footnote{Upon revising the initial version of this paper, we became aware of recent independent research \cite{ren2022linear}, which utilizes a similar approach to DaS for solving the discrete inner product maximization problem. Notably, their study does not address the more general problem $(Q_2)$.}. The proposed DaS is guaranteed to identify the optimal discrete solution.  Furthermore, in the case of $(Q_\infty)$, the DaS ensures the identification of the global optimum with polynomial search complexity.



\item We validate the effectiveness of the alternating inner product maximization framework in beamforming using  both numerical experiments and field trials. The results demonstrate that the proposed approach achieves higher power enhancement and outperforms other competitors. Finally, we show that discrete phase configurations with moderate quantization bits (e.g., 4-bit) have comparable performance to continuous configurations in RIS-aided communication systems.

\end{itemize}


%The proposed iterative method effectively fills this gap. 
 % especially those involving extensive RIS sizes and/or a significant number of RISs.

\subsection{Outline}

The remainder of the paper is organized as follows. In Section~\ref{Section2}, we demonstrate that beamforming through RISs can be formulated as an $\ell_2$-norm maximization problem. Section~\ref{Section3} presents a concise mathematical framework comprising alternating inner product maximizations to address $(Q_p)$. In Section~\ref{Section4}, we introduce a divide-and-sort (DaS) search method to address the discrete inner product maximization problem, a crucial step in the proposed iterative framework. Section~\ref{Section6} is dedicated to the convergence behaviors and unique lifting capabilities. In Sections~\ref{Section7} and~\ref{Section7}, we conduct performance evaluations through numerical simulations and field trials. The paper is concluded in Section~\ref{Section9}.



\subsection{Reproducible Research}
The simulation results can be reproduced using codes available at: \url{https://github.com/RujingXiong/RIS\_Optimization.git}

\subsection{Notations}
The imaginary unit is denoted by $j$. The magnitude and real component of a complex number are represented by $|\cdot|$ and $\mathcal{\Re}\{\cdot\}$, respectively. Unless explicitly specified, lower and upper case bold letters represent vectors and matrices. The conjugate transpose, conjugate, and transpose of~$\mathbf{A}$ are denoted as $\mathbf{A}^H$, $\mathbf{A}^{*}$ and $\mathbf{A}^T$, respectively. ${\rm diag}(\cdot)$ refers to the diagonal matrix operator. %The norm of a vector is expressed as $\Vert \cdot \Vert$.





\section{System Model and Beamforming Problem Formulation}\label{Section2}
We investigate a point-to-point multiple-input single-output (MISO) downlink communication system as illustrated in Fig.~\ref{Scenarios}, 
where a base station (BS) equipped with $M$ antennas serves a single-antenna user equipment (UE). In this scenario, linear transmit precoding is applied at the BS, allocating the UE a dedicated beamforming vector $\mathbf{w}$. The transmitted signal is represented as $\mathbf{x} = \mathbf{w} s$, where $s$ is the transmitted symbol. 


To enhance communication quality, a RIS consisting of $N$ reflecting units is employed. By representing the phase configuration of the RIS as $e^{j \mathbf{\Omega}} = [e^{j \Omega_1}, \cdots, e^{j\Omega_N}]^T$, the received signal at the UE is given by
\begin{equation}\label{modelingLOS}
y = ( \mathbf{h}_{\text{UE-RIS}}^H \text{diag} (e^{j \mathbf{\Omega}} ) \mathbf{H}_{\text{RIS-BS}}+\mathbf{h}_d^H ) \mathbf{w} s + v,
\end{equation}
where the equivalent channel between RIS-BS and UE-RIS links are denoted by $\mathbf{H}_{\text{RIS-BS}} \in \mathbb{C}^{N \times M}$ and $\mathbf{h}_{\text{UE-RIS}}^H \in \mathbb{C}^{N}$, respectively. The direct link between the BS and the UE is represented by $\mathbf{h}_d^H\in \mathbb{C}^M$. The received signal is corrupted by additive Gaussian white noise $v \sim \mathcal{CN}(0,\sigma^2)$.


\begin{figure}[tbp]
  \centering
  \subfigure[]{
  \label{Scenarios:LOS}
  \includegraphics[width=.75\columnwidth]{Scenario2-1.PNG}}
  \subfigure[]{
  \label{Scenarios:NLOS}
  \includegraphics[width=.75\columnwidth]{Scenario1-1.PNG}}
    \caption{RIS-aided point-to-point MISO communication. (a) line-of-sight (LoS) scenario. (b) non-line-of-sight (NLoS) scenario.} %{\red plot a figure on the physical modeling of communications systems, instead of a picture in real life.}}
  \label{Scenarios}
\end{figure}

The objective of RIS-aided coverage enhancement is to maximize the received signal power. According to maximum ratio transmission principle \cite{wu2019intelligent, tse2005fundamentals}, the optimal transmit beamforming vector is given by
\begin{equation}
  \mathbf{w}= \sqrt{P} \frac{\left( \mathbf{h}_{\text{UE-RIS}}^H \text{diag} (e^{j \mathbf{\Omega}} ) \mathbf{H}_{\text{RIS-BS}}+\mathbf{h}_d^H \right)^H }{ \lVert \mathbf{h}_{\text{UE-RIS}}^H \text{diag} (e^{j \mathbf{\Omega}} ) \mathbf{H}_{\text{RIS-BS}}+\mathbf{h}_d^H \rVert},
\end{equation}
where $P$ denotes the transmit power of the BS. Employing this optimal transmit beamforming vector, the problem of maximizing the received  power can be formulated as
\begin{equation*}
 \max_{ \mathbf{\Omega} } \lVert \mathbf{h}_{\text{UE-RIS}}^H \text{diag} (e^{j \mathbf{\Omega}} ) \mathbf{H}_{\text{RIS-BS}}+\mathbf{h}_d^H \rVert_2 .
\end{equation*}
In addition, since
\begin{equation}\label{E:Phi}
  \mathbf{h}_{\text{UE-RIS}}^H \text{diag} ( e^{j \mathbf{\Omega}} ) \mathbf{H}_{\text{RIS-BS}} = e^{j \mathbf{\Omega}} \underbrace{ \text{diag} ( \mathbf{h}_{\text{UE-RIS}}^H ) \mathbf{H}_{\text{RIS-BS}} }_{ = \mathbf{\Phi} } ,
\end{equation}
we can rewrite the received signal as
\begin{equation}
  \mathbf{h}_{\text{UE-RIS}}^H \text{diag} (e^{j \mathbf{\Omega}} ) \mathbf{H}_{\text{RIS-BS}}+\mathbf{h}_d^H = 
  \begin{bmatrix} 
    \mathbf{\Phi}^T & \mathbf{h}_d^H 
  \end{bmatrix} 
  \begin{bmatrix}
    e^{j \mathbf{\Omega}} \\
    1
  \end{bmatrix} .
\end{equation}


In practical implementations, the phase configuration is typically selected from a finite set of values $\Delta = \left\{ 0, \delta, \ldots, (2^B-1) \delta \right\}$, where $B$ represents the number of bits of quantization and $\delta= 2 \pi / 2^B$. The optimal beamforming can be  expressed as
\begin{equation}\label{P3}
  \max_{ \mathbf{\Omega} \in \Delta^N } \left \lVert 
  \begin{bmatrix} 
    \mathbf{\Phi}^T & \mathbf{h}_d^H 
  \end{bmatrix} 
  \begin{bmatrix}
    e^{j \mathbf{\Omega}} \\
    1
  \end{bmatrix} \right \rVert_2 .
\end{equation}
For a more general optimization problem %We investigate a related optimization problem
\begin{equation}\label{P4}
\max_{ \mathbf{\Omega}, \Omega_{N+1} \in \Delta^{N+1} } \left \lVert 
  \begin{bmatrix} 
    \mathbf{\Phi}^T & \mathbf{h}_d^H 
  \end{bmatrix} 
  \begin{bmatrix}
    e^{j \mathbf{\Omega}} \\
    e^{j \Omega_{N+1}}
  \end{bmatrix} \right \rVert_2 .
\end{equation}
We denote the solution as $\mathbf{\Omega}_{\text{opt}}, \Omega_{N+1, \text{opt}}$. Consequently, the optimal solution for \eqref{P3} can be represented as $\mathbf{\Omega}_{\text{opt}} - \Omega_{N+1, {\text{opt}}}$. Indeed, \eqref{P4} is a specific instance of a broader optimization problem $(Q_2)$. 



%In practical implementations, the phase configuration is selected from a finite set of values. To facilitate this, we denote the discrete configuration set by $\Delta = \left\{ 0, \delta, \ldots, (2^B-1) \delta \right\}$, where $B$ represents the phase quantization level and $\delta= 2 \pi / 2^B$. With this quantization scheme, the discrete beamforming optimization problem can be formulated as
%\begin{equation}\label{P:DiscreteBeamforming}
%\max_{\Omega_1, \ldots, \Omega_{N} \in \Delta} \ \| \boldsymbol{\tilde{ \Phi }}^H  \mathbf{\tilde{w}} \|.
%\end{equation}

%It is well-known that solving general quadratic programming problems is NP-hard, as demonstrated by a reduction from an NP-complete matrix partitioning problem \cite{zhang2006complex}. Furthermore, the maximization of a general quadratic form over a finite alphabet is also known to be NP-hard. The NP-hardness of these problems poses significant challenges in finding exact solutions, especially for problems with large system parameters. 


%One of the primary objectives of this research is to develop highly efficient algorithms for addressing discrete quadratic programming problems featuring rank-one constraints. It is worth noting that even in this special case, attaining the optimal solution within a finite alphabet remains a considerable challenge. In this specific scenario, taking into account the rank-one constraint of matrix $\mathbf{\tilde{R}}$, the discrete quadratic programming problem \eqref{P:DiscreteBeamforming} can be reformulated as an inner product maximization problem, given by 
%\begin{equation}\label{multi-bit2}
%\max_{\omega_1, \dots, \omega_{N+1} \in \Delta} \ \left| \mathbf{\tilde{w}}^H \mathbf{\tilde{z}} \right|,
%\end{equation}
%where $ \mathbf{\tilde{w}}=[e^{j\omega_1},e^{j\omega_2},\dots, e^{j\omega_N},e^{j\omega_{N+1}}]^H$ and $\mathbf{\tilde{z}}$ corresponds to the unique eigenvector of $\mathbf{\tilde{R}}$, i.e., $\mathbf{\tilde{R}} = \lambda \mathbf{\tilde{z}} \mathbf{\tilde{z}}^H$. It is important to note that upon acquiring an optimal solution $\mathbf{\tilde{w}}_{ \text{opt} }$ to \eqref{multi-bit2}, the optimal discrete solution for the original problem \eqref{P2} can be derived as $\mathbf{w}_\text{opt} = \mathbf{ \tilde{w}}_{\text{opt}} (1:N) /  \mathbf{\tilde{w}}_{\text{opt} } (N+1)$.


In certain scenarios, as depicted in Fig.~\ref{Scenarios:NLOS}, the link between the BS and the UE is completely blocked. In such non-line-of-sight (NLOS) conditions, employing RIS to enhance signal coverage leads to an optimization problem formulated as
\begin{equation}\label{Optimization Problem}
\max_{ \mathbf{\Omega} \in \Delta^N } \lVert \mathbf{\Phi }^T e^{j \mathbf{\Omega} } \rVert_2,
\end{equation}
which is evidently an instance of $(Q_2)$. 


\section{An Alternating Maximization Framework}\label{Section3}

The $\ell_p$-norm maximization $(Q_p)$ with discrete uni-modular constraints holds fundamental importance in various applications, particularly in engineering problems related to quantization. One approach to solving $(Q_p)$ is to perform an exhaustive search among all elements in $\Delta^{n}$, with an intractable computation complexity of $\mathcal{O}(2^{B n})$. In order to reduce the complexity, we propose a mathematically concise iterative framework consisting of alternating inner product maximizations. This framework is specifically designed to address $\ell_1$- and $\ell_2$-norm maximization problems with either discrete or continuous uni-modular constraints.


Let $\lVert \cdot \rVert_q$ represent $\ell_q$-norm ($q \ge 1$) on $\mathbb{C}^{n}$ and $\langle \cdot, \cdot \rangle$ denote the inner product. The associated dual norm $\lVert \cdot \rVert_{p}$ is denoted as 
\begin{equation}\label{E:DualNorm}
  \lVert \mathbf{x} \rVert_{p} = \sup \{ \lvert \langle \mathbf{z}, \mathbf{x} \rangle \rvert : \lVert \mathbf{z} \rVert_q = 1 \} ,
\end{equation}
where $1/p + 1/q = 1$. By setting $p=2$ and $q=2$, we know that the dual of the Euclidean norm is the Euclidean norm, given by
\begin{equation}
  \lVert \mathbf{x} \rVert_{2} = \sup \{ \lvert \mathbf{z}^H \mathbf{x} \rvert : \lVert \mathbf{z} \rVert_2 = 1 \} .
\end{equation}


To reformulate the original maximization $(Q_p)$, we introduce a dual variable $\{ \mathbf{z} : \lVert \mathbf{z} \rVert_q = 1 \}$. This yields
\begin{equation}
\begin{aligned}
\max_{ \mathbf{\Omega} \in \Delta^n } \lVert \mathbf{A} e^{j \mathbf{\Omega} } \rVert_p 
& = \max_{ \mathbf{\Omega} \in \Delta^n } \sup_{ \lVert \mathbf{z} \rVert_q = 1 } \lvert \langle \mathbf{z} , \mathbf{A} e^{ j \mathbf{\Omega} } \rangle \rvert \\
& = \sup_{ \lVert \mathbf{z} \rVert_q = 1 } \max_{ \mathbf{\Omega} \in \Delta^n } \lvert \langle \mathbf{A}^H \mathbf{z} , e^{ j \mathbf{\Omega} } \rangle \rvert.
\end{aligned}
\end{equation}
Our objective becomes solving
\begin{equation}\label{Maxmax_1}
(\mathbf{z}_{\text{opt}}, \mathbf{\Omega}_{\text{opt}}) = \arg \max_{ \mathbf{\Omega} \in \Delta^n } \sup_{ \lVert \mathbf{z} \rVert_q = 1 } \lvert \langle \mathbf{z} , \mathbf{A} e^{ j \mathbf{\Omega} } \rangle \rvert
\end{equation}
or equivalently
\begin{equation}\label{Maxmax_2}
(\mathbf{z}_{\text{opt}}, \mathbf{\Omega}_{\text{opt}}) = \arg \sup_{ \lVert \mathbf{z} \rVert_q = 1 } \max_{ \mathbf{\Omega} \in \Delta^n } \lvert \langle \mathbf{A}^H \mathbf{z} , e^{ j \mathbf{\Omega} } \rangle \rvert.
\end{equation}


The reformulation appears to introduce more complexity as \eqref{Maxmax_1} and \eqref{Maxmax_2} expand the feasible set from $\Delta^n$ to $\Delta^n \times \{ \lVert \cdot \rVert_q = 1 \}$. However, the advantage lies in the fact that we can use alternating restricted maximizations over the subsets of variables. For instance, in \eqref{Maxmax_1}, if $\mathbf{\Omega}_{\text{opt}}$ is known, $\mathbf{z}_{\text{opt}}$ is the solution to a continuous inner product maximization problem
\begin{equation}
  \sup_{ \lVert \mathbf{z} \rVert_q = 1 } \lvert \langle \mathbf{z} , \mathbf{A} e^{ j \mathbf{\Omega}_{\text{opt}} } \rangle \rvert.
\end{equation}
On the other hand, if $\mathbf{z}_{\text{opt}}$ is given, $\mathbf{\Omega}_{\text{opt}}$ is the solution to a discrete uni-modular constrained inner product maximization problem  
\begin{equation}
  \max_{ \mathbf{\Omega} \in \Delta^n } \lvert \langle \mathbf{z}_{\text{opt}} , \mathbf{A} e^{ j \mathbf{\Omega} } \rangle \rvert = \max_{ \mathbf{\Omega} \in \Delta^n } \lvert \langle \mathbf{A}^H \mathbf{z}_{\text{opt}} , e^{ j \mathbf{\Omega} } \rangle \rvert.
\end{equation}
We now reach an iterative procedure involving alternating inner product maximization, defined by the following steps 
\begin{subnumcases}
  \mathbf{z}_k = \arg \sup_{ \lVert \mathbf{z} \rVert_q = 1 } \lvert \langle \mathbf{z} , \mathbf{A} e^{ j \mathbf{\Omega}_k } \rangle \rvert, \label{E:Arg_z} \\
  \mathbf{\Omega}_{k+1} = \arg \max_{ \mathbf{\Omega} \in \Delta^n } \lvert \langle \mathbf{A}^H \mathbf{z}_{k} , e^{ j \mathbf{\Omega} } \rangle \rvert . \label{E:Arg_Omega}
\end{subnumcases}



The following theorem investigates the convergence inherent in this iterative sequence.


\begin{thm}\label{T:Iteration}
Given any initial $\mathbf{\Omega}_0 \in \Delta^n$, let $\mathbf{\Omega}_0, \mathbf{\Omega}_1, \ldots$ be the sequence obtained from \eqref{E:Arg_z} and \eqref{E:Arg_Omega}. The following inequality holds for the sequence of $\ell_p$-norms
\begin{equation}
  \lVert \mathbf{A} e^{j \mathbf{\Omega}_0 } \rVert_p \le \lVert \mathbf{A} e^{j \mathbf{\Omega}_1 } \rVert_p \le \cdots \le \lVert \mathbf{A} e^{j \mathbf{\Omega}_k } \rVert_p \le \cdots .
\end{equation}
\end{thm}

\begin{proof}
  By utilizing the definitions presented in \eqref{E:DualNorm} and \eqref{E:Arg_z}, we can express $\lVert \mathbf{A} e^{j \mathbf{\Omega}_k } \rVert_p = \lvert \langle \mathbf{z}_k , \mathbf{A} e^{ j \mathbf{\Omega}_k } \rangle \rvert = \lvert \langle \mathbf{A}^H \mathbf{z}_k , e^{ j \mathbf{\Omega}_k } \rangle \rvert$. Further leveraging \eqref{E:Arg_Omega}, we establish $ \lvert \langle \mathbf{A}^H \mathbf{z}_k , e^{ j \mathbf{\Omega}_k } \rangle \rvert \le \lvert \langle \mathbf{A}^H \mathbf{z}_k , e^{ j \mathbf{\Omega}_{k+1} } \rangle \rvert = \lvert \langle \mathbf{z}_k , \mathbf{A} e^{ j \mathbf{\Omega}_{k+1} } \rangle \rvert$. Furthermore, from \eqref{E:Arg_z}, we derive that $\lvert \langle \mathbf{z}_k , \mathbf{A} e^{ j \mathbf{\Omega}_{k+1} } \rangle \rvert \le \lvert \langle \mathbf{z}_{k+1} , \mathbf{A} e^{ j \mathbf{\Omega}_{k+1} } \rangle \rvert = \lVert \mathbf{A} e^{j \mathbf{\Omega}_{k+1} } \rVert_p$. We finally establish the inequality $\lVert \mathbf{A} e^{j \mathbf{\Omega}_k } \rVert_p \le \lVert \mathbf{A} e^{j \mathbf{\Omega}_{k+1} } \rVert_p$.
\end{proof}


\begin{rem}\label{R:lifting}
Theorem~\ref{T:Iteration} establishes that for any initial point $\mathbf{\Omega}_0 \in \Delta^n$, the iterative procedure generates a sequence $\mathbf{\Omega}_1, \mathbf{\Omega}_2, \ldots$ where the $\ell_p$-norms (cost function) exhibit a monotonically non-decreasing behavior. The role of \eqref{E:Arg_Omega} is to ensure that the sequence adheres to the discrete uni-modular constraints. The proposed iteration is notable for its ability to effectively compensate for the performance degradation caused by hard rounding. This distinctive feature positions the proposed method as the first post-rounding \emph{lifting} approach applicable to any algorithms with continuous solutions. %, distinguishing it from other optimization methods.
\end{rem}


The following sections focus on solving both the continuous and discrete inner product maximization problems presented in \eqref{E:Arg_z} and \eqref{E:Arg_Omega}. Initially, we address the continuous inner product maximization problem. 


\subsection{Analytical Solutions for Continuous Inner Product Maximization Problems}
For a given vector $\mathbf{w} \in \mathbb{C}^{n}$, our objective is to solve 
\begin{equation}
  \sup_{ \lVert \mathbf{z} \rVert_q = 1 } \lvert \langle \mathbf{z} , \mathbf{w} \rangle \rvert.  
\end{equation}
Fortunately, analytical solutions exist for $q=2, \infty$ (corresponding to $p=2, 1$, respectively). Specifically, when $q = 2$ ($p=2$), for  $\lVert \mathbf{z} \rVert_2 = 1$, $\lvert \langle \mathbf{z} , \mathbf{w} \rangle \rvert \le \lVert \mathbf{z} \rVert_2 \lVert \mathbf{w} \rVert_2 = \lVert \mathbf{w} \rVert_2$. By setting $\mathbf{z} = e^{j \phi} \mathbf{w} / \lVert \mathbf{w} \rVert_2$, we achieve  $\lvert \langle \mathbf{z} , \mathbf{w} \rangle \rvert = \lVert \mathbf{w} \rVert_2$. Here $\phi$ is an arbitrary angle. For simplicity, in the case of $q=2$, we choose $\mathbf{z}^k = \mathbf{A} e^{ j \mathbf{\Omega}_k } / \lVert \mathbf{A} e^{ j \mathbf{\Omega}_k } \rVert_2$ in \eqref{E:Arg_z}.



We now consider the scenario where $q = \infty$ ($p=1$). H{\"o}lder's inequality asserts that, for $\lVert \mathbf{z} \rVert_\infty = 1$, $\lvert \langle \mathbf{z} , \mathbf{w} \rangle \rvert \le \lVert \mathbf{z} \rVert_\infty \lVert \mathbf{w} \rVert_1 = \lVert \mathbf{w} \rVert_1$. By setting $\mathbf{z} = e^{j \phi} e^{j \angle \mathbf{w}}$, where $\phi$ is also an arbitrary angle, we achieve  $\lvert \langle \mathbf{z} , \mathbf{w} \rangle \rvert = \lVert \mathbf{w} \rVert_1$. Similarly, for the case $q = \infty$, we choose $\mathbf{z}^k = e^{ j \angle \mathbf{A} e^{ j \mathbf{\Omega}_k } }$ in \eqref{E:Arg_z}. Thus, we successfully obtain the solution for the scenarios where $q=2, \infty$ (corresponding to $p=2, 1$). 


\begin{rem}
When $q=1$ ($p=\infty$), an analytical solution also exists for the problem $\sup_{ \lVert \mathbf{z} \rVert_1 = 1 } \lvert \langle \mathbf{z} , \mathbf{w} \rangle \rvert$. However, we do not employ the iteration presented in \eqref{E:Arg_z} and \eqref{E:Arg_Omega} to address $(Q_\infty)$. Instead, we develop an efficient divide-and-sort (DaS) method to solve the discrete inner product maximization problem \eqref{E:Arg_Omega}. In the case of $(Q_\infty)$, the DaS enables the identification of the global optimum with polynomial search complexity. 
\end{rem}


Before exploring the DaS method, we consider the selection of initial starting point in (15). We replace \eqref{E:Arg_Omega} with its continuous counterpart, leading to the following iteration
\begin{subnumcases}
  \mathbf{z}_k = \arg \sup_{ \lVert \mathbf{z} \rVert_q = 1 } \lvert \langle \mathbf{z} , \mathbf{A} e^{ j \mathbf{\Omega}_k } \rangle \rvert , \label{E:Arg_z_2} \\
  \mathbf{\Omega}_{k+1} = \arg \sup_{ \mathbf{\Omega} } \lvert \langle \mathbf{A}^H \mathbf{z}_{k} , e^{ j \mathbf{\Omega} } \rangle \rvert . \label{E:Arg_Omega_2}
\end{subnumcases}
Analogous to Theorem~\ref{T:Iteration}, this iterative process generates a sequence $\mathbf{\Omega}_1, \mathbf{\Omega}_2, \ldots$ where the $\ell_p$-norm sequence $\lVert \mathbf{A} e^{j \mathbf{\Omega}_1 } \rVert_p, \lVert \mathbf{A} e^{j \mathbf{\Omega}_2 } \rVert_p, \ldots$ increases monotonically. Indeed, the convergence of such iterations gives rise to a local maxima for the problem
\begin{equation}
\max_{ \mathbf{\Omega} } \lVert \mathbf{A} e^{j \mathbf{\Omega} } \rVert_p.
\end{equation}
In practice, this local maxima serves as an excellent starting point for the iteration presented in \eqref{E:Arg_z} and \eqref{E:Arg_Omega}.



Solving \eqref{E:Arg_Omega_2} is straightforward. Following the analysis for the case $q = \infty$ ($p=1$), H{\"o}lder's inequality asserts that $\lvert \langle \mathbf{A}^H \mathbf{z}_{k} , e^{ j \mathbf{\Omega} } \rangle \rvert \le \lVert \mathbf{A}^H \mathbf{z}_{k} \rVert_1 \lVert e^{ j \mathbf{\Omega} } \rVert_\infty = \lVert \mathbf{A}^H \mathbf{z}_{k} \rVert_1$. By setting $\mathbf{\Omega} = e^{j \phi} \angle \mathbf{A}^H \mathbf{z}_{k}$, we achieve $\lvert \langle \mathbf{A}^H \mathbf{z}_{k} , e^{ j \mathbf{\Omega} } \rangle \rvert = \lVert \mathbf{A}^H \mathbf{z}_{k} \rVert_1$. Here $\phi$ represents an arbitrary angle. In practical, we can choose $\mathbf{\Omega}_{k+1} = \angle \mathbf{A}^H \mathbf{z}_{k}$ for simplicity.




\section{A General Divide-and-sort Search Framework for Discrete Inner Product Maximization}\label{Section4}

In this section, we focus on the discrete uni-modular constrained inner product maximization problem \eqref{E:Arg_Omega}, which is a specific instance of a broader problem as
\begin{equation}\label{P1}
\max_{ \mathbf{\Omega} \in \Delta^n } \lvert \langle \mathbf{v} , e^{ j \mathbf{\Omega} } \rangle \rvert .
\end{equation}
Here $\mathbf{v} \in \mathbb{C}^n$ represents a given vector. 



By introducing an auxiliary variable $\psi$ representing the argument, we can express the absolute value as 
\begin{equation}
   \lvert \langle \mathbf{v} , e^{ j \mathbf{\Omega} } \rangle \rvert = \max_{\psi \in [0, 2 \pi)} \Re \left \{ e^{- j \psi} \mathbf{v}^H e^{j \mathbf{\Omega} } \right \} .
\end{equation}
With the polar form $v_i = \lvert v_i \rvert e^{j\tau_i}$, we have
\begin{equation}\label{E:max_max_2}
  \begin{aligned}
   & \max_{ \mathbf{\Omega} \in \Delta^n } \lvert \langle \mathbf{v} , e^{ j \mathbf{\Omega} } \rangle \rvert  \\
 = & \max_{ \mathbf{\Omega} \in \Delta^n } \max_{\psi \in [0, 2 \pi)}  \Re \left \{ \sum_{i=1}^{n} \lvert v_i \rvert e^{j ( - \psi + \tau_i + \Omega_i ) } \right \} \\
 = & \max_{\psi \in [0, 2 \pi)} \max_{ \mathbf{\Omega} \in \Delta^n }   \Re \left \{ \sum_{i=1}^{n} \lvert v_i \rvert e^{j ( - \psi + \tau_i + \Omega_i ) } \right \} .
  \end{aligned}
\end{equation}
The order of the variables being maximized does not impact the results. Thus, we successfully identify an equivalent form to \eqref{P1}
\begin{equation}\label{E:EquivalentForm}
  \max_{\psi \in [0, 2 \pi)} \sum_{i=1}^{n} \left( \lvert v_i \rvert \max_{ \Omega_i \in \Delta } \cos \left( \psi - (\tau_i + \Omega_i) \right) \right) .
\end{equation}
The advantage of \eqref{E:EquivalentForm} is that it yields a search set, parameterized by $\psi$, that contains the optimal solution. Importantly, this search set has a significantly smaller cardinality compared to the exhaustive search space. 


\subsection{Parameterized Search Set}
To construct a parameterized search set with a smaller cardinality, we first consider a sub-problem defined as
\begin{align}
  \Omega_{i, \text{opt}} (\psi) \equiv \arg \max_{ \Omega_i \in \Delta } \cos \left( \psi - (\tau_i + \Omega_i) \right) .
  \label{E:Subproblem}
\end{align}
For a given $\psi$, the value of $\cos \left( \psi - (\tau_i + \Omega_i) \right)$ increases as the angular difference $| \psi - (\tau_i + \Omega_i) |$ decreases. The primary task is to select $\Omega_i$ that minimizes $| \psi - (\tau_i + \Omega_i) |$. 

\begin{figure}[htbp]
  \centering
  \subfigure[]{
  \label{Fig:Solutions:SingleElement}
  \includegraphics[width=.7\columnwidth]{SolutionMax.pdf}}
  \subfigure[]{
  \label{Fig:Solutions:Piecewise}
  \includegraphics[width=.8\columnwidth]{PiecewiseConstant2.pdf}}
  \caption{The approach to find a suitable solution to \eqref{E:Subproblem}. (a) When $\psi$ is given and held fixed, the step to determine the best phase configuration $\Omega_{i, \text{opt}} (\psi)$ is to check which region $\psi$ belongs to. (b) The piecewise constant nature of the function  $\Omega_{i, \text{opt}} (\psi)$.}
  \label{Fig:Solutions}
\end{figure}

In fact, $\tau_i + \Omega_i$ has $2^B$ potential values. We divide the interval $[0, 2 \pi)$ into $2^B$ equal-length regions $\mathbb{P}^i_0, \mathbb{P}^i_1, \dots, \mathbb{P}^i_{2^B-1}$. Each region $\mathbb{P}^i_{n}= \left[ ( \tau_i + n \delta ) - \delta / 2, ( \tau_i + n \delta ) + \delta / 2 \right)$ is centered around $\tau_i + n\delta$, as illustrated in Fig.~\ref{Fig:Solutions:SingleElement}. When $\psi$ is given, determining the optimal $\Omega_{i, \text{opt}} (\psi)$ is straightforward: it corresponds to the region to which $\psi$ belongs. Specifically, if $ ( \tau_i + n \delta ) - \delta / 2 \le \psi < ( \tau_i + n \delta ) + \delta / 2 $, then the optimal configuration $\Omega_{i, \text{opt}} (\psi) = n \delta$. Fig.~\ref{Fig:Solutions:SingleElement} provides a visual representation on the ingredients to find such $\Omega_{i, \text{opt}} (\psi)$. By letting $\psi$ vary within the interval $[0, 2\pi)$, we can generate a plot of the function $\Omega_{i, \text{opt}} (\psi)$, as demonstrated in Fig.~\ref{Fig:Solutions:Piecewise}. One notable characteristic of this function is its piecewise constant nature, where $\Omega_{i, \text{opt}} (\psi)$ remains constant within each region $\mathbb{P}^i_{n}$. 







In \eqref{E:EquivalentForm}, there are $n$ inner maximization sub-problems, each corresponding to an instance of \eqref{E:Subproblem}. The solutions for all sub-problems can be represented as a vector $\mathbf{\Omega}_{\text{opt}} (\psi)$. We observe that there exist $n$ groups of partitions, with each group consisting of $2^B$ regions. By rearranging the boundaries of these regions, the angle $[0, 2\pi)$ can be divided into $n 2^B$ non-overlapping regions, denoted as $\mathbb{P}^1, \ldots, \mathbb{P}^{n 2^B}$. We thus build a new search set, as the problem \eqref{E:EquivalentForm} can be rewritten as 
\begin{equation}
  \max_{\psi \in \mathbb{P}^1 \cup \cdots \cup \mathbb{P}^{n 2^B } } \sum_{i=1}^{n} \left( \lvert v_i \rvert \max_{ \Omega_i \in \Delta } \cos \left( \psi - (\tau_i + \Omega_i) \right) \right) .
\end{equation}
The advantage of such rearrangement lies in the fact that, for $\psi \in \mathbb{P}^l$, the solution vector $\mathbf{\Omega}_{\text{opt}} (\psi)$ to the inner maximization problems remains constant. 



We provide an illustration for the rearrangement in Fig.~\ref{Fig:MultipleElements}. Two groups of partitions are represented by red (on the left) and blue arcs (in the middle), respectively. After rearranging, they combine to form $2 \times 2^B$ non-overlapping regions (denoted by $[\mathbb{P}_{0}^1,\mathbb{P}_{0}^2],[\mathbb{P}_{1}^1,\mathbb{P}_{0}^2]\cdots, [\mathbb{P}_{2^B-1}^1,\mathbb{P}_{2^B-1}^2] $), as shown on the right in Fig.~\ref{Fig:MultipleElements}. Within each region, the value of $\mathbf{\Omega}_{\text{opt}} (\psi)$ remains constant.



\begin{figure*}
  \centering
  \includegraphics[width=0.9\linewidth]{Partition_1_1.pdf}
  \caption{Illustration of region rearrangement. There are two groups of partitions ($n=2$), represented by red (on the left) and blue arcs (in the middle), each containing $2^B$ regions. After the rearrangement, these two groups combine to form a total of $2 \times 2^B$ non-overlapping regions (on the right).}
  \label{Fig:MultipleElements}
\end{figure*}


\subsection{Efficient Encoding for $n 2^B$ Regions}

We now explore encoding schemes for all regions $\mathbb{P}^1, \ldots, \mathbb{P}^{n 2^B}$. Since $\tau_1, \ldots, \tau_N$ are known \emph{a priori}, we can represent the centers of all regions as
\begin{equation}\label{E:CandidateSet}
\begin{array}{cl}
\mathcal{C}^1 & = \left\{ \tau_1, \tau_1 + \delta, \cdots, \tau_1 + (2^B-1) \delta \right\} \mod 2 \pi, \\
& \vdots \\
\mathcal{C}^n & = \left\{ \tau_n, \tau_n + \delta, \cdots, \tau_n + (2^B-1) \delta \right\} \mod 2 \pi.
\end{array}
\end{equation}
Without loss of generality, we assume that, for each $i$, the smallest center in $\mathcal{C}^i$ is $\tau_i$. We establish a bijective mapping $\mathcal{M}$ from $\{1, \ldots, n\}$ to $\{1, \ldots, n\}$ such that 
\begin{equation}\label{E:BijectiveMapping}
\tau_{\mathcal{M}(1)} \le \tau_{\mathcal{M}(2)} \le \cdots \le \tau_{\mathcal{M}(n)}.
\end{equation}
Each region can be encoded as
\begin{equation}\label{E:EncodingPartition}
\begin{aligned}
\begin{array}{cl}
  \mathbb{P}^1 & := [\tau_{\mathcal{M}(1)}, \tau_{\mathcal{M}(2)}, \cdots, \tau_{\mathcal{M}(n)}]^T + \delta [1, 0, \cdots, 0]^T, \\
  & \vdots \\
  \mathbb{P}^{n} & := [\tau_{\mathcal{M}(1)}, \tau_{\mathcal{M}(2)}, \cdots, \tau_{\mathcal{M}(n)}]^T + \delta [1, 1, \cdots, 1]^T, \\
  \mathbb{P}^{n+1} & := [\tau_{\mathcal{M}(1)}, \tau_{\mathcal{M}(2)}, \cdots, \tau_{\mathcal{M}(n)}]^T + \delta [2, 1, \cdots, 1]^T, \\
  & \vdots \\
  \mathbb{P}^{2 n} & := [\tau_{\mathcal{M}(1)}, \tau_{\mathcal{M}(2)}, \cdots, \tau_{\mathcal{M}(n)}]^T + \delta [2, 2, \cdots, 2]^T, \\
  \mathbb{P}^{2 n +1 } & := [\tau_{\mathcal{M}(1)}, \tau_{\mathcal{M}(2)}, \cdots, \tau_{\mathcal{M}(n)}]^T + \delta [3, 2, \cdots, 2]^T , \\
  & \vdots \\
  \mathbb{P}^{n 2^B } & := [\tau_{\mathcal{M}(1)}, \tau_{\mathcal{M}(2)}, \cdots, \tau_{\mathcal{M}(n)}]^T + \delta [0, 0, \cdots, 0]^T .
  \end{array}
\end{aligned}
\end{equation}


As previously mentioned, for $\psi \in \mathbb{P}^l,l = 1,\cdots,n2^B$, the vector $\mathbf{\Omega}_{\text{opt}} (\psi)$ remains constant. The $\mathcal{M}(i)$-th element of $\mathbf{\Omega}_{\text{opt}} (\psi)$ is given as
\begin{equation}
  \Omega^l_{\mathcal{M}(i),\text{opt}} = \mathbb{P}^l(i) - \tau_{\mathcal{M}(i)}.
\end{equation}
Finally, we construct a search set $\mathbb{U}$ consisting of $n 2^B$ candidates
\begin{equation}
  \mathbb{U} = \left\{ \{ \Omega^1_{1,\text{opt}}, \ldots, \Omega^1_{n,\text{opt}} \}, \cdots, \{ \Omega^{n 2^B}_{1,\text{opt}}, \ldots, \Omega^{n 2^B}_{N,\text{opt}} \} \right\} .
\end{equation}


\begin{prop}
There exists a candidate set $\mathbb{U}$ with a cardinality of $n 2^B$ such that the discrete uni-modular constrained inner product maximization problem $\max_{ \mathbf{\Omega} \in \Delta^n } \lvert \langle \mathbf{v} , e^{ j \mathbf{\Omega} } \rangle \rvert $ is equivalent to 
\begin{equation}
  \max_{ \mathbf{\Omega} \in \mathbb{U} } \lvert \langle \mathbf{v} , e^{ j \mathbf{\Omega} } \rangle \rvert .
\end{equation}
\end{prop}


\begin{rem}
  The primary advantage of this encoding method is the significant reduction in the search space. The cardinality of $\mathbb{U}$ decreases from an exponential size to a polynomial size. The number of required searches decreases from $2^{n B}$ to $n 2^B$.
\end{rem}


The proposed DaS-based alternating inner product maximization for solving $(Q_1)$ and $(Q_2)$ is illustrated in Algorithm~\ref{alg1}.
%\vspace{-0.1cm}
%\begin{algorithm}[htbp]
% %算法开始
%\caption{Divide-and-Sort (DaS) for discrete inner product maximization} %算法的题目 
%\label{alg1} %算法的标签 
%\begin{algorithmic}[1] %此处的[1]控制一下算法中的每句前面都有标号 
%\REQUIRE Complex vector $\mathbf{v}$, the number of discrete levels $2^B$. 
%\ENSURE Optimal discrete phase configurations $\mathbf{\Omega}_{\text{opt}}$. %输出结果(此处的ENSURE默认关键字为Ensure在上面已自定义为Output) 
%\STATE Calculate the magnitude $| v_i |$ and angle $\tau_i$, for each element $v_i$ in $\mathbf{v}$. 
%\STATE Divide the complete angle into $2^B$ parts based on $\tau_i$ and construct the set $\mathcal{C}^i$ as~\eqref{E:CandidateSet} . 
%\STATE Sort $\{ \tau_1, \ldots, \tau_n \}$ and find the mapping $\mathcal{M}$ in~\eqref{E:BijectiveMapping}.
%\STATE Construct the set $\mathbb{U}$ consisting of $n 2^B$ candidates according to the parts encoder in~\eqref{E:EncodingPartition}. 
%\STATE Find $\mathbf{\Omega}_{\text{opt}} = \arg \max_{ \mathbf{\Omega} \in \mathbb{U} } \ \lvert \langle \mathbf{v} , e^{ j \mathbf{\Omega} } \rangle \rvert$.
%\RETURN $\mathbf{\Omega}_{\text{opt}}$.
%\end{algorithmic} 
%\end{algorithm}
%
%Therefore, the proposed algorithm for iteratively solving the original optimization problem $(Q_p)$ based on the DaS algorithm can be summarized in Algorithm~\ref{alg2}. %While employing DaS-A to maximize the $\ell_1$-norm need to replace the $\ell_2$-norm as $\ell_1$-norm in Step 3.

\begin{algorithm}[htbp]
 %算法开始
\caption{DaS-based alternating inner product maximization} %算法的题目 
\label{alg1} %算法的标签 
\begin{algorithmic}[1] %此处的[1]控制一下算法中的每句前面都有标号 
\REQUIRE Complex matrix $\mathbf{A}$, the number of discrete levels $2^B$. 
\ENSURE Optimal discrete phase configurations $\mathbf{\Omega}_{\text{opt}}$. %输出结果(此处的ENSURE默认关键字为Ensure在上面已自定义为Output) 
\STATE Choose an initial iteration point $\mathbf{\Omega}_0$, and set $k=0$ . 
\REPEAT
\STATE Calculate $\mathbf{z}_k$ according to \eqref{E:Arg_z}. 
\STATE Calculate $\lVert A e^{j \mathbf{\Omega}_k } \rVert_p$.
\STATE Determine $\mathbf{\Omega}_{k+1}$ by DaS method (\textbf{S1}-\textbf{S5}) based on $\mathbf{A}^H$ and $\mathbf{z}_k$ as in~\eqref{E:Arg_Omega}.
	\STATE \ \  \textbf{S1}: Set $\mathbf{v}=\mathbf{A}^H\mathbf{z}_k$, and calculate the magnitude $| v_i |$ \\ \ \ and angle $\tau_i$, for each element $v_i$ in $\mathbf{v}$.
    \STATE \ \ \textbf{S2}: Divide the complete angle $[0,2\pi)$ into $2^B$ parts\\ \ \ based on $\tau_i$ and construct the set $\mathcal{C}^i$ as~\eqref{E:CandidateSet} . 
    \STATE \ \ \textbf{S3}: Sort $\{ \tau_1, \ldots, \tau_n \}$ and find the mapping $\mathcal{M}$ as\\ \ \ in~\eqref{E:BijectiveMapping}.
    \STATE \ \ \textbf{S4} :Construct the set $\mathbb{U}$ consisting of $n 2^B$ candidates \\ \ \ according to the parts encoder in~\eqref{E:EncodingPartition}.
    \STATE \ \ \textbf{S5}: Find $\mathbf{\Omega}_{\text{opt}} = \arg \max_{ \mathbf{\Omega} \in \mathbb{U} } \ \lvert \langle \mathbf{v} , e^{ j \mathbf{\Omega} } \rangle \rvert$.
\STATE Calculate $\lVert A e^{j \mathbf{\Omega}_{k+1} } \rVert_p$.
\UNTIL $\left\lvert \lVert A e^{j \mathbf{\Omega}_{k+1} } \rVert_p - \lVert A e^{j \mathbf{\Omega}_k } \rVert_p \right\rvert \leq 10^{-10}$
\RETURN $\mathbf{\Omega}_{\text{opt}} = \mathbf{\Omega}_{k+1}$.
\end{algorithmic} 
\end{algorithm}


%\begin{algorithm}[htbp]
% %算法开始
%\caption{DaS-based alternative (DaS-A) for discrete $\ell_p$-norm maximization as in problem $(Q_p)$} %算法的题目 
%\label{alg2} %算法的标签 
%\begin{algorithmic}[1] %此处的[1]控制一下算法中的每句前面都有标号 
%\REQUIRE Complex matrix $\mathbf{A}$, the number of discrete levels $2^B$. 
%\ENSURE Optimal discrete phase configurations $\mathbf{\Omega}_{\text{opt}}$. %输出结果(此处的ENSURE默认关键字为Ensure在上面已自定义为Output) 
%\STATE Choose an initial iteration point $\mathbf{\Omega}_0$, and set $k=0$ . 
%\REPEAT
%\STATE Calculate $\mathbf{z}_k$ according to equation~\eqref{E:Arg_z}. 
%\STATE Calculate the $\ell_p$-norm of $A e^{j \mathbf{\Omega}_k }$, denoted as $f_1$.
%\STATE Determine $\mathbf{\Omega}_{k+1}$ by Steps \textbf{S1}-\textbf{S5} based on $\mathbf{A}^H$ and $\mathbf{z}_k$ as in~\eqref{E:Arg_Omega}.
%	\STATE 
%\begin{tabular}[t]{@{\hspace{\algorithmicindent}}l}
%     \textbf{S1}: Set $\mathbf{v}=\mathbf{A}^H$ and $\mathbf{z}_k$, and calculate the magnitu-\\de $| v_i |$ and phase $\tau_i$, for each element $v_i$ in $\mathbf{v}$.\\
%     \textbf{S2}: Divide the complete angle $[1,2\pi)$ into $2^B$ parts \\ based on $\tau_i$ and construct the set $\mathcal{C}^i$ as~\eqref{E:CandidateSet}. \\
%     \textbf{S3}: Sort $\{ \tau_1, \ldots, \tau_n \}$ and find the mapping $\mathcal{M}$ as\\~\eqref{E:BijectiveMapping}.\\
%     \textbf{S4}: Construct the set $\mathbb{U}$ consisting of $n 2^B$ candidat-\\es according to the parts encoder in~\eqref{E:EncodingPartition}.\\
%     \textbf{S5}: Find $\mathbf{\Omega}_{\text{opt}} = \arg \max_{ \mathbf{\Omega} \in \mathbb{U} } \ \lvert \langle \mathbf{v} , e^{ j \mathbf{\Omega} } \rangle \rvert$.
%     \end{tabular}
%\STATE Calculate the $\ell_p$-norm of $A e^{j \mathbf{\Omega}_{k+1} }$, denoted as $f_2$.
%\STATE $\epsilon = {\rm abs}(f_2-f_1)$
%\UNTIL $\epsilon \leq 10^{-10}$
%\RETURN $\mathbf{\Omega}_{\text{opt}} = \mathbf{\Omega}_{k+1}$.
%\end{algorithmic} 
%\end{algorithm}






\subsection{Maximize the $\ell_\infty$-norm}

With the proposed DaS method, we can solve $(Q_\infty)$ efficiently. Utilizing the definition of the $\ell_\infty$-norm, we rewrite $(Q_\infty)$ as
\begin{equation}
  \max_{ \mathbf{\Omega} \in \Delta^n } \max_{i=1, \ldots, m} \lvert \langle \mathbf{A}_{i,:}^H, e^{j \mathbf{\Omega} } \rangle \rvert 
  = \max_{i=1, \ldots, m} \max_{ \mathbf{\Omega} \in \Delta^n } \lvert \langle \mathbf{A}_{i,:}^H, e^{j \mathbf{\Omega} } \rangle \rvert .
\end{equation}
Here, $\mathbf{A}_{i,:}$ represents the $i$-th row of the matrix $\mathbf{A}$. This equivalent formulation implies that to find the solution to $(Q_\infty)$, we only need to solve $m$ discrete uni-modular constrained inner product maximization problems, each of which can be efficiently solved using the proposed DaS method.



\section{Convergence and Lifting Capabilities}\label{Section6}

To evaluate the effectiveness of the proposed alternating inner product maximization approach for solving $\ell_p$-norm maximization problems, we conduct numerical assessments. It is easily seen that the problem $(Q_\infty)$ involves multiple independent inner product maximization problems, each of which can be effectively addressed by the DaS method without the need of iterations. We then focus on the performance of the alternating maximization framework for $(Q_1)$ and $(Q_2)$. 
  \begin{figure}[htbp]
    \centering
    \subfigure[]{
    \label{Fig:Lifting:1norm}
    \includegraphics[width=.75\columnwidth]{Lifting.pdf}}
    \subfigure[]{
    \label{Fig:Lifting:2norm}
    \includegraphics[width=.75\columnwidth]{Lifting2.pdf}}
    \caption{Convergence behavior and lifting performance. We set $\mathbf{A} \in \mathbb{C}^{10 \times 100}$ and $B = 2$. Both discrete and continuous alternating inner product maximizations converge rapidly, requiring only a small number of iterations. The proposed lifting approach recovers the hard rounding loss. (a) and (b) illustrate the value of cost function for solving $(Q_1)$ and $(Q_2)$, respectively.}
    \label{Fig:Lifting}
  \end{figure}


In Fig.~\ref{Fig:Lifting}, we present the convergence behaviors of the proposed alternating inner product maximization schemes as outlined in (15) and (18). Figs.~\ref{Fig:Lifting:1norm} and \ref{Fig:Lifting:2norm} show that both discrete and continuous alternating inner product maximizations converge rapidly, requiring only a small number of iterations. Moreover, we observe there exists significant rounding loss, particularly with low-bit quantizations. However, after applying post-rounding lifting, there's a notable improvement in the cost-function performance. This unique lifting capability highlights the distinctiveness of the proposed alternating inner product maximization approach. %compared to other competitors.

  \begin{figure}[htbp]
    \centering
    \subfigure[]{
    \label{Fig:LiftingStat:1norm}
    \includegraphics[width=.75\columnwidth]{LiftingStat1Norm.pdf}}
    \subfigure[]{
    \label{Fig:LiftingStat:2norm}
    \includegraphics[width=.75\columnwidth]{LiftingStat2Norm.pdf}}
    \caption{Lift the solution obtained using Manopt. We set $\mathbf{A} \in \mathbb{C}^{10 \times 100}$ and $B = 1$, conducting 20,000 trials for $p=1, 2$. The distribution of the relative lifting gain is visualized, with the red line marking the median. (a) and (b) illustrate the results for solving $(Q_1)$ and $(Q_2)$, respectively.}
    \label{Fig:LiftingStat}
  \end{figure}

We now present the lifting performance for the discretization of the solution obtained using Manopt, a distinguished state-of-the-art technique.  For better illustration, we first define the relative lifting gain as the ratio between the lifting gain and the rounding loss, expressed as
\begin{equation}
  \frac{ \lVert A e^{j \mathbf{\Omega}_{\text{lifted}} } \rVert_p - \lVert A e^{j \mathbf{\Omega}_{\text{rounded}} } \rVert_p }{ \lVert A e^{j \mathbf{\Omega}_{\text{unrounded}} } \rVert_p - \lVert A e^{j \mathbf{\Omega}_{\text{rounded}} } \rVert_p } .
\end{equation}
We conduct 20,000 trials for $p=1, 2$ and record the relative lifting gain. Fig.~\ref{Fig:LiftingStat} illustrates the distribution of the relative lifting gain, with the red line indicating the median. We observe that there exist instances that the relative lifting gain is greater than 0.4, indicating that for these instances $40\%$ of the hard rounding loss is compensated for. The median value in Fig.~\ref{Fig:LiftingStat:1norm} indicates that, in solving $(Q_1)$, the proposed lifting approach recovers at least $11.55 \%$ of the hard rounding loss for half of the conducted trials. Similarly, in solving $(Q_2)$, at least $9.64 \%$ of the hard rounding loss could be recovered for half of the conducted trials. 



\section{Numerical Comparisons of SNR Boosting in RIS beamforming}\label{Section7}
%To assess the efficacy of the proposed DaS and DaS-A algorithms in solving $\ell_p$-norm maximization $(Q_p)$, we conduct an evaluation involving numerical simulations. When $p = \infty$, the problem $(Q_\infty)$ effectively involves multiple independent inner product maximization problems, which can be optimally solved by the DaS algorithm without additional iterative operation. Similarly, the $\ell_2$-norm maximization problem $Q_2$ degenerates into an inner product maximization problem while considering the special case of matrix $\mathbf{A}$ is of rank-1. Therefore, in this section, we primarily evaluate the proposed algorithms for $\ell_1$- and $\ell_2$-norm maximization. 

\begin{figure}[tbp]
  \centering
  \subfigure[]{
  \label{ComparisonM32B1}
  \includegraphics[width=0.75\linewidth]{ComparisonM32B1.eps}}
  \subfigure[]{
  \label{ComparisonM32B2}
  \includegraphics[width=0.75\linewidth]{ComparisonM32B2.eps}}
  \caption{A comparison of SNR performance of different methods as a function $N$ with the number of BS antennas $M=32$. (a) 1-bit phase quantization scheme. (b) 2-bit phase quantization scheme.}
  \label{ComparisonM32}
\end{figure}


In the context of SNR boosting through RISs, we focus on solving the $\ell_2$-norm maximization problems~\eqref{P4} and~\eqref{Optimization Problem}. We compare the performance of our proposed alternating inner product maximization approach with several state-of-the-art methods, including SDR-SDP~\cite{wu2019intelligent}, Manopt~\cite{yu2019miso}, successive refinement algorithm (SFA)~\cite{wu2019beamforming}, and approximation (APX)~\cite{zhang2022configuring}. SFA and APX are the methods that handle discrete phase configuration directly. APX is dedicated to single-output systems ($M=1$) and is claimed to approximate the global optimum. Additionally, we include a search among $\mathbf{10^5}$ random configurations as a benchmark, denoted as Random. For clarity, we refer to discrete SDR-SDP and discrete Manopt as the hard rounding of their continuous counterparts.



%In our numerical simulations, we consider channel parameters based on independent and identically distributed (i.i.d.) Gaussian channels with zero mean and variance $\sigma^2$, i.e., $\mathbf{h}_{\text{UE-RIS}}^H,\mathbf{H}_{\text{RIS-BS}}, \mathbf{h}_d^H \sim \mathcal{CN}(0,\sigma^2\mathbf{I}_N)$, the background noise $v \sim \mathcal{CN}(0,1)$. 
%
%
% It should be noted that while solving problem $(Q_\infty)$, 
%
%
%We initiate our evaluation with numerical simulations, aiming to assess the performance of the proposed algorithms. It should be noted that if $M=1$, the matrix $\mathbf{A}$ in problem $(Q_2)$ is of rank-1. Then, the problem $(Q_2)$ degenerates into a discrete inner product maximization problem, and can be optimally solved by the proposed DaS algorithm. We refer to the SDR-SDP and Manopt algorithms, which take continuous solutions and discretization processes as discrete SDR-SDP and discrete Manopt, respectively.
%
%
%\subsection{Maximize the $\ell_1$-norm}
%
%\begin{figure}[htbp]
%\centering
%\includegraphics[width=0.7\columnwidth]{Norm-1.eps}
%\caption{The proposed DaS-A can be utilized to solve the $\ell_1$-norm maximization problem}
%\label{Norm-1}
%\end{figure}
%
%To validate the proposed algorithm's efficacy in solving the $\ell_1$-norm maximization problem, we compare the performance of the DaS-A algorithm and the Random method for problem $(Q_1)$. The matrix $\mathbf{A}$ is defined as $\mathbf{\Phi}^T$, as described in \eqref{Optimization Problem}. The results indicate that the proposed DaS-A algorithm not only maximizes the $\ell_1$-norm but also outperforms the Random method. Moreover, as the number of units (which also corresponds to the variable length) $N$  increases, the advantage of DaS-A becomes more pronounced. This is understandable because as the length of the variables increases, the probability of randomly finding the optimal solution decreases.
%
%\subsection{Iteration Convergence}
%
%
%
%
%\begin{figure}[htbp]
%  \centering
%  \subfigure[]{
%  \label{IC-R}
%  \includegraphics[width=.48\columnwidth]{IC-R.eps}}
%  \subfigure[]{
%  \label{IC-O}
%  \includegraphics[width=.48\columnwidth]{IC-O.eps}}
%  \caption{The iterative convergence of the proposed DaS-A algorithm with a 1-bit phase quantization scheme. The number of BS antennas is $M=128$, and the number of RIS units is $N = 500$. (a) The initial iteration point $\mathbf{\Omega}_0$ is randomly selected. (b) The initial iteration point $\mathbf{\Omega}_0$ is a local maximum, which is optimized through iteratively between equations~\eqref{E:Arg_z_2} and~\eqref{E:Arg_Omega_2}.}
%  \label{IC}
%\end{figure}
%
%\begin{figure}[htbp]
%\centering
%\includegraphics[width=0.7\columnwidth]{IC-O-B1234.eps}
%\caption{The iterative convergence when employing the proposed DaS-A algorithm with different phase quantization schemes.}
%\label{IC-B1234}
%\end{figure}
%
%
%In the formulated $\ell_2$-norm maximization problem in RIS-aided communication, specifically problem~\eqref{Optimization Problem}, we initially assess the convergence of the DaS-A algorithm. The results presented in Fig~\ref{IC} illustrate that when the initial iteration point $\mathbf{\Omega}_0$ is randomly selected, the proposed algorithm converges in approximately 10 iterations. However, if it is chosen specifically, convergence is expedited and achieved within three to four iterations. 
%
%Furthermore, we investigate the impact of different quantization schemes, represented by the $B$-bit quantization, on the convergence speed. It is apparent that with an increase in quantization resolution, the algorithm necessitates more iterations to achieve convergence. While 1-bit quantization leads to fast convergence, considering the objective function value (SNR performance), 2-bit or 3-bit quantization might be a better choice in practice.




We conduct a comprehensive evaluation of the DaS-based inner product maximization algorithm's performance under various parameter settings. The power gain is recorded for each of the 100 trials with a fixed value of $N$. The channels are assumed to follow independent and identically distributed (i.i.d.) Gaussian distributions with zero mean and variance $\sigma^2$. The noise is Gaussian with variance 1. 



%\begin{figure}[htbp]
%  \centering
%  \subfigure[]{
%  \label{CDFM1B1N200-NLos}
%  \includegraphics[width=0.48\linewidth]{CDFM1B1N200NLoS.eps}}
%  \subfigure[]{
%  \label{CDFM1B1N200-Los}
%  \includegraphics[width=0.48\linewidth]{CDFM1B1N200LoS.eps}}
%  \caption{Cumulative distribution of SNR versus different methods with 1-bit phase quantization. The number of units and BS antennas are $N=200$, $M=1$. (a) NLOS scenario. (b) LOS scenario.}
%  \label{CDFM1B1N200}
%\end{figure}

%To examine the optimality of the proposed DaS algorithm, we compare the average signal-to-noise ratio (SNR) achieved by DaS with that obtained through brute-force searches in the non-line-of-sight (NLOS) channels case, as described in~\eqref{Optimization Problem}. The power gain is recorded for each of the 400 trials with a fixed value of $N$. As shown in Fig.~\ref{fig: Compa}, the plots demonstrate that DaS can achieve exactly identical SNR results to the exhaustive search method.





Initially, we investigate the discrete beamforming in the NLOS channels, considering an increased number of transmitting antennas $M$. The results depicted in Fig.~\ref{ComparisonM32} illustrate the superior performance of the proposed DaS-based alternating inner product maximization approach compared to other competing methods in terms of SNR. These plots highlight the robustness of our approach in achieving optimal solutions. Notably, for $B=1$ and $B=2$, SFA emerges as the second-best approach. However, as $B$ increases to 2, the performance of SFA deteriorates significantly, dropping more than 2 dB below the DaS-based alternating inner product maximization approach. 



In Fig.~\ref{CDFM32B2}, we proceed to investigate the scenario with $M=32$ while keeping $N$ fixed at 200. Across 1000 trials, we observe the power gain and plot the cumulative distribution functions of SNR. The results consistently demonstrate that the DaS-based alternating inner product approach outperforms other methods, achieving an average SNR gain of 2 dB with the quantization level $B=2$ compared to SFA and the hard-rounding of SDR-SDP.
\begin{figure}[tbp]
\centering
\includegraphics[width=0.8\columnwidth]{CDFComparisonM32B2.eps}
\caption{Cumulative distribution of SNR versus different methods under the quantization level $B=2$ and number of units $N=200$, and The number of BS antennas $M=32$.}
\label{CDFM32B2}
\end{figure}
\vspace{-0.2cm}

%The direct channel is described in \eqref{E:LoS}, while the reflected channel is described in \eqref{E:ReflectedPath}. The specific locations of the BS, RIS, and UE are represented by $(50,-200,20)$, $(-2,-1,0)$, and $(0,0,0)$ in meters, respectively. During the simulations, we keep the value of $N$ fixed at $200$ and observe the power gain across 1000 trials. The cumulative distribution results, as depicted in Fig.~\ref{CDF-His1}, illustrate the superior performance of the proposed DaS algorithm compared to other competing methods in terms of SNR.
%
%In Fig.~\ref{CDF-His2}, we focus on the performance comparison between the proposed DaS algorithm and the state-of-the-art APX method. We examine the SNR for various discrete quantization levels. The results consistently demonstrate that the DaS algorithm outperforms APX in terms of SNR performance, particularly for extremely low-resolution quantization schemes, e.g., $B=1$ or $B=2$. We also find that, for moderate resolution quantizations, e.g., $B=3$ and $B=4$, there appears to be no significant difference between DaS and APX in terms of SNR performance. This finding highlights the importance of the proposed DaS algorithm for practical applications of RISs.  The fact that most RIS currently use no more than 2-bit quantization schemes emphasizes the practical relevance and benefits of the proposed DaS algorithm.  

\begin{figure}[htbp]
  \centering
  \subfigure[]{
  \label{fig: Compa}
  \includegraphics[width=.75\columnwidth]{ComparisonES.eps}}
  \subfigure[]{
  \label{fig: Compa3Method}
  \includegraphics[width=.75\columnwidth]{Comparison1050M1B1.eps}}
  \caption{A comparison of SNR performance as a function $N$ with 1-bit phase quantization scheme. The number of BS antennas $M=1$. (a) The proposed DaS algorithm achieves comparable performance to that of the exhaustive search method. (b) The SNR performance comparison of different methods.}
  \label{Fig1}
\end{figure}



As a special case, when the BS consists of only one antenna, i.e., $M=1$, the optimal beamforming problem is reduced into a discrete inner product maximization problem. This can be efficiently addressed using our proposed DaS search method. The plots in Fig.~\ref{fig: Compa} demonstrate that in such scenarios, the DaS achieves SNR results identical to those obtained through exhaustive search. In Fig.~\ref{fig: Compa3Method}, the comparison results show that when using the 1-bit quantization scheme, the proposed method outperforms other competitors. %achieves an average SNR gain of 0.8 dB over discrete Manopt.


%and can be directly addressed using the proposed DaS search method when matrix $\mathbf{\Phi}$ is of rank-1 (including the case of that number of BS antennas $M=1$). %we consider the scenario with the number of BS antennas $M=1$, wherein. Subsequently, It should be noted that the $\ell_2$-norm maximization problems can be reformulated as inner product maximization problems if the matrix $\mathbf{\Phi}$ is of rank-1, which happens when the number of BS antennas $M=1$. %, through eigenvalue decomposition, 




%As shown in Fig.~\ref{fig: Compa}, the plots demonstrate that the DaS method can achieve identical SNR results to the exhaustive search method. In Fig.~\ref{fig: Compa3Method}, we present a performance comparison with several optimization methods. The results show that when using the 1-bit quantization scheme, the proposed DaS method achieves an average SNR gain of 0.8 dB over, discrete Manopt. %, 0.4 dB, 0.2 dB, and 0.1 dB over, discrete Manopt, APX, discrete SDR-SDP, and SFA respectively. %In Fig.~\ref{CDFM1B1N200}, we conduct 1000 trials with a fixed $N=200$ considering LoS and NLoS scenarios and plot the cumulative distribution functions of SNR. The results also demonstrate that the proposed DaS method outperforms other competitors.


\subsection{4-bit Quantization is Adequate}

In Fig.~\ref{Comparison-Continuous}, we present the results of continuous phase configurations (obtained using Manopt) depicted by red curves, aiming to offer an analysis regarding different quantization schemes. We consider the case regarding the number of BS antennas $M=16$. Notably, the 1-bit discrete configurations exhibit a loss of approximately 3 dB compared to the continuous phase configurations (Manopt) in this case. However, as the quantization resolution increases, the loss in received signal power diminishes. Remarkably, when utilizing 4-bit quantization, the proposed methods achieve SNR gains comparable to continuous configurations, with an average loss of less than  \textbf{0.02} dB. % in $M=1$ cases. For $M=16$, this discrepancy is reduced to dB.


%%We consider two case $M=1$ and $M=16$. It is observed that the 1-bit discrete configurations lead to a loss of about 3 dB compared to the continuous phase configurations (Manopt) in both cases. However, as the quantization resolution increases, the loss in received signal power diminishes. Remarkably, when utilizing 4-bit quantization, the proposed DaS method achieves SNR gains that are comparable to continuous configurations, with an average loss of less than $\mathbf{0.05}$ dB.

%%We consider two scenarios regarding the number of BS antennas, $M=1$ and $M=16$. Notably, the 1-bit discrete configurations exhibit a loss of approximately 3 dB compared to the continuous phase configurations (Manopt) in both cases. However, as the quantization resolution increases, the loss in received signal power diminishes. Remarkably, when utilizing 4-bit quantization, the proposed methods achieves SNR gains comparable to continuous configurations, with an average loss of less than 0.05 dB in $M=1$ cases. For $M=16$, this discrepancy is reduced to 0.02 dB.


%Moreover, we observe that, for large $N$, the improvement rate in SNR performance diminishes gradually for higher-resolution phase configurations. To illustrate that, we plot the average SNR gap between $(B+1)$-bit and $B$-bit quantization scheme, as shown in Fig.~\ref{Comparison multi-bit}. The graph clearly indicates that the 5-bit quantization scheme provides near-zero improvement over the 4-bit. 

\begin{figure}[htbp]
\centering
\includegraphics[width=0.8\columnwidth]{Comparison-ContinuousM16B1234.eps}
\caption{The SNR performance distance between different quantization levels and the continuous phase configuration in NLoS scenarios, $N=200$ and $M=16$.}
\label{Comparison-Continuous}
\end{figure}


\subsection{Overall Execution-time Comparison}

To assess the effectiveness of the proposed approach, we conduct tests to evaluate the execution-time as a function of the number of reflecting units in the setting of $M=32$. For each value of $N$, we conduct 100 trials and record the overall execution-time, as presented in Table~\ref{tab: time} and Fig.~\ref{fig:time}. The results demonstrate that the execution-time of discrete SDR-SDP increases substantially as $N$ increases. In fact, for $N = 1000$, it fails to produce a solution even after running for many hours. Conversely, the proposed DaS-based alternating inner product maximization method is much more efficient, when $N = 1000$, it takes only 0.7409 s on average to find the optimal discrete phase configurations. The SFA algorithm is the second fastest. The superior execution-time performance of DaS-A algorithm makes it particularly well-suited for large-scale practical implementations.
%{\red When N is set to 1000 utilizing the SDR-SDP algorithm, the computer is unable to perform the calculation due to insufficient memory. It can be anticipated that even if computation is possible, it would require several hours.}


%The second model parameter follows the channel models employed in previous works~\cite{zhang2022configuring}, which pertains to the LOS scenarios. In this case, the direct channel is represented as
%\begin{equation}\label{E:LoS}
%  h_d=10^{-\mathrm{PL}_0 / 20} \zeta_0,
%\end{equation}
%$\mathrm{PL}_0=32.6+36.7 \log _{10}\left(d_0\right)$ represents the path loss between the transmitter and the receiver. Here, $d_0$ is the distance between the transmitter and the receiver in meters. The Rayleigh fading component $\zeta_0$ follows a Gaussian distribution $\mathcal{CN}(0,1)$. The reflected channel related to the RIS is represented by $\mathbf{h} = \mathbf{h}_r^H \odot \mathbf{h}_s$, each elements in the vector $\mathbf{h}$ is given by 
%\begin{equation}\label{E:ReflectedPath}
%h_i=10^{-\left(\mathrm{PL}_1^i + \mathrm{PL}_2^i \right) / 20} \zeta_i,\quad i=1, \ldots, N,
%\end{equation}
%where $\mathrm{PL}_1^i$ and $\mathrm{PL}_2^i$ are both based on the path loss model $\mathrm{PL}=30+22 \log _{10}(d)$, with $d$ in meters representing the BS-RIS distance and the RIS-UE distance, respectively. The Rayleigh fading component of $\zeta_i \sim \mathcal{CN}(0,1)$, for each $i=1, \ldots, N$. The transmit power level $P$ is set to 30 dBm, and the background noise power level $\sigma_0^2$ is set to -90 dBm.














%\begin{figure}[htbp]
%  \centering
%  \subfigure[]{
%  \label{CDF-My}
%  \includegraphics[width=0.48\linewidth]{cdfB1N200My-eps-converted-to.pdf}}
%  \subfigure[]{
%  \label{CDF-His1}
%  \includegraphics[width=0.48\linewidth]{cdfB1N200His-eps-converted-to.pdf}}
%  \caption{Cumulative distribution of SNR versus different methods under the quantization level $B=1$ and number of units $N=200$, and The number of BS antennas M=1. in (a) NLOS scenarios. (b) LOS scenarios.}
%  \label{Fig8-9}
%\end{figure}


%\begin{figure}[htbp]
%  \centering
%  \subfigure[]{
%  \label{Continuous-CDF-DaS}
%  \includegraphics[width=0.48\linewidth]{CDFComContinuousM1B1234.eps}}
%  \subfigure[]{
%  \label{Continuous-DaS-A}
%  \includegraphics[width=0.48\linewidth]{Comparison-ContinuousM16B1234.eps}}
%  \caption{The performance distance between different quantization levels in NLoS scenarios. (a) Cumulative distribution of SNR when $N=200$ and $M=1$. (b) SNR performance when $M=16$.}
%  \label{Comparison-Continuous}
%\end{figure}




%\begin{figure}[htbp]
%\centering
%\includegraphics[width=0.5\columnwidth]{CDFComContinuousM1B1234.eps}
%\caption{Cumulative distribution of SNR with different quantization levels when $N=200$, $M=1$ in NLOS scenarios.}
%\label{CDF-DaS}
%\end{figure}
%
%\begin{figure}[htbp]
%\centering
%\includegraphics[width=0.5\columnwidth]{Comparison-ContinuousM16B1234.eps}
%\caption{SNR performance with different quantization levels when $M=16$.}
%\label{Comparison-Continuous}
%\end{figure}

%SNR performance with different quantization levels when $M=16$. Only 0.02 dB gap to the continuous scheme.

%\begin{figure}[htbp]
%  \centering
%  \subfigure[]{
%  \label{1-bit}
%    \includegraphics[width=.48\columnwidth]{ComparisonB=1.pdf}}
%  \subfigure[]{
%  \label{2-bit}
%  \includegraphics[width=.48\columnwidth]{ComparisonB=2.pdf}}
%  \subfigure[]{
%  \label{4-bit}
%  \includegraphics[width=.48\columnwidth]{ComparisonB=3.pdf}}
%  \subfigure[]{
%  \label{8-bit}
%  \includegraphics[width=.48\columnwidth]{ComparisonB=4.pdf}}
%  \caption{SNR performance versus different methods as a function of $N$ in NLOS scenarios. (a) 1-bit quantization. (b) 2-bit quantization. (c) 3-bit quantization. (d) 4-bit quantization.}
%  \label{2-4-8bit}
%\end{figure}









%\begin{figure}[htbp]
%\centering
%\includegraphics[width=.5\columnwidth]{Gap1-2-3-4-5-bit2.pdf}
%\caption{The SNR gap between ($B+1$)-bit and $B$-bit quantization scheme in NLOS scenarios, where $B=1,2,3,4$. $M=1$.} %NLOS.}
%\label{Comparison multi-bit}
%\end{figure}



\begin{table*}[t]
\caption{Overall execution-time comparison for 100 channel realizations of 1-bit RIS, $M=32$} 
\centering
\setlength{\tabcolsep}{2.4mm}
\begin{tabular}{cccccccc}
\toprule
Methods & $N=10$  &  $N = 50$ & $N = 100$ & $N = 200$ &$N = 500$ &$N = 1000$  \\
\midrule
Discrete SDR-SDP  &  $208.06$ s &$241.01$ s  &$411.57$ s  &$1536.24$ s  & $22767.74$ s & -                         \\%698525.53s
Discrete Manopt  &  $3.27$ s   &$14.02$ s    & $23.76$ s  &$58.57$ s   & $515.25$ s  & $1164.71$ s               \\
SFA       &    $0.04$ s      &$0.15$ s    &$0.44$ s    &$2.15$ s    &$19.03$ s    & $134.85$ s      \\
%SFA (M=1)  &     0.024 s (N=10)           0.047   (N=50)       &  0.13 (N=100)           &            &              &                &              \\
Proposed Method   &  $0.03$ s   &$0.09$ s    & $0.22$ s   &$0.72$ s    & $11.44$ s   & $74.09$ s      \\
\bottomrule 
%'-' denotes that the execution time is too high.
\vspace{-0.5cm}
\label{tab: time}
\end{tabular}
\end{table*}


\begin{figure}[htbp]
\centering
\includegraphics[width=0.8\columnwidth]{PlotTime.eps}
\caption{The overall execution-time of $100$ trials for each $N$ in NLOS scenarios, with a quantization level of $B=1$, and the number of BS antennas is $M=32$.}%, NLOS.}
\label{fig:time}
\end{figure}







\section{RIS-Aided Experimental Field Trials}\label{Section8}
%Furthermore, we execute field tests within an actual RIS-aided communication prototype system. 
To evaluate the performance of the proposed algorithms in real-world scenarios, we conduct a series of experiments within a practical RIS-aided communication system. One of the key challenges in RIS-aided communications is the lack of dedicated signal processing capabilities in passive reflecting units, which makes traditional channel estimation methods impractical. However, in the context of geometrical optics models~\cite{mi2023towards}, the phase differences between various paths are calculated directly based on units' locations and configurations. This feature enables beamforming without the need for explicit channel estimation processes, making it more efficient and practical in real-world applications. To ensure a fair and accurate comparison of the performance of various methods, the phase configurations corresponding to different methods are first derived using geometrical optics models. Subsequently, these configurations are translated into control codebooks and seamlessly implemented on the controller of the RISs, ensuring their readiness for practical testing. 


\begin{figure}[htbp]
\centering
\includegraphics[width=0.9\linewidth]{WCS.png}
\caption{The prototype of 1-bit RIS-aided wireless communication system.}
\label{system}
\end{figure}

We carry out all experiments utilizing a 1-bit RIS-aided communication system, as depicted in Figs.~\ref{system} and \ref{chamber}. The signal is generated and modulated using the USRP 2954R, transmitted through a horn antenna, reflected by the RIS, and finally received by another horn. To ensure the reliability of the evaluation, we calculate the average received signal power based on 8912 samples. The experiments are designed to encompass two different frequency types of RISs, providing a comprehensive evaluation and validation of the algorithm's performance under diverse scenarios. 



\begin{figure}[tbp]
\centering
\includegraphics[width=0.9\columnwidth]{Chamber2.png}
\caption{Experiment conducted inside the anechoic chamber while using a 1-bit RIS operating at a frequency of 4.85 GHz.}
\label{chamber}
\end{figure}



\begin{figure}[tbp]
\centering
\includegraphics[width=0.9\linewidth]{Experiment2.png}
\caption{Experiment setups while using the RIS operating at a frequency of 4.85 GHz. All devices are positioned at the same height to ensure that the azimuth angle $\phi$ remains equal to $0^\circ$ the Tx antenna is located at an elevation angle of $\theta^{\text{Arr}}=0^{\circ}$ with a distance of 2.8 meters to the center of RIS, the Rx antenna is positioned at direction angles of $\theta^{\text{Arr}}= 30^{\circ}, 45^{\circ}$, and $60^{\circ}$.}
\label{Experiment Test}
\end{figure}


\subsubsection{Anechoic Chamber Environment Testing}
We first conduct an experiment inside an anechoic chamber. The experiment aims to compare the received power before and after beamforming using the proposed algorithm. The 1-bit RIS utilized in this test operates at a frequency of 4.85 GHz, as illustrated in Fig.~\ref{chamber}. It comprises $10\times16$ reflecting units, with each unit spaced 0.027 meters apart. To simplify the experiments, all devices are positioned at the same height to ensure that the azimuth angle $\phi$ remains equal to $0^\circ$.

\begin{figure}[htbp]
  \centering
  \subfigure[]{
  \label{30}
  \includegraphics[width=.31\columnwidth]{0,0-30,0.png}}
  \subfigure[]{
  \label{45}
  \includegraphics[width=.31\columnwidth]{0,0-45,0.png}}
  \subfigure[]{
  \label{60}
  \includegraphics[width=.31\columnwidth]{0,0-60,0.png}}
  \caption{RIS codebooks related to the optimization phase configurations by DaS when using the RIS operating at a frequency of 4.85 GHz. The Tx is located at the elevation angles $\theta^{\text{Arr}}=0^{\circ}$ with a distance of 2.8 meters to the center of RIS, the Rx is positioned at (a) $\theta^{\text{Arr}} = 30^{\circ}$, 3.23 meters. $\theta^{\text{Arr}} = 45^{\circ}$, 3.96 meters.  $\theta^{\text{Arr}} =60^{\circ}$, 5.6 meters.}
  \label{codebook}
\end{figure}


For each of the three experimental setups, we perform the proposed DaS method to obtain the optimal discrete phase configurations based on the geometrical optics model~\cite{mi2023towards}. These configurations are then transformed into control codebooks. As shown in Fig.\ref{codebook}. The bright yellow color represents the corresponding reflecting units in the configuration of $\Omega_i = 0$, with the controlling diodes in the ON state. Conversely, the blue color corresponds to the configuration of $\Omega_i = \pi$, indicating the OFF state. For clarity, the configuration with all diodes in the OFF state is denoted as "not-configured."


\begin{figure}[htbp]
  \centering
  \subfigure[]{
  \label{30degree}
  \includegraphics[width=.68\columnwidth]{Rt30-485.png}}
  \subfigure[]{
  \label{45degree}
  \includegraphics[width=.68\columnwidth]{Rt45-485.png}}
  \subfigure[]{
  \label{60degree}
  \includegraphics[width=.68\columnwidth]{Rt60-485.png}}
  \caption{The received signal power measurements at different locations during the experiment involving the RIS operating at a frequency of 4.85 GHz. The Tx keeps the distance at 2.8 meters in front of the RIS, with both elevation and azimuth angles set to $0^{\circ}$. The Rx is placed at (a) $\theta^{\text{Arr}}=30^{\circ}$, 3.23 meters. (b) $\theta^{\text{Arr}}=45^{\circ}$, 3.96 meters. (c) $\theta^{\text{Arr}}=60^{\circ}$, 5.6 meters.}
  \label{Repower}
\end{figure}

The experimental results in Fig.~\ref{Repower} highlight the remarkable performance of the optimized configurations derived through the proposed algorithm, resulting in substantial enhancements in signal strength. Across all of the experimental setups, the configurations designed by DaS achieve an average gain of 13.1 dB compared to no elaborate configurations.
\begin{figure}[htbp] 
  \centering
  \subfigure[]{
  \label{rand45}
  \includegraphics[width=.31\columnwidth]{45Allzeros-RGB-3d26a8.png}}
 \subfigure[]{
  \label{zero45}
  \includegraphics[width=.31\columnwidth]{45Random.png}}
 \subfigure[]{
  \label{sdr45}
  \includegraphics[width=.31\columnwidth]{45DiscreteSDR-SDP.png}}
 \subfigure[]{
  \label{man45}
  \includegraphics[width=.31\columnwidth]{45DiscreteManopt.png}}
  \subfigure[]{
  \label{my45}
  \includegraphics[width=.31\columnwidth]{45DaS.png}}
  \subfigure[]{
  \label{apx45}
  \includegraphics[width=.31\columnwidth]{45APX.png}}
  \caption{The control codebooks correspond to the phase configurations obtained by various approaches at the operating frequency of 5.8 GHz. (a) Random. (b) Not-configured. (c) Discrete SDR-SDP. (d) Discrete Manopt. (e) Proposed DaS. (f) APX.}
\label{codebooks}
\end{figure}




\begin{table*}[t]
\centering
\begin{small}
\caption{Practical power gains over different approaches in 1-bit RIS operating at a frequency of 5.8 GHz} 
\centering
\setlength{\tabcolsep}{1.3mm}%调整列宽
\begin{tabular}{ccccccccc}
\toprule
Tx, Rx Position/Methods                         & Not-configured        &  Random    & Discrete SDR-SDP & Discrete Manop   & APX & Proposed DaS   \\
\midrule
Tx: 2.1 m, Rx: ($30^{\circ},0^{\circ})$ & $-47.29$ dBm  & $-44.81$ dBm  & $-39.83$ dBm    & $-40.59$ dBm     & $-40.54$ dBm  & $\mathbf{-32.79}$ dBm  \\
Tx: 2.1 m, Rx:  ($45^{\circ},0^{\circ})$ & $-49.42$ dBm  & $-44.68$ dBm  & $-33.09$ dBm    & $-33.21$ dBm     & $-32.52$ dBm  & $\mathbf{-31.63}$ dBm  \\
Tx: 2.1 m, Rx: ($60^{\circ},0^{\circ})$ & $-44.41$ dBm  & $-47.00$ dBm  & $-44.94$ dBm    & $-39.77$ dBm     & $-41.04$ dBm  & $\mathbf{-37.47}$ dBm   \\ 
Tx: 4.0 m, Rx: ($30^{\circ},0^{\circ})$ & $-40.00$ dBm  & $-45.14$ dBm  & $-43.74$ dBm    & $-42.70$ dBm     & $-40.78$ dBm  & $\mathbf{-39.91}$ dBm   \\
Tx: 4.0 m, Rx: ($45^{\circ},0^{\circ})$ & $-46.72$ dBm  & $-41.32$ dBm  & $-44.00$ dBm    & $-52.91$ dBm     & $-46.85$ dBm  & $\mathbf{-39.80}$ dBm    \\
Tx: 4.0 m, Rx: ($60^{\circ},0^{\circ})$ & $-52.21$ dBm  & $-48.11$ dBm  & $-46.58$ dBm    & $-44.32$ dBm     & $-46.50$ dBm  & $\mathbf{-43.75}$ dBm \\
\bottomrule
\label{Table-Performances}
\end{tabular}
\end{small}
\end{table*}




\subsubsection{Open Office Area Testing}
The primary objective of our second experiment is to compare the actual signal power gains achieved by various algorithms in an open office area. For this purpose, we consider the proposed DaS method, along with the discrete SDR-SDP and discrete Manopt methods. Additionally, we include two benchmark configurations: random phase configurations and not-configured phase configurations. The codebooks are visualized in Fig.~\ref{codebooks}. 

In this experiment, a 1-bit RIS operating at a frequency of 5.8 GHz is employed. The transmitting antenna is precisely placed 2.1 meters in front of the RIS board, with elevation angles of $\theta^{\text{Arr}}=0^{\circ}$. Conversely, the receiving antenna is set at a distance of 2.97 meters from the RIS, with an angle of $\theta^{\text{Dep}}=45^{\circ}$. Similarly, all devices are fixed at the same height. 



The measurement results presented in Fig.~\ref{Result2.1-45} clearly demonstrate the effectiveness of the proposed DaS method, surpassing other competing methods by approximately 1 dB in terms of received signal power gain. Notably, when compared to no elaborate phase configurations, the proposed DaS method achieves a remarkable power gain of up to 18 dB. 


We further conduct tests with the receiver positioned at direction angles $\theta^{\text{Arr}}=30^{\circ}$ and $\theta^{\text{Arr}}=60^{\circ}$, at distances of 2.42 meters and 4.20 meters from the RIS, respectively. Moreover, for comprehensiveness, we extend the transmitter-RIS distance to 4.0 meters and repeat the tests. The results are summarized in TABLE~\ref{Table-Performances}. It is evident from the table that the proposed approach achieves an increase in received signal power, outperforming other competing methods. 





\begin{figure}[htbp]
\centering
\includegraphics[width=.98\columnwidth]{Result21-45.png}
\vspace{-0.4cm}
\caption{The received signal power measurements for different approaches in a 1-bit RIS-aided communication system operating at a frequency of 5.8 GHz. The Tx is located 2.1 meters in front of the RIS at an elevation angle of $\theta^{\text{Arr}}=0^{\circ}$, the Rx is positioned at an angle of $ \theta^{\text{Arr}}=45^{\circ}$,  with a distance of 2.97 meters to the RIS.}
\label{Result2.1-45}
\end{figure}



In summary, the simulation and experiment results have revealed several noteworthy findings.
\begin{itemize}
\item The proposed algorithm gives rise to the optimal solution in discrete beamforming for RIS. Both simulation and experimental results demonstrate its superior performance compared to other competing algorithms.
\item With the 1-bit quantization scheme performed, there is an approximate 3 dB reduction in received power compared to the continuous phase configurations. However, when using moderate resolution quantization, such as 4-bit and above, there is no noticeable difference between continuous and discrete phase configurations in terms of the received signal power. 
%\item \textbf{In the experiments involving 1-bit RIS-aided systems, a symmetrical power peak is observed at an angle that is symmetrical to the desired direction. This phenomenon could potentially explain the 3 dB power loss.}
\end{itemize}



\section{Conclusion}\label{Section9}


This paper presents a novel framework dedicated to maximizing the $\ell_p$-norm with discrete uni-modular variable constraints. Our proposed alternating inner product maximization approach represents the first post-rounding lifting method capable of mitigating performance degradation caused by discrete quantization. Numerical simulations demonstrate superior performance in terms of SNR and execution-time compared to other competing methods. Finally, we validate the effectiveness of the alternating inner product maximization framework in beamforming through RISs using both numerical experiments and field trials on prototypes. 



\section{Acknowledgment}

We would like to thank the anonymous referees of the initial version of this paper, who drew our attention to the reference \cite{ren2022linear}.


\bibliographystyle{IEEEtran}

\bibliography{Reference}



\end{document}


% Generated by IEEEtran.bst, version: 1.14 (2015/08/26)
\begin{thebibliography}{10}
\providecommand{\url}[1]{#1}
\csname url@samestyle\endcsname
\providecommand{\newblock}{\relax}
\providecommand{\bibinfo}[2]{#2}
\providecommand{\BIBentrySTDinterwordspacing}{\spaceskip=0pt\relax}
\providecommand{\BIBentryALTinterwordstretchfactor}{4}
\providecommand{\BIBentryALTinterwordspacing}{\spaceskip=\fontdimen2\font plus
\BIBentryALTinterwordstretchfactor\fontdimen3\font minus
  \fontdimen4\font\relax}
\providecommand{\BIBforeignlanguage}[2]{{%
\expandafter\ifx\csname l@#1\endcsname\relax
\typeout{** WARNING: IEEEtran.bst: No hyphenation pattern has been}%
\typeout{** loaded for the language `#1'. Using the pattern for}%
\typeout{** the default language instead.}%
\else
\language=\csname l@#1\endcsname
\fi
#2}}
\providecommand{\BIBdecl}{\relax}
\BIBdecl

\bibitem{cui2014coding}
T.~J. Cui, M.~Q. Qi, X.~Wan, J.~Zhao, and Q.~Cheng, ``Coding metamaterials,
  digital metamaterials and programmable metamaterials,'' \emph{Light-Sci.
  Appl.}, vol.~3, no.~10, pp. e218--e218, Oct. 2014.

\bibitem{basar2019wireless}
E.~Basar, M.~Di~Renzo, J.~De~Rosny, M.~Debbah, M.-S. Alouini, and R.~Zhang,
  ``Wireless communications through reconfigurable intelligent surfaces,''
  \emph{IEEE Access}, vol.~7, pp. 116\,753--116\,773, Aug. 2019.

\bibitem{di2020smart}
M.~Di~Renzo \emph{et~al.}, ``Smart radio environments empowered by
  reconfigurable intelligent surfaces: How it works, state of research, and the
  road ahead,'' \emph{IEEE J. Sel. Areas Commun.}, vol.~38, no.~11, pp.
  2450--2525, Nov. 2020.

\bibitem{di2020hybrid}
B.~Di, H.~Zhang, L.~Song, Y.~Li, Z.~Han, and H.~V. Poor, ``Hybrid beamforming
  for reconfigurable intelligent surface based multi-user communications:
  Achievable rates with limited discrete phase shifts,'' \emph{IEEE J. Sel.
  Areas Commun.}, vol.~38, no.~8, pp. 1809--1822, Apr. 2020.

\bibitem{chen2023channel}
J.~Chen, Y.-C. Liang, H.~V. Cheng, and W.~Yu, ``Channel estimation for
  reconfigurable intelligent surface aided multi-user mmwave mimo systems,''
  \emph{IEEE Trans. Wirel. Commun.}, vol.~22, no.~10, pp. 6853--6869, Oct.
  2023.

\bibitem{yang2020secrecy}
L.~Yang, J.~Yang, W.~Xie, M.~O. Hasna, T.~Tsiftsis, and M.~Di~Renzo, ``Secrecy
  performance analysis of {RIS}-aided wireless communication systems,''
  \emph{IEEE Trans. Veh. Technol.}, vol.~69, no.~10, pp. 12\,296--12\,300, Oct.
  2020.

\bibitem{cui2019secure}
M.~Cui, G.~Zhang, and R.~Zhang, ``Secure wireless communication via intelligent
  reflecting surface,'' \emph{IEEE Wirel. Commun. Lett.}, vol.~8, no.~5, pp.
  1410--1414, Oct. 2019.

\bibitem{lin2020adaptive}
S.~Lin, B.~Zheng, G.~C. Alexandropoulos, M.~Wen, F.~Chen, and S.~sMumtaz,
  ``Adaptive transmission for reconfigurable intelligent surface-assisted
  {OFDM} wireless communications,'' \emph{IEEE J. Sel. Areas Commun.}, vol.~38,
  no.~11, pp. 2653--2665, Nov. 2020.

\bibitem{yang2020intelligent}
Y.~Yang, B.~Zheng, S.~Zhang, and R.~Zhang, ``Intelligent reflecting surface
  meets {OFDM}: Protocol design and rate maximization,'' \emph{IEEE Trans.
  Commun.}, vol.~68, no.~7, pp. 4522--4535, Jul. 2020.

\bibitem{li2020reconfigurable}
S.~Li, B.~Duo, X.~Yuan, Y.-C. Liang, and M.~Di~Renzo, ``Reconfigurable
  intelligent surface assisted {UAV} communication: Joint trajectory design and
  passive beamforming,'' \emph{IEEE Wirel. Commun. Lett.}, vol.~9, no.~5, pp.
  716--720, May. 2020.

\bibitem{mu2021intelligent}
X.~Mu, Y.~Liu, L.~Guo, J.~Lin, and H.~V. Poor, ``Intelligent reflecting surface
  enhanced multi-{UAV} {NOMA} networks,'' \emph{IEEE J. Sel. Areas Commun.},
  vol.~39, no.~10, pp. 3051--3066, Oct. 2021.

\bibitem{pan2020intelligent}
C.~Pan \emph{et~al.}, ``Intelligent reflecting surface aided {MIMO}
  broadcasting for simultaneous wireless information and power transfer,''
  \emph{IEEE J. Sel. Areas Commun.}, vol.~38, no.~8, pp. 1719--1734, Aug. 2020.

\bibitem{wu2020joint}
Q.~Wu and R.~Zhang, ``Joint active and passive beamforming optimization for
  intelligent reflecting surface assisted {SWIPT} under {QoS} constraints,''
  \emph{IEEE J. Sel. Areas Commun.}, vol.~38, no.~8, pp. 1735--1748, Aug. 2020.

\bibitem{bai2020latency}
T.~Bai, C.~Pan, Y.~Deng, M.~Elkashlan, A.~Nallanathan, and L.~Hanzo, ``Latency
  minimization for intelligent reflecting surface aided mobile edge
  computing,'' \emph{IEEE J. Sel. Areas Commun.}, vol.~38, no.~11, pp.
  2666--2682, Nov. 2020.

\bibitem{mao2022reconfigurable}
S.~Mao \emph{et~al.}, ``Reconfigurable intelligent surface-assisted secure
  mobile edge computing networks,'' \emph{IEEE Trans. Veh. Technol.}, vol.~71,
  no.~6, pp. 6647--6660, Jun. 2022.

\bibitem{elzanaty2021reconfigurable}
A.~Elzanaty, A.~Guerra, F.~Guidi, and M.-S. Alouini, ``Reconfigurable
  intelligent surfaces for localization: Position and orientation error
  bounds,'' \emph{IEEE Trans. Signal Process.}, vol.~69, pp. 5386--5402, Aug.
  2021.

\bibitem{chen2022efficient}
P.~Chen, Z.~Chen, B.~Zheng, and X.~Wang, ``Efficient {DOA} estimation method
  for reconfigurable intelligent surfaces aided {UAV} swarm,'' \emph{IEEE
  Trans. Signal Process.}, vol.~70, pp. 743--755, Jan. 2022.

\bibitem{xiong2023ris}
\BIBentryALTinterwordspacing
R.~Xiong \emph{et~al.} {RIS}-aided wireless communication in real-world:
  Antennas design, prototyping, beam reshape and field trials.
  arXiv:2303.03287. Mar. 2023. [Online]. Available:
  \url{https://arxiv.org/abs/2303.03287}
\BIBentrySTDinterwordspacing

\bibitem{arun2020rfocus}
V.~Arun and H.~Balakrishnan, ``{RFocus}: Beamforming using thousands of passive
  antennas.'' in \emph{Proc. 17 th USENIX Symp. Networked Syst. Design
  Implement.}, Feb. 2020, pp. 1047--1061.

\bibitem{tran2020demonstration}
N.~M. Tran \emph{et~al.}, ``Demonstration of reconfigurable metasurface for
  wireless communications,'' in \emph{Proc. IEEE Wireless Commun. Netw.
  Conf.}\hskip 1em plus 0.5em minus 0.4em\relax IEEE, May. 2020, pp. 1--2.

\bibitem{pei2021ris}
X.~Pei \emph{et~al.}, ``{RIS}-aided wireless communications: Prototyping,
  adaptive beamforming, and indoor/outdoor field trials,'' \emph{IEEE Trans.
  Commun.}, vol.~69, no.~12, pp. 8627--8640, Dec. 2021.

\bibitem{dai2020reconfigurable}
L.~Dai \emph{et~al.}, ``Reconfigurable intelligent surface-based wireless
  communications: Antenna design, prototyping, and experimental results,''
  \emph{IEEE Access}, vol.~8, pp. 45\,913--45\,923, Mar. 2020.

\bibitem{rains2022high}
J.~Rains \emph{et~al.}, ``High-resolution programmable scattering for wireless
  coverage enhancement: an indoor field trial campaign,'' \emph{IEEE Trans.
  Antennas Propag.}, vol.~71, no.~1, pp. 518--530, Jan. 2023.

\bibitem{kishiyama2021research}
K.~Daisuke, H.~Yuto, M.~Kensuke, and K.~Yoshihisa, ``Research of transparent
  {RIS} technology toward {5G} evolution \& {6G},'' \emph{NTT DOCOMO Tech. J.},
  vol.~19, no.~11, pp. 26--34, Nov. 2021.

\bibitem{wu2019intelligent}
Q.~Wu and R.~Zhang, ``Intelligent reflecting surface enhanced wireless network
  via joint active and passive beamforming,'' \emph{IEEE Trans. Wirel.
  Commun.}, vol.~18, no.~11, pp. 5394--5409, Aug. 2019.

\bibitem{wu2023intelligent}
\BIBentryALTinterwordspacing
Q.~Wu \emph{et~al.} Intelligent surfaces empowered wireless network: Recent
  advances and the road to {6G}. arXiv:2312.16918. Mar. 2024. [Online].
  Available: \url{https://arxiv.org/abs/2312.16918}
\BIBentrySTDinterwordspacing

\bibitem{zhang2006complex}
S.~Zhang and Y.~Huang, ``Complex quadratic optimization and semidefinite
  programming,'' \emph{SIAM J. Optim.}, vol.~16, no.~3, pp. 871--890, 2006.

\bibitem{soltanalian2014designing}
M.~Soltanalian and P.~Stoica, ``Designing unimodular codes via quadratic
  optimization,'' \emph{IEEE Trans. Signal Process.}, vol.~62, no.~5, pp.
  1221--1234, Mar. 2014.

\bibitem{liang2016unimodular}
J.~Liang, H.~C. So, J.~Li, and A.~Farina, ``Unimodular sequence design based on
  alternating direction method of multipliers,'' \emph{IEEE Trans. Signal
  Process.}, vol.~64, no.~20, pp. 5367--5381, Oct. 2016.

\bibitem{yang2021beamforming}
Z.~Yang and Y.~Zhang, ``Beamforming optimization for {RIS}-aided {SWIPT} in
  cell-free {MIMO} networks,'' \emph{China Commun.}, vol.~18, no.~9, pp.
  175--191, Sep. 2021.

\bibitem{wang2022sca}
T.~Wang, F.~Fang, and Z.~Ding, ``An {SCA} and relaxation based energy
  efficiency optimization for multi-user ris-assisted {NOMA} networks,''
  \emph{IEEE Trans. Veh. Technol.}, vol.~71, no.~6, pp. 6843--6847, Jun. 2022.

\bibitem{kumar2022novel}
V.~Kumar, R.~Zhang, M.~Di~Renzo, and L.-N. Tran, ``A novel {SCA}-based method
  for beamforming optimization in {IRS/RIS}-assisted {MU-MISO} downlink,''
  \emph{IEEE Wirel. Commun. Lett.}, vol.~12, no.~2, pp. 297--301, Nov. 2022.

\bibitem{zhou2020robust}
G.~Zhou, C.~Pan, H.~Ren, K.~Wang, M.~Di~Renzo, and A.~Nallanathan, ``Robust
  beamforming design for intelligent reflecting surface aided {MISO}
  communication systems,'' \emph{IEEE Wirel. Commun. Lett.}, vol.~9, no.~10,
  pp. 1658--1662, Oct. 2020.

\bibitem{shen2019secrecy}
H.~Shen, W.~Xu, S.~Gong, Z.~He, and C.~Zhao, ``Secrecy rate maximization for
  intelligent reflecting surface assisted multi-antenna communications,''
  \emph{IEEE Commun. Lett.}, vol.~23, no.~9, pp. 1488--1492, Sep. 2019.

\bibitem{bai2021reconfigurable}
T.~Bai, C.~Pan, C.~Han, and L.~Hanzo, ``Reconfigurable intelligent surface
  aided mobile edge computing,'' \emph{IEEE Wirel. Commun.}, vol.~28, no.~6,
  pp. 80--86, Dec. 2021.

\bibitem{salem2022active}
A.~A. Salem, M.~H. Ismail, and A.~S. Ibrahim, ``Active reconfigurable
  intelligent surface-assisted {MISO} integrated sensing and communication
  systems for secure operation,'' \emph{IEEE Trans. Veh. Technol.}, vol.~72,
  no.~4, pp. 4919--4931, Apr 2023.

\bibitem{absil2008optimization}
P.-A. Absil, R.~Mahony, and R.~Sepulchre, \emph{Optimization algorithms on
  matrix manifolds}.\hskip 1em plus 0.5em minus 0.4em\relax Princeton, NJ, USA:
  Princeton Univ. Press, 2009.

\bibitem{yu2019miso}
X.~Yu, D.~Xu, and R.~Schober, ``{MISO} wireless communication systems via
  intelligent reflecting surfaces,'' in \emph{Proc. IEEE Int. Conf. Commun.
  China}.\hskip 1em plus 0.5em minus 0.4em\relax IEEE, Aug. 2019, pp. 735--740.

\bibitem{wang2020intelligent}
P.~Wang, J.~Fang, X.~Yuan, Z.~Chen, and H.~Li, ``Intelligent reflecting
  surface-assisted millimeter wave communications: Joint active and passive
  precoding design,'' \emph{IEEE Trans. Veh. Technol.}, vol.~69, no.~12, pp.
  14\,960--14\,973, Dec. 2020.

\bibitem{zheng2020intelligent}
B.~Zheng, Q.~Wu, and R.~Zhang, ``Intelligent reflecting surface-assisted
  multiple access with user pairing: {NOMA} or {OMA}?'' \emph{IEEE Commun.
  Lett.}, vol.~24, no.~4, pp. 753--757, Apr. 2020.

\bibitem{you2020channel}
C.~You, B.~Zheng, and R.~Zhang, ``Channel estimation and passive beamforming
  for intelligent reflecting surface: Discrete phase shift and progressive
  refinement,'' \emph{IEEE J. Sel. Areas Commun.}, vol.~38, no.~11, pp.
  2604--2620, Nov. 2020.

\bibitem{qiao2020secure}
J.~Qiao and M.-S. Alouini, ``Secure transmission for intelligent reflecting
  surface-assisted mmwave and terahertz systems,'' \emph{IEEE Wirel. Commun.
  Lett.}, vol.~9, no.~10, pp. 1743--1747, Oct. 2020.

\bibitem{wu2019beamforming}
Q.~Wu and R.~Zhang, ``Beamforming optimization for wireless network aided by
  intelligent reflecting surface with discrete phase shifts,'' \emph{IEEE
  Trans. Commun.}, vol.~68, no.~3, pp. 1838--1851, May 2020.

\bibitem{zhang2022configuring}
Y.~Zhang, K.~Shen, S.~Ren, X.~Li, X.~Chen, and Z.-Q. Luo, ``Configuring
  intelligent reflecting surface with performance guarantees: Optimal
  beamforming,'' \emph{IEEE J. Sel. Top. Signal Process.}, vol.~16, no.~5, pp.
  967--979, Aug. 2022.

\bibitem{ren2022linear}
S.~Ren, K.~Shen, X.~Li, X.~Chen, and Z.-Q. Luo, ``A linear time algorithm for
  the optimal discrete irs beamforming,'' \emph{IEEE Wirel. Commun. Lett.},
  vol.~12, no.~3, pp. 496--500, May. 2023.

\bibitem{tse2005fundamentals}
D.~Tse and P.~Viswanath, \emph{Fundamentals of wireless communication}.\hskip
  1em plus 0.5em minus 0.4em\relax Cambridge, U.K: Cambridge Univ. Press, 2005.

\bibitem{mi2023towards}
T.~Mi, J.~Zhang, R.~Xiong, Z.~Wang, P.~Zhang, and R.~C. Qiu, ``Towards
  analytical electromagnetic models for reconfigurable intelligent surfaces,''
  \emph{IEEE Trans. Wirel. Commun.}, Sep. 2023, early access, doi:
  \href{https://doi.org/10.1109/TWC.2023.3315580}{10.1109/TWC.2023.3315580}.

\end{thebibliography}