# Design and cross-layer optimization of low cost RIS-assisted communication systems

Antoine Dejonghe, Zwi Altman, Francesco De Pellegrini, Eitan Altman

► To cite this version:

Antoine Dejonghe, Zwi Altman, Francesco De Pellegrini, Eitan Altman. Design and cross-layer optimization of low cost RIS-assisted communication systems. IEEE Transactions on Wireless Communications, 2024. hal-04601576

HAL Id: hal-04601576

https://hal.science/hal-04601576

Submitted on 5 Jun 2024

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Design and cross-layer optimization of low cost RIS-assisted communication systems

Antoine Dejonghe, Zwi Altman, Francesco De Pellegrini, Eitan Altman

► To cite this version:

Antoine Dejonghe, Zwi Altman, Francesco De Pellegrini, Eitan Altman. Design and cross-layer optimization of low cost RIS-assisted communication systems. IEEE Transactions on Wireless Communications, 2024, 23 (10), 10.1109/TWC.2024.3404231. [hal-04601576](https://hal.science/hal-04601576v1)

HAL Id: hal-04601576

https://hal.science/hal-04601576v1

Submitted on 5 Jun 2024

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Design and cross-layer optimization of low cost RIS-assisted communication systems

Antoine Dejonghe*†, Zwi Altman*, Francesco de Pellegrini†, and Eitan Altman‡

***Abstract***—The deployment of RISs in future 6G networks is expected to substantially improve mobile network coverage. This paper introduces a new cross-layer low-complexity scheme for the online optimization of RIS-assisted communication systems. It jointly combines BS and RIS configuration and fair UEs' scheduling which is critical for high-performance deployments. A RIS beam synthesis method is especially proposed for RIS configuration. The proposed solution embeds two nested control loops: i) a fast control loop working at the OFDMA slot scale and consisting in a standard UEs proportional fair scheduler, and ii) a slow control loop operating at the OFDMA frame scale which adapts the RIS' configuration to the UEs' spatial distribution and maximizes the UEs' aggregated performance. The slow control loop is based on an online stochastic approximation algorithm whose convergence to the optimal restpoint is proved. In a reference scenario, the proposed scheduler achieves a gain of 47% in mean spectral efficiency for NLOS UEs over a baseline scheme.

***Index Terms***—Reconfigurable Intelligent Surfaces, proportional fair scheduler, stochastic approximation, RIS beam synthesis, cross-layer design.

## I. INTRODUCTION

THE sixth Generation (6G) technology targets new applications in the 2030 area, with performance requirements not supported by previous generations [1]. Reconfigurable Intelligent Surfaces (RISs) have been identified among the important 6G technological enablers to achieve 6G targets. RISs are panels composed of numerous electronically controllable Reflecting Elements (REs) [2]. The phase-shift applied by each RE can be tuned to steer the reflection of impinging waves in desired directions. The overall RIS phase shifts define the RIS precoder. The deployment of RISs can improve mobile networks' performance, e.g., Spectral Efficiency (SE) by substantially improving User Equipments' (UEs) Signal to Noise Ratio (SNR).

Recently, several authors have studied RISs from a Physical (PHY) layer point of view. The basic system analyzed in this context is a multi-antenna Base Station (BS) coupled to a RIS. By leveraging instantaneous Channel State Information (CSI), the BS and RIS precoders are jointly designed in order to maximize UEs' SNR [3], [4], [6]–[9], [11]–[13]. However, instantaneous CSI-based schemes generally cope with three main problems. The first one is the computation of optimal BS and RIS precoders for all UEs in each coherence time interval. This task usually requires to solve a non-convex optimization

problem [3], the solution of which is of high complexity and cannot be solved in real time. It is standard practice to avoid such complexity by using Machine Learning tools such as Deep Learning (DL) [8] or Reinforcement Learning (RL) [9]. Moreover, these approaches often require the collection of a high amount of data specific to a scenario and a long training period. The second problem corresponds to the pilot overhead produced by the instantaneous CSI acquisition. In networks with RIS deployment, the overhead of state-of-the art channel estimation methods is proportional to the number of REs [13]. It is noted that a RIS is generally composed of a large number of REs in order to enable a given coverage extension, which leads to an excessively high overhead. The third problem is the sensitivity to CSI imperfections which are caused by the stochasticity of both wireless environment and hardware, and significantly limit RIS-assisted communication system performance. Lately, a new class of BS and RIS configuration schemes refered as statistical CSI-based schemes have been extensively investigated. They enable to jointly address the above two problems by leveraging statistical CSI (e.g., channel covariance matrices), the coherence time of which is much longer than that of instantaneous CSI. For instance, [11] exploits departure and arrival angles in order to design the RIS phase shifts. Alternatively, UEs' spectral efficiency can be exploited in order to learn the optimal BS and RIS configurations as for example is proposed in [7] via a two-stage stochastic multi-armed bandit strategy to select sequentially the best BS and RIS precoders from finite-size codebooks. Interestingly, statistical CSI-based schemes are also less sensitive to CSI imperfections than instantaneous CSI-based schemes. Hence, they can provide better performance in specific scenarios (e.g., highly dynamic environments). In this work we propose a low-complexity and efficient solution for the joint BS and RIS configuration. Having in mind a design practically viable in production, the scheme relies on three main pillars: (i) the use of 5G compatible measurements, (ii) the use of standard Proportional Fair (PF) or α-fair schedulers, and (iii) the design of a small set of RIS beam patterns, denoted later RCPs.

In fact, up to date, few works in the literature have addressed Medium Access Control-layer. However, the related resource management aspects appear key to enable effective RIS deployment [5]. In particular, a core problem which is addressed in this work is how to configure optimally a RIS in combination with fair UEs' schedulers [4]. To this end, we have introduced the *RIS configuration pattern* (RCP) which is a novel lightweight solution to configure RISs online in a blind and adaptive fashion [6]. The RCP is a predetermined periodic sequence of precoders with fixed duration, drawn

<footnote>*Orange Labs, Chatillon, France; †University of Avignon, Avignon, France; †INRIA Sophia Antipolis, France; an early version of this work appeared in [6]. The work of F. De Pellegrini has been partially supported by ANR within the framework of the PARFAIT project (ANR-21-CE25-0013).</footnote>
# Design and cross-layer optimization of low cost RIS-assisted communication systems

Antoine Dejonghe*†, Zwi Altman*, Francesco de Pellegrini†, and Eitan Altman‡

***Abstract***—The deployment of RISs in future 6G networks is expected to substantially improve mobile network coverage. This paper introduces a new cross-layer low-complexity scheme for the online optimization of RIS-assisted communication systems. It jointly combines BS and RIS configuration and fair UEs' scheduling which is critical for high-performance deployments. A RIS beam synthesis method is especially proposed for RIS configuration. The proposed solution embeds two nested control loops: i) a fast control loop working at the OFDMA slot scale and consisting in a standard UEs proportional fair scheduler, and ii) a slow control loop operating at the OFDMA frame scale which adapts the RIS' configuration to the UEs' spatial distribution and maximizes the UEs' aggregated performance. The slow control loop is based on an online stochastic approximation algorithm whose convergence to the optimal restpoint is proved. In a reference scenario, the proposed scheduler achieves a gain of 47% in mean spectral efficiency for NLOS UEs over a baseline scheme.

***Index Terms***—Reconfigurable Intelligent Surfaces, proportional fair scheduler, stochastic approximation, RIS beam synthesis, cross-layer design.

## I. INTRODUCTION

THE sixth Generation (6G) technology targets new applications in the 2030 area, with performance requirements not supported by previous generations [1]. Reconfigurable Intelligent Surfaces (RISs) have been identified among the important 6G technological enablers to achieve 6G targets. RISs are panels composed of numerous electronically controllable Reflecting Elements (REs) [2]. The phase-shift applied by each RE can be tuned to steer the reflection of impinging waves in desired directions. The overall RIS phase shifts define the RIS precoder. The deployment of RISs can improve mobile networks' performance, e.g., Spectral Efficiency (SE) by substantially improving User Equipments' (UEs) Signal to Noise Ratio (SNR).

Recently, several authors have studied RISs from a Physical (PHY) layer point of view. The basic system analyzed in this context is a multi-antenna Base Station (BS) coupled to a RIS. By leveraging instantaneous Channel State Information (CSI), the BS and RIS precoders are jointly designed in order to maximize UEs' SNR [3], [4], [6]–[9], [11]–[13]. However, instantaneous CSI-based schemes generally cope with three main problems. The first one is the computation of optimal BS and RIS precoders for all UEs in each coherence time interval. This task usually requires to solve a non-convex optimization

problem [3], the solution of which is of high complexity and cannot be solved in real time. It is standard practice to avoid such complexity by using Machine Learning tools such as Deep Learning (DL) [8] or Reinforcement Learning (RL) [9]. Moreover, these approaches often require the collection of a high amount of data specific to a scenario and a long training period. The second problem corresponds to the pilot overhead produced by the instantaneous CSI acquisition. In networks with RIS deployment, the overhead of state-of-the art channel estimation methods is proportional to the number of REs [13]. It is noted that a RIS is generally composed of a large number of REs in order to enable a given coverage extension, which leads to an excessively high overhead. The third problem is the sensitivity to CSI imperfections which are caused by the stochasticity of both wireless environment and hardware, and significantly limit RIS-assisted communication system performance. Lately, a new class of BS and RIS configuration schemes refered as statistical CSI-based schemes have been extensively investigated. They enable to jointly address the above two problems by leveraging statistical CSI (e.g., channel covariance matrices), the coherence time of which is much longer than that of instantaneous CSI. For instance, [11] exploits departure and arrival angles in order to design the RIS phase shifts. Alternatively, UEs' spectral efficiency can be exploited in order to learn the optimal BS and RIS configurations as for example is proposed in [7] via a two-stage stochastic multi-armed bandit strategy to select sequentially the best BS and RIS precoders from finite-size codebooks. Interestingly, statistical CSI-based schemes are also less sensitive to CSI imperfections than instantaneous CSI-based schemes. Hence, they can provide better performance in specific scenarios (e.g., highly dynamic environments). In this work we propose a low-complexity and efficient solution for the joint BS and RIS configuration. Having in mind a design practically viable in production, the scheme relies on three main pillars: (i) the use of 5G compatible measurements, (ii) the use of standard Proportional Fair (PF) or α-fair schedulers, and (iii) the design of a small set of RIS beam patterns, denoted later RCPs.

In fact, up to date, few works in the literature have addressed Medium Access Control-layer. However, the related resource management aspects appear key to enable effective RIS deployment [5]. In particular, a core problem which is addressed in this work is how to configure optimally a RIS in combination with fair UEs' schedulers [4]. To this end, we have introduced the *RIS configuration pattern* (RCP) which is a novel lightweight solution to configure RISs online in a blind and adaptive fashion [6]. The RCP is a predetermined periodic sequence of precoders with fixed duration, drawn

<footnote>*Orange Labs, Chatillon, France; †University of Avignon, Avignon, France; †INRIA Sophia Antipolis, France; an early version of this work appeared in [6]. The work of F. De Pellegrini has been partially supported by ANR within the framework of the PARFAIT project (ANR-21-CE25-0013).</footnote>
from a predefined codebook. On the other hand, in order to guarantee a low complexity of the RCP solution, we consider codebooks containing few large beams. Therefore, we provide a specialized RIS beam synthesis method, which is also detailed in the next sections. In a RCP, each precoder can be allocated a different time duration within the RCP period. The time resource allocation for each RCP precoder is based on an online Stochastic Approximation (SA) algorithm. In a real deployment, the RCP configuration can be calculated at the BS scheduler or alternatively at a network controller (e.g., mobile edge computing). Thus, it does not require any processing load at the RIS side and can be transmitted to the RIS over a low-capacity management interface. Ultimately, the resulting RCP adapts to the UEs' distribution and maximizes the aggregated UEs' throughput of typical eMBB service. Appealingly, it also retains backward compatibility with standard PF or α-fair schedulers. Overall, the RCP optimization and UEs' scheduling can be viewed as a pair of nested control loops. The RCP optimization is a slow control loop where the RCP is only updated every few tens of milliseconds. Conversely, UEs' scheduling corresponds to a fast control loop where the RCP is considered fixed in time.

This paper builds on a preliminary conference paper [6] adding three main novel contributions:

* We introduce an initial configuration phase to determine the RIS coverage area. We note that this step is often not addressed in the literature [6], [7].

* We propose a beam synthesis method based on a Semi Definite Program (SDP) to adapt the RIS beam patterns to the desired design characteristics.

* We propose a SA algorithm for RCP optimization. We prove formally that the iterates of the algorithm converge to the optimal solution. In particular, convergence to the optimal restpoint is guaranteed provided that noisy data samples for UEs' rates are collected using a standard unbiased estimator.

The rest of the paper is organized as follows. Section II details the system model. Sec. III proposes two RIS-assisted network implementations, one of which is compatible with the 3GPP-5G standard. Sec. III also covers the initial RIS configuration and the RIS beam synthesis technique. UEs' scheduling and the formulation of the RCP optimization problem are presented in Sec. IV. A SA algorithm for RCP optimization and its convergence proof are provided in Sec. V. The complexity of the RCP optimization solution is analyzed in Sec. VI. Simulation results and conclusions are presented in Sec. VII and VIII.

## II. SYSTEM MODEL

We study an outdoor Downlink (DL) scenario for a Multiple Input Multiple Output-Orthogonal Frequency Division Multiple Access (MIMO-OFDMA) system. The reference two-dimensional (2D) system is depicted in Fig. 1. It is composed of a BS equipped with *M* antennas (Uniform Linear Array (ULA)) which serves *U* single-antenna UEs. The system includes a RIS equipped with *N* REs (ULA) which can assist

the communication between the BS and the UEs. The BS-RIS model describes the azimuthal variations of the radiated fields, while Path-Losses (PLs) are considered in 3D. This approach is often used in the literature and allows to achieve meaningful Quality of Service (QoS) results [10].

<figure><img src="image_2.png" /><figcaption>Fig. 1. The baseline system model. Orange dots and blue rectangles represent BS antennas and RIS REs, respectively; $N_B = 8$, $N_C = 3$.</figcaption></figure>

We assume the BS and the RIS are located at fixed positions, while UEs are mobile. Fig. 1 shows a central obstruction that splits the playground into two equal zones denoted by $\mathcal{A}_{LOS}$ and $\mathcal{A}_{NLOS}$. UEs located in $\mathcal{A}_{LOS}$ experience a Line-of-Sight (LOS) channel with respect to the BS. Conversely, the UEs located in $\mathcal{A}_{NLOS}$ experience a Non-LOS (NLOS) channel.

<table><caption>TABLE I
MAIN NOTATION USED THROUGHOUT THE PAPER</caption><thead><tr><th>Symbols</th><th>Definitions</th></tr></thead><tbody><tr><td><i>M</i></td><td>number of BS antennas</td></tr><tr><td><i>N</i>, <i>N</i></td><td>number of RIS REs, set of RIS REs indexes</td></tr><tr><td><i>U</i>, <i>U</i></td><td>number of UEs, set of UEs indexes</td></tr><tr><td><i>U</i><sup><i>t</i></sup><sub><i>sch</i></sub></td><td>number of UEs scheduled at time <i>t</i></td></tr><tr><td><i>U</i><sup><i>sch</i></sup></td><td>set of indexes of UEs scheduled at time <i>t</i></td></tr><tr><td><i>U</i><sup><i>max</i></sup><sub><i>sch</i></sub></td><td>max number of simultaneously scheduled UEs</td></tr><tr><td><i>A</i><sub>LOS</sub>, <i>A</i><sub>NLOS</sub></td><td>cell LOS zone, cell NLOS zone</td></tr><tr><td><b><i>f</i></b><sup><i>t</i>,<i>k</i></sup><sub><i>it</i></sub></td><td>BS-UE channel at time <i>t</i> on subcarrier <i>k</i></td></tr><tr><td><b><i>g</i></b><sup><i>t</i>,<i>k</i></sup><sub><i>it</i></sub></td><td>RIS-UE channel at time <i>t</i> on subcarrier <i>k</i></td></tr><tr><td><b><i>H</i></b></td><td>BS-RIS channel</td></tr><tr><td><b><i>f</i></b><sup><i>t</i>,<i>k</i></sup><sub><i>it</i></sub>, <b><i>g</i></b><sup><i>t</i>,<i>k</i></sup><sub><i>it</i></sub>, <b><i>H</i></b></td><td>small-scale fading components of <b><i>f</i></b><sup><i>t</i>,<i>k</i></sup><sub><i>it</i></sub>, <b><i>g</i></b><sup><i>t</i>,<i>k</i></sup><sub><i>it</i></sub>, <b><i>H</i></b></td></tr><tr><td><b><i>ψ</i></b></td><td>RIS precoder</td></tr><tr><td><i>ξ</i><sup><i>t</i>,<i>k</i></sup><sub><i>it</i></sub> (<i>ψ</i>)</td><td>BS-UE aggregated channel at time <i>t</i> on subcarrier <i>k</i></td></tr><tr><td><b><i>B</i></b>, <b><i>B</i></b></td><td>BS GoB, set of BS beams indexes</td></tr><tr><td><b><i>C</i></b></td><td>RIS precoder codebook</td></tr><tr><td><b><i>C</i></b></td><td>set of RIS precoders indexes</td></tr><tr><td><i>N</i><sub>B</sub>, <i>N</i><sub>C</sub></td><td>number of BS beams, number of RIS precoders</td></tr><tr><td><i>c</i>(<i>t</i>)</td><td>index of the RIS precoder active at time <i>t</i></td></tr><tr><td><i>P</i><sub>tx</sub></td><td>BS transmit power</td></tr><tr><td><b><i>K</i></b></td><td>number of OFDM subcarriers</td></tr><tr><td><b><i>K</i></b></td><td>set of subcarriers indexes</td></tr><tr><td><i>K</i><sub>control</sub>, <i>K</i><sub>data</sub></td><td>number of subcarriers for control and data</td></tr><tr><td><i>K</i><sub>control</sub>, <i>K</i><sub>data</sub></td><td>set of control and data subcarriers indexes</td></tr></tbody></table>

We respectively define the sets of UEs, RIS REs and OFDM subcarriers indexes as $\mathcal{U} = \{0, 1, ..., U-1\}$, $\mathcal{N} = \{0, 1, ..., N-1\}$ and $\mathcal{K} = \{0, 1, ..., K-1\}$ where *K* is the number of OFDM subcarriers. We also define the time-scale *T* whose granularity
from a predefined codebook. On the other hand, in order to guarantee a low complexity of the RCP solution, we consider codebooks containing few large beams. Therefore, we provide a specialized RIS beam synthesis method, which is also detailed in the next sections. In a RCP, each precoder can be allocated a different time duration within the RCP period. The time resource allocation for each RCP precoder is based on an online Stochastic Approximation (SA) algorithm. In a real deployment, the RCP configuration can be calculated at the BS scheduler or alternatively at a network controller (e.g., mobile edge computing). Thus, it does not require any processing load at the RIS side and can be transmitted to the RIS over a low-capacity management interface. Ultimately, the resulting RCP adapts to the UEs' distribution and maximizes the aggregated UEs' throughput of typical eMBB service. Appealingly, it also retains backward compatibility with standard PF or α-fair schedulers. Overall, the RCP optimization and UEs' scheduling can be viewed as a pair of nested control loops. The RCP optimization is a slow control loop where the RCP is only updated every few tens of milliseconds. Conversely, UEs' scheduling corresponds to a fast control loop where the RCP is considered fixed in time.

This paper builds on a preliminary conference paper [6] adding three main novel contributions:

* We introduce an initial configuration phase to determine the RIS coverage area. We note that this step is often not addressed in the literature [6], [7].

* We propose a beam synthesis method based on a Semi Definite Program (SDP) to adapt the RIS beam patterns to the desired design characteristics.

* We propose a SA algorithm for RCP optimization. We prove formally that the iterates of the algorithm converge to the optimal solution. In particular, convergence to the optimal restpoint is guaranteed provided that noisy data samples for UEs' rates are collected using a standard unbiased estimator.

The rest of the paper is organized as follows. Section II details the system model. Sec. III proposes two RIS-assisted network implementations, one of which is compatible with the 3GPP-5G standard. Sec. III also covers the initial RIS configuration and the RIS beam synthesis technique. UEs' scheduling and the formulation of the RCP optimization problem are presented in Sec. IV. A SA algorithm for RCP optimization and its convergence proof are provided in Sec. V. The complexity of the RCP optimization solution is analyzed in Sec. VI. Simulation results and conclusions are presented in Sec. VII and VIII.

## II. SYSTEM MODEL

We study an outdoor Downlink (DL) scenario for a Multiple Input Multiple Output-Orthogonal Frequency Division Multiple Access (MIMO-OFDMA) system. The reference two-dimensional (2D) system is depicted in Fig. 1. It is composed of a BS equipped with *M* antennas (Uniform Linear Array (ULA)) which serves *U* single-antenna UEs. The system includes a RIS equipped with *N* REs (ULA) which can assist

the communication between the BS and the UEs. The BS-RIS model describes the azimuthal variations of the radiated fields, while Path-Losses (PLs) are considered in 3D. This approach is often used in the literature and allows to achieve meaningful Quality of Service (QoS) results [10].

<figure><img src="image_2.png" /><figcaption>Fig. 1. The baseline system model. Orange dots and blue rectangles represent BS antennas and RIS REs, respectively; $N_B = 8$, $N_C = 3$.</figcaption></figure>

We assume the BS and the RIS are located at fixed positions, while UEs are mobile. Fig. 1 shows a central obstruction that splits the playground into two equal zones denoted by $\mathcal{A}_{LOS}$ and $\mathcal{A}_{NLOS}$. UEs located in $\mathcal{A}_{LOS}$ experience a Line-of-Sight (LOS) channel with respect to the BS. Conversely, the UEs located in $\mathcal{A}_{NLOS}$ experience a Non-LOS (NLOS) channel.

<table><caption>TABLE I
MAIN NOTATION USED THROUGHOUT THE PAPER</caption><thead><tr><th>Symbols</th><th>Definitions</th></tr></thead><tbody><tr><td><i>M</i></td><td>number of BS antennas</td></tr><tr><td><i>N</i>, <i>N</i></td><td>number of RIS REs, set of RIS REs indexes</td></tr><tr><td><i>U</i>, <i>U</i></td><td>number of UEs, set of UEs indexes</td></tr><tr><td><i>U</i><sup><i>t</i></sup><sub><i>sch</i></sub></td><td>number of UEs scheduled at time <i>t</i></td></tr><tr><td><i>U</i><sup><i>sch</i></sup></td><td>set of indexes of UEs scheduled at time <i>t</i></td></tr><tr><td><i>U</i><sup><i>max</i></sup><sub><i>sch</i></sub></td><td>max number of simultaneously scheduled UEs</td></tr><tr><td><i>A</i><sub>LOS</sub>, <i>A</i><sub>NLOS</sub></td><td>cell LOS zone, cell NLOS zone</td></tr><tr><td><b><i>f</i></b><sup><i>t</i>,<i>k</i></sup><sub><i>it</i></sub></td><td>BS-UE channel at time <i>t</i> on subcarrier <i>k</i></td></tr><tr><td><b><i>g</i></b><sup><i>t</i>,<i>k</i></sup><sub><i>it</i></sub></td><td>RIS-UE channel at time <i>t</i> on subcarrier <i>k</i></td></tr><tr><td><b><i>H</i></b></td><td>BS-RIS channel</td></tr><tr><td><b><i>f</i></b><sup><i>t</i>,<i>k</i></sup><sub><i>it</i></sub>, <b><i>g</i></b><sup><i>t</i>,<i>k</i></sup><sub><i>it</i></sub>, <b><i>H</i></b></td><td>small-scale fading components of <b><i>f</i></b><sup><i>t</i>,<i>k</i></sup><sub><i>it</i></sub>, <b><i>g</i></b><sup><i>t</i>,<i>k</i></sup><sub><i>it</i></sub>, <b><i>H</i></b></td></tr><tr><td><b><i>ψ</i></b></td><td>RIS precoder</td></tr><tr><td><b><i>ξ</i></b><sup><i>t</i>,<i>k</i></sup><sub><i>it</i></sub> (<b><i>ψ</i></b>)</td><td>BS-UE aggregated channel at time <i>t</i> on subcarrier <i>k</i></td></tr><tr><td><b><i>B</i></b>, <b><i>B</i></b></td><td>BS GoB, set of BS beams indexes</td></tr><tr><td><b><i>C</i></b></td><td>RIS precoder codebook</td></tr><tr><td><b><i>C</i></b></td><td>set of RIS precoders indexes</td></tr><tr><td><i>N</i><sub>B</sub>, <i>N</i><sub>C</sub></td><td>number of BS beams, number of RIS precoders</td></tr><tr><td><i>c</i>(<i>t</i>)</td><td>index of the RIS precoder active at time <i>t</i></td></tr><tr><td><i>P</i><sub>tx</sub></td><td>BS transmit power</td></tr><tr><td><b><i>K</i></b></td><td>number of OFDM subcarriers</td></tr><tr><td><b><i>K</i></b></td><td>set of subcarriers indexes</td></tr><tr><td><i>K</i><sub>control</sub>, <i>K</i><sub>data</sub></td><td>number of subcarriers for control and data</td></tr><tr><td><i>K</i><sub>control</sub>, <i>K</i><sub>data</sub></td><td>set of control and data subcarriers indexes</td></tr></tbody></table>

We respectively define the sets of UEs, RIS REs and OFDM subcarriers indexes as $\mathcal{U} = \{0, 1, ..., U-1\}$, $\mathcal{N} = \{0, 1, ..., N-1\}$ and $\mathcal{K} = \{0, 1, ..., K-1\}$ where $K$ is the number of OFDM subcarriers. We also define the time-scale $\mathcal{T}$ whose granularity
corresponds to a slot. Finally, we define the indexes $u \in \mathcal{U}$, $n \in \mathcal{N}$, $k \in \mathcal{K}$ and $t \in \mathcal{T}$.

### A. Channel Model

Two links between a UE $u \in \mathcal{U}$ and the BS are considered, namely a direct link and a cascaded link. For the direct link, the signals transmitted by the BS are received by the UE without being reflected by the RIS. If the UE is located in $\mathcal{A}_{\text{LOS}}$ (resp. $\mathcal{A}_{\text{NLOS}}$), this link is modelled thanks to a LOS (resp. NLOS) channel denoted by $\mathbf{f}_{u,\text{LOS}}^{t,k} \in \mathbb{C}^{1 \times M}$ (resp. $\mathbf{f}_{u,\text{NLOS}}^{t,k} \in \mathbb{C}^{1 \times M}$). In the sequel, the channel vector $\mathbf{f}_{u}^{t,k}$ will be written without the subscripts LOS and NLOS for sake of notation. For the cascaded link, the signals transmitted by the BS are reflected by the RIS before being received by the UE. The cascaded link is modelled thanks to two channels: a free-space BS-RIS channel denoted by $\mathbf{H} \in \mathbb{C}^{N \times M}$ and a LOS RIS-UE channel denoted by $\mathbf{g}_{u}^{t,k} \in \mathbb{C}^{1 \times N}$.

In this work, LOS channels are modelled as Ricean channels where channel coefficients simulating a free-space path and multiple reflected paths are summed and scaled by a Ricean factor [14]. NLOS channels are only based on channel coefficients simulating reflected paths. LOS and NLOS channels are time-varying, and remain constant during an interval of time smaller than their time coherence $T_c$. Finally, given the large bandwidth considered, these channels are also frequency-dependent and are expressed in terms of time $t$ and a subcarrier $k$ (e.g. $\mathbf{f}_{u}^{t,k}$).

The BS-UE, BS-RIS and RIS-UE channels are modelled as $\mathbf{f}_{u}^{t,k} = \sqrt{\beta_{f,u}}\tilde{\mathbf{f}}_{u}^{t,k}, \mathbf{H} = \sqrt{\beta_{H}}\tilde{\mathbf{H}}$ and $\mathbf{g}_{u}^{t,k} = \sqrt{\beta_{g,u}}\tilde{\mathbf{g}}_{u}^{t,k}$, respectively. Here, $\tilde{\mathbf{f}}_{u}^{t,k}$ and $\tilde{\mathbf{g}}_{u}^{t,k}$ denote small-scale fading channel components, defined according to the 3GPP channel model [14]. $\tilde{\mathbf{H}}$ is modelled as in [8]. The terms, $\beta_{f,u} = \beta_0(1+d_{f,u})^{-\alpha_t}$ and $\beta_{g,u} = \beta_0(1+d_{g,u})^{-\alpha_g}$ denote the PL for BS-UE and RIS-UE channels; $\beta_0$ is the PL at one meter, $d_{f,u}$ and $d_{g,u}$ are distances and $\alpha_t$ and $\alpha_g$ are PL exponents. $\beta_H = \frac{(\Delta N)^2}{4\pi d_H^2}$ denotes the PL for the BS-RIS channel where $d_H$ is a distance and $\Delta^2$ is the area of an RE [8].

### B. Signal model

Denote by $U_{sch}^t$ the number of UEs scheduled simultaneously by the BS at time $t$. Note that, $U_{sch}^t \le U_{sch}^{max}$ where $U_{sch}^{max}$ is the maximum number of UEs that can be scheduled on a time slot. Let $\mathbf{s}^{t,k} \in \mathbb{C}^{U_{sch}^t}$ denote the signal transmitted by the BS on the subcarrier $k$ at time $t$, with $\mathbb{E}\{|\mathbf{s}_u^{t,k}|^2\} = \frac{P_{tx}}{KU_{sch}^t}$, $\forall u \in \mathcal{U}_{sch}^t = \{1, 2, ..., U_{sch}^t\}$. $P_{tx}$ denotes the BS total transmit power. At time $t$, $P_{tx}$ is equally distributed among the $K$ subcarriers and among the $U_{sch}^t$ beams which are simultaneously steered by the BS (i.e., at most one UE is scheduled per beam). The signal received by the UE $u \in \mathcal{U}_{sch}^t$ is modelled as

$$ \mathbf{y}_{u}^{t,k} = \xi_{u}^{t,k}(\boldsymbol{\psi}) \left( \mathbf{W}_{\cdot,u}^{t} \mathbf{s}_{u}^{t,k} + \sum_{v \in \mathcal{U}_{sch}^{t} \setminus \{u\}} \mathbf{W}_{\cdot,v}^{t} \mathbf{s}_{v}^{t,k} \right) + \mathbf{e}_{u}^{t,k} \quad (1) $$

where

$$ \xi_{u}^{t,k}(\boldsymbol{\psi}) = (\mathbf{f}_{u}^{t,k} + \mathbf{g}_{u}^{t,k} \text{diag}(\boldsymbol{\psi})\mathbf{H}). \quad (2) $$

In (2), $\boldsymbol{\psi} = [e^{j\psi_0}, e^{j\psi_1}, ..., e^{j\psi_{N-1}}] \in \mathbb{C}^N$ is the RIS precoder, with $\psi_n \in [0, 2\pi] \ \forall n \in \mathcal{N}$. $\mathbf{e}^{t,k} \sim \text{NC}(0, \sigma_e^2 \mathbf{I}_{U_{sch}^t})$ is an additive white gaussian noise. The BS precoding matrix is denoted by $\mathbf{W}^t \in \mathbb{C}^{M \times U_{sch}^t}$. We consider here that the BS serves UEs via a Grid of Beams (GoB) of $N_B$ beams denoted by $\mathbf{B} \in \mathbb{C}^{M \times N_B}$ [15]. The GoB can be modelled by a DFT codebook: it gathers orthogonal precoders which permit to steer beams in all directions. Such a codebook can be constructed as follows: $\mathbf{B} = [\mathbf{b}_0 \ \mathbf{b}_1 \ ... \ \mathbf{b}_b \ ... \ \mathbf{b}_{N_B}]$ with $\mathbf{b}_b = \frac{1}{\sqrt{M}} [1 \ e^{j\frac{2\pi}{N_B}b} \ e^{j\frac{2\pi}{N_B}2b} \ ... \ e^{j\frac{2\pi}{N_B}(M-1)b}]^T \in \mathbb{C}^M$. Note that in (1), $\mathbf{W}_{\cdot,u}^t = \mathbf{B}_{\cdot,b}, b \in \mathcal{B} = \{0, 1, ..., N_B - 1\}$. We consider that the GoB is used for both control and data channels. It is noted that in comparison with eigen-based beamforming, the GoB implementation does not require to estimate large channel matrices and benefits from a low processing complexity at the expense of lower performance. In the rest of this paper, we drop the time indexes for the sake of simplicity.

## III. RIS-ASSISTED NETWORK IMPLEMENTATION

### A. BS working principle

We consider a BS deploying a 3GPP-5G OFDM-Time Division Duplexing (TDD) system. The 5G standard provides high flexibility in the configuration of its frame structure. In the following we present a configuration which enables to address three challenges encountered in the deployment of efficient RIS-assisted networks. It is recalled that the RIS configuration modifies the propagation characteristics which may in turn modify: (i) the UEs' achievable rates via the highest available Modulation and Coding Schemes (MCSs), and (ii) the best BS precoders to serve UEs. The first two challenges are the ability to rapidly adapt UEs' MCSs and BS serving beams following each RIS reconfiguration. The third challenge is the capability of serving the users with the best available RIS precoders. To address these challenges, frequent performance measurements and Uplink (UL) reports are needed. As explained presently, this is achieved by selecting: (i) a short slot duration (via a high Subcarrier Spacing (SCS)), (ii) a high periodicity of control signals transmissions allowing frequent performance measurements, and (iii) a UL-DL time slot partitioning that supports more frequent UL reports.

**BS-UE signalling.** In our system, the BS transmits on a carrier bandwidth of $W$ MHz centered around a frequency of $f_c$ GHz. The BS periodically transmits control signals which permit the UEs to measure performance counters and report them to the BS for MCS and BS beam determination. We select a SCS of $\mu = 30$ kHz (i.e., a slot lasts 0.5 ms) to shorten the periodicity of control signals' transmissions. This enables frequent UEs' performance measurements.

**UE-BS reporting.** To enable frequent UEs' performance indicators reporting, we use a specific fixed TDD pattern for UL-DL time slot partitioning [16]. In the rest of the paper, we consider “Pattern A”, see Fig. 2a: compared to the alternative pattern, namely “Pattern B”, it ensures more frequent UL transmissions, i.e., one UL transmission every 2 ms against 4 ms for “Pattern B”.
corresponds to a slot. Finally, we define the indexes $u \in \mathcal{U}$, $n \in \mathcal{N}$, $k \in \mathcal{K}$ and $t \in \mathcal{T}$.

### A. Channel Model

Two links between a UE $u \in \mathcal{U}$ and the BS are considered, namely a direct link and a cascaded link. For the direct link, the signals transmitted by the BS are received by the UE without being reflected by the RIS. If the UE is located in $\mathcal{A}_{\text{LOS}}$ (resp. $\mathcal{A}_{\text{NLOS}}$), this link is modelled thanks to a LOS (resp. NLOS) channel denoted by $\mathbf{f}_{u,\text{LOS}}^{t,k} \in \mathbb{C}^{1 \times M}$ (resp. $\mathbf{f}_{u,\text{NLOS}}^{t,k} \in \mathbb{C}^{1 \times M}$). In the sequel, the channel vector $\mathbf{f}_{u}^{t,k}$ will be written without the subscripts LOS and NLOS for sake of notation. For the cascaded link, the signals transmitted by the BS are reflected by the RIS before being received by the UE. The cascaded link is modelled thanks to two channels: a free-space BS-RIS channel denoted by $\mathbf{H} \in \mathbb{C}^{N \times M}$ and a LOS RIS-UE channel denoted by $\mathbf{g}_{u}^{t,k} \in \mathbb{C}^{1 \times N}$.

In this work, LOS channels are modelled as Ricean channels where channel coefficients simulating a free-space path and multiple reflected paths are summed and scaled by a Ricean factor [14]. NLOS channels are only based on channel coefficients simulating reflected paths. LOS and NLOS channels are time-varying, and remain constant during an interval of time smaller than their time coherence $T_c$. Finally, given the large bandwidth considered, these channels are also frequency-dependent and are expressed in terms of time $t$ and a subcarrier $k$ (e.g. $\mathbf{f}_{u}^{t,k}$).

The BS-UE, BS-RIS and RIS-UE channels are modelled as $\mathbf{f}_{u}^{t,k} = \sqrt{\beta_{f,u}} \tilde{\mathbf{f}}_{u}^{t,k}, \mathbf{H} = \sqrt{\beta_{H}} \tilde{\mathbf{H}}$ and $\mathbf{g}_{u}^{t,k} = \sqrt{\beta_{g,u}} \tilde{\mathbf{g}}_{u}^{t,k}$, respectively. Here, $\tilde{\mathbf{f}}_{u}^{t,k}$ and $\tilde{\mathbf{g}}_{u}^{t,k}$ denote small-scale fading channel components, defined according to the 3GPP channel model [14]. $\tilde{\mathbf{H}}$ is modelled as in [8]. The terms, $\beta_{f,u} = \beta_0(1+d_{f,u})^{-\alpha_t}$ and $\beta_{g,u} = \beta_0(1+d_{g,u})^{-\alpha_g}$ denote the PL for BS-UE and RIS-UE channels; $\beta_0$ is the PL at one meter, $d_{f,u}$ and $d_{g,u}$ are distances and $\alpha_t$ and $\alpha_g$ are PL exponents. $\beta_H = \frac{(\Delta N)^2}{4\pi d_H^2}$ denotes the PL for the BS-RIS channel where $d_H$ is a distance and $\Delta^2$ is the area of an RE [8].

### B. Signal model

Denote by $U_{sch}^t$ the number of UEs scheduled simultaneously by the BS at time $t$. Note that, $U_{sch}^t \le U_{sch}^{\text{max}}$ where $U_{sch}^{\text{max}}$ is the maximum number of UEs that can be scheduled on a time slot. Let $\mathbf{s}^{t,k} \in \mathbb{C}^{U_{sch}^t}$ denote the signal transmitted by the BS on the subcarrier $k$ at time $t$, with $\mathbb{E}\{|\mathbf{s}_u^{t,k}|^2\} = \frac{P_{tx}}{K U_{sch}^t}, \forall u \in \mathcal{U}_{sch}^t = \{1, 2, ..., U_{sch}^t\}$. $P_{tx}$ denotes the BS total transmit power. At time $t$, $P_{tx}$ is equally distributed among the $K$ subcarriers and among the $U_{sch}^t$ beams which are simultaneously steered by the BS (i.e., at most one UE is scheduled per beam). The signal received by the UE $u \in \mathcal{U}_{sch}^t$ is modelled as

$$ \mathbf{y}_{u}^{t,k} = \xi_{u}^{t,k}(\boldsymbol{\psi}) \left( \mathbf{W}_{:,u}^{t} \mathbf{s}_{u}^{t,k} + \sum_{v \in \mathcal{U}_{sch}^{t} \setminus \{u\}} \mathbf{W}_{:,v}^{t} \mathbf{s}_{v}^{t,k} \right) + \mathbf{e}_{u}^{t,k} \quad (1) $$

where

$$ \xi_{u}^{t,k}(\boldsymbol{\psi}) = (\mathbf{f}_{u}^{t,k} + \mathbf{g}_{u}^{t,k} \text{diag}(\boldsymbol{\psi})\mathbf{H}). \quad (2) $$

In (2), $\boldsymbol{\psi} = [e^{j\psi_0}, e^{j\psi_1}, ..., e^{j\psi_{N-1}}] \in \mathbb{C}^N$ is the RIS precoder, with $\psi_n \in [0, 2\pi] \ \forall n \in \mathcal{N}$. $\mathbf{e}^{t,k} \sim \text{NC}(0, \sigma_e^2 \mathbf{I}_{U_{sch}^t})$ is an additive white gaussian noise. The BS precoding matrix is denoted by $\mathbf{W}^t \in \mathbb{C}^{M \times U_{sch}^t}$. We consider here that the BS serves UEs via a Grid of Beams (GoB) of $N_B$ beams denoted by $\mathbf{B} \in \mathbb{C}^{M \times N_B}$ [15]. The GoB can be modelled by a DFT codebook: it gathers orthogonal precoders which permit to steer beams in all directions. Such a codebook can be constructed as follows: $\mathbf{B} = [\mathbf{b}_0 \ \mathbf{b}_1 \ ... \ \mathbf{b}_b \ ... \ \mathbf{b}_{N_B}]$ with $\mathbf{b}_b = \frac{1}{\sqrt{M}} [1 \ e^{j\frac{2\pi}{N_B}b} \ e^{j\frac{2\pi}{N_B}2b} \ ... \ e^{j\frac{2\pi}{N_B}(M-1)b}]^T \in \mathbb{C}^M$. Note that in (1), $\mathbf{W}_{:,u}^t = \mathbf{B}_{:,b}, b \in \mathcal{B} = \{0, 1, ..., N_B - 1\}$. We consider that the GoB is used for both control and data channels. It is noted that in comparison with eigen-based beamforming, the GoB implementation does not require to estimate large channel matrices and benefits from a low processing complexity at the expense of lower performance. In the rest of this paper, we drop the time indexes for the sake of simplicity.

## III. RIS-ASSISTED NETWORK IMPLEMENTATION

### A. BS working principle

We consider a BS deploying a 3GPP-5G OFDM-Time Division Duplexing (TDD) system. The 5G standard provides high flexibility in the configuration of its frame structure. In the following we present a configuration which enables to address three challenges encountered in the deployment of efficient RIS-assisted networks. It is recalled that the RIS configuration modifies the propagation characteristics which may in turn modify: (i) the UEs' achievable rates via the highest available Modulation and Coding Schemes (MCSs), and (ii) the best BS precoders to serve UEs. The first two challenges are the ability to rapidly adapt UEs' MCSs and BS serving beams following each RIS reconfiguration. The third challenge is the capability of serving the users with the best available RIS precoders. To address these challenges, frequent performance measurements and Uplink (UL) reports are needed. As explained presently, this is achieved by selecting: (i) a short slot duration (via a high Subcarrier Spacing (SCS)), (ii) a high periodicity of control signals transmissions allowing frequent performance measurements, and (iii) a UL-DL time slot partitioning that supports more frequent UL reports.

**BS-UE signalling.** In our system, the BS transmits on a carrier bandwidth of $W$ MHz centered around a frequency of $f_c$ GHz. The BS periodically transmits control signals which permit the UEs to measure performance counters and report them to the BS for MCS and BS beam determination. We select a SCS of $\mu = 30$ kHz (i.e., a slot lasts 0.5 ms) to shorten the periodicity of control signals' transmissions. This enables frequent UEs' performance measurements.

**UE-BS reporting.** To enable frequent UEs' performance indicators reporting, we use a specific fixed TDD pattern for UL-DL time slot partitioning [16]. In the rest of the paper, we consider “Pattern A”, see Fig. 2a: compared to the alternative pattern, namely “Pattern B”, it ensures more frequent UL transmissions, i.e., one UL transmission every 2 ms against 4 ms for “Pattern B”.
<figure><img src="image_3.png" /><figcaption>Fig. 2. a) The standard TDD patterns; b) RIS Configuration Pattern principle for $F = 6$, $N_c = 3$.</figcaption></figure>

It is noted that frequent UEs' performance measurements and reporting allow to test the performance of numerous RIS configurations in a short timeframe and to select the best one.

## B. RIS working principle

We now introduce two low-complexity schemes for RIS configuration. As presented in section II, the RIS REs are configured based on a precoder $\psi \in \mathbb{C}^N$. In this work, the RIS is configured following a predetermined sequence of RIS precoders as depicted in Fig. 2b, namely the RCP. We assume that an RCP has a fixed duration of $F$ frames and repeats over time. The precoders from the RCP are drawn from a codebook $C \in \mathbb{C}^{N \times N_c}$ of size $N_c$. At any time, we have $\psi = C_{:,c}$, $c \in C = \{0, 1, ..., N_c - 1\}$.

We build here a codebook $C$ containing few large beams spanning the zone $\mathcal{A}_{\text{NLOS}}$. In real networks, the location of such a zone is not known a priori and needs to be determined once for stationary environments or tracked for non-stationary environments. In subsection III-C, an initial phase to determine the coverage area of the RIS is presented.

The choice of relatively large RCP beams for covering $\mathcal{A}_{\text{NLOS}}$ ensures that all locations in $\mathcal{A}_{\text{NLOS}}$ are covered frequently enough. Generating large reflected beams with a large RIS composed of many REs is a complex task. To tackle this problem, we introduce in subsection III-D a new method for RIS beam synthesis extending the BS beam synthesis technique developed in [18].

**Beam coverage.** In the proposed scheme we synthesize first one large beam which covers the whole zone $\mathcal{A}_{\text{NLOS}}$. In addition, we design $N_c - 1$ thinner beams with minimal overlap, each of which covers a part of $\mathcal{A}_{\text{NLOS}}$ so that the union of the zones covered by these beams corresponds to $\mathcal{A}_{\text{NLOS}}$. The large beam and the thinner ones allow both to transmit control signals and data signals to the UEs located in $\mathcal{A}_{\text{NLOS}}$. Fig. 1 depicts a possible codebook $C$ with $N_c = 3$. The large beam and the $N_c - 1 = 2$ thinner beams are respectively denoted by $C_{:,0}$ and by $C_{:,1}$ and $C_{:,2}$. Let $C$ denote the set of RIS precoder indexes. We use notation $c(t) \in C$ for the index of the RIS precoder which is active in the RCP at time $t$.

**Network attachment.** In the 5G standard, the network attachment procedure corresponds to the transmission of a sequence of control messages between the BS and an UE. According to the system configuration detailed in subsection III-A, this handshake sequence lasts one frame. A successful attachment procedure hence requires the active RIS precoder

to remain fixed during an entire frame. Also, for network's performance optimization purpose, it is necessary to frequently make performance measurements on all the precoders which appear within the RCP. This requires each precoder from $C$ to appear at least once in an RCP.

**Precoder Allocation Rules.** To ensure the above conditions, we define the following two rules for RCP design. Rule 1: each precoder from $C$ appears only once in an RCP and the order of appearance is fixed. Rule 2: the active RCP precoder can only be switched at the beginning of a frame (e.g. switch from $C_{:,0}$ to $C_{:,1}$). The above two rules imply that an RCP precoder is active during an integer number of consecutive frames (at least one per RCP).

Based on the RCP principle for RIS configuration, we focus on two reference schemes. The first one denoted by “RCP A” corresponds to a fixed RCP structure. The percentage of the $F$ frames composing the RCP allocated to each precoder from $C$ is constant over time. It is noted that this simple scheme does not require dedicated RIS configuration management and is compatible with the 3GPP-5G standard.

The second scheme denoted by “RCP B” uses a flexible allocation of the $F$ RCP frames. To maximize the UEs' performance, the allocation can be adapted to the UEs' distribution. For example, more resources can be provided to the RIS beams that serve zones with higher UE density. In this scheme, a network controller decides at the beginning of each RCP how are the $F$ frames shared among the precoders from $C$ (i.e., the RCP structure). Each RCP starts with a frame allocated to the precoder $C_{:,0}$. The network controller exploits the activation time of $C_{:,0}$ to compute the optimal RCP structure following $C_{:,0}$ and sends it to the RIS.

## C. Initial RIS configuration

The initial RIS configuration requires to track the NLOS zone, that may vary at long time intervals. The configuration method exploits a codebook denoted as $C^{tr}$ containing few large beams which cover the whole cell as depicted in Fig. 3. Specifically, the UEs' performance is evaluated for each beam and the one bringing the best performance gain is selected as precoder $C_{:,0}$ in $C$. This process can be periodically applied (e.g., once per month) with RCPs allocating equal amounts of time resources to precoders from $C^{tr}$ (Fig. 3).

## D. RIS beam synthesis

We detail presently the adaptation and further optimization of a BS beam synthesis method proposed in [18] to RIS beam
<figure><img src="image_3.png" /><figcaption>Fig. 2. a) The standard TDD patterns; b) RIS Configuration Pattern principle for $F = 6$, $N_c = 3$.</figcaption></figure>

It is noted that frequent UEs' performance measurements and reporting allow to test the performance of numerous RIS configurations in a short timeframe and to select the best one.

## B. RIS working principle

We now introduce two low-complexity schemes for RIS configuration. As presented in section II, the RIS REs are configured based on a precoder $\psi \in \mathbb{C}^N$. In this work, the RIS is configured following a predetermined sequence of RIS precoders as depicted in Fig. 2b, namely the RCP. We assume that an RCP has a fixed duration of $F$ frames and repeats over time. The precoders from the RCP are drawn from a codebook $C \in \mathbb{C}^{N \times N_c}$ of size $N_c$. At any time, we have $\psi = C_{:,c}$, $c \in C = \{0, 1, ..., N_c - 1\}$.

We build here a codebook $C$ containing few large beams spanning the zone $\mathcal{A}_{\text{NLOS}}$. In real networks, the location of such a zone is not known a priori and needs to be determined once for stationary environments or tracked for non-stationary environments. In subsection III-C, an initial phase to determine the coverage area of the RIS is presented.

The choice of relatively large RCP beams for covering $\mathcal{A}_{\text{NLOS}}$ ensures that all locations in $\mathcal{A}_{\text{NLOS}}$ are covered frequently enough. Generating large reflected beams with a large RIS composed of many REs is a complex task. To tackle this problem, we introduce in subsection III-D a new method for RIS beam synthesis extending the BS beam synthesis technique developed in [18].

**Beam coverage.** In the proposed scheme we synthesize first one large beam which covers the whole zone $\mathcal{A}_{\text{NLOS}}$. In addition, we design $N_c - 1$ thinner beams with minimal overlap, each of which covers a part of $\mathcal{A}_{\text{NLOS}}$ so that the union of the zones covered by these beams corresponds to $\mathcal{A}_{\text{NLOS}}$. The large beam and the thinner ones allow both to transmit control signals and data signals to the UEs located in $\mathcal{A}_{\text{NLOS}}$. Fig. 1 depicts a possible codebook $C$ with $N_c = 3$. The large beam and the $N_c - 1 = 2$ thinner beams are respectively denoted by $C_{:,0}$ and by $C_{:,1}$ and $C_{:,2}$. Let $C$ denote the set of RIS precoder indexes. We use notation $c(t) \in C$ for the index of the RIS precoder which is active in the RCP at time $t$.

**Network attachment.** In the 5G standard, the network attachment procedure corresponds to the transmission of a sequence of control messages between the BS and an UE. According to the system configuration detailed in subsection III-A, this handshake sequence lasts one frame. A successful attachment procedure hence requires the active RIS precoder

to remain fixed during an entire frame. Also, for network's performance optimization purpose, it is necessary to frequently make performance measurements on all the precoders which appear within the RCP. This requires each precoder from $C$ to appear at least once in an RCP.

**Precoder Allocation Rules.** To ensure the above conditions, we define the following two rules for RCP design. Rule 1: each precoder from $C$ appears only once in an RCP and the order of appearance is fixed. Rule 2: the active RCP precoder can only be switched at the beginning of a frame (e.g. switch from $C_{:,0}$ to $C_{:,1}$). The above two rules imply that an RCP precoder is active during an integer number of consecutive frames (at least one per RCP).

Based on the RCP principle for RIS configuration, we focus on two reference schemes. The first one denoted by “RCP A” corresponds to a fixed RCP structure. The percentage of the $F$ frames composing the RCP allocated to each precoder from $C$ is constant over time. It is noted that this simple scheme does not require dedicated RIS configuration management and is compatible with the 3GPP-5G standard.

The second scheme denoted by “RCP B” uses a flexible allocation of the $F$ RCP frames. To maximize the UEs' performance, the allocation can be adapted to the UEs' distribution. For example, more resources can be provided to the RIS beams that serve zones with higher UE density. In this scheme, a network controller decides at the beginning of each RCP how are the $F$ frames shared among the precoders from $C$ (i.e., the RCP structure). Each RCP starts with a frame allocated to the precoder $C_{:,0}$. The network controller exploits the activation time of $C_{:,0}$ to compute the optimal RCP structure following $C_{:,0}$ and sends it to the RIS.

## C. Initial RIS configuration

The initial RIS configuration requires to track the NLOS zone, that may vary at long time intervals. The configuration method exploits a codebook denoted as $C^{tr}$ containing few large beams which cover the whole cell as depicted in Fig. 3. Specifically, the UEs' performance is evaluated for each beam and the one bringing the best performance gain is selected as precoder $C_{:,0}$ in $C$. This process can be periodically applied (e.g., once per month) with RCPs allocating equal amounts of time resources to precoders from $C^{tr}$ (Fig. 3).

## D. RIS beam synthesis

We detail presently the adaptation and further optimization of a BS beam synthesis method proposed in [18] to RIS beam
<figure><img src="image_4.png" /><figcaption>Fig. 3. RIS codebook and RCP structure for NLOS zone tracking.</figcaption></figure>

synthesis. RIS beam synthesis consists in finding the RIS REs' excitations $\psi \in \mathbb{C}^N$ such that the power radiated by the RIS in some azimuthal directions of interest denoted by $\phi^i, i \in \mathcal{I} = \{0, ..., I-1\}$ follow a specific pattern. The desired radiated pattern can include design constraints such as side lobe level. It is noted that the BS and the RIS are both modelled as ULAs so that only the azimuthal variations of the radiated fields are considered (i.e. beam synthesis is performed in the azimuthal plane). However, extending the technique developed in the sequel to the elevation variations is straightforward.

We assume here that each BS antenna and RIS RE radiates isotropically. Therefore, when configured with the precoder $\psi$, the far field radiated by the RIS in the direction of interest $\phi^i$ can be expressed as follows

$$r(\phi^i) = \rho(\phi^i)\psi \quad (3)$$

where

$$\rho(\phi^i) = \left( \mathbf{a}_{t_x}(\phi^i)^H \mathrm{diag} \left( \mathbf{a}_{r_x}(\nu) \mathbf{a}_{t_x}(\nu)^H \mathbf{w} \right) \right). \quad (4)$$

$\rho(\phi^i) \in \mathbb{C}^N$ aggregates the BS precoder, the cascaded-link BS steering vector and the RIS steering and response vectors denoted by $\mathbf{w} \in \mathbb{C}^M$, $\mathbf{a}_{t_x}(\nu) \in \mathbb{C}^M$, $\mathbf{a}_{t_x}(\phi^i) \in \mathbb{C}^N$ and $\mathbf{a}_{r_x}(\nu) \in \mathbb{C}^N$ respectively. The q-th term of $\mathbf{a}_{t_x}(\cdot)$ and $\mathbf{a}_{r_x}(\cdot)$ can be expressed as $[\mathbf{a}_{t_x}(\nu)]_q = \exp(j \frac{2\pi}{\lambda} q \Delta_{t_x} \cos(\nu))$ and $[\mathbf{a}_{r_x}(\nu)]_q = \exp(-j \frac{2\pi}{\lambda} q \Delta_{r_x} \cos(\nu))$ where $\lambda, \Delta_{t_x}$ and $\Delta_{r_x}$ are the wavelength, the transmitter and receiver radiating elements spacing, respectively. $r(\phi^i)$ is a complex scalar whose real and imaginary parts can be arranged in a vector as

$$[\mathbb{R}(r(\phi^i)) \quad \mathbb{I}(r(\phi^i))]^T = \mathbf{A}^i \mathbf{x} \quad (5)$$

where the matrix $\mathbf{A}^i \in \mathbb{R}^{2 \times 2N}$ and the vector $\mathbf{x} \in \mathbb{R}^{2N}$ can be expressed as in (6).

$$\mathbf{A}^i = \begin{bmatrix} \mathbb{R}(\rho(\phi^i)^T) & -\mathbb{I}(\rho(\phi^i)^T) \\ \mathbb{I}(\rho(\phi^i)^T) & \mathbb{R}(\rho(\phi^i)^T) \end{bmatrix}, \quad \mathbf{x} = \begin{bmatrix} \mathbb{R}(\psi) \\ \mathbb{I}(\psi) \end{bmatrix} \quad (6)$$

Based on (3), the power radiated by the RIS in the direction $\phi^i$ can be formulated as follows

$$|r(\phi^i)|^2 = \mathbf{x}^T \mathbf{Q}^i \mathbf{x} = \mathrm{Tr}(\mathbf{Q}^i \mathbf{X}) \quad (7)$$

where $\mathbf{Q}^i = \mathbf{A}^i \mathbf{T} \mathbf{A}^i$ is a symmetric matrix and $\mathbf{X} = \mathbf{x} \mathbf{x}^T \in \mathbb{S}^{2N}$ is a symmetric positive semi-definite matrix (i.e. $\mathbf{X} \ge \mathbf{0}$) of rank one (i.e. $\mathrm{rank}(\mathbf{X}) = 1$).

RIS beam synthesis consists in finding the vector $\mathbf{x}$ such that the powers radiated by the RIS in the directions of interest $\phi^i, i \in \mathcal{I}$ follow a specific pattern. We split the set of directions into two regions, namely the Main Lobe Region (MLR) and the Side Lobe Region (SLR). In the MLR, the radiated power needs to be maximized with flat response (i.e., with limited gap between its lower and upper extreme values). In the SLR, the radiated power needs to be minimized. We represent the radiated pattern by the set $\mathcal{S}^i$ whose structure is given as

$$\mathcal{S}^i: \left\{ \begin{array}{l} \mathrm{Tr}(\mathbf{Q}^i \mathbf{X}) \ge \alpha^i, \\ \mathrm{Tr}(\mathbf{Q}^i \mathbf{X}) \le \beta^i. \end{array} \right. \quad (8a)$$

$$\mathrm{Tr}(\mathbf{Q}^i \mathbf{X}) \le \beta^i. \quad (8b)$$

Constraints (8a) and (8b) permit to bound the power of the radiated beam in the $i$-th direction, from below and from above, respectively. Specifically, if the $i$-th direction belongs to the MLR, $\alpha^i$ and $\beta^i$ should be set to high values with $\beta^i - \alpha^i \to \epsilon^i$ where $\epsilon^i$ is a small number. Conversely, if the $i$-th direction belongs to the SLR, we impose $\alpha^i = 0$ whereas $\beta^i$ is a small number, as described in the following. As in prior works, we assume here that precoder weights have unit amplitude (i.e., lossless system), namely $|\psi_n| = 1, n \in \mathcal{N}$. Using the same steps as in (7), the squared amplitude $|\psi_n|^2$ can be expressed in terms of vector $\mathbf{x}$ as

$$|\psi_n|^2 = \mathbf{x}^T \mathbf{O}^n \mathbf{x} = \mathrm{Tr}(\mathbf{O}^n \mathbf{X}) \quad (9)$$

where

$$\mathbf{O}_{j,j}^n = \begin{cases} 1 & \text{if } j = n, \\ 1 & \text{if } j = n + N, \\ 0 & \text{elsewhere.} \end{cases} \quad (10)$$

Based on the above discussion, the RIS beam synthesis problem can be written as an SDP as

$$\text{find} \quad \mathbf{X} \in \mathbb{S}^{2N} \quad (11a)$$

$$\text{subject to} \quad \mathrm{Tr}(\mathbf{Q}^i \mathbf{X}) \in \mathcal{S}^i \quad \text{for } i \in \mathcal{I} \quad (11b)$$

$$\mathrm{Tr}(\mathbf{O}^n \mathbf{X}) = 1 \quad \text{for } n \in \mathcal{N} \quad (11c)$$

$$\mathbf{X} \ge 0 \quad (11d)$$

$$\mathrm{rank}(\mathbf{X}) = 1. \quad (11e)$$

It is noted that (11a) is not a convex problem because of constraint (11e). In [18], constraint (11e) is relaxed to obtain a convex problem solvable in polynomial-time. A so called log-det heuristic in turn is introduced in order to encourage low-rank solutions. The relaxed problem can hence be solved using standard interior point methods. In this work, the rank minimization involved in the RIS beam synthesis problem is tackled via a generalization of the trace heuristic. This method – whose full development is deferred to Appendix E – appears much more efficient than log-det heuristic as exemplified by the synthesis of RIS beam $\mathbf{C}_{.,1}$ in section VII. We remark that in our numerical implementation, each precoder weight $(\psi_n, \forall n \in \mathcal{N})$ is encoded using $z$ bits [4]. Indeed, current RIS prototypes only admit discrete precoder weights. We further notice that this RIS beam synthesis method can be performed at a network controller without any processing load on the RIS.
<figure><img src="image_4.png" /><figcaption>Fig. 3. RIS codebook and RCP structure for NLOS zone tracking.</figcaption></figure>

synthesis. RIS beam synthesis consists in finding the RIS REs' excitations $\psi \in \mathbb{C}^N$ such that the power radiated by the RIS in some azimuthal directions of interest denoted by $\phi^i, i \in \mathcal{I} = \{0, ..., I - 1\}$ follow a specific pattern. The desired radiated pattern can include design constraints such as side lobe level. It is noted that the BS and the RIS are both modelled as ULAs so that only the azimuthal variations of the radiated fields are considered (i.e. beam synthesis is performed in the azimuthal plane). However, extending the technique developed in the sequel to the elevation variations is straightforward.

We assume here that each BS antenna and RIS RE radiates isotropically. Therefore, when configured with the precoder $\psi$, the far field radiated by the RIS in the direction of interest $\phi^i$ can be expressed as follows

$$r(\phi^i) = \rho(\phi^i)\psi \quad (3)$$

where

$$\rho(\phi^i) = \left( \mathbf{a}_{t_x}(\phi^i)^H \text{diag} \left( \mathbf{a}_{r_x}(\nu) \mathbf{a}_{t_x}(\nu)^H \mathbf{w} \right) \right). \quad (4)$$

$\rho(\phi^i) \in \mathbb{C}^N$ aggregates the BS precoder, the cascaded-link BS steering vector and the RIS steering and response vectors denoted by $\mathbf{w} \in \mathbb{C}^M$, $\mathbf{a}_{t_x}(\nu) \in \mathbb{C}^M$, $\mathbf{a}_{t_x}(\phi^i) \in \mathbb{C}^N$ and $\mathbf{a}_{r_x}(\nu) \in \mathbb{C}^N$ respectively. The q-th term of $\mathbf{a}_{t_x}(\cdot)$ and $\mathbf{a}_{r_x}(\cdot)$ can be expressed as $[\mathbf{a}_{t_x}(\nu)]_q = \exp(j \frac{2\pi}{\lambda} q \Delta_{tx} \cos(\nu))$ and $[\mathbf{a}_{r_x}(\nu)]_q = \exp(-j \frac{2\pi}{\lambda} q \Delta_{rx} \cos(\nu))$ where $\lambda, \Delta_{tx}$ and $\Delta_{rx}$ are the wavelength, the transmitter and receiver radiating elements spacing, respectively. $r(\phi^i)$ is a complex scalar whose real and imaginary parts can be arranged in a vector as

$$[\mathbb{R}(r(\phi^i)) \quad \mathbb{I}(r(\phi^i))]^T = \mathbf{A}^i \mathbf{x} \quad (5)$$

where the matrix $\mathbf{A}^i \in \mathbb{R}^{2 \times 2N}$ and the vector $\mathbf{x} \in \mathbb{R}^{2N}$ can be expressed as in (6).

$$\mathbf{A}^i = \begin{bmatrix} \mathbb{R}(\rho(\phi^i)^T) & -\mathbb{I}(\rho(\phi^i)^T) \\ \mathbb{I}(\rho(\phi^i)^T) & \mathbb{R}(\rho(\phi^i)^T) \end{bmatrix}, \quad \mathbf{x} = \begin{bmatrix} \mathbb{R}(\psi) \\ \mathbb{I}(\psi) \end{bmatrix} \quad (6)$$

Based on (3), the power radiated by the RIS in the direction $\phi^i$ can be formulated as follows

$$|r(\phi^i)|^2 = \mathbf{x}^T \mathbf{Q}^i \mathbf{x} = \text{Tr}(\mathbf{Q}^i \mathbf{X}) \quad (7)$$

where $\mathbf{Q}^i = \mathbf{A}^i \mathbf{T} \mathbf{A}^i$ is a symmetric matrix and $\mathbf{X} = \mathbf{x} \mathbf{x}^T \in \mathbb{S}^{2N}$ is a symmetric positive semi-definite matrix (i.e. $\mathbf{X} \ge \mathbf{0}$) of rank one (i.e. $\text{rank}(\mathbf{X}) = 1$).

RIS beam synthesis consists in finding the vector $\mathbf{x}$ such that the powers radiated by the RIS in the directions of interest $\phi^i, i \in \mathcal{I}$ follow a specific pattern. We split the set of directions into two regions, namely the Main Lobe Region (MLR) and the Side Lobe Region (SLR). In the MLR, the radiated power needs to be maximized with flat response (i.e., with limited gap between its lower and upper extreme values). In the SLR, the radiated power needs to be minimized. We represent the radiated pattern by the set $\mathcal{S}^i$ whose structure is given as

$$\mathcal{S}^i: \left\{ \begin{array}{l} \text{Tr}(\mathbf{Q}^i \mathbf{X}) \ge \alpha^i, \\ \text{Tr}(\mathbf{Q}^i \mathbf{X}) \le \beta^i. \end{array} \right. \quad (8a)$$

$$\text{Tr}(\mathbf{Q}^i \mathbf{X}) \le \beta^i. \quad (8b)$$

Constraints (8a) and (8b) permit to bound the power of the radiated beam in the $i$-th direction, from below and from above, respectively. Specifically, if the $i$-th direction belongs to the MLR, $\alpha^i$ and $\beta^i$ should be set to high values with $\beta^i - \alpha^i \to \epsilon^i$ where $\epsilon^i$ is a small number. Conversely, if the $i$-th direction belongs to the SLR, we impose $\alpha^i = 0$ whereas $\beta^i$ is a small number, as described in the following. As in prior works, we assume here that precoder weights have unit amplitude (i.e., lossless system), namely $|\psi_n| = 1, n \in \mathcal{N}$. Using the same steps as in (7), the squared amplitude $|\psi_n|^2$ can be expressed in terms of vector $\mathbf{x}$ as

$$|\psi_n|^2 = \mathbf{x}^T \mathbf{O}^n \mathbf{x} = \text{Tr}(\mathbf{O}^n \mathbf{X}) \quad (9)$$

where

$$\mathbf{O}_{j,j}^n = \begin{cases} 1 & \text{if } j = n, \\ 1 & \text{if } j = n + N, \\ 0 & \text{elsewhere.} \end{cases} \quad (10)$$

Based on the above discussion, the RIS beam synthesis problem can be written as an SDP as

$$\text{find} \quad \mathbf{X} \in \mathbb{S}^{2N} \quad (11a)$$

$$\text{subject to} \quad \text{Tr}(\mathbf{Q}^i \mathbf{X}) \in \mathcal{S}^i \quad \text{for } i \in \mathcal{I} \quad (11b)$$

$$\text{Tr}(\mathbf{O}^n \mathbf{X}) = 1 \quad \text{for } n \in \mathcal{N} \quad (11c)$$

$$\mathbf{X} \ge 0 \quad (11d)$$

$$\text{rank}(\mathbf{X}) = 1. \quad (11e)$$

It is noted that (11a) is not a convex problem because of constraint (11e). In [18], constraint (11e) is relaxed to obtain a convex problem solvable in polynomial-time. A so called log-det heuristic in turn is introduced in order to encourage low-rank solutions. The relaxed problem can hence be solved using standard interior point methods. In this work, the rank minimization involved in the RIS beam synthesis problem is tackled via a generalization of the trace heuristic. This method – whose full development is deferred to Appendix E – appears much more efficient than log-det heuristic as exemplified by the synthesis of RIS beam $\mathbf{C}_{.,1}$ in section VII. We remark that in our numerical implementation, each precoder weight $(\psi_n, \forall n \in \mathcal{N})$ is encoded using $z$ bits [4]. Indeed, current RIS prototypes only admit discrete precoder weights. We further notice that this RIS beam synthesis method can be performed at a network controller without any processing load on the RIS.
### E. UEs working principle

We assume that the carrier bandwidth is divided into two non-overlapping parts spreading on $K_{data}$ and $K_{control}$ subcarriers, respectively (i.e. $K = K_{data} + K_{control}$). These parts respectively group all data and control signals exchanged between the BS and each UE. Let $K_{data}$ and $K_{control}$ denote the sets of subcarriers dedicated to data and control signals.

During all their active period, UEs periodically perform power measurements thanks to the control signals transmitted on the subcarriers from $K_{control}$. Based on power measurements reported by UEs, the BS can update as frequently as necessary the pairing between UEs and BS beams. We denote by $(u \in b)_c, b \in \mathcal{B}, c \in C$, an UE $u \in \mathcal{U}$ attached to the BS beam $\mathbf{B}_{.,b}$ when the RIS precoder $\mathbf{C}_{.,c}$ is active. Note that an UE can be attached to different BS beams when different RIS precoders are active. After each power measurement, the beam $b$ to which the UE $u$ is attached, namely $(u \in b)_c$, is determined as follows

$$b = \arg\max_{b' \in \mathcal{B}} \{p_u^{b',c}\}. \quad (12)$$

In (12), $p_u^{b',c}$ corresponds to the power measurement of UE $u$ when served by the BS beam $\mathbf{B}_{.,b'}$ when the RIS precoder $\mathbf{C}_{.,c}$ is active. $p_u^{b',c}$ is computed as

$$p_u^{b',c} = \frac{P_{tx}}{K_{control} K U_{sch}} \sum_{k \in K_{control}} |\xi_u^k(\mathbf{C}_{.,c}) \mathbf{B}_{.,b'}|^2 \quad (13)$$

where $\frac{P_{tx}}{K_{U_{sch}}}$ denotes the power transmitted by the BS on one subcarrier and dedicated to one UE when $U_{sch}$ UEs are scheduled simultaneously. $p_u^{b',c}$ can be interpreted as the mean power received by the UE $u$ on a subcarrier occupied by a control signal. Note that, the expression of the function $\xi_u^k(.)$ is the same as in (2). Therefore, $\xi_u^k(\mathbf{C}_{.,c})$ corresponds to the sum of the direct and cascaded channels on subcarrier $k$ when the RIS precoder $\mathbf{C}_{.,c}$ is active.

Based on (1), we express the Signal to Interference plus Noise Ratio (SINR) of an UE $u$ served by the BS beam $\mathbf{B}_{.,b}$ while the RIS precoder $\mathbf{C}_{.,c}$ is active, on subcarrier $k$ as

$$\gamma_u^{b,c,k} = \frac{\frac{P_{tx}}{K U_{sch}} |\xi_u^k(\mathbf{C}_{.,c}) \mathbf{B}_{.,b}|^2}{\sigma_e^2 + \frac{P_{tx}}{K U_{sch}} \sum_{b' \in \mathcal{B} \setminus \{b\}} |\xi_u^k(\mathbf{C}_{.,c}) \mathbf{B}_{.,b'}|^2} \quad (14)$$

where $\sigma_e^2$ is the noise power.

For sake of simplicity, we assume here that when an UE is scheduled on a given slot, it receives data on all $K_{data}$ subcarriers. Note that multiple UEs can be scheduled on the same time and frequency resources if they can be spatially separated. Therefore, the rate of the UE $u$ served by the BS beam $\mathbf{B}_{.,b}$ when the RIS precoder $\mathbf{C}_{.,c}$ is active can be formulated as follows

$$r_u^{b,c} = \frac{1}{K_{data}} \sum_{k \in K_{data}} \log_2 (1 + \gamma_u^{b,c,k}) \quad (\text{bit/s/Hz}). \quad (15)$$

Note that, the rate achieved on each subcarrier $k \in K_{data}$ obeys to $\log_2(1 + \gamma_u^{b,c,k}) \le r^{max}$ where $r^{max}$ corresponds to the SE of the highest available MCS.

<table><caption>TABLE II
MAIN NOTATION USED IN THE REST OF THE PAPER</caption><thead><tr><th>Symbols</th><th>Definitions</th></tr></thead><tbody><tr><td>$p_u^{b,c}$</td><td>UE power measurement on BS beam $\mathbf{B}_{.,b}$ when RIS precoder $\mathbf{C}_{.,c}$ is active</td></tr><tr><td>$\tilde{r}_{u,t}^{b,c(t)}$</td><td>UE instantaneous rate at time $t$</td></tr><tr><td>$\tilde{r}_{u,t}$</td><td>UE average rate at time $t$</td></tr><tr><td>$\tilde{F}$</td><td>RCP duration in frames</td></tr><tr><td>$\tilde{F}$</td><td>number of RCP frames to allocate</td></tr><tr><td>$\mathbf{q}_i^s$</td><td>fraction of $\tilde{F}$ frames assigned to precoder $i$ at time $s$</td></tr><tr><td>$\boldsymbol{\theta}_i^s$</td><td>$\boldsymbol{\theta}_i^s = \exp(\mathbf{q}_i^s)$</td></tr><tr><td>$\mathcal{U}_c$</td><td>cluster of UEs whose best RIS precoder is $\mathbf{C}_{.,c}$</td></tr><tr><td>$\tilde{\mathbf{r}}_{u,t}^{a,s}$</td><td>UE average rate at time $s$ on RIS precoder $\mathbf{C}_{.,c}$</td></tr><tr><td>$\tilde{\mathbf{r}}_i^{a,s}$</td><td>noisy estimate of $\tilde{\mathbf{r}}_i^{a,s}$</td></tr><tr><td>$\tilde{\mathbf{r}}_i^{c,s}$</td><td>sum of average rates of UEs from $\mathcal{U}_c$ when RIS precoder $\mathbf{C}_{.,i}$ is active</td></tr><tr><td>$\tilde{\mathbf{r}}_i^s$</td><td>vector storing rates used to compute $X_s^\alpha(\boldsymbol{\theta}^s)$</td></tr><tr><td>$\tilde{\mathbf{r}}_i^s$</td><td>noisy estimate of $\tilde{\mathbf{r}}_i^s$</td></tr><tr><td>$\boldsymbol{\zeta}_i^s$</td><td>error in $\tilde{\mathbf{r}}_i^s$ estimation</td></tr><tr><td>$X_s^\alpha(\boldsymbol{\theta}^s)$</td><td>alpha-fair utility function used for RCP computation</td></tr><tr><td>$\tilde{X}_s^\alpha(\boldsymbol{\theta}^s)$</td><td>noisy estimate of $X_s^\alpha(\boldsymbol{\theta}^s)$</td></tr><tr><td>$\alpha$</td><td>fairness coefficient used in $X_s^\alpha(\boldsymbol{\theta}^s)$</td></tr><tr><td>$L(\boldsymbol{\theta}^s, \lambda)$</td><td>Lagrangian derived based on (OPT)</td></tr><tr><td>$\tilde{L}(\boldsymbol{\theta}^s, \lambda)$</td><td>noisy estimate of $L(\boldsymbol{\theta}^s, \lambda)$</td></tr><tr><td>$\lambda$</td><td>Lagrange multiplier</td></tr><tr><td>$\eta^s$</td><td>step-size sequence</td></tr><tr><td>$\boldsymbol{\beta}^s$</td><td>bias noise</td></tr><tr><td>$\boldsymbol{\omega}^s$</td><td>martingale noise</td></tr></tbody></table>

## IV. PROBLEM FORMULATION

This paper addresses both the BS and RIS configuration and the UEs' scheduling problems. In principle, these two problems could be solved jointly. However, the target mathematical model, namely a Markov decision process describing the process both at the PHY and MAC layers, may result in a model hardly tractable analytically. Instead, we resort to time scale separation, where the whole RIS/BS resource allocation scheme is viewed as a double control-loop optimization problem: (i) a fast loop for UEs' scheduling where the RCP structure is considered fixed, and (ii) a slow loop adapting the RCP structure to optimize the system sum-rate in a fair manner. It is noted that while the solutions of each of the two concave maximization problems is indeed optimal, the resulting solution of the joint problem may be suboptimal.

### A. UEs' scheduling

We first focus on the fast control loop optimization problem, namely scheduling UEs under a fixed RCP structure. At each time slot $t$, the BS can serve up to $U_{sch}^{max}$ UEs. At most one UE can be scheduled on each active BS beam per time slot $t$, i.e., $U_{sch}^{max} = N_{\mathbf{B}}$. A BS beam is active if at least one UE is associated to this beam. Let us denote $\mathcal{B}^t$ the set of active beams at time $t$.

UEs attached to the same BS beam are scheduled based on a PF utility function. This utility function depends on the instantaneous rate of the UE $u$ at time $t+1$ denoted by $r_{u,t+1}^{b,c(t+1)}$ where $(u \in b)_c(t+1)$. We define the average rate of the UE $u$ at time $t$ denoted by $\tilde{r}_{u,t}$. The average rate at time $t+1$ is the exponential moving average with parameter $0 < \epsilon \le 1$

$$\tilde{r}_{u,t+1} = (1 - \epsilon)\tilde{r}_{u,t} + \epsilon r_{u,t+1}^{b,c(t+1)}. \quad (16)$$
### E. UEs working principle

We assume that the carrier bandwidth is divided into two non-overlapping parts spreading on $K_{data}$ and $K_{control}$ subcarriers, respectively (i.e. $K = K_{data} + K_{control}$). These parts respectively group all data and control signals exchanged between the BS and each UE. Let $\mathcal{K}_{data}$ and $\mathcal{K}_{control}$ denote the sets of subcarriers dedicated to data and control signals.

During all their active period, UEs periodically perform power measurements thanks to the control signals transmitted on the subcarriers from $\mathcal{K}_{control}$. Based on power measurements reported by UEs, the BS can update as frequently as necessary the pairing between UEs and BS beams. We denote by $(u \in b)_c, b \in \mathcal{B}, c \in \mathcal{C}$, an UE $u \in \mathcal{U}$ attached to the BS beam $\mathbf{B}_{.,b}$ when the RIS precoder $\mathbf{C}_{.,c}$ is active. Note that an UE can be attached to different BS beams when different RIS precoders are active. After each power measurement, the beam $b$ to which the UE $u$ is attached, namely $(u \in b)_c$, is determined as follows

$$b = \arg\max_{b' \in \mathcal{B}} \{p_u^{b',c}\}. \quad (12)$$

In (12), $p_u^{b',c}$ corresponds to the power measurement of UE $u$ when served by the BS beam $\mathbf{B}_{.,b'}$ when the RIS precoder $\mathbf{C}_{.,c}$ is active. $p_u^{b',c}$ is computed as

$$p_u^{b',c} = \frac{P_{tx}}{K_{control}KU_{sch}} \sum_{k \in \mathcal{K}_{control}} |\xi_u^k(\mathbf{C}_{.,c})\mathbf{B}_{.,b'}|^2 \quad (13)$$

where $\frac{P_{tx}}{K_{U_{sch}}}$ denotes the power transmitted by the BS on one subcarrier and dedicated to one UE when $U_{sch}$ UEs are scheduled simultaneously. $p_u^{b',c}$ can be interpreted as the mean power received by the UE $u$ on a subcarrier occupied by a control signal. Note that, the expression of the function $\xi_u^k(.)$ is the same as in (2). Therefore, $\xi_u^k(\mathbf{C}_{.,c})$ corresponds to the sum of the direct and cascaded channels on subcarrier $k$ when the RIS precoder $\mathbf{C}_{.,c}$ is active.

Based on (1), we express the Signal to Interference plus Noise Ratio (SINR) of an UE $u$ served by the BS beam $\mathbf{B}_{.,b}$ while the RIS precoder $\mathbf{C}_{.,c}$ is active, on subcarrier $k$ as

$$\gamma_u^{b,c,k} = \frac{\frac{P_{tx}}{K_{U_{sch}}} |\xi_u^k(\mathbf{C}_{.,c})\mathbf{B}_{.,b}|^2}{\sigma_e^2 + \frac{P_{tx}}{K_{U_{sch}}} \sum_{b' \in \mathcal{B} \setminus \{b\}} |\xi_u^k(\mathbf{C}_{.,c})\mathbf{B}_{.,b'}|^2} \quad (14)$$

where $\sigma_e^2$ is the noise power.

For sake of simplicity, we assume here that when an UE is scheduled on a given slot, it receives data on all $K_{data}$ subcarriers. Note that multiple UEs can be scheduled on the same time and frequency resources if they can be spatially separated. Therefore, the rate of the UE $u$ served by the BS beam $\mathbf{B}_{.,b}$ when the RIS precoder $\mathbf{C}_{.,c}$ is active can be formulated as follows

$$r_u^{b,c} = \frac{1}{K_{data}} \sum_{k \in \mathcal{K}_{data}} \log_2 (1 + \gamma_u^{b,c,k}) \quad (\text{bit/s/Hz}). \quad (15)$$

Note that, the rate achieved on each subcarrier $k \in \mathcal{K}_{data}$ obeys to $\log_2(1 + \gamma_u^{b,c,k}) \le r^{max}$ where $r^{max}$ corresponds to the SE of the highest available MCS.

<table><caption>TABLE II
MAIN NOTATION USED IN THE REST OF THE PAPER</caption><thead><tr><th>Symbols</th><th>Definitions</th></tr></thead><tbody><tr><td>$p_u^{b,c}$</td><td>UE power measurement on BS beam $\mathbf{B}_{.,b}$ when RIS precoder $\mathbf{C}_{.,c}$ is active</td></tr><tr><td>$\tilde{r}_{u,t}^{b,c(t)}$</td><td>UE instantaneous rate at time $t$</td></tr><tr><td>$\tilde{r}_{u,t}$</td><td>UE average rate at time $t$</td></tr><tr><td>$F$</td><td>RCP duration in frames</td></tr><tr><td>$\tilde{F}$</td><td>number of RCP frames to allocate</td></tr><tr><td>$\mathbf{q}_i^s$</td><td>fraction of $\tilde{F}$ frames assigned to precoder $i$ at time $s$</td></tr><tr><td>$\boldsymbol{\theta}_i^s$</td><td>$\boldsymbol{\theta}_i^s = \exp(\mathbf{q}_i^s)$</td></tr><tr><td>$\mathcal{U}_c$</td><td>cluster of UEs whose best RIS precoder is $\mathbf{C}_{.,c}$</td></tr><tr><td>$\tilde{\mathbf{r}}_{u,t}^{a,s}$</td><td>UE average rate at time $s$ on RIS precoder $\mathbf{C}_{.,c}$</td></tr><tr><td>$\tilde{\mathbf{r}}_i^{a,s}$</td><td>noisy estimate of $\tilde{\mathbf{r}}_i^{a,s}$</td></tr><tr><td>$\tilde{\mathbf{r}}_i^{c,s}$</td><td>sum of average rates of UEs from $\mathcal{U}_c$ when RIS precoder $\mathbf{C}_{.,i}$ is active</td></tr><tr><td>$\tilde{\mathbf{r}}_i^s$</td><td>vector storing rates used to compute $X_s^\alpha(\boldsymbol{\theta}^s)$</td></tr><tr><td>$\tilde{\mathbf{r}}_i^s$</td><td>noisy estimate of $\tilde{\mathbf{r}}_i^s$</td></tr><tr><td>$\boldsymbol{\zeta}_i^s$</td><td>error in $\tilde{\mathbf{r}}_i^s$ estimation</td></tr><tr><td>$X_s^\alpha(\boldsymbol{\theta}^s)$</td><td>alpha-fair utility function used for RCP computation</td></tr><tr><td>$\tilde{X}_s^\alpha(\boldsymbol{\theta}^s)$</td><td>noisy estimate of $X_s^\alpha(\boldsymbol{\theta}^s)$</td></tr><tr><td>$\alpha$</td><td>fairness coefficient used in $X_s^\alpha(\boldsymbol{\theta}^s)$</td></tr><tr><td>$L(\boldsymbol{\theta}^s, \lambda)$</td><td>Lagrangian derived based on (OPT)</td></tr><tr><td>$\tilde{L}(\boldsymbol{\theta}^s, \lambda)$</td><td>noisy estimate of $L(\boldsymbol{\theta}^s, \lambda)$</td></tr><tr><td>$\lambda$</td><td>Lagrange multiplier</td></tr><tr><td>$\eta^s$</td><td>step-size sequence</td></tr><tr><td>$\boldsymbol{\beta}^s$</td><td>bias noise</td></tr><tr><td>$\boldsymbol{\omega}^s$</td><td>martingale noise</td></tr></tbody></table>

## IV. PROBLEM FORMULATION

This paper addresses both the BS and RIS configuration and the UEs' scheduling problems. In principle, these two problems could be solved jointly. However, the target mathematical model, namely a Markov decision process describing the process both at the PHY and MAC layers, may result in a model hardly tractable analytically. Instead, we resort to time scale separation, where the whole RIS/BS resource allocation scheme is viewed as a double control-loop optimization problem: (i) a fast loop for UEs' scheduling where the RCP structure is considered fixed, and (ii) a slow loop adapting the RCP structure to optimize the system sum-rate in a fair manner. It is noted that while the solutions of each of the two concave maximization problems is indeed optimal, the resulting solution of the joint problem may be suboptimal.

### A. UEs' scheduling

We first focus on the fast control loop optimization problem, namely scheduling UEs under a fixed RCP structure. At each time slot $t$, the BS can serve up to $U_{sch}^{max}$ UEs. At most one UE can be scheduled on each active BS beam per time slot $t$, i.e., $U_{sch}^{max} = N_{\mathbf{B}}$. A BS beam is active if at least one UE is associated to this beam. Let us denote $\mathcal{B}^t$ the set of active beams at time $t$.

UEs attached to the same BS beam are scheduled based on a PF utility function. This utility function depends on the instantaneous rate of the UE $u$ at time $t+1$ denoted by $r_{u,t+1}^{b,c(t+1)}$ where $(u \in b)_c(t+1)$. We define the average rate of the UE $u$ at time $t$ denoted by $\tilde{r}_{u,t}$. The average rate at time $t+1$ is the exponential moving average with parameter $0 < \epsilon \le 1$

$$\tilde{r}_{u,t+1} = (1 - \epsilon)\tilde{r}_{u,t} + \epsilon r_{u,t+1}^{b,c(t+1)}. \quad (16)$$
Note that if the UE $u$ is not scheduled at time $t+1$, the instantaneous rate $r_{u,t+1}^{b,c(t+1)}$ is null. Note also that the average rate $\bar{r}_{u,t}$ is computed over several frames where the UE $u$ can be served by different BS beams and RIS precoders. Finally, the PF scheduling utility function at time $t+1$, which is adapted here to the multi-user scheduling, is denoted by $U_{t+1}$ and can be expressed as $U_{t+1} = V_t + W_{t+1}$ [19]. $V_t$ and $W_{t+1}$ correspond to the parts of $U_{t+1}$ depending on past scheduling decisions up to time $t$ and on the scheduling decision at time $t+1$, respectively. $V_t$ and $W_{t+1}$ can be formulated as

$$V_t = \sum_{u \in \mathcal{U}} \left[ \log(\bar{r}_{u,t} + d) - \epsilon \left( \frac{\bar{r}_{u,t}}{\bar{r}_{u,t} + d} \right) \right] \quad (17)$$

$$W_{t+1} = \left[ \epsilon \sum_{b \in \mathcal{B}^t} \max_{(u \in b)_{c'}} \left( \frac{r_{u,t+1}^{b,c'}}{\bar{r}_{u,t} + d} \right) \right]_{c'=c(t+1)} \quad (18)$$

where $d > 0$ is an arbitrarily small constant to avoid problematic behaviors near zero.

## B. Optimal RCP structure computation

We now focus on the slow control loop optimization problem, namely the computation of the RCP structure. Since the system sum-rate depends on the RIS beams available to UEs, the frequency by which they appear in the pattern must be optimized in a fair manner. To this aim, the adaptive RIS configuration scheme “RCP B” presented in subsection III-B is the core of the slow optimization loop. In the “RCP B” scheme, the network controller decides at the beginning of each RCP how the RCP $F$ frames are shared among the $N_C$ RIS precoders from $\mathbf{C}$. In our scheme each RIS precoder is activated in at least one frame per RCP (see subsection III-B). Thus, the remaining $\bar{F} = F - N_C$ RCP frames are assigned a RIS precoder each. To this end, the RCP structure at time $s \in S$ can be represented by a non-negative real vector $\mathbf{q}^s \in \mathbb{R}^{N_C}$, where component $\mathbf{q}_i^s \in [0, 1]$ is the fraction of $\bar{F}$ frames assigned to precoder $i$ at time $s$. In our formulation, we shall control each component $\mathbf{q}_i^s$ by variable $\theta_i^s$ where $\mathbf{q}_i^s = \exp(\theta_i^s)$ and $\sum_{i \in C} \exp(\theta_i^s) = 1$. This identification permits to halve the number of multipliers required by the learning algorithm introduced later.

In turn, the control vector $\theta^s$ is determined via an optimization problem that is described next. Let us consider an alpha-fair utility function denoted by $X_s^\alpha(\theta^s)$. By maximizing $X_s^\alpha(\theta^s)$ it is possible to achieve a given degree of fairness among clusters of UEs associated to each RIS precoder.

The set of UEs $\mathcal{U}$ is partitioned into $N_C$ non-overlapping clusters denoted by $\mathcal{U}_c, c \in C$, i.e., $\mathcal{U} = \cup_{c \in C} \mathcal{U}_c$ and $\mathcal{U}_c \cap \mathcal{U}_{c'} = \emptyset$ for every $c \neq c'$. The cluster $\mathcal{U}_c$ contains all the UEs whose best RIS precoder is $\mathbf{C}_{.,c}$, i.e., when the corresponding received power under $\mathbf{C}_{.,c}$ is higher than the one under any other precoder from $\mathbf{C}$. Note that, because the PF scheduler does not discriminate between rates obtained on specific RIS precoders at some time slots, depending on channel conditions, an UE associated to a tagged cluster may well be served on different RIS precoders, i.e., those associated to different clusters.

The clusters $\mathcal{U}_c$ are determined at the end of each RCP based on power measurements as

$$\mathcal{U}_c = \left\{ u \in \mathcal{U} \left| \max_{b \in \mathcal{B}} p_u^{b,c} \ge \max_{b' \in \mathcal{B}, c' \in C \setminus \{c\}} p_u^{b',c'} \right. \right\}. \quad (19)$$

Let $\bar{r}_c^{u,s}$ denote the average rate experienced at time $s$ by the UE $u \in \mathcal{U}$ when the RIS precoder $c \in C$ is active. Note that $\bar{r}_c^{u,s}$ is computed based on instantaneous rates $r_{u,t}^{b,c(t)}$ which respect $c(t) = c$. For each UE $u \in \mathcal{U}$, we define the vector $\bar{\mathbf{r}}^{u,s} = [\bar{r}_0^{u,s}, \dots, \bar{r}_{N_C-1}^{u,s}] \in \mathbb{R}^{N_C}$ which stores the average rate experienced by $u$ on each RIS precoder $c \in C$. Finally, we define the vector $\bar{\mathbf{r}}^{c,s} \in \mathbb{R}^{N_C}$ whose $i$-th component $\bar{\mathbf{r}}_i^{c,s} = \sum_{u \in \mathcal{U}_c} \bar{\mathbf{r}}_i^{u,s}$ corresponds to the sum of the average rates experienced by the UEs from $\mathcal{U}_c$ when the RIS precoder $i \in C$ is active.

To model the impact of the RCP structure on the system sum-rate, we compute the average sum-rate of cluster $\mathcal{U}_c$ as a weighted sum of the contributions of all RIS precoders as

$$\bar{\mathbf{r}}_u^s = \frac{1}{F} \sum_{i \in C} (1 + \bar{F} \exp(\theta_i^s)) \bar{\mathbf{r}}_i^{c,s}. \quad (20)$$

In (20), $\frac{1}{F}(1 + \bar{F} \exp(\theta_i^s))$ is the fraction of the $F$ RCP frames allocated to the RIS precoder $i \in C$ at time $s$ so that $\frac{1}{F}(1 + \bar{F} \exp(\theta_i^s))\bar{\mathbf{r}}_i^{c,s}$ corresponds to the contribution of the RIS precoder $i \in C$ to the average sum-rate $\bar{\mathbf{r}}_u^s$.

Using (20), the alpha-fair formulation of the system sum-rate for $\alpha = 1$ and $\alpha \in \mathbb{R}_+ \setminus \{1\}$ respectively writes as in (21) and (22) where $d > 0$ is an arbitrarily small constant.

$$X_s^\alpha(\theta^s) = \sum_{c \in C} \frac{\delta|u_c| \neq 0}{1 - \alpha} \left( d + \sum_{i \in C} \left[ \frac{\exp(\theta_i^s) \bar{F} + 1}{F} \right] \bar{\mathbf{r}}_i^{c,s} \right)^{1-\alpha} \quad (21)$$

$$X_s^\alpha(\theta^s) = \sum_{c \in C} \delta|u_c| \neq 0 \log \left( d + \sum_{i \in C} \left[ \frac{\exp(\theta_i^s) \bar{F} + 1}{F} \right] \bar{\mathbf{r}}_i^{c,s} \right) \quad (22)$$

As showed in Appendix A, the system sum-rate is actually concave for positive values of $\alpha$.

**Proposition 1.** The utility function $X_s^\alpha(\theta^s)$ (resp. $-X_s^\alpha(\theta^s)$) is concave (resp. convex) in $\theta^s$ for $\alpha \in \mathbb{R}_+$. Strict concavity (resp. strict convexity) in $\theta^s$ is observed for $\alpha \in \mathbb{R}_{+*}$.

Based on $X_s^\alpha(\theta^s)$, the RCP allocation problem is formulated as a convex optimization problem:

$$\min_{\theta^s} - X_s^\alpha(\theta^s) \qquad (\text{OPT})$$

$$\text{subject to} \quad \sum_{c \in C} \exp(\theta_c^s) = 1.$$

In the rest of the paper we denote $\theta^*$ the optimal solution of (OPT). Depending on $\alpha$ and $N_C$, the solution of OPT can be characterized in different ways. For the cases ii and iii listed below, only the derivations for $\alpha \in \mathbb{R}_+ \setminus \{1\}$ are presented. It is noted that the same methodology can be used to address the case where $\alpha = 1$.

**Case i:** $\alpha = 0$. This case corresponds to opportunistic scheduling when no fairness is required between UEs clusters. Specifically, the utility function $X_s^\alpha(\theta^s)$ is maximized by allocating all resources to a single RIS precoder $c \in C$.
Note that if the UE $u$ is not scheduled at time $t+1$, the instantaneous rate $r_{u,t+1}^{b,c(t+1)}$ is null. Note also that the average rate $\bar{r}_{u,t}$ is computed over several frames where the UE $u$ can be served by different BS beams and RIS precoders. Finally, the PF scheduling utility function at time $t+1$, which is adapted here to the multi-user scheduling, is denoted by $U_{t+1}$ and can be expressed as $U_{t+1} = V_t + W_{t+1}$ [19]. $V_t$ and $W_{t+1}$ correspond to the parts of $U_{t+1}$ depending on past scheduling decisions up to time $t$ and on the scheduling decision at time $t+1$, respectively. $V_t$ and $W_{t+1}$ can be formulated as

$$V_t = \sum_{u \in \mathcal{U}} \left[ \log(\bar{r}_{u,t} + d) - \epsilon \left( \frac{\bar{r}_{u,t}}{\bar{r}_{u,t} + d} \right) \right] \quad (17)$$

$$W_{t+1} = \left[ \epsilon \sum_{b \in \mathcal{B}^t} \max_{(u \in b)_{c'}} \left( \frac{r_{u,t+1}^{b,c'}}{\bar{r}_{u,t} + d} \right) \right]_{c'=c(t+1)} \quad (18)$$

where $d > 0$ is an arbitrarily small constant to avoid problematic behaviors near zero.

## B. Optimal RCP structure computation

We now focus on the slow control loop optimization problem, namely the computation of the RCP structure. Since the system sum-rate depends on the RIS beams available to UEs, the frequency by which they appear in the pattern must be optimized in a fair manner. To this aim, the adaptive RIS configuration scheme “RCP B” presented in subsection III-B is the core of the slow optimization loop. In the “RCP B” scheme, the network controller decides at the beginning of each RCP how the RCP $F$ frames are shared among the $N_C$ RIS precoders from $\mathbf{C}$. In our scheme each RIS precoder is activated in at least one frame per RCP (see subsection III-B). Thus, the remaining $\bar{F} = F - N_C$ RCP frames are assigned a RIS precoder each. To this end, the RCP structure at time $s \in S$ can be represented by a non-negative real vector $\mathbf{q}^s \in \mathbb{R}^{N_C}$, where component $\mathbf{q}_i^s \in [0, 1]$ is the fraction of $\bar{F}$ frames assigned to precoder $i$ at time $s$. In our formulation, we shall control each component $\mathbf{q}_i^s$ by variable $\theta_i^s$ where $\mathbf{q}_i^s = \exp(\theta_i^s)$ and $\sum_{i \in C} \exp(\theta_i^s) = 1$. This identification permits to halve the number of multipliers required by the learning algorithm introduced later.

In turn, the control vector $\theta^s$ is determined via an optimization problem that is described next. Let us consider an alpha-fair utility function denoted by $X_s^\alpha(\theta^s)$. By maximizing $X_s^\alpha(\theta^s)$ it is possible to achieve a given degree of fairness among clusters of UEs associated to each RIS precoder.

The set of UEs $\mathcal{U}$ is partitioned into $N_C$ non-overlapping clusters denoted by $\mathcal{U}_c, c \in C$, i.e., $\mathcal{U} = \cup_{c \in C} \mathcal{U}_c$ and $\mathcal{U}_c \cap \mathcal{U}_{c'} = \emptyset$ for every $c \neq c'$. The cluster $\mathcal{U}_c$ contains all the UEs whose best RIS precoder is $\mathbf{C}_{.,c}$, i.e., when the corresponding received power under $\mathbf{C}_{.,c}$ is higher than the one under any other precoder from $\mathbf{C}$. Note that, because the PF scheduler does not discriminate between rates obtained on specific RIS precoders at some time slots, depending on channel conditions, an UE associated to a tagged cluster may well be served on different RIS precoders, i.e., those associated to different clusters.

The clusters $\mathcal{U}_c$ are determined at the end of each RCP based on power measurements as

$$\mathcal{U}_c = \left\{ u \in \mathcal{U} \left| \max_{b \in \mathcal{B}} p_u^{b,c} \ge \max_{b' \in \mathcal{B}, c' \in C \setminus \{c\}} p_u^{b',c'} \right. \right\}. \quad (19)$$

Let $\bar{r}_c^{u,s}$ denote the average rate experienced at time $s$ by the UE $u \in \mathcal{U}$ when the RIS precoder $c \in C$ is active. Note that $\bar{r}_c^{u,s}$ is computed based on instantaneous rates $r_{u,t}^{b,c(t)}$ which respect $c(t) = c$. For each UE $u \in \mathcal{U}$, we define the vector $\bar{\mathbf{r}}^{u,s} = [\bar{r}_0^{u,s}, \dots, \bar{r}_{N_C-1}^{u,s}] \in \mathbb{R}^{N_C}$ which stores the average rate experienced by $u$ on each RIS precoder $c \in C$. Finally, we define the vector $\bar{\mathbf{r}}^{c,s} \in \mathbb{R}^{N_C}$ whose $i$-th component $\bar{\mathbf{r}}_i^{c,s} = \sum_{u \in \mathcal{U}_c} \bar{\mathbf{r}}_i^{u,s}$ corresponds to the sum of the average rates experienced by the UEs from $\mathcal{U}_c$ when the RIS precoder $i \in C$ is active.

To model the impact of the RCP structure on the system sum-rate, we compute the average sum-rate of cluster $\mathcal{U}_c$ as a weighted sum of the contributions of all RIS precoders as

$$\bar{\mathbf{r}}_{u_c}^s = \frac{1}{F} \sum_{i \in C} (1 + \bar{F} \exp(\theta_i^s)) \bar{\mathbf{r}}_i^{c,s}. \quad (20)$$

In (20), $\frac{1}{F}(1 + \bar{F} \exp(\theta_i^s))$ is the fraction of the $F$ RCP frames allocated to the RIS precoder $i \in C$ at time $s$ so that $\frac{1}{F}(1 + \bar{F} \exp(\theta_i^s))\bar{\mathbf{r}}_i^{c,s}$ corresponds to the contribution of the RIS precoder $i \in C$ to the average sum-rate $\bar{\mathbf{r}}_{u_c}^s$.

Using (20), the alpha-fair formulation of the system sum-rate for $\alpha = 1$ and $\alpha \in \mathbb{R}_+ \setminus \{1\}$ respectively writes as in (21) and (22) where $d > 0$ is an arbitrarily small constant.

$$X_s^\alpha(\theta^s) = \sum_{c \in C} \frac{\delta|u_c| \neq 0}{1 - \alpha} \left( d + \sum_{i \in C} \left[ \frac{\exp(\theta_i^s) \bar{F} + 1}{F} \right] \bar{\mathbf{r}}_i^{c,s} \right)^{1-\alpha} \quad (21)$$

$$X_s^\alpha(\theta^s) = \sum_{c \in C} \delta|u_c| \neq 0 \log \left( d + \sum_{i \in C} \left[ \frac{\exp(\theta_i^s) \bar{F} + 1}{F} \right] \bar{\mathbf{r}}_i^{c,s} \right) \quad (22)$$

As shown in Appendix A, the system sum-rate is actually concave for positive values of $\alpha$.

**Proposition 1.** The utility function $X_s^\alpha(\theta^s)$ (resp. $-X_s^\alpha(\theta^s)$) is concave (resp. convex) in $\theta^s$ for $\alpha \in \mathbb{R}_+$. Strict concavity (resp. strict convexity) in $\theta^s$ is observed for $\alpha \in \mathbb{R}_{+*}$.

Based on $X_s^\alpha(\theta^s)$, the RCP allocation problem is formulated as a convex optimization problem:

$$\begin{array}{ll} \min_{\boldsymbol{\theta}^s} & -X_s^\alpha(\boldsymbol{\theta}^s) \qquad (\text{OPT}) \\ \text{subject to} & \sum_{c \in C} \exp(\boldsymbol{\theta}_c^s) = 1. \end{array}$$

In the rest of the paper we denote $\boldsymbol{\theta}^*$ the optimal solution of (OPT). Depending on $\alpha$ and $N_C$, the solution of OPT can be characterized in different ways. For the cases ii and iii listed below, only the derivations for $\alpha \in \mathbb{R}_+ \setminus \{1\}$ are presented. It is noted that the same methodology can be used to address the case where $\alpha = 1$.

**Case i:** $\alpha = 0$. This case corresponds to opportunistic scheduling when no fairness is required between UEs clusters. Specifically, the utility function $X_s^\alpha(\theta^s)$ is maximized by allocating all resources to a single RIS precoder $c \in C$.
**Case ii:** $\alpha > 0$ and $N_C = 2$. A closed-form expression of the value of $\theta^s$ solving OPT can be derived (see App. B).

**Case iii:** $\alpha > 0$ and $N_C > 2$. In this case no simple analytical solution of problem OPT; the solution is obtained via the online primal-dual SA algorithm developed next.

## V. STOCHASTIC APPROXIMATION SOLUTION

In this section, we propose a stochastic primal-dual optimization algorithm to tackle the optimal RCP structure computation problem (i.e., problem OPT) for the case defined by $\alpha \in \mathbb{R}_{+*}$ and $N_C > 2$. The proposed SA solution aims at minimizing the following Lagrangian

$$L(\theta^s, \lambda) = -X_s^\alpha(\theta^s) + \lambda \left( \sum_{c \in C} \exp(\theta_c^s) - 1 \right) \quad (24)$$

where $\lambda \in \mathbb{R}$ is a Lagrange multiplier. It is possible to observe that the Slater condition for constraint qualification is verified [20].

The update rules for the primal and dual variables write as

$$\theta_c^{s+1} = \left[ \theta_c^s - \eta^s \frac{\partial L}{\partial \theta_c^s}(\theta^s, \lambda^s) \right]^{(-\infty, 0]} \quad (25a)$$

$$\lambda^{s+1} = \lambda^s + \eta^s \frac{\partial L}{\partial \lambda}(\theta^s, \lambda^s) \quad (25b)$$

where $[a]^{[b,c]}$ denotes the projection and $\{\eta^s\}_{s \in \mathbb{N}}$ is a standard step-size sequence. The terms $\frac{\partial L}{\partial \theta_c^s}(\theta^s, \lambda^s) = -\frac{\partial X_c^\alpha}{\partial \theta_c^s}(\theta^s) + \lambda^s \exp(\theta_c^s)$ and $\frac{\partial L}{\partial \lambda}(\theta^s, \lambda^s) = \sum_{c \in C} \exp(\theta_c^s) - 1$ are the gradient of the Lagrangian with respect to $\theta^s$ and $\lambda$ in $(\theta^s, \lambda^s)$.

In general, (24) cannot be solved directly since the parameters account for the presence of noisy estimates. In practice, the instantaneous rates $r_{u,t}^{b,c(t)}$ can be retrieved in the form of noisy estimates measured via some suitable estimation procedure. In the rest of the discussion we shall assume that $r_{u,t}^{b,c(t)}$ are independent and identically distributed (i.i.d.) random variables with finite variance. The estimation of $\bar{\mathbf{r}}^s = [\bar{\mathbf{r}}^{0,s}, \dots, \bar{\mathbf{r}}^{N_C-1,s}] \in \mathbb{R}^{N_C^2}$ is represented by $\hat{\mathbf{r}}^s \in \mathbb{R}^{N_C^2}$ and can be expressed as follows

$$\hat{\mathbf{r}}^s = \bar{\mathbf{r}}^s + \zeta^s \quad (26)$$

where $\zeta^s \in \mathbb{R}^{N_C^2}$ is a noise vector.

We now denote $\hat{X}_s^\alpha(\theta^s)$ the noisy estimate of $X_s^\alpha(\theta^s)$ which can be computed by replacing $\bar{\mathbf{r}}_i^{c,s}$ by $\hat{\mathbf{r}}_i^{c,s}$ in (21). We also denote by $\hat{L}(\theta^s, \lambda)$ the noisy estimate of $L(\theta^s, \lambda)$ which can be calculated by replacing $X_s^\alpha(\theta^s)$ by $\hat{X}_s^\alpha(\theta^s)$ in (24).

From (27) and (28) we obtain also the estimate of first order partial derivatives of the Lagrangian and of the utility function, respectively.

$$\frac{\partial \hat{L}}{\partial \theta_j^s}(\theta^s, \lambda^s) = -\frac{\partial \hat{X}_s^\alpha}{\partial \theta_j^s}(\theta^s) + \lambda^s \exp(\theta_j^s) \quad (27)$$

$$\frac{\partial \hat{X}_s^\alpha}{\partial \theta_j^s}(\theta^s) = \sum_{c \in C} \left[ \delta|u_c| \delta(\frac{\tilde{F}}{F}) \exp(\theta_j^s) \hat{\mathbf{r}}_j^{c,s} \right. \\ \times \left. \left( d + \sum_{i \in C} \left[ \frac{\exp(\theta_i^s) \tilde{F} + 1}{F} \hat{\mathbf{r}}_i^{c,s} \right] \right)^{-\alpha} \right] \quad (28)$$

We denote $\{\eta^s\}_{s \in \mathbb{N}}$ a standard step-size sequence if it has the following properties

$$\eta^s \ge 0, \quad \sum_{s=0}^{\infty} \eta^s = \infty, \quad \sum_{s=0}^{\infty} (\eta^s)^2 < \infty. \quad (29)$$

We can now state the convergence properties of the proposed SA algorithm with the following result, the proof of which is provided in the Appendix C.

**Theorem 1.** Let $\hat{\mathbf{r}}_i^{u,s}$ be the output of an asymptotically unbiased estimator for the average rate $\bar{\mathbf{r}}_i^{u,s}$ experienced at time $s$ by the UE $u$ when the precoder $i \in C$ is active. Let $\{\eta^s\}_{s \in \mathbb{N}^+}$ be a standard step-size sequence. Assume that the estimation error $\zeta^s = \hat{\mathbf{r}}^s - \bar{\mathbf{r}}^s$ is such that $\lim_{s \to \infty} s ||\zeta^s|| \eta^s = 0$ w.p.1. Then the iterates of the primal-dual Algorithm (25a) converge w.p.1. to the optimal solution of problem OPT (i.e., $\theta^s$ converges to $\theta^*$).

As mentioned above, the instantaneous rates $r_{u,t}^{b,c(t)}$ are i.i.d random variables bounded w.p.1. Hence, if the average rates $\hat{\mathbf{r}}_i^{u,s}$ are computed through the sample mean estimator and we consider a standard step-size sequence, then Theorem 1 holds as shown by Theorem 2.

**Theorem 2.** Let $\hat{\mathbf{r}}_i^{u,s} = \frac{1}{s} \sum_{j=1}^s \delta_{c(j)=i} r_{u,j}^{b,c(j)}$ be the output of the sample mean average for the rates experienced up to time $s$ by the UE $u$ when the precoder $i \in C$ is active. Let $\eta^s = 1/s^\gamma$ be the standard stepsize sequence for $s \in \mathbb{N}^+$ and $\gamma \in (\frac{3}{4}, 1]$. Then Theorem 1 holds.

## VI. COMPLEXITY ANALYSIS

In this section, we analyze the complexity of the “RCP B” scheme. In particular, we consider the two key operations involved in the proposed solution: (i) the RCP structure computation, and (ii) the transmission of the RCP structure from the BS to the RIS. We remark that, different from the vast majority of the RIS configuration schemes in the literature, the “RCP B” scheme only relies on existing 5G low-complexity measurements. Thus, it does not require any additional channel estimation, i.e., beyond standardization. As such, the scheme does not add any additional complexity to data acquisition.

**Computational complexity.** Unlike deterministic optimization solutions presented in the literature, e.g., online convex optimization as in [6], in order to account for noisy measurements, we have adopted an iterative stochastic approximation algorithm for the computation of the optimal RCP structure. The iterates of this algorithm are proved to converge to the optimal solution provided that noisy data samples are collected using an unbiased estimator. Specifically, algorithm’s iterates are performed every $F \times 10$ ms and require the computation of $N_C$ gradients as in (27). The computation of a gradient in turn requires to perform $N_C(U+d)$ numerical operations where $d$ is a small number independent of scenario’s parameters. A scenario where the maximum number of admitted UEs is reached (i.e. $U = U^{max}$) and $N_C = 3$ leads to the consumption of about 180 numerical operations by each algorithm’s iterate.

**Message complexity.** The message complexity of the scheme is associated to the RCP structure transmission. We observe that for most of the literature’s works, the number of bits to
**Case ii:** $\alpha > 0$ and $N_C = 2$. A closed-form expression of the value of $\theta^s$ solving OPT can be derived (see App. B).

**Case iii:** $\alpha > 0$ and $N_C > 2$. In this case no simple analytical solution of problem OPT; the solution is obtained via the online primal-dual SA algorithm developed next.

## V. STOCHASTIC APPROXIMATION SOLUTION

In this section, we propose a stochastic primal-dual optimization algorithm to tackle the optimal RCP structure computation problem (i.e., problem OPT) for the case defined by $\alpha \in \mathbb{R}_{+*}$ and $N_C > 2$. The proposed SA solution aims at minimizing the following Lagrangian

$$L(\theta^s, \lambda) = -X_s^\alpha(\theta^s) + \lambda \left( \sum_{c \in C} \exp(\theta_c^s) - 1 \right) \quad (24)$$

where $\lambda \in \mathbb{R}$ is a Lagrange multiplier. It is possible to observe that the Slater condition for constraint qualification is verified [20].

The update rules for the primal and dual variables write as

$$\theta_c^{s+1} = \left[ \theta_c^s - \eta^s \frac{\partial L}{\partial \theta_c^s} (\theta^s, \lambda^s) \right]^{(-\infty, 0]} \quad (25a)$$

$$\lambda^{s+1} = \lambda^s + \eta^s \frac{\partial L}{\partial \lambda} (\theta^s, \lambda^s) \quad (25b)$$

where $[a]^{[b,c]}$ denotes the projection and $\{\eta^s\}_{s \in \mathbb{N}}$ is a standard step-size sequence. The terms $\frac{\partial L}{\partial \theta_c^s}(\theta^s, \lambda^s) = -\frac{\partial X_c^\alpha}{\partial \theta_c^s}(\theta^s) + \lambda^s \exp(\theta_c^s)$ and $\frac{\partial L}{\partial \lambda}(\theta^s, \lambda^s) = \sum_{c \in C} \exp(\theta_c^s) - 1$ are the gradient of the Lagrangian with respect to $\theta^s$ and $\lambda$ in $(\theta^s, \lambda^s)$.

In general, (24) cannot be solved directly since the parameters account for the presence of noisy estimates. In practice, the instantaneous rates $r_{u,t}^{b,c(t)}$ can be retrieved in the form of noisy estimates measured via some suitable estimation procedure. In the rest of the discussion we shall assume that $r_{u,t}^{b,c(t)}$ are independent and identically distributed (i.i.d.) random variables with finite variance. The estimation of $\tilde{\mathbf{r}}^s = [\tilde{\mathbf{r}}^{0,s}, \dots, \tilde{\mathbf{r}}^{N_C-1,s}] \in \mathbb{R}^{N_C^2}$ is represented by $\tilde{\mathbf{r}}^s \in \mathbb{R}^{N_C^2}$ and can be expressed as follows

$$\tilde{\mathbf{r}}^s = \tilde{\mathbf{r}}^s + \zeta^s \quad (26)$$

where $\zeta^s \in \mathbb{R}^{N_C^2}$ is a noise vector.

We now denote $\tilde{X}_s^\alpha(\theta^s)$ the noisy estimate of $X_s^\alpha(\theta^s)$ which can be computed by replacing $\tilde{\mathbf{r}}_i^{c,s}$ by $\tilde{\mathbf{r}}_i^{c,s}$ in (21). We also denote by $\tilde{L}(\theta^s, \lambda)$ the noisy estimate of $L(\theta^s, \lambda)$ which can be calculated by replacing $X_s^\alpha(\theta^s)$ by $\tilde{X}_s^\alpha(\theta^s)$ in (24).

From (27) and (28) we obtain also the estimate of first order partial derivatives of the Lagrangian and of the utility function, respectively.

$$\frac{\partial \tilde{L}}{\partial \theta_j^s}(\theta^s, \lambda^s) = -\frac{\partial \tilde{X}_s^\alpha}{\partial \theta_j^s}(\theta^s) + \lambda^s \exp(\theta_j^s) \quad (27)$$

$$\frac{\partial \tilde{X}_s^\alpha}{\partial \theta_j^s}(\theta^s) = \sum_{c \in C} \left[ \delta |u_c| \delta(0) \left(\frac{\tilde{F}}{F}\right) \exp(\theta_j^s) \tilde{\mathbf{r}}_j^{c,s} \times \left( d + \sum_{i \in C} \left[ \frac{\exp(\theta_i^s) \tilde{F} + 1}{F} \tilde{\mathbf{r}}_i^{c,s} \right]^{-\alpha} \right) \right] \quad (28)$$

We denote $\{\eta^s\}_{s \in \mathbb{N}}$ a standard step-size sequence if it has the following properties

$$\eta^s \ge 0, \quad \sum_{s=0}^{\infty} \eta^s = \infty, \quad \sum_{s=0}^{\infty} (\eta^s)^2 < \infty. \quad (29)$$

We can now state the convergence properties of the proposed SA algorithm with the following result, the proof of which is provided in the Appendix C.

**Theorem 1.** Let $\tilde{\mathbf{r}}_i^{u,s}$ be the output of an asymptotically unbiased estimator for the average rate $\tilde{\mathbf{r}}_i^{u,s}$ experienced at time $s$ by the UE $u$ when the precoder $i \in C$ is active. Let $\{\eta^s\}_{s \in \mathbb{N}^+}$ be a standard step-size sequence. Assume that the estimation error $\zeta^s = \tilde{\mathbf{r}}^s - \tilde{\mathbf{r}}_i^{u,s}$ is such that $\lim_{s \to \infty} s ||\zeta^s|| \eta^s = 0$ w.p.1. Then the iterates of the primal-dual Algorithm (25a) converge w.p.1. to the optimal solution of problem OPT (i.e., $\theta^s$ converges to $\theta^*$).

As mentioned above, the instantaneous rates $r_{u,t}^{b,c(t)}$ are i.i.d random variables bounded w.p.1. Hence, if the average rates $\tilde{\mathbf{r}}_i^{u,s}$ are computed through the sample mean estimator and we consider a standard step-size sequence, then Theorem 1 holds as shown by Theorem 2.

**Theorem 2.** Let $\tilde{\mathbf{r}}_i^{u,s} = \frac{1}{s} \sum_{j=1}^s \delta_{c(j)=i} r_{u,j}^{b,c(j)}$ be the output of the sample mean average for the rates experienced up to time $s$ by the UE $u$ when the precoder $i \in C$ is active. Let $\eta^s = 1/s^\gamma$ be the standard stepsize sequence for $s \in \mathbb{N}^+$ and $\gamma \in (\frac{3}{4}, 1]$. Then Theorem 1 holds.

## VI. COMPLEXITY ANALYSIS

In this section, we analyze the complexity of the “RCP B” scheme. In particular, we consider the two key operations involved in the proposed solution: (i) the RCP structure computation, and (ii) the transmission of the RCP structure from the BS to the RIS. We remark that, different from the vast majority of the RIS configuration schemes in the literature, the “RCP B” scheme only relies on existing 5G low-complexity measurements. Thus, it does not require any additional channel estimation, i.e., beyond standardization. As such, the scheme does not add any additional complexity to data acquisition.

**Computational complexity.** Unlike deterministic optimization solutions presented in the literature, e.g., online convex optimization as in [6], in order to account for noisy measurements, we have adopted an iterative stochastic approximation algorithm for the computation of the optimal RCP structure. The iterates of this algorithm are proved to converge to the optimal solution provided that noisy data samples are collected using an unbiased estimator. Specifically, algorithm’s iterates are performed every $F \times 10$ ms and require the computation of $N_C$ gradients as in (27). The computation of a gradient in turn requires to perform $N_C(U + d)$ numerical operations where $d$ is a small number independent of scenario’s parameters. A scenario where the maximum number of admitted UEs is reached (i.e. $U = U^{max}$) and $N_C = 3$ leads to the consumption of about 180 numerical operations by each algorithm’s iterate.

**Message complexity.** The message complexity of the scheme is associated to the RCP structure transmission. We observe that for most of the literature’s works, the number of bits to
be transmitted per RIS reconfiguration (every time slot) equals to $N \times z$ where z is the number of bits used to encode each RIS precoder weight. In our case the number of transmitted bits is much smaller, that is $\tilde{F}[\log_2(N_C)]$ for a whole RCP. In the present example where $N = 32$ and $z = 3$, our scheme hence requires a management interface with a capacity of $\frac{\tilde{F}[\log_2(N_C)]}{F \cdot 10 \cdot 10^{-3}} = 100$ bps against $\frac{Nz}{0,5 \cdot 10^{-3}} = 192$ kbps for a standard scheme.

## VII. NUMERICAL RESULTS

The results presented in this section cover simulations of the RIS beam synthesis, UEs' scheduling and RCP optimization. All simulations are carried out using a system simulator with time resolution of a slot (0, 5 ms).

### A. Simulation scenario

We consider a BS and a RIS deployed in a rectangular cell of size $x_{max} \times y_{max}$ where $x_{max} = 200$ m and $y_{max} = 160$ m, located at $(\frac{x_{max}}{2}, 0)$ and $(0, \frac{y_{max}}{2})$, respectively (Fig. 1). The BS is equipped with $M = 8$ antennas and can steer up to $N_B = 8$ beams simultaneously. The BS transmit power is set to $P_{tx} = 40$ W. The RIS is equipped with $N = 32$ REs.

The PL coefficients are set to $\alpha_f = 2.7$ (resp. $\alpha_f = 4.1$) for LOS UEs (resp. NLOS UEs) and $\alpha_g = 2.7$. The PL at one meter is equal to $\beta_0 = -20.4$dB. To model the PL associated to the BS-RIS link, we consider that $\Delta = \frac{\lambda}{2}$ where $\lambda$ is the wavelength. The small scale fading components $\tilde{f}_{it}^{t,k}$ and $\tilde{g}_{it}^{t,k}$ are generated following the Urban Macro scenario from [14]. The central frequency and bandwidth of the system are set to $f_c = 3.5$ GHz and $W = 20$ MHz, respectively. As the SCS is set to $\mu = 30$ kHz, we have $K = 666$, $K_{data} = 378$ and $K_{control} = 288$. 256-Quadrature Amplitude Modulation is the highest MCS used here so that $r^{max} = 7.4$ bit/s/Hz [17].

The traffic process is generated by UEs which enter the cell according to a Poisson process, download a file of size $S = 3$ MB and leave the system when the download is complete. We consider different arrival rates for the $\mathcal{A}_{LOS}$ and $\mathcal{A}_{NLOS}$ zones denoted by $\lambda_{LOS}$ and $\lambda_{NLOS}$ (UE/s), respectively. An admission control that accepts up to $U^{max} = 20$ UEs is implemented.

We consider a codebook $\mathbf{C}$ with $N_C = 3$ precoders. The RCP lasts $F = 6$ frames and $\alpha$ is set with a value near to 1.

### B. RIS Beam Synthesis Example

Fig. 4a) depicts the normalized gain pattern of RIS beam $\mathbf{C}_{.,1}$. It is synthesized for a 20° beamwidth and centered around 105° thanks to the method developed in subsection III-D. It is compared to the normalized gain pattern of a standard DFT beam steered in the same direction. The beam pattern of $\mathbf{C}_{.,1}$ is synthesized with $\beta^i$ in (8b) for the SLR set to the maximum value of the first sidelobe of the DFT pattern. Fig. 4b) illustrates that the generalized trace heuristic for the RIS beam synthesis problem permits to concentrate energy on fewer eigenvalues than the log-det heuristic. Overall, the proposed heuristic results for RIS beam patterns better satisfy the input pattern design constraints than that of [18].

### C. Online RCP optimization

Regarding the $\mathcal{A}_{NLOS}$ zone, we consider time-varying arrival probabilities for the coverage areas of RIS beams $\mathbf{C}_{.,1}$ and $\mathbf{C}_{.,2}$, denoted as $\mathbf{p}_1^t$ and $\mathbf{p}_2^t$. Hence, the effective arrival rate in the coverage area of beam $\mathbf{C}_{.,i}$, $i \in \{1, 2\}$ at time $t$ can be expressed as $\lambda_{NLOS} \times \mathbf{p}_i^t$. In the following example we consider a periodic UEs' arrival rate to the $\mathcal{A}_{NLOS}$ zone, with a 100s period (see Fig. 5a)). The arrival probabilities $\mathbf{p}_1^t$ and $\mathbf{p}_2^t$ vary periodically in the range $[\frac{1}{8}, \frac{7}{8}]$. Fig. 5b) shows the trajectory of time resources allocated by “RCP B” scheme to the RIS precoders from $\mathbf{C}$ (i.e. $\mathbf{q}^s$) for a single run. The amount of time resources allocated to precoders $\mathbf{C}_{.,1}$ and $\mathbf{C}_{.,2}$ is correlated to UEs' arrival probabilities. Indeed, the same variations are observed for $\mathbf{q}_i^s$ and $\mathbf{p}_i^t$, $i \in \{1, 2\}$. Fig. 5c) presents the mean time resources allocation trajectory obtained by averaging 32 independent runs. This series of experiments illustrate that the proposed online algorithm is able to adapt the allocated resources to changing traffic conditions.

### D. Performance evaluation

Figures 6a) and 6b) show the results for the UEs long-term mean SE. Data are obtained by simulating the traffic generated by UEs, with arrival rates varying periodically as shown in Fig. 5a) over a very large time horizon. In Fig. 6a), we assess the NLOS UEs mean SE obtained for different combinations of two UEs' schedulers (i.e., a PF scheduler (18) and a Round-Robin (RR) scheduler) and two RIS configuration schemes (i.e., “RCP A” and “RCP B” schemes). In the “RCP A” scheme, the $F$ RCP frames are equally distributed among the $N_C$ precoders. We first observe that for both UEs' schedulers, the “RCP B” scheme achieves a gain of above 15% over the “RCP A” scheme. The “RCP B” scheme allocates more time resources to RIS precoders which provide better performance to active UEs. Moreover, for both RCP schemes, the PF scheduler outperforms the RR scheduler by at least 28% in terms of mean SE. Overall, the best UEs scheduler-RIS configuration scheme combination outperforms the worst combination by 46%.

Finally, we compare in Fig. 6b) the NLOS UEs' mean SE offered by five RIS configuration schemes for different NLOS UEs' arrival rates. The first scheme denoted by “Direct Path” (DP) corresponds to the case where no RIS is deployed in the system. It is noted that in this case, NLOS UEs suffer from severe power losses and SE degradation. In comparison with the four other schemes, the “DP” scheme hence reaches capacity saturation for lower UEs' arrival rates. Therefore, the performance offered by this scheme are only assessed for the lowest UEs' arrival rate (i.e. $\lambda_{NLOS} = 0.5$ (UE/s)) so as to precisely evaluate the potential of other schemes. The second scheme denoted by “Large Beam” (LB) represents a setting that only utilizes the large RIS beam from $\mathbf{C}$. The two next schemes correspond to the “RCP A” and “RCP B” schemes. The last scheme denoted by “Oracle” configures the RIS on each time slot in order to maximize the power received by the UE scheduled via the RIS. Specifically, it aligns the phases of the direct and the cascaded channels, as done, e.g., in (19) of [12]. It can be seen as the optimal RIS configuration scheme.
be transmitted per RIS reconfiguration (every time slot) equals to $N \times z$ where z is the number of bits used to encode each RIS precoder weight. In our case the number of transmitted bits is much smaller, that is $\tilde{F}[\log_2(N_C)]$ for a whole RCP. In the present example where $N = 32$ and $z = 3$, our scheme hence requires a management interface with a capacity of $\frac{\tilde{F}[\log_2(N_C)]}{F \cdot 10 \cdot 10^{-3}} = 100$ bps against $\frac{Nz}{0,5 \cdot 10^{-3}} = 192$ kbps for a standard scheme.

## VII. NUMERICAL RESULTS

The results presented in this section cover simulations of the RIS beam synthesis, UEs' scheduling and RCP optimization. All simulations are carried out using a system simulator with time resolution of a slot (0, 5 ms).

### A. Simulation scenario

We consider a BS and a RIS deployed in a rectangular cell of size $x_{max} \times y_{max}$ where $x_{max} = 200$ m and $y_{max} = 160$ m, located at $(\frac{x_{max}}{2}, 0)$ and $(0, \frac{y_{max}}{2})$, respectively (Fig. 1). The BS is equipped with $M = 8$ antennas and can steer up to $N_B = 8$ beams simultaneously. The BS transmit power is set to $P_{tx} = 40$ W. The RIS is equipped with $N = 32$ REs.

The PL coefficients are set to $\alpha_f = 2.7$ (resp. $\alpha_f = 4.1$) for LOS UEs (resp. NLOS UEs) and $\alpha_g = 2.7$. The PL at one meter is equal to $\beta_0 = -20.4$dB. To model the PL associated to the BS-RIS link, we consider that $\Delta = \frac{\lambda}{2}$ where $\lambda$ is the wavelength. The small scale fading components $\tilde{f}_{it}^{t,k}$ and $\tilde{g}_{it}^{t,k}$ are generated following the Urban Macro scenario from [14]. The central frequency and bandwidth of the system are set to $f_c = 3.5$ GHz and $W = 20$ MHz, respectively. As the SCS is set to $\mu = 30$ kHz, we have $K = 666$, $K_{data} = 378$ and $K_{control} = 288$. 256-Quadrature Amplitude Modulation is the highest MCS used here so that $r^{max} = 7.4$ bit/s/Hz [17].

The traffic process is generated by UEs which enter the cell according to a Poisson process, download a file of size $S = 3$ MB and leave the system when the download is complete. We consider different arrival rates for the $\mathcal{A}_{LOS}$ and $\mathcal{A}_{NLOS}$ zones denoted by $\lambda_{LOS}$ and $\lambda_{NLOS}$ (UE/s), respectively. An admission control that accepts up to $U^{max} = 20$ UEs is implemented.

We consider a codebook $\mathbf{C}$ with $N_C = 3$ precoders. The RCP lasts $F = 6$ frames and $\alpha$ is set with a value near to 1.

### B. RIS Beam Synthesis Example

Fig. 4a) depicts the normalized gain pattern of RIS beam $\mathbf{C}_{.,1}$. It is synthesized for a 20° beamwidth and centered around 105° thanks to the method developed in subsection III-D. It is compared to the normalized gain pattern of a standard DFT beam steered in the same direction. The beam pattern of $\mathbf{C}_{.,1}$ is synthesized with $\beta^i$ in (8b) for the SLR set to the maximum value of the first sidelobe of the DFT pattern. Fig. 4b) illustrates that the generalized trace heuristic for the RIS beam synthesis problem permits to concentrate energy on fewer eigenvalues than the log-det heuristic. Overall, the proposed heuristic results for RIS beam patterns better satisfy the input pattern design constraints than that of [18].

### C. Online RCP optimization

Regarding the $\mathcal{A}_{NLOS}$ zone, we consider time-varying arrival probabilities for the coverage areas of RIS beams $\mathbf{C}_{.,1}$ and $\mathbf{C}_{.,2}$, denoted as $\mathbf{p}_1^t$ and $\mathbf{p}_2^t$. Hence, the effective arrival rate in the coverage area of beam $\mathbf{C}_{.,i}$, $i \in \{1, 2\}$ at time $t$ can be expressed as $\lambda_{NLOS} \times \mathbf{p}_i^t$. In the following example we consider a periodic UEs' arrival rate to the $\mathcal{A}_{NLOS}$ zone, with a 100s period (see Fig. 5a)). The arrival probabilities $\mathbf{p}_1^t$ and $\mathbf{p}_2^t$ vary periodically in the range $[\frac{1}{8}, \frac{7}{8}]$. Fig. 5b) shows the trajectory of time resources allocated by “RCP B” scheme to the RIS precoders from $\mathbf{C}$ (i.e. $\mathbf{q}^s$) for a single run. The amount of time resources allocated to precoders $\mathbf{C}_{.,1}$ and $\mathbf{C}_{.,2}$ is correlated to UEs' arrival probabilities. Indeed, the same variations are observed for $\mathbf{q}_i^s$ and $\mathbf{p}_i^t$, $i \in \{1, 2\}$. Fig. 5c) presents the mean time resources allocation trajectory obtained by averaging 32 independent runs. This series of experiments illustrate that the proposed online algorithm is able to adapt the allocated resources to changing traffic conditions.

### D. Performance evaluation

Figures 6a) and 6b) show the results for the UEs long-term mean SE. Data are obtained by simulating the traffic generated by UEs, with arrival rates varying periodically as shown in Fig. 5a) over a very large time horizon. In Fig. 6a), we assess the NLOS UEs mean SE obtained for different combinations of two UEs' schedulers (i.e., a PF scheduler (18) and a Round-Robin (RR) scheduler) and two RIS configuration schemes (i.e., “RCP A” and “RCP B” schemes). In the “RCP A” scheme, the F RCP frames are equally distributed among the $N_C$ precoders. We first observe that for both UEs' schedulers, the “RCP B” scheme achieves a gain of above 15% over the “RCP A” scheme. The “RCP B” scheme allocates more time resources to RIS precoders which provide better performance to active UEs. Moreover, for both RCP schemes, the PF scheduler outperforms the RR scheduler by at least 28% in terms of mean SE. Overall, the best UEs scheduler-RIS configuration scheme combination outperforms the worst combination by 46%.

Finally, we compare in Fig. 6b) the NLOS UEs' mean SE offered by five RIS configuration schemes for different NLOS UEs' arrival rates. The first scheme denoted by “Direct Path” (DP) corresponds to the case where no RIS is deployed in the system. It is noted that in this case, NLOS UEs suffer from severe power losses and SE degradation. In comparison with the four other schemes, the “DP” scheme hence reaches capacity saturation for lower UEs' arrival rates. Therefore, the performance offered by this scheme are only assessed for the lowest UEs' arrival rate (i.e. $\lambda_{NLOS} = 0.5$ (UE/s)) so as to precisely evaluate the potential of other schemes. The second scheme denoted by “Large Beam” (LB) represents a setting that only utilizes the large RIS beam from $\mathbf{C}$. The two next schemes correspond to the “RCP A” and “RCP B” schemes. The last scheme denoted by “Oracle” configures the RIS on each time slot in order to maximize the power received by the UE scheduled via the RIS. Specifically, it aligns the phases of the direct and the cascaded channels, as done, e.g., in (19) of [12]. It can be seen as the optimal RIS configuration scheme.
<figure><img src="image_5.png" /><figcaption>Fig. 4. Solution for beam $C_{.,1}$, for $M = 8$, $N = 32$. a) RIS normalized gain pattern: synthesized beam vs DFT beam. b) The six largest eigenvalues of $X$: log-det heuristic v.s. generalized trace heuristic.</figcaption></figure>

<figure><img src="image_6.png" /><figcaption>Fig. 5. a) UEs' arrival rate probability pattern in $\mathcal{A}_{\text{NLOS}}$ zone for coverage areas of RIS beams $C_{.,1}$ and $C_{.,2}$; b) c) Trajectory of time resources allocated by “RCP B” scheme to RCP precoders for traffic pattern (a) with $\lambda_{\text{LOS}} = 2$ UE/s and $\lambda_{\text{NLOS}} = 1.5$ UE/s; b) Single run; c) Averaged over 32 independent runs.</figcaption></figure>

<figure><img src="image_7.png" /><figcaption>Fig. 6. a) NLOS UEs' mean spectral efficiency for different RIS configuration schemes and UEs schedulers, ($\lambda_{\text{LOS}} = 2$ UE/s, $\lambda_{\text{NLOS}} = 1.5$ UE/s) b) NLOS UEs' mean spectral efficiency for different RIS configuration schemes and NLOS UEs arrival rates, ($\lambda_{\text{LOS}} = 2$).</figcaption></figure>

However, in comparison to the proposed schemes, it assumes both the availability of full instantaneous CSI and the ability to compute and transmit to the RIS controller the optimal RIS precoder for each UE in each coherence time interval. Therefore, it provides an upper bound on the system's performance which might not be practically achievable. The PF scheduler is considered for all RIS configuration schemes. Firstly, we infer that by deploying a RIS, the mean SE is significantly improved for NLOS UEs. The RIS reflections directly improve their SINRs and hence their mean SEs. Furthermore, it is noted that NLOS UEs' performance improvement permits to optimize the overall system performance. Secondly, we observe that the mean SE gain of the “RCP A” and “RCP B” schemes

with respect to the “LB” scheme increases with the traffic demand. In particular, gains of 28% and 47% are observed for the highest traffic demand. The very high gain achieved by the “Oracle” scheme comes at the expense of high complexity and cost, and neglecting latency of control channels. While the proposed “RCP B” scheme has lower gain than that of the “Oracle”, it is still very significant, and benefits from low complexity and consequently lower cost of implementation.

VIII. CONCLUSION

In this paper, we have presented a new cross-layer low-complexity scheme for joint BS and RIS configuration and
<figure><img src="image_5.png" /><figcaption>Fig. 4. Solution for beam $C_{.,1}$, for $M = 8$, $N = 32$. a) RIS normalized gain pattern: synthesized beam vs DFT beam. b) The six largest eigenvalues of $X$: log-det heuristic v.s. generalized trace heuristic.</figcaption></figure>

<figure><img src="image_6.png" /><figcaption>Fig. 5. a) UEs' arrival rate probability pattern in $\mathcal{A}_{\text{NLOS}}$ zone for coverage areas of RIS beams $C_{.,1}$ and $C_{.,2}$; b) c) Trajectory of time resources allocated by “RCP B” scheme to RCP precoders for traffic pattern (a) with $\lambda_{\text{LOS}} = 2$ UE/s and $\lambda_{\text{NLOS}} = 1.5$ UE/s; b) Single run; c) Averaged over 32 independent runs.</figcaption></figure>

<figure><img src="image_7.png" /><figcaption>Fig. 6. a) NLOS UEs' mean spectral efficiency for different RIS configuration schemes and UEs schedulers, ($\lambda_{\text{LOS}} = 2$ UE/s, $\lambda_{\text{NLOS}} = 1.5$ UE/s) b) NLOS UEs' mean spectral efficiency for different RIS configuration schemes and NLOS UEs arrival rates, ($\lambda_{\text{LOS}} = 2$).</figcaption></figure>

However, in comparison to the proposed schemes, it assumes both the availability of full instantaneous CSI and the ability to compute and transmit to the RIS controller the optimal RIS precoder for each UE in each coherence time interval. Therefore, it provides an upper bound on the system's performance which might not be practically achievable. The PF scheduler is considered for all RIS configuration schemes. Firstly, we infer that by deploying a RIS, the mean SE is significantly improved for NLOS UEs. The RIS reflections directly improve their SINRs and hence their mean SEs. Furthermore, it is noted that NLOS UEs' performance improvement permits to optimize the overall system performance. Secondly, we observe that the mean SE gain of the “RCP A” and “RCP B” schemes

with respect to the “LB” scheme increases with the traffic demand. In particular, gains of 28% and 47% are observed for the highest traffic demand. The very high gain achieved by the “Oracle” scheme comes at the expense of high complexity and cost, and neglecting latency of control channels. While the proposed “RCP B” scheme has lower gain than that of the “Oracle”, it is still very significant, and benefits from low complexity and consequently lower cost of implementation.

## VIII. CONCLUSION

In this paper, we have presented a new cross-layer low-complexity scheme for joint BS and RIS configuration and
fair UEs' scheduling. The RIS is configured following a predetermined sequence of precoders drawn from a codebook which is designed thanks to a new RIS beam synthesis method. We have proposed a SA algorithm that adapts the precoders sequence to the UEs' distribution so as to optimize their performance. We have especially proven the convergence of the algorithm iterates to the optimal sequence. The solution fairness has been achieved by adapting the PF scheduler to the RIS configuration scheme. The optimized solution achieves a gain of 47% compared to a baseline solution with Round-Robin scheduler combined with a non-optimized sequence of precoders for RIS configuration. The optimized precoders sequence can be computed within a radio controller such as, e.g., a mobile edge computing one, and transmitted to the RIS over a management interface that needs to be standardized. Further, we consider extending our joint BS and RIS configuration scheme to multi-cell scenarios with multiple RISs. The deployment of efficient RIS-assisted communication systems in such scenarios especially requires to solve important RIS positioning problems.

# APPENDIX

## A. Proof of Proposition 1

Without loss of generality, only the case where $\alpha \in \mathbb{R}_+ \setminus \{1\}$ is considered in this proof. It is noted that the same methodology can be used to address the case where $\alpha = 1$.

We first prove that the sub-utility function $Y_{c,s}^{\alpha}(\theta^s), c \in C$, is concave in $\theta^s$ for $\alpha \in \mathbb{R}_+ \setminus \{1\}$. We also prove that $Y_{c,s}^{\alpha}(\theta^s)$ is strictly concave in $\theta^s$ for $\alpha \in \mathbb{R}_{+*} \setminus \{1\}$.

$$ Y_{c,s}^{\alpha}(\theta^s) = \frac{\delta|u_c| \neq 0}{1 - \alpha} \left( d + \sum_{i \in C} \left[ \frac{\exp(\theta_i^s) \tilde{F} + 1}{F} \right] \bar{\mathbf{r}}_i^{c,s} \right)^{1-\alpha} . \quad (30) $$

Thanks to the second order conditions [23, §3.6.4], we know that if $Y_{c,s}^{\alpha} : (-\infty, \infty)^{N_c} \to \mathbb{R}$ is a twice differentiable multivariate function and that its domain is convex, it is sufficient to show that its hessian is semi-negative definite (i.e., $\nabla^2 Y_{c,s}^{\alpha}(\theta^s) \le 0$) for all $\theta^s$ and $\alpha \in \mathbb{R}_+ \setminus \{1\}$ in order to prove concavity. Under the same conditions, it is sufficient to show that the hessian $\nabla^2 Y_{c,s}^{\alpha}(\theta^s)$ is negative definite (i.e., $\nabla^2 Y_{c,s}^{\alpha}(\theta^s) < 0$) for all $\theta^s \neq 0$ and $\alpha \in \mathbb{R}_{+*} \setminus \{1\}$ in order to prove strict concavity.

Since $\nabla^2 Y_{c,s}^{\alpha}(\theta^s)$ is a real symmetric matrix, its negative semi-definiteness (resp. definiteness) can be proven by showing that $\mathbf{x}^T \nabla^2 Y_{c,s}^{\alpha}(\theta^s) \mathbf{x} \le 0, \forall \mathbf{x} \in \mathbb{R}^{N_c} \text{ (resp. } \mathbf{x}^T \nabla^2 Y_{c,s}^{\alpha}(\theta^s) \mathbf{x} < 0, \forall \mathbf{x} \in \mathbb{R}_{+*}^{N_c})$.

The second order cross partial derivative of $Y_{c,s}^{\alpha}(\theta^s)$ can be expressed as follows

$$ \frac{\partial^2 Y_{c,s}^{\alpha}}{\partial \theta_i^s \partial \theta_j^s}(\theta^s) = -\alpha \delta|u_c| \neq 0 \left(\frac{\tilde{F}}{F}\right)^2 \bar{\mathbf{r}}_i^{c,s} \bar{\mathbf{r}}_j^{c,s} \exp(\theta_i^s) \exp(\theta_j^s) \\ \times \left( d + \sum_{i \in C} \left[ \frac{\exp(\theta_i^s) \tilde{F} + 1}{F} \right] \bar{\mathbf{r}}_i^{c,s} \right)^{\alpha-1} . \quad (31) $$

Based on (31), $\mathbf{x}^T \nabla^2 Y_{c,s}^{\alpha}(\theta^s) \mathbf{x}$ can be expanded as follows

$$ \mathbf{x}^T \nabla^2 Y_{c,s}^{\alpha}(\theta^s) \mathbf{x} = -\alpha \delta|u_c| \neq 0 \left[ \frac{\tilde{F}}{F} \sum_{i \in C} \mathbf{x}_i \bar{\mathbf{r}}_i^{c,s} \exp(\theta_i^s) \right]^2 \\ \times \left( d + \sum_{i \in C} \left[ \frac{\theta_i^s \tilde{F} + 1}{F} \right] \bar{\mathbf{r}}_i^{c,s} \right)^{\alpha-1} . \quad (32) $$

For all $\theta^s$ and $\alpha \in \mathbb{R}_+ \setminus \{1\}$ (resp. $\alpha \in \mathbb{R}_{+*} \setminus \{1\}$), it is straightforward to show that $\mathbf{x}^T \nabla^2 Y_{c,s}^{\alpha}(\theta^s) \mathbf{x} \le 0, \forall \mathbf{x} \in \mathbb{R}^{N_c} \text{ (resp. } \mathbf{x}^T \nabla^2 Y_{c,s}^{\alpha}(\theta^s) \mathbf{x} < 0, \forall \mathbf{x} \in \mathbb{R}_{+*}^{N_c})$. Therefore, $Y_{c,s}^{\alpha}(\theta^s)$ is concave (resp. strictly concave) for $\alpha \in \mathbb{R}_+ \setminus \{1\}$ (resp. $\alpha \in \mathbb{R}_{+*} \setminus \{1\}$). Finally, since $X_s^{\alpha}(\theta^s) = \sum_{c \in C} Y_{c,s}^{\alpha}(\theta^s)$, the result follows.

## B. Closed-form expression of $\theta^*$ for $\alpha > 0$ and $N_c = 2$

For $\alpha > 0$ and $N_c = 2$, (21) can be reformulated to (33) where $\theta^s$ reduces to a scalar and $\exp(\theta^s) \in [0, 1]$.

$$ X_s^{\alpha}(\theta^s) = \sum_{c \in C} \frac{\delta|u_c| \neq 0}{(1-\alpha)} \left( d + \frac{\exp(\theta^s) \tilde{F} + 1}{F} \bar{\mathbf{r}}_0^{c,s} \right. \\ \left. + \frac{(1-\exp(\theta^s)) \tilde{F} + 1}{F} \bar{\mathbf{r}}_1^{c,s} \right)^{1-\alpha} \quad (33) $$

For this scenario, the optimization problem (OPT) and the Lagrangian (24) can be rewritten as in (34a) and (35) where $\lambda \in \mathbb{R}_+$ is a Lagrange multiplier.

$$ \min_{\theta^s} \quad -X_s^{\alpha}(\theta^s) \quad (34a) $$

$$ \text{subject to} \quad \exp(\theta^s) \le 1. \quad (34b) $$

$$ L(\theta^s, \lambda) = -X_s^{\alpha}(\theta^s) + \lambda(\exp(\theta^s) - 1) \quad (35) $$

From the Karush-Kuhn-Tucker (KKT) conditions, we know that if $\theta^*$ and $\lambda^*$ minimize $L(\theta^s, \lambda)$, then the two following conditions are satisfied.

$$ \frac{\partial X_s^{\alpha}}{\partial \theta^s}(\theta^*) - \lambda^* \exp(\theta^*) = 0 \quad (36) $$

$$ \lambda^* (\exp(\theta^*) - 1) = 0 \quad (37) $$

The first condition (36) imposes the gradient of $L(\theta^s, \lambda^*)$ to vanish at $\theta^*$ whereas the second condition (37) derives from complementary-slackness [23]. Solving the problem (34a) is equivalent to solving $\frac{\partial X_s^{\alpha}}{\partial \theta^s}(\theta^*) = 0$. The optimal amount of resources to allocate to precoder $C_{.,0}$, namely $q^* = \exp(\theta^*)$ has the closed form

$$ q^* = \frac{B_s^{\alpha} + (\tilde{F} + 1)\bar{\mathbf{r}}_1^{1,s} + \bar{\mathbf{r}}_0^{1,s} - A_s^{\alpha} (\bar{\mathbf{r}}_0^{0,s} + \bar{\mathbf{r}}_1^{0,s} (\tilde{F} + 1))}{\tilde{F} (A_s^{\alpha} (\bar{\mathbf{r}}_0^{0,s} - \bar{\mathbf{r}}_1^{0,s}) + (\bar{\mathbf{r}}_1^{1,s} - \bar{\mathbf{r}}_0^{1,s}))} \quad (38) $$

where $A_s^{\alpha} = \left( \frac{\delta|u_1| \neq 0 (\bar{\mathbf{r}}_1^{1,s} - \bar{\mathbf{r}}_0^{1,s})}{\delta|u_0| \neq 0 (\bar{\mathbf{r}}_0^{0,s} - \bar{\mathbf{r}}_1^{0,s})} \right)^{\frac{1}{\alpha}}$ and $B_s^{\alpha} = Fd(1 - A_s^{\alpha})$. The term $\rho_i^s = (\bar{\mathbf{r}}_i^{1,s} - \bar{\mathbf{r}}_j^{1,s})$, $i \in C, j \in C \setminus \{i\}$, appearing in (38) is the gain perceived by UEs from $\mathcal{U}_i$ when they are served by $C_{.,i}$ instead of $C_{.,j}$. Indeed, $\rho_i^s$ is non-negative since UEs from $\mathcal{U}_i$ experience better rates when they are served by $C_{.,i}$ than by $C_{.,j}$. Since $f(y) = y^{\frac{1}{\alpha}}$ is a strictly increasing function for
fair UEs' scheduling. The RIS is configured following a predetermined sequence of precoders drawn from a codebook which is designed thanks to a new RIS beam synthesis method. We have proposed a SA algorithm that adapts the precoders sequence to the UEs' distribution so as to optimize their performance. We have especially proven the convergence of the algorithm iterates to the optimal sequence. The solution fairness has been achieved by adapting the PF scheduler to the RIS configuration scheme. The optimized solution achieves a gain of 47% compared to a baseline solution with Round-Robin scheduler combined with a non-optimized sequence of precoders for RIS configuration. The optimized precoders sequence can be computed within a radio controller such as, e.g., a mobile edge computing one, and transmitted to the RIS over a management interface that needs to be standardized. Further, we consider extending our joint BS and RIS configuration scheme to multi-cell scenarios with multiple RISs. The deployment of efficient RIS-assisted communication systems in such scenarios especially requires to solve important RIS positioning problems.

# APPENDIX

## A. Proof of Proposition 1

Without loss of generality, only the case where $\alpha \in \mathbb{R}_+ \setminus \{1\}$ is considered in this proof. It is noted that the same methodology can be used to address the case where $\alpha = 1$.

We first prove that the sub-utility function $Y_{c,s}^{\alpha}(\theta^s), c \in C$, is concave in $\theta^s$ for $\alpha \in \mathbb{R}_+ \setminus \{1\}$. We also prove that $Y_{c,s}^{\alpha}(\theta^s)$ is strictly concave in $\theta^s$ for $\alpha \in \mathbb{R}_{+*} \setminus \{1\}$.

$$Y_{c,s}^{\alpha}(\theta^s) = \frac{\delta|u_c| \neq 0}{1-\alpha} \left( d + \sum_{i \in C} \left[ \frac{\exp(\theta_i^s) \tilde{F} + 1}{F} \right] \bar{\mathbf{r}}_i^{c,s} \right)^{1-\alpha} . \quad (30)$$

Thanks to the second order conditions [23, §3.6.4], we know that if $Y_{c,s}^{\alpha} : (-\infty, \infty)^{N_c} \to \mathbb{R}$ is a twice differentiable multivariate function and that its domain is convex, it is sufficient to show that its hessian is semi-negative definite (i.e., $\nabla^2 Y_{c,s}^{\alpha}(\theta^s) \le 0$) for all $\theta^s$ and $\alpha \in \mathbb{R}_+ \setminus \{1\}$ in order to prove concavity. Under the same conditions, it is sufficient to show that the hessian $\nabla^2 Y_{c,s}^{\alpha}(\theta^s)$ is negative definite (i.e., $\nabla^2 Y_{c,s}^{\alpha}(\theta^s) < 0$) for all $\theta^s \neq 0$ and $\alpha \in \mathbb{R}_{+*} \setminus \{1\}$ in order to prove strict concavity.

Since $\nabla^2 Y_{c,s}^{\alpha}(\theta^s)$ is a real symmetric matrix, its negative semi-definiteness (resp. definiteness) can be proven by showing that $\mathbf{x}^T \nabla^2 Y_{c,s}^{\alpha}(\theta^s) \mathbf{x} \le 0, \forall \mathbf{x} \in \mathbb{R}^{N_c} \text{ (resp. } \mathbf{x}^T \nabla^2 Y_{c,s}^{\alpha}(\theta^s) \mathbf{x} < 0, \forall \mathbf{x} \in \mathbb{R}^{N_c}_*)$.

The second order cross partial derivative of $Y_{c,s}^{\alpha}(\theta^s)$ can be expressed as follows

$$\frac{\partial^2 Y_{c,s}^{\alpha}}{\partial \theta_i^s \partial \theta_j^s}(\theta^s) = -\alpha \delta|u_c| \neq 0 \left(\frac{\tilde{F}}{F}\right)^2 \bar{\mathbf{r}}_i^{c,s} \bar{\mathbf{r}}_j^{c,s} \exp(\theta_i^s) \exp(\theta_j^s) \\ \times \left( d + \sum_{i \in C} \left[ \frac{\exp(\theta_i^s) \tilde{F} + 1}{F} \right] \bar{\mathbf{r}}_i^{c,s} \right)^{\alpha-1} . \quad (31)$$

Based on (31), $\mathbf{x}^T \nabla^2 Y_{c,s}^{\alpha}(\theta^s) \mathbf{x}$ can be expanded as follows

$$\mathbf{x}^T \nabla^2 Y_{c,s}^{\alpha}(\theta^s) \mathbf{x} = -\alpha \delta|u_c| \neq 0 \left[ \frac{\tilde{F}}{F} \sum_{i \in C} \mathbf{x}_i \bar{\mathbf{r}}_i^{c,s} \exp(\theta_i^s) \right]^2 \\ \times \left( d + \sum_{i \in C} \left[ \frac{\theta_i^s \tilde{F} + 1}{F} \right] \bar{\mathbf{r}}_i^{c,s} \right)^{\alpha-1} . \quad (32)$$

For all $\theta^s$ and $\alpha \in \mathbb{R}_+ \setminus \{1\}$ (resp. $\alpha \in \mathbb{R}_{+*} \setminus \{1\}$), it is straightforward to show that $\mathbf{x}^T \nabla^2 Y_{c,s}^{\alpha}(\theta^s) \mathbf{x} \le 0, \forall \mathbf{x} \in \mathbb{R}^{N_c} \text{ (resp. } \mathbf{x}^T \nabla^2 Y_{c,s}^{\alpha}(\theta^s) \mathbf{x} < 0, \forall \mathbf{x} \in \mathbb{R}^{N_c}_*)$. Therefore, $Y_{c,s}^{\alpha}(\theta^s)$ is concave (resp. strictly concave) for $\alpha \in \mathbb{R}_+ \setminus \{1\}$ (resp. $\alpha \in \mathbb{R}_{+*} \setminus \{1\}$). Finally, since $X_s^\alpha(\theta^s) = \sum_{c \in C} Y_{c,s}^\alpha(\theta^s)$, the result follows.

## B. Closed-form expression of $\theta^*$ for $\alpha > 0$ and $N_c = 2$

For $\alpha > 0$ and $N_c = 2$, (21) can be reformulated to (33) where $\theta^s$ reduces to a scalar and $\exp(\theta^s) \in [0, 1]$.

$$X_s^\alpha(\theta^s) = \sum_{c \in C} \frac{\delta|u_c| \neq 0}{(1-\alpha)} \left( d + \frac{\exp(\theta^s) \tilde{F} + 1}{F} \bar{\mathbf{r}}_0^{c,s} \right. \\ \left. + \frac{(1-\exp(\theta^s)) \tilde{F} + 1}{F} \bar{\mathbf{r}}_1^{c,s} \right)^{1-\alpha} \quad (33)$$

For this scenario, the optimization problem (OPT) and the Lagrangian (24) can be rewritten as in (34a) and (35) where $\lambda \in \mathbb{R}_+$ is a Lagrange multiplier.

$$\min_{\theta^s} \quad -X_s^\alpha(\theta^s) \quad (34a)$$

$$\text{subject to} \quad \exp(\theta^s) \le 1. \quad (34b)$$

$$L(\theta^s, \lambda) = -X_s^\alpha(\theta^s) + \lambda(\exp(\theta^s) - 1) \quad (35)$$

From the Karush-Kuhn-Tucker (KKT) conditions, we know that if $\theta^*$ and $\lambda^*$ minimize $L(\theta^s, \lambda)$, then the two following conditions are satisfied.

$$\frac{\partial X_s^\alpha}{\partial \theta^s}(\theta^*) - \lambda^* \exp(\theta^*) = 0 \quad (36)$$

$$\lambda^* (\exp(\theta^*) - 1) = 0 \quad (37)$$

The first condition (36) imposes the gradient of $L(\theta^s, \lambda^*)$ to vanish at $\theta^*$ whereas the second condition (37) derives from complementary-slackness [23]. Solving the problem (34a) is equivalent to solving $\frac{\partial X_s^\alpha}{\partial \theta^s}(\theta^*) = 0$. The optimal amount of resources to allocate to precoder $C_{.,0}$, namely $q^* = \exp(\theta^*)$ has the closed form

$$q^* = \frac{B_s^\alpha + (\tilde{F} + 1)\bar{\mathbf{r}}_1^{1,s} + \bar{\mathbf{r}}_0^{1,s} - A_s^\alpha (\bar{\mathbf{r}}_0^{0,s} + \bar{\mathbf{r}}_1^{0,s} (\tilde{F} + 1))}{\tilde{F} (A_s^\alpha (\bar{\mathbf{r}}_0^{0,s} - \bar{\mathbf{r}}_1^{0,s}) + (\bar{\mathbf{r}}_1^{1,s} - \bar{\mathbf{r}}_0^{1,s}))} \quad (38)$$

where $A_s^\alpha = \left( \frac{\delta|u_1| \neq 0 (\bar{\mathbf{r}}_1^{1,s} - \bar{\mathbf{r}}_0^{1,s})}{\delta|u_0| \neq 0 (\bar{\mathbf{r}}_0^{0,s} - \bar{\mathbf{r}}_1^{0,s})} \right)^{\frac{1}{\alpha}}$ and $B_s^\alpha = F d(1 - A_s^\alpha)$. The term $\rho_i^s = (\bar{\mathbf{r}}_i^{1,s} - \bar{\mathbf{r}}_j^{1,s})$, $i \in C, j \in C \setminus \{i\}$, appearing in (38) is the gain perceived by UEs from $\mathcal{U}_i$ when they are served by $C_{.,i}$ instead of $C_{.,j}$. Indeed, $\rho_i^s$ is non-negative since UEs from $\mathcal{U}_i$ experience better rates when they are served by $C_{.,i}$ than by $C_{.,j}$. Since $f(y) = y^{\frac{1}{\alpha}}$ is a strictly increasing function for
$y \in \mathbb{R}_+$ and $\alpha > 0$, $A_s^\alpha$ and $\frac{\rho_0^s}{\rho_0^\alpha}$ have same variations. Finally, $q^*$ increases (resp. decreases) if $\frac{\rho_0^s}{\rho_0^\alpha}$ decreases (resp. increases) over time, so that the optimal amount of resources to allocate to $C_{.,0}$ should be high (resp. low) if $C_{.,0}$ (resp. $C_{.,1}$) enhances by a larger extent UEs' performance than $C_{.,1}$ (resp. $C_{.,0}$).

### C. Proof of Theorem 1

*Proof:* The proof of convergence of the iterates of the primal-dual algorithm (25a) to the optimal solution of problem (OPT) is based on the ODE method for SAs. Its application requires to verify the assumptions of Theorem 2.1 in [21]. These assumptions will be verified for the update rule associated to primal variable $\theta^s$. They can be verified in the same way for the update rule associated to the dual variable $\lambda$, but will be omitted for sake of space.

We first rewrite the update rule (25a) as $\theta_c^{s+1} = \theta_c^s + \eta^s(y_c^s + z_c^s)$, where $z_c^s \in \mathbb{R}^{N_c}$ corresponds to a projection error and the $c$-th term of $y^s \in \mathbb{R}^{N_c}$ can be expended as follows

$$ \mathbf{y}_c^s = \frac{\partial L}{\partial \theta_c^s}(\theta^s, \lambda^s) + \omega_c^s + \beta_c^s. \quad (39) $$

In (39), $\beta^s \in \mathbb{R}^{N_c}$ corresponds to a possibly non zero-mean noise, i.e., a bias noise, whereas $\omega^s \in \mathbb{R}^{N_c}$ is a zero-mean martingale noise. We can express the bias noise as follows

$$ \begin{aligned} \boldsymbol{\beta}_c^s = \mathbb{E}_s \left[ \frac{\partial \hat{L}}{\partial \theta_c^s}(\boldsymbol{\theta}^s, \lambda^s) \middle| (\boldsymbol{\theta}^0, \lambda^0), \frac{\partial \hat{L}}{\partial \theta_c^s}(\boldsymbol{\theta}^k, \lambda^k), k < s \right] \quad (40) \\ - \frac{\partial L}{\partial \theta_c^s}(\boldsymbol{\theta}^s, \lambda^s) = f_c(\boldsymbol{\theta}^s, \hat{\mathbf{r}}^s) - f_c(\boldsymbol{\theta}^s, \bar{\mathbf{r}}^s). \end{aligned} $$

Preliminary, we observe that rate $\bar{\mathbf{r}}_c^{u,s}$, $c \in C$ experienced by an UE $u$ is upper-bounded by a constant, i.e., the rate associated to the highest MCS. Since the number of UEs is finite, this holds also for the estimates $\hat{\mathbf{r}}^s$. The Lagrangian appearing in $\beta^s$ is a continuously differentiable function of $\hat{\mathbf{r}}^s$, taking values in a compact set and hence uniformly Lipschitz continuous therein. Therefore there exists a constant $L > 0$ so that $\forall \hat{\mathbf{r}}^s, \bar{\mathbf{r}}^s$, $||\beta^s(\hat{\mathbf{r}}^s) - \beta^s(\bar{\mathbf{r}}^s)|| \le L||\hat{\mathbf{r}}^s - \bar{\mathbf{r}}^s|| = L||\zeta^s||$.

Next, we verify the assumptions of Theorem 2.1 in [21]

A1) $\sup_s \mathbb{E}[|\mathbf{y}_c^s|^2] < \infty$, $\forall c \in C$: this condition is verified since the instantaneous rates $r_{u,t}^{b,c(t)}$ are assumed to be finite with probability 1 (w.p.1).

A2) There is a measurable function $f_c(\cdot)$ of $(\theta^s, \bar{\mathbf{r}}^s)$ and random variables $\beta_c^s$ such that $\mathbb{E}_s[\mathbf{y}_c^s|\theta^0, \mathbf{y}_c^k, k < s] = f_c(\theta^s, \bar{\mathbf{r}}^s) + \beta_c^s$. The assumption is automatically verified by construction for equation (40), where $f_c(\theta^s, \bar{\mathbf{r}}^s) = \frac{\partial L}{\partial \theta_c^s}(\theta^s, \lambda^s)$.

A3) The function $f_c(\cdot)$ is continuous: it holds since the Lagrangian is continuously differentiable.

A4) From (29): it holds by assumption.

A5) $\forall c \in C$, $\sum_s \eta^s |\boldsymbol{\beta}_c^s| < \infty$: we know that $|\boldsymbol{\beta}_c^s| \le L||\zeta^s||$. Hence, it is sufficient to prove that $\sum_s \eta^s ||\zeta^s|| < \infty$, which holds by assumption on the properties of the estimation error.

Once the assumptions of Theorem 2.1 in [21] are verified, the ODE method can be used to prove that the trajectories of (25a) are guaranteed to converge w.p.1 to an invariant set of

$$ \dot{\boldsymbol{\theta}} = -\frac{\partial L}{\partial \boldsymbol{\theta}}(\boldsymbol{\theta}, \lambda), \quad \lambda = \sum_{c \in C} \exp(\theta_c) - 1. \quad (41) $$

In particular, in order to grant convergence to the optimal solution it is sufficient to enlist the following observations. First, since the ODE (41) is Lipschitz continuous, the solution is unique. Second, a restpoint of (41) must verify the first-order KKT conditions of (36) and the complementary slackness conditions (37). Therefore, a restpoint of (41) must coincide with the optimal solution of (OPT) so that the invariant set of the ODE (41) is formed by the optimal primal-dual variables. Theorem 2.1 in [21] states that the sample paths of the primal-dual dynamics (25a) converge with some probability to such restpoint. Third, because of asymptotic stability of the restpoint with respect to (41), the sample paths of the primal-dual dynamics converge almost surely to the restpoint of (41) for any initial condition in the stability set. Finally, the strict convexity of the Lagrangian [22] ensures the Lyapunov condition for asymptotic stability of a restpoint is verified for the primal-dual trajectory in (41), which ensures a.s. convergence for any initial condition. ■

### D. Proof of Theorem 2

*Proof:* Without loss of generality, we restrict to the case where $N_c = 1$ (single RIS precoder) and $U = 1$ (single UE). In this case, the bias error $\zeta^s$ reduces to a scalar $\zeta^s = \hat{\mathbf{r}}^s - \bar{\mathbf{r}}^s$ where $\hat{\mathbf{r}}^s = \frac{1}{s} \sum_{k=1}^s r_{1,k}^1$ and indeed $\sigma_\zeta^2 = \sigma_r^2/s$ where we have omitted the RIS and UE index. It is noted that the extension to the case where $N_c > 1$ and $U > 1$ is straightforward. The statement is proved for $\gamma = 1$; the extension for $\gamma \in (\frac{3}{4}, 1]$ follows from simple calculations. We shall prove that $\eta^s \zeta^s = o(1/s^{1+p})$, i.e., for a suitable $p > 0$ it holds $s^p \zeta^s \to 0$ w.p.1. The argument of the proof is based on the method of subsequences (see [24]) in order to apply the Borel-Cantelli Lemma to the events $E_s = \{s^p \zeta^s > \epsilon\}$ and prove that $\sum_{s=0}^{+\infty} P(E_s) < +\infty$. First, by using the Chebyshev's inequality we observe that for the subsequence of events of index $s = n^2$ we can write

$$ P(n^{2p} \zeta^{n^2} > \epsilon) \le \frac{1}{n^{2-4p}} \frac{\sigma_r^2}{\epsilon^2} \quad (42) $$

for all $\epsilon > 0$. By choosing $0 < p < 1/4$ it holds $n^{2p} \zeta^{n^2} \to 0$ w.p.1. Now, we can consider index set $k \in \mathcal{K}_{n^2} = \{n^2 \le k \le (n+1)^2\}$ and define

$$ F_{n^2} := \max_{k \in \mathcal{K}_{n^2}} |k^p \zeta^k - n^{2p} \zeta^{n^2}|. \quad (43) $$

The following facts hold for $k \in \mathcal{K}_{n^2}$:

$$ |k^p \zeta^k - n^{2p} \zeta^{n^2}| = |k^p \zeta^k - k^p \zeta^{n^2} + k^p \zeta^{n^2} - n^{2p} \zeta^{n^2}| \quad (44a) $$

$$ \le k^p |\zeta^k - \zeta^{n^2}| + (k^p - n^{2p}) |\zeta^{n^2}| \quad (44b) $$

so that $F_{n^2} \le F_{n^2}^{(a)} + F_{n^2}^{(b)}$ where $F_{n^2}^{(a)} := \max_{k \in \mathcal{K}_{n^2}} k^p |\zeta^k - \zeta^{n^2}|$

and $F_{n^2}^{(b)} := \max_{k \in \mathcal{K}_{n^2}} (k^p - n^{2p}) |\zeta^{n^2}|$. We shall prove next that $F_{n^2}^{(a)}$ and $F_{n^2}^{(b)}$ converge to 0 w.p.1. First we can observe that

$$ \zeta^k - \zeta^{n^2} = \left(\frac{n^2}{k} - 1\right) \zeta^{n^2} + \frac{1}{k} \sum_{h=n^2+1}^{k} \zeta^h \quad (45) $$
$y \in \mathbb{R}_+$ and $\alpha > 0$, $A_s^\alpha$ and $\frac{\rho_0^\beta}{\rho_0^\alpha}$ have same variations. Finally, $q^*$ increases (resp. decreases) if $\frac{\rho_0^\beta}{\rho_0^\alpha}$ decreases (resp. increases) over time, so that the optimal amount of resources to allocate to $C_{.,0}$ should be high (resp. low) if $C_{.,0}$ (resp. $C_{.,1}$) enhances by a larger extent UEs' performance than $C_{.,1}$ (resp. $C_{.,0}$).

### C. Proof of Theorem 1

*Proof:* The proof of convergence of the iterates of the primal-dual algorithm (25a) to the optimal solution of problem (OPT) is based on the ODE method for SAs. Its application requires to verify the assumptions of Theorem 2.1 in [21]. These assumptions will be verified for the update rule associated to primal variable $\theta^s$. They can be verified in the same way for the update rule associated to the dual variable $\lambda$, but will be omitted for sake of space.

We first rewrite the update rule (25a) as $\theta_c^{s+1} = \theta_c^s + \eta^s(y_c^s + z_c^s)$, where $z_c^s \in \mathbb{R}^{N_c}$ corresponds to a projection error and the $c$-th term of $y_c^s \in \mathbb{R}^{N_c}$ can be expended as follows

$$ \mathbf{y}_c^s = \frac{\partial L}{\partial \theta_c^s}(\theta^s, \lambda^s) + \omega_c^s + \beta_c^s. \quad (39) $$

In (39), $\beta^s \in \mathbb{R}^{N_c}$ corresponds to a possibly non zero-mean noise, i.e., a bias noise, whereas $\omega^s \in \mathbb{R}^{N_c}$ is a zero-mean martingale noise. We can express the bias noise as follows

$$ \begin{aligned} \boldsymbol{\beta}_c^s = \mathbb{E}_s \left[ \frac{\partial \hat{L}}{\partial \theta_c^s}(\boldsymbol{\theta}^s, \lambda^s) \middle| (\boldsymbol{\theta}^0, \lambda^0), \frac{\partial \hat{L}}{\partial \theta_c^s}(\boldsymbol{\theta}^k, \lambda^k), k < s \right] \quad (40) \\ - \frac{\partial L}{\partial \theta_c^s}(\boldsymbol{\theta}^s, \lambda^s) = f_c(\boldsymbol{\theta}^s, \hat{\mathbf{r}}^s) - f_c(\boldsymbol{\theta}^s, \bar{\mathbf{r}}^s). \end{aligned} $$

Preliminary, we observe that rate $\bar{\mathbf{r}}_c^{u,s}$, $c \in C$ experienced by an UE $u$ is upper-bounded by a constant, i.e., the rate associated to the highest MCS. Since the number of UEs is finite, this holds also for the estimates $\hat{\mathbf{r}}^s$. The Lagrangian appearing in $\beta^s$ is a continuously differentiable function of $\hat{\mathbf{r}}^s$, taking values in a compact set and hence uniformly Lipschitz continuous therein. Therefore there exists a constant $L > 0$ so that $\forall \hat{\mathbf{r}}^s, \bar{\mathbf{r}}^s$, $||\beta^s(\hat{\mathbf{r}}^s) - \beta^s(\bar{\mathbf{r}}^s)|| \le L||\hat{\mathbf{r}}^s - \bar{\mathbf{r}}^s|| = L||\zeta^s||$.

Next, we verify the assumptions of Theorem 2.1 in [21]

A1) $\sup_s \mathbb{E}[|\mathbf{y}_c^s|^2] < \infty$, $\forall c \in C$: this condition is verified since the instantaneous rates $r_{u,t}^{b,c(t)}$ are assumed to be finite with probability 1 (w.p.1).

A2) There is a measurable function $f_c(\cdot)$ of $(\theta^s, \bar{\mathbf{r}}^s)$ and random variables $\beta_c^s$ such that $\mathbb{E}_s[\mathbf{y}_c^s|\theta^0, \mathbf{y}_c^k, k < s] = f_c(\theta^s, \bar{\mathbf{r}}^s) + \beta_c^s$. The assumption is automatically verified by construction for equation (40), where $f_c(\theta^s, \bar{\mathbf{r}}^s) = \frac{\partial L}{\partial \theta_c^s}(\theta^s, \lambda^s)$.

A3) The function $f_c(\cdot)$ is continuous: it holds since the Lagrangian is continuously differentiable.

A4) From (29): it holds by assumption.

A5) $\forall c \in C$, $\sum_s \eta^s |\boldsymbol{\beta}_c^s| < \infty$: we know that $|\boldsymbol{\beta}_c^s| \le L||\zeta^s||$. Hence, it is sufficient to prove that $\sum_s \eta^s ||\zeta^s|| < \infty$, which holds by assumption on the properties of the estimation error.

Once the assumptions of Theorem 2.1 in [21] are verified, the ODE method can be used to prove that the trajectories of (25a) are guaranteed to converge w.p.1 to an invariant set of

$$ \dot{\boldsymbol{\theta}} = -\frac{\partial L}{\partial \boldsymbol{\theta}}(\boldsymbol{\theta}, \lambda), \quad \lambda = \sum_{c \in C} \exp(\boldsymbol{\theta}_c) - 1. \quad (41) $$

In particular, in order to grant convergence to the optimal solution it is sufficient to enlist the following observations. First, since the ODE (41) is Lipschitz continuous, the solution is unique. Second, a restpoint of (41) must verify the first-order KKT conditions of (36) and the complementary slackness conditions (37). Therefore, a restpoint of (41) must coincide with the optimal solution of (OPT) so that the invariant set of the ODE (41) is formed by the optimal primal-dual variables. Theorem 2.1 in [21] states that the sample paths of the primal-dual dynamics (25a) converge with some probability to such restpoint. Third, because of asymptotic stability of the restpoint with respect to (41), the sample paths of the primal-dual dynamics converge almost surely to the restpoint of (41) for any initial condition in the stability set. Finally, the strict convexity of the Lagrangian [22] ensures the Lyapunov condition for asymptotic stability of a restpoint is verified for the primal-dual trajectory in (41), which ensures a.s. convergence for any initial condition. ■

### D. Proof of Theorem 2

*Proof:* Without loss of generality, we restrict to the case where $N_c = 1$ (single RIS precoder) and $U = 1$ (single UE). In this case, the bias error $\zeta^s$ reduces to a scalar $\zeta^s = \hat{\mathbf{r}}^s - \bar{\mathbf{r}}^s$ where $\hat{\mathbf{r}}^s = \frac{1}{s} \sum_{k=1}^s r_{1,k}^1$ and indeed $\sigma_\zeta^2 = \sigma_r^2/s$ where we have omitted the RIS and UE index. It is noted that the extension to the case where $N_c > 1$ and $U > 1$ is straightforward. The statement is proved for $\gamma = 1$; the extension for $\gamma \in (\frac{3}{4}, 1]$ follows from simple calculations. We shall prove that $\eta^s \zeta^s = o(1/s^{1+p})$, i.e., for a suitable $p > 0$ it holds $s^p \zeta^s \to 0$ w.p.1. The argument of the proof is based on the method of subsequences (see [24]) in order to apply the Borel-Cantelli Lemma to the events $E_s = \{s^p \zeta^s > \epsilon\}$ and prove that $\sum_{s=0}^{+\infty} P(E_s) < +\infty$. First, by using the Chebyshev's inequality we observe that for the subsequence of events of index $s = n^2$ we can write

$$ P(n^{2p} \zeta^{n^2} > \epsilon) \le \frac{1}{n^{2-4p}} \frac{\sigma_r^2}{\epsilon^2} \quad (42) $$

for all $\epsilon > 0$. By choosing $0 < p < 1/4$ it holds $n^{2p} \zeta^{n^2} \to 0$ w.p.1. Now, we can consider index set $k \in \mathcal{K}_{n^2} = \{n^2 \le k \le (n+1)^2\}$ and define

$$ F_{n^2} := \max_{k \in \mathcal{K}_{n^2}} |k^p \zeta^k - n^{2p} \zeta^{n^2}|. \quad (43) $$

The following facts hold for $k \in \mathcal{K}_{n^2}$:

$$ |k^p \zeta^k - n^{2p} \zeta^{n^2}| = |k^p \zeta^k - k^p \zeta^{n^2} + k^p \zeta^{n^2} - n^{2p} \zeta^{n^2}| \quad (44a) $$

$$ \le k^p |\zeta^k - \zeta^{n^2}| + (k^p - n^{2p}) |\zeta^{n^2}| \quad (44b) $$

so that $F_{n^2} \le F_{n^2}^{(a)} + F_{n^2}^{(b)}$ where $F_{n^2}^{(a)} := \max_{k \in \mathcal{K}_{n^2}} k^p |\zeta^k - \zeta^{n^2}|$

and $F_{n^2}^{(b)} := \max_{k \in \mathcal{K}_{n^2}} (k^p - n^{2p}) |\zeta^{n^2}|$. We shall prove next that $F_{n^2}^{(a)}$ and $F_{n^2}^{(b)}$ converge to 0 w.p.1. First we can observe that

$$ \zeta^k - \zeta^{n^2} = \left(\frac{n^2}{k} - 1\right) \zeta^{n^2} + \frac{1}{k} \sum_{h=n^2+1}^{k} \zeta^h \quad (45) $$
where the first and second terms of the sum which appear at the RHS are independent so that

$$ \operatorname{var}(\zeta^k - \zeta^{n^2}) = \left(\frac{n^2}{k} - 1\right)^2 \frac{1}{n^2} \sigma_r^2 + \frac{(k-n^2)}{k^2} \sigma_r^2 \quad (46a) $$

$$ = \sigma_r^2 \left( \frac{1}{n^2} - \frac{1}{k} \right) \le \sigma_r^2 \left( \frac{1}{n^2} - \frac{1}{(n+1)^2} \right). \quad (46b) $$

Based on (46b) and using the Chebyshev's inequality it holds

$$ P(k^p | \zeta^k - \zeta^{n^2} | > \epsilon) \le \frac{k^{2p} \sigma_r^2}{\epsilon^2} \left( \frac{1}{n^2} - \frac{1}{(n+1)^2} \right) \le \frac{\sigma_r^2}{\epsilon^2 k^{2-2p}} \quad (47) $$

from which for all $k \in \mathcal{K}_{n^2}$ it holds $\sum_{n^2} P(k^p | \zeta^k - \zeta^{n^2} | > \epsilon) < +\infty$ so that $F_{n^2}^{(a)}$ converges to 0 w.p.1. Furthermore, we can observe that $k^p - n^{2p} \le (n+1)^p - n^p$ so that

$$ P((k^p - n^{2p}) | \zeta^{n^2} | > \epsilon) \le \frac{\sigma_r^2 ((n+1)^p - n^p)^2}{\epsilon^2 n^2} \sim \frac{\sigma_r^2}{\epsilon^2 n^{2-2p}} \quad (48) $$

Noting that the last term is convergent for $0 < p < 1/4$: by comparison the series with terms $F_{n^2}^{(b)}$ converges to 0 w.p.1. It hence holds $F_{n^2} \to 0$ w.p.1.

Finally we can observe that for any $k \in \mathbb{N}$

$$ |k^p \zeta^k| = |k^p \zeta^k - n^{2p} \zeta^{n^2} + n^{2p} \zeta^{n^2}| \quad (49a) $$

$$ \le |k^p \zeta^k - n^{2p} \zeta^{n^2}| + |n^{2p} \zeta^{n^2}| \quad (49b) $$

$$ \le |F_{n^2}| + |n^{2p} \zeta^{n^2}|. \quad (49c) $$

Now by observing that $\{|k^p \zeta^k| > \epsilon\} \subseteq \{|F_{n^2}| + |n^{2p} \zeta^{n^2}| > \epsilon\}$ the thesis follows since both $F_{n^2}$ and $n^{2p} \zeta^{n^2}$ converge to 0 w.p.1. ■

### E. Rank minimization for RIS beam synthesis

As mentioned previously, the problem (11a) is not convex because of the rank-one constraint. In this work, we propose to use a rank minimization method that generalizes the trace heuristic [23]. This method consists in iteratively solving the two convex problems (50a) and (51a) until convergence. In both problems, $\mathbf{W}$ is a direction matrix $\mathbf{X}^*$ and $\mathbf{W}^*$ correspond to the optimal solutions of the first and the second problem.

$$ \min_{\mathbf{X} \in \mathcal{S}^{2N}} \operatorname{Tr}(\mathbf{W}^* \mathbf{X}) \quad (50a) $$

$$ \text{subject to} \quad \operatorname{Tr}(\mathbf{Q}^i \mathbf{X}) \in \mathcal{S}^i \text{ for } i \in \mathcal{I} \quad (50b) $$

$$ \operatorname{Tr}(\mathbf{O}^n \mathbf{X}) = 1 \quad \text{for } n \in \mathcal{N} \quad (50c) $$

$$ \mathbf{X} \ge 0 \quad (50d) $$

$$ \min_{\mathbf{W} \in \mathcal{S}^{2N}} \operatorname{Tr}(\mathbf{W}\mathbf{X}^*) \quad (51a) $$

$$ \text{subject to} \quad 0 \le \mathbf{W} \le \mathbf{I}_{2N} \quad (51b) $$

$$ \operatorname{Tr}(\mathbf{W}) = N - 1 \quad (51c) $$

Note that finding a rank-one solution to the problem (50a) is subject to the existence of such solution in the convex set (50b), (51c), (50d). Note also that only local optimality convergence of problems (50a) and (51a) iterates is guaranteed as proved in [23, §4.4.1]. Therefore, finding a rank-one solution or even a low-rank solution is not guaranteed. In this case, a

feasible vector $\tilde{\psi} \in \mathbb{C}^N$ can be computed from a rank-one approximation of $\mathbf{X}^*$ as $\tilde{\psi} = \sqrt{\sigma} \mathbf{u}$ where $\sigma$ and $\mathbf{u} \in \mathbb{C}^N$ are the largest eigenvalue of $\mathbf{X}$ and the associated eigen vector.

### REFERENCES

[1] N. Rajatheva, I. Atzeni, E. Bjornson, et al. "White paper on broadband connectivity in 6G", arXiv preprint arXiv:2004.14247, 2020.

[2] M. di Renzo, A. Zappone, M. Debbah, et al. "Smart radio environments empowered by reconfigurable intelligent surfaces: How it works, state of research, and road ahead", arXiv preprint arXiv:2004.09352, 2020.

[3] C. Huang, A. Zappone, M. Debbah, et al. "Achievable rate maximization by passive intelligent mirrors." in Proc. of IEEE ICASSP, 2018.

[4] M. Jung, W. Saad, M. Debbah, et al. "On the optimality of reconfigurable intelligent surfaces (RISs): Passive beamforming, modulation, and resource allocation." arXiv preprint arXiv:1910.00968, 2019.

[5] X. Cao, B. Yang, C. Huang, et al. "Massive access of static and mobile users via reconfigurable intelligent surfaces: Protocol design and performance analysis." IEEE Journal on Selected Areas in Communications, 2022, vol. 40, no 4, p. 1253-1269.

[6] A. Dejonghe, Z. Altman, F. De Pellegrini, et al. "A Lightweight Joint RIS/BS Configuration Scheme". In: 2022 1st International Conference on 6G Networking (6GNet). IEEE, 2022. p. 1-8.

[7] E.M. Mohamed, S. Hashima, K. Hatano, et al. "Two-Stage Multiarmed Bandit for Reconfigurable Intelligent Surface Aided Millimeter Wave Communications". Sensors, 2022, vol. 22, no 6, p. 2179.

[8] Ö. Özdoğan et E. Björnson. "Deep learning-based phase reconfiguration for intelligent reflecting surfaces". In: 2020 54th Asilomar Conference on Signals, Systems, and Computers. IEEE, 2020. p. 707-711.

[9] G. Lee, M. Jung, A. Kasgari, et al. "Deep reinforcement learning for energy-efficient networking with reconfigurable intelligent surfaces". In: ICC 2020-2020 IEEE International Conference on Communications (ICC). IEEE, 2020. p. 1-6.

[10] S. Li, B. Duo, X. Yuan, et al. "Reconfigurable intelligent surface assisted UAV communication: Joint trajectory design and passive beamforming". IEEE Wireless Communications Letters, 2020, vol. 9, no 5, p. 716-720.

[11] Y. Han, W. Tang, S. Jin, et al. "Large intelligent surface-assisted wireless communication exploiting statistical CSI". IEEE Transactions on Vehicular Technology, 2019, vol. 68, no 8, p. 8238-8242.

[12] Q. Qingqing et R. Zhang. "Intelligent reflecting surface enhanced wireless network via joint active and passive beamforming". IEEE transactions on wireless communications, 2019, vol. 18, no 11, p. 5394-5409.

[13] Z. Wang, L. Liu, et S. Cui. "Channel estimation for intelligent reflecting surface assisted multiuser communications: Framework, algorithms, and analysis". IEEE Transactions on Wireless Communications, 2020, vol. 19, no 10, p. 6607-6620.

[14] "Channel model(s) for 0.5-100 GHz," 3GPP, Sophia Antipolis Cedex, France, TR 38.901., Jun. 2018. [Online]. Available: www.3gpp.org.

[15] H. Asplund, D. Astely, P. Von Butovitsch, et al. "Advanced Antenna Systems for 5G Network Deployments: Bridging the Gap Between Theory and Practice". Academic Press, 2020.

[16] 3GPP TS 38.213: "NR; Physical layer procedures for control".

[17] 3GPP TS 38.214: "NR; Physical layer procedures for data".

[18] B. Fuchs. "Application of convex relaxation to array synthesis problems". IEEE Trans. on Anten. and Propagation, 2013, vol. 62, no 2.

[19] R. Combes et al., "Scheduling gain for frequency-selective Rayleigh fading channels with application to self-organizing packet scheduling," Elsevier Performance Evaluation, Vol. 68, Issue 8, Aug 2011.

[20] S. Boyd and S. Vaderberghe. "Convex Optimization" Cambridge University Press, 2004.

[21] H. Kushner et G. Yin. "Stochastic approximation and recursive algorithms and applications". Springer Science and Business Media, 2003.

[22] A. Cherukuri et al., "Asymptotic convergence of constrained primal-dual dynamics". Systems and Control Letters, 2016, vol. 87, p. 10-15.

[23] J. Dattorro. "Convex optimization and Euclidean distance geometry". Lulu. com, 2010.

[24] J. Davidson. "Stochastic Limit Theory: and Introduction for Economicians". Oxford University Press, 1994.
where the first and second terms of the sum which appear at the RHS are independent so that

$$ \mathrm{var}(\zeta^k - \zeta^{n^2}) = \left(\frac{n^2}{k} - 1\right)^2 \frac{1}{n^2} \sigma_r^2 + \frac{(k-n^2)}{k^2} \sigma_r^2 \quad (46a) $$

$$ = \sigma_r^2 \left( \frac{1}{n^2} - \frac{1}{k} \right) \le \sigma_r^2 \left( \frac{1}{n^2} - \frac{1}{(n+1)^2} \right). \quad (46b) $$

Based on (46b) and using the Chebyshev's inequality it holds

$$ P(k^p | \zeta^k - \zeta^{n^2} | > \epsilon) \le \frac{k^{2p} \sigma_r^2}{\epsilon^2} \left( \frac{1}{n^2} - \frac{1}{(n+1)^2} \right) \le \frac{\sigma_r^2}{\epsilon^2 k^{2-2p}} \quad (47) $$

from which for all $k \in \mathcal{K}_{n^2}$ it holds $\sum_{n^2} P(k^p | \zeta^k - \zeta^{n^2} | > \epsilon) < +\infty$ so that $F_{n^2}^{(a)}$ converges to 0 w.p.1. Furthermore, we can observe that $k^p - n^{2p} \le (n+1)^p - n^p$ so that

$$ P((k^p - n^{2p}) | \zeta^{n^2} | > \epsilon) \le \frac{\sigma_r^2 ((n+1)^p - n^p)^2}{\epsilon^2 n^2} \sim \frac{\sigma_r^2}{\epsilon^2 n^{2-2p}} \quad (48) $$

Noting that the last term is convergent for $0 < p < 1/4$: by comparison the series with terms $F_{n^2}^{(b)}$ converges to 0 w.p.1. It hence holds $F_{n^2} \to 0$ w.p.1.

Finally we can observe that for any $k \in \mathbb{N}$

$$ |k^p \zeta^k| = |k^p \zeta^k - n^{2p} \zeta^{n^2} + n^{2p} \zeta^{n^2}| \quad (49a) $$

$$ \le |k^p \zeta^k - n^{2p} \zeta^{n^2}| + |n^{2p} \zeta^{n^2}| \quad (49b) $$

$$ \le |F_{n^2}| + |n^{2p} \zeta^{n^2}|. \quad (49c) $$

Now by observing that $\{|k^p \zeta^k| > \epsilon\} \subseteq \{|F_{n^2}| + |n^{2p} \zeta^{n^2}| > \epsilon\}$ the thesis follows since both $F_{n^2}$ and $n^{2p} \zeta^{n^2}$ converge to 0 w.p.1. ■

### E. Rank minimization for RIS beam synthesis

As mentioned previously, the problem (11a) is not convex because of the rank-one constraint. In this work, we propose to use a rank minimization method that generalizes the trace heuristic [23]. This method consists in iteratively solving the two convex problems (50a) and (51a) until convergence. In both problems, $\mathbf{W}$ is a direction matrix $\mathbf{X}^*$ and $\mathbf{W}^*$ correspond to the optimal solutions of the first and the second problem.

$$ \min_{\mathbf{X} \in \mathcal{S}^{2N}} \mathrm{Tr}(\mathbf{W}^* \mathbf{X}) \quad (50a) $$

$$ \text{subject to} \quad \mathrm{Tr}(\mathbf{Q}^i \mathbf{X}) \in \mathcal{S}^i \text{ for } i \in \mathcal{I} \quad (50b) $$

$$ \mathrm{Tr}(\mathbf{O}^n \mathbf{X}) = 1 \quad \text{for } n \in \mathcal{N} \quad (50c) $$

$$ \mathbf{X} \ge 0 \quad (50d) $$

$$ \min_{\mathbf{W} \in \mathcal{S}^{2N}} \mathrm{Tr}(\mathbf{W}\mathbf{X}^*) \quad (51a) $$

$$ \text{subject to} \quad 0 \le \mathbf{W} \le \mathbf{I}_{2N} \quad (51b) $$

$$ \mathrm{Tr}(\mathbf{W}) = N - 1 \quad (51c) $$

Note that finding a rank-one solution to the problem (50a) is subject to the existence of such solution in the convex set (50b), (51c), (50d). Note also that only local optimality convergence of problems (50a) and (51a) iterates is guaranteed as proved in [23,§4.4.1]. Therefore, finding a rank-one solution or even a low-rank solution is not guaranteed. In this case, a

feasible vector $\tilde{\psi} \in \mathbb{C}^N$ can be computed from a rank-one approximation of $\mathbf{X}^*$ as $\tilde{\psi} = \sqrt{\sigma} \mathbf{u}$ where $\sigma$ and $\mathbf{u} \in \mathbb{C}^N$ are the largest eigenvalue of $\mathbf{X}$ and the associated eigen vector.

### REFERENCES

[1] N. Rajatheva, I. Atzeni, E. Bjornson, et al. "White paper on broadband connectivity in 6G", arXiv preprint arXiv:2004.14247, 2020.

[2] M. di Renzo, A. Zappone, M. Debbah, et al. "Smart radio environments empowered by reconfigurable intelligent surfaces: How it works, state of research, and road ahead", arXiv preprint arXiv:2004.09352, 2020.

[3] C. Huang, A. Zappone, M. Debbah, et al. "Achievable rate maximization by passive intelligent mirrors." in Proc. of IEEE ICASSP, 2018.

[4] M. Jung, W. Saad, M. Debbah, et al. "On the optimality of reconfigurable intelligent surfaces (RISs): Passive beamforming, modulation, and resource allocation." arXiv preprint arXiv:1910.00968, 2019.

[5] X. Cao, B. Yang, C. Huang, et al. "Massive access of static and mobile users via reconfigurable intelligent surfaces: Protocol design and performance analysis." IEEE Journal on Selected Areas in Communications, 2022, vol. 40, no 4, p. 1253-1269.

[6] A. Dejonghe, Z. Altman, F. De Pellegrini, et al. "A Lightweight Joint RIS/BS Configuration Scheme". In: 2022 1st International Conference on 6G Networking (6GNet). IEEE, 2022. p. 1-8.

[7] E.M. Mohamed, S. Hashima, K. Hatano, et al. "Two-Stage Multiarmed Bandit for Reconfigurable Intelligent Surface Aided Millimeter Wave Communications". Sensors, 2022, vol. 22, no 6, p. 2179.

[8] Ö. Özdoğan et E. Björnson. "Deep learning-based phase reconfiguration for intelligent reflecting surfaces". In: 2020 54th Asilomar Conference on Signals, Systems, and Computers. IEEE, 2020. p. 707-711.

[9] G. Lee, M. Jung, A. Kasgari, et al. "Deep reinforcement learning for energy-efficient networking with reconfigurable intelligent surfaces". In: ICC 2020-2020 IEEE International Conference on Communications (ICC). IEEE, 2020. p. 1-6.

[10] S. Li, B. Duo, X. Yuan, et al. "Reconfigurable intelligent surface assisted UAV communication: Joint trajectory design and passive beamforming". IEEE Wireless Communications Letters, 2020, vol. 9, no 5, p. 716-720.

[11] Y. Han, W. Tang, S. Jin, et al. "Large intelligent surface-assisted wireless communication exploiting statistical CSI". IEEE Transactions on Vehicular Technology, 2019, vol. 68, no 8, p. 8238-8242.

[12] Q. Qingqing et R. Zhang. "Intelligent reflecting surface enhanced wireless network via joint active and passive beamforming". IEEE transactions on wireless communications, 2019, vol. 18, no 11, p. 5394-5409.

[13] Z. Wang, L. Liu, et S. Cui. "Channel estimation for intelligent reflecting surface assisted multiuser communications: Framework, algorithms, and analysis". IEEE Transactions on Wireless Communications, 2020, vol. 19, no 10, p. 6607-6620.

[14] "Channel model(s) for 0.5-100 GHz," 3GPP, Sophia Antipolis Cedex, France, TR 38.901., Jun. 2018. [Online]. Available: www.3gpp.org.

[15] H. Asplund, D. Astely, P. Von Butovitsch, et al. "Advanced Antenna Systems for 5G Network Deployments: Bridging the Gap Between Theory and Practice". Academic Press, 2020.

[16] 3GPP TS 38.213: "NR; Physical layer procedures for control".

[17] 3GPP TS 38.214: "NR; Physical layer procedures for data".

[18] B. Fuchs. "Application of convex relaxation to array synthesis problems". IEEE Trans. on Anten. and Propagation, 2013, vol. 62, no 2.

[19] R. Combes et al., "Scheduling gain for frequency-selective Rayleigh fading channels with application to self-organizing packet scheduling," Elsevier Performance Evaluation, Vol. 68, Issue 8, Aug 2011.

[20] S. Boyd and S. Vaderberghe. "Convex Optimization" Cambridge University Press, 2004.

[21] H. Kushner et G. Yin. "Stochastic approximation and recursive algorithms and applications". Springer Science and Business Media, 2003.

[22] A. Cherukuri et al., "Asymptotic convergence of constrained primal-dual dynamics". Systems and Control Letters, 2016, vol. 87, p. 10-15.

[23] J. Dattorro. "Convex optimization and Euclidean distance geometry". Lulu. com, 2010.

[24] J. Davidson. "Stochastic Limit Theory: and Introduction for Economicians". Oxford University Press, 1994.