RISMA: Reconfigurable Intelligent Surfaces Enabling Beamforming for IoT Massive Access

Massive access for Internet-of-Things (IoT) in beyond 5G networks represents a daunting challenge for conventional bandwidth-limited technologies. Millimeter-wave technologies (mmWave)---which provide large chunks of bandwidth at the cost of more complex wireless processors in harsher radio environments---is a promising alternative to accommodate massive IoT but its cost and power requirements are an obstacle for wide adoption in practice. In this context, meta-materials arise as a key innovation enabler to address this challenge by Re-configurable Intelligent Surfaces (RISs). In this paper we take on the challenge and study a beyond 5G scenario consisting of a multi-antenna base station (BS) serving a large set of single-antenna user equipments (UEs) with the aid of RISs to cope with non-line-of-sight paths. Specifically, we build a mathematical framework to jointly optimize the precoding strategy of the BS and the RIS parameters in order to minimize the system sum mean squared error (SMSE). This novel approach reveals convenient properties used to design two algorithms, RISMA and Lo-RISMA, which are able to either find simple and efficient solutions to our problem (the former) or accommodate practical constraints with low-resolution RISs (the latter). Numerical results show that our algorithms outperform conventional benchmarks that do not employ RIS (even with low-resolution meta-surfaces) with gains that span from 20% to 120% in sum rate performance.


I. INTRODUCTION
Spurred by economic and environmental concerns, the design of energy-efficient high-bandwidth wireless technologies is becoming paramount-even small improvements matter at the scale of next-generation Internet-of-Things (IoT) systems [1]. We argue in this paper that a joint exploitation of millimeter-wave spectrum (mmWave), which can provide multi-GHz bandwidth, and Re-configurable Intelligent Surfaces (RISs), 1 which can alleviate the energy toll attained to the former, has the potential to achieve this goal.
RISs: aiding and abetting Massive IoT access based on mmWave technology. The hunt for wider radio bands has led network practitioners to study, with success, the use of mmWave as a means to accommodate broadband connectivity. In fact, mmWave is doubtlessly one of the key building stones of 5G and will continue to be so in future-generation systems. However, the low-power low-throughput nature of conventionally-deployed IoT devices have caused such high-frequency bands, with considerably harsher propagation properties, to be largely ignored when building IoT environments. Nevertheless, the advent of massive IoT applications spawning a huge volume of devices puts a strain on low-bandwidth sub-6GHz technologies and poses mmWave as a candidate solution for quasi-nomadic scenarios such as smart grids, smart cities and smart industries [2]. The main challenge in this case is that mmWave transceivers usually employ digital or hybrid beamforming, with multiple RF chains and a large number of antenna arrays that allow focusing electromagnetic energy into certain angles (i.e., irradiate beams), in order to combat mmWave's aquaphobia and high attenuation. This strategy is however doomed for energy-constrained IoT devices, as integrating multiple active components draining energy becomes infeasible [3]. Faced with such a challenge, RISs may hold the key to properly exploiting the use of mmWave with its vast bandwidth resources while enabling advanced massive IoT scenarios with a significantly-low service disruption probability [4].
Indeed, RISs, which apply controllable transformations into impinging radio waves without leveraging on power amplifiers, create a host of opportunities for the optimization of wireless systems at a low cost and with a low energy footprint [5]. They are in fact gaining a lot of momentum [6]- [21] because of their ability to turn the stochastic nature of the wireless environment-fundamentally passive-into a programmable channel that plays an active role on the way in which signals propagate. RISs have been recently proposed for a variety of applications, ranging from secure communications [15], [16], non-orthogonal multiple access [17], over-the-air-computation [18] or energy-efficient cellular networks [19], [20]. A RIS is essentially a continuous meta-surface that can be modeled as a grid of discrete unit cells spaced at subwavelength distance that can alter their electromagnetic response, such as phase, amplitude, polarization and frequency in a programmable manner. For instance, they can be tuned such that signals bouncing off a RIS are combined constructively to increase signal quality at the intended receiver or destructively to avoid leaking signals to undesired receivers.
RISs vs. relaying and MIMO. Conceptually, a RIS may remind some of the challenges behind conventional Amplify-and-Forward (AF) relaying methods [22] and the beamforming methods used in (massive) MIMO [23]. There exists a marked difference between conventional AF relays and RISs [24], [25]. Indeed, the former rely on active (energy-consuming) low-noise power amplifiers and other active electronic components, such as digital-to-analog (DAC) or analog-to-digital (ADC) converters, mixers and filters. In contrast, RISs have very low hardware footprint, consisting on a single or just a few layers of planar structures that can be built using lithography or nano-printing methods. Consequently, RISs result to be particularly attractive for seamless integration into walls, ceilings, object cases, building glasses or even clothing [26].
On the other hand, (massive) MIMO employs a large number of antennas to attain large beamforming gains. In fact, upon similar conditions, both massive MIMO and RIS technology can produce similar signal-to-noise-ratio (SNR) gains. 2 However, a RIS achieves such beamforming gains passively-with a negligible power supply-exhibiting high energy efficiency. We claim in this paper that active beamforming via an antenna array at the transmitter side and passive beamforming in the channel via a RIS can complement each other and provide even larger gains when they both are jointly optimized, which is precisely the goal of this paper. To this aim-and in marked contrast to earlier works [27]- [33]-we use the received sum mean squared error (SMSE) as optimization objective, which let us find simple and efficient solutions for the problem at hand.
While the theoretical modelling of RIS-aided wireless networks is well studied, many challenges are still open to be tackled such as building testbeds for experimental validation [34]- [37], 2 Although it has been shown that the SNR scales linearly with the number of antennas M when using massive MIMO and proportional to the square of the number of equivalent antenna elements N 2 with RIS technology, the lack of power amplification in the latter determines a performance loss such that, overall, both technologies produce very similar SNR gains given the same conditions [23]. the task of estimating the combined channel from the BS to the RIS and on to the UE [30], [38] and the joint optimization of the multi-antenna BS and the RIS parameters [27]- [33].
Particularly relevant for this paper is the latter category, concerning the joint optimization of active beamforming at the BS and passive beamforming at the RIS. In [27] the authors analyze a single-UE case and propose to maximize the rate. The resulting non-convex optimization problem is solved via both fixed point iteration and manifold optimization. A similar setting is analyzed in [30], where the authors propose a heuristic solution to the non-convex maximization of the received signal power with similar performance to conventional semidefinite relaxation (SDR).
The single-UE setting is also studied in [32], where the authors propose to encode information both in the transmitted signal and in the RIS configuration. A multiuser setting is analyzed in [28] where the authors propose to maximize the minimum receive SNR among all UEs in the large system regime. While this approach guarantees fairness among UEs, it might not maximize the system sum rate. In [29], the authors design jointly the beamforming at the BS side and the RIS parameters by minimizing the total transmit power at the BS, given a minimum receive signal-to-interference-plus-noise ratio (SINR) requirement. This framework was later extended to consider low resolution RISs in a single UE setting [31].

A. Novelty and contributions
The main novelty of this paper stems from exploiting the SMSE as an optimization objective.
The choice of an objective function is of paramount importance, especially for massive access scenarios. Our objective function is purposely chosen such that we can derive a mechanism that provides high-performing solutions while guaranteeing efficiency and scalability. Interestingly, such metric-which has not been studied so far in the context of RIS-aided networks-reveals a convex structure in the two optimization variables separately, namely the precoding strategy at the transmitter and the RIS parameters. This gives us an edge over prior work because it allows to design very efficient iterative algorithms for RIS control. Specifically, we present RISMA, a RIS-aided Multiuser Alternating optimization algorithm that jointly optimizes the beamforming strategy at the transmitter (a BS) and the RIS parameters to provide high-bandwidth low-cost connectivity in massive IoT scenarios. In marked contrast with prior work, RISMA exploits the convex nature of the problem at hand in the two optimization variables separately to ensure scalability, efficiency and provable convergence in the design without the need of setting any system parameter.
Moreover, we adapt RISMA, which provides a solution from a theoretical perspective, to accommodate practical constraints when using low-resolution RISs that are comprised of antenna elements that can be activated in a binary fashion. In this way, these are meta-surfaces that only support phase shift values from a discrete set, rather than any real value from a range, and further compound our problem [39], [40]. To address this scenario, we propose Lo-RISMA, which decouples the optimization of the binary activation coefficients and the quantized phase shits. The former are optimized via SDR while the latter are projected onto the quantized space. Differently than other prior work considering low-resolution RISs [31], [41], Lo-RISMA benefits from the key properties of the chosen SMSE metric. Specifically, for each iteration of the proposed algorithm for a fixed RIS configuration the precoding strategy is found via a simple closed form solution. Whereas once the precoding strategy is fixed the problem of finding the RIS parameters can be efficiently solved via SDR.
Our numerical results show that a joint optimization of both the precoder of the transmitter and the RIS parameters in terms of induced phase shifts and amplitude attenuation produce substantial gains in sum rate performance. Specifically, our joint optimization approach leads to ∼40% gain compared to using only a minimum mean squared error (MMSE) precoder over a broad range of network area radii, and gains that scale linearly with the network-area's radius compared to a zero-forcing (ZF) precoder, e.g., ∼20% and ∼120% improvement for radii equal to 100 and 150 meters, respectively.
To summarize, the contributions of this paper are: • We introduce a novel mathematical framework to minimize the SMSE of RIS-aided beamforming communication systems that make them suitable for massive IoT wireless access.
This approach, which to the best of our knowledge has not been explored before, allows us to build efficient algorithms that maximize sum rate performance.
• We design RISMA, a low-complexity scheme with provable convergence that finds a simple and efficient solution to the aforementioned problem.
• We introduce Lo-RISMA, an efficient algorithm for realistic scenarios with low-resolution meta-surfaces.
• We present a thorough numerical evaluation that shows substantial gains in terms of sum rate performance. Specifically, we present scenarios where our approach achieves around 40% gain over an MMSE precoder, and gains that span between 20% and over 120% with respect to a ZF precoder, depending on the network radius. 6 The remaining of this paper is structured as follows. Section II introduces the system model and the problem formulation to optimize the considered metric. In Section III we tackle the solution of the considered problem in the simple case of a single UE. In Section IV the aforementioned problem is solved through the proposed RISMA algorithm in a general multiuser setting. Moreover, we propose Lo-RISMA which provides a practical implementation of RISMA in the case of low-resolution RIS. Section V presents numerical results to evaluate the performance of the proposed algorithms. Lastly, Section VI concludes the paper.

B. Notation
Throughout the paper, we use italic letters to denote scalars, whereas vectors and matrices are denoted by bold-face lower-case and upper-case letters, respectively. We let C, R and Z denote the set of complex, real and integer numbers, respectively. We use C n and C n×m to represent the sets of n-dimensional complex vectors and m × n complex matrices, respectively.
Vectors are denoted by default as column vectors. Subscripts represent an element in a vector and superscripts elements in a sequence. For instance, n ] T is a vector from  plus a multipath NLoS link. Lastly, due to high path loss we neglect all signals reflected two times or more by the RIS as in [14], [29], [30].
All channels follow a quasi-static flat-fading model and thus remain constant over the transmission time of a codeword. We further assume that perfect channel state information (CSI) is available at the BS, i.e., the latter knows {h d,k } K k=1 , G and {h k } K k=1 . The BS operates in time-division duplexing mode, such that the uplink and downlink channels are reciprocal. The downlink physical channel can thus be estimated through the uplink training from the UEs via a separate control channel 3 .
While we focus on the downlink data transmission, our proposed framework might be straightforwardly extended to the uplink direction considering multiple UEs and one single BS. Each UE k receives the sum of two contributions, namely a direct path from the BS and a suitably reflected path upon the RIS. Hence, the receive signal at UE k is given by where Φ = diag[α 1 e jφ 1 , . . . , α N e jφ N ] with φ i ∈ [0, 2π) and |α i | 2 ≤ 1, ∀i represents the phase shifts and amplitude attenuation introduced by the RIS ( [9], [11], [29], [42] , ∀k, and n k is the noise term distributed as CN (0, σ 2 n ). Hence, assuming single-user decoding at the receiver side the system sum rate can be defined as follows (3)

B. Problem Formulation
Our objective is to optimize the overall system performance of the considered RIS-aided network in terms of the system sum rate, as defined in Eq. (3). In particular, given the complexity of treating such an expression, we propose to jointly optimize the precoding strategy at the BS and the reflections (as a tunable parameter) introduced by the RIS by minimizing the SMSE over all connected UEs, which is known to relate to the sum rate [43]. In particular, for a given configuration of the RIS the considered system in the downlink is a broadcast channel and duality between broadcast and uplink multiple access channel holds. In the dual multiple access channel the classical relation between minimum mean squared error (MSE) of UE k and maximum SINR of UE k holds for linear filters [44]. Hence, this motivates us to study the SMSE as a means to optimize the system sum rate in the downlink.
The receive MSE of UE k is given by 9 The receive SMSE over all UEs is thus expressed as Hence, our optimization problem can be formulated as the following with v defined in Eq. (9) and P the available transmit power at the BS. Note that the constraint |v i | 2 ≤ 1 ensures that the i-th RIS element does not amplify the incoming signal, thus guaranteeing a passive structure overall. We remark that contrarily to previous works on beamforming optimization in RIS-aided networks [27]- [32], our proposed framework has the key advantage of being convex in the two optimization variables v and W separately. This allows us to find simple and efficient solutions to the problem at hand. Moreover, thanks to this aforementioned key property the use of alternating optimization between the two optimization variables v and W allows us to guarantee convergence to a critical point of Problem 11, i.e., a point that satisfies the Karush-Kuhn-Tucker (KKT) conditions of Problem 1 ( [45], [46]). Note that given the non convex nature of Problem 1, the KKT conditions are necessary but not sufficient conditions for optimality. We now deeply examine our problem for two main use cases: i) single UE receiver and ii) multiuser receiver.

III. SINGLE USER CASE
We firstly focus on the case of K = 1 to better highlight the key feature of the proposed RISMA method. In order to separately exploit the convexity in v and W of our objective function in Problem 1, let the RIS parameters in v be fixed such that we can firstly focus on finding the precoding strategy W. Since perfect CSI is available at the BS, when v is fixed the optimal linear transmit precoding vector is known to be the one matched to the (here, effective) channel between the BS and the UE maximizing the receive SNR, which is given by maximum-ratio transmission (MRT), i.e., Thus, once the precoding strategy is obtained the problem reduces to the optimization of the RIS setting parameters in Φ. Consider the receive MSE after MRT precoding where the expectation is over the symbol s and the noise n, which are assumed to be independent.
Hence, we have that We thus formulate the following optimization problem By substituting Eq. (9) and Eq. (10) into Eq. (16), we recast the latter into the following optimization problem Note that Problem 2 is non-convex in v but it can be solved efficiently by standard convexconcave programming as it is a summation of a convex function, i.e., the squared norm term, minus a second convex function, i.e., the norm term [47].
An alternative yet simpler approach defines V = vv H and solve the following optimization problem Problem 3 (P3).
Note that Problem 3 is non-convex in V due to the rank constraint. However, by employing SDR the latter can be turned into a convex problem by relaxing the rank constraint. The resulting problem can be then solved via standard semidefinite programming as, e.g., CVX.
An approximate solution of Problem 3 can be obtained from the relaxed convex problem via Gaussian randomization [48]. While the optimality of Gaussian Randomization is only proven for a small well-defined family of optimization problems, it guarantees an π 4 -approximation of the optimal objective value of the original problem for a sufficiently large number of randomizations, as shown in [49].
Lastly, note that the RIS parameters {α i } N i=1 and {φ i } N i=1 can be obtained by setting A. Practical systems: low-resolution RIS In practical systems, it is difficult to control exactly the state of each reflecting element as this control is implemented through sensible variations of the equivalent impedance of each reflecting cell. It is thus not practical to allow any possible state for the absorption coefficients and phase reflection {φ i } N i=1 of the i-th reflecting element [19], [35]. In this respect, we propose an extension of the method proposed in Section III, dubbed as Lo-RISMA, which decouples to include practical implementation constraints, namely, each reflecting element is activated in a binary fashion and each phase shift can vary on a given set of discrete values.
Binary activation. We start by treating the binary activation assumption, namely each reflecting element can have only one of two states, i.e., α i ∈ {0, 1} ∀i. Hence, we solve Problem (2) or Eq.
which is clearly maximed when b = 1.
Quantized phase shifts. Consider now the case where the phases {φ i } N i=1 are quantized with a given number of bits b as in explained in [19], [31], [41], [50]. The ideal feasible set [0, 2π) is thus quantized into 2 b uniformly spaced discrete points as To achieve such quantization, we simply project the phase shifts obtained by solving Problem 2 or 3 onto the closest point within the constellation in Q.

IV. MULTIUSER CASE
Hereafter, we consider the multiuser scenario described in Section II. Differently than the single UE case, here the optimal transmit precoder is not know a priori and needs to be optimized. In

A. Alternating Optimization
Let us consider Problem 1 (P_SMSE), which is not jointly convex in v and W whereas, differently than prior work, is convex in the two optimization variables, separately. We can thus solve Problem 1 efficiently via alternating optimization. If W is fixed, then Problem 1 (P_SMSE) reduces as follows 22) where e N +1 is the (N + 1)-th column of the identity matrix of size N + 1 and µ ≥ 0 is a vector of non-negative variables to be determined in the following way µ i = 0 and |v i | 2 ≤ 1,

Problem 4 admits the following solution
To alleviate the task of finding µ in Eq. (23) we set µ = σ 2 n 1 following the results in [51].
where I N +1 is the identity matrix of size N + 1.
Lastly, ν is found by letting v N +1 = 1 as where z = kH k w k and e N +1 is the (N + 1)-th column of the identity matrix of size N + 1.

Proof: The solution of Problem 4 is analytically derived in Appendix A by solving the
Karush-Kuhn-Tucker (KKT) conditions.
When v is fixed, Problem 1(P_SMSE) reduces to the following where we defineh k H H k v and e k is the k-th column of the identity matrix of size K. Again, given the convexity of Problem 5, the KKT conditions are necessary and sufficient for the solution of the problem and yield the following withH = [h 1 , . . . ,h K ] and µ ≥ 0 such that W 2 F = P is satisfied 5 . Leveraging the results in [51] we set µ = Kσ 2 n /P which is proven to maximize the UEs SINRs in the limit of large K, while proving to be tight for even small values of K. Hence we obtain the following empirical

B. Practical systems: low resolution RIS
As described in Section III-A, in practical conditions it is difficult to control the state of each reflecting element perfectly. In the following, we reformulate the problem in Section IV-A to cope with the limits of practical hardware implementations and we assume that each reflecting 5 In order to determine µ we can apply a bisection method.
element can be activated in a binary fashion and introduces only quantized phase shifts. The proposed algorithm dubbed Lo-RISMA is formally described in Algorithm 2.
If W is fixed then Problem 4 (P_SMSE_v) stated in Section IV-A is modified as follows Problem 6 (P_SMSE_Lo).
where we have defined the constellation of discrete pointsQ as to include the deactivated RIS antenna elements and the quantized phase shifts. Let the effective channel matrix of the k-th UE be defined as follows Lastly, let us definev [v T c] T andV =vv T with |c| 2 = 1. Hence, Problem (6) (P_SMSE_Lo) is equivalent to the following homogeneous quadratic problem Following the results in [52], [53], area radius vary on a broad range of values. Finally, we show that similar outstanding gains can be attained even when considering RIS as a low-resolution surface whose antenna elements are activated in a binary fashion thereby introducing only uniformly spaced discrete phase shifts.

A. Channel model
The channel model used for our numerical results is defined as follows. Let h d denote the direct channel between the BS and UE k defined as follows where Here, δ is the antenna spacing-wavelength ratio. Similarly, we define the NLoS component as the following where η d,k,p ∼ CN (0, 1), P d,k and θ k,p are the small-scale fading coefficient, the number of scattered paths and the steering angle of the p-th scattered path between the BS and UE k, respectively. We denote the channel between the BS and the RIS as follows where K R is the Rician factor, whereas G LoS and G NLoS represent the deterministic LoS and Rayleigh fading components, respectively. The latter component is defined as where γ G = d −β 1 is the large-scale fading coefficient with β the pathloss exponent and b(ψ A ) is the planar linear array (PLA) response vector, which models the RIS response for the steering angle ψ A . We assume that the RIS is a two dimensional structure with N = N x N y elements where N x and N y are the number of elements along the x and y axis, respectively. The PLA response is defined as with ψ A,z and ψ A,x the azimuth and longitudinal AoA, repsectively. The NLoS component of the BS-RIS link is defined as where P G is the total number of scattered paths, G (w) represents the small-scale fading coefficients of the p-th path with vec(G (w) p ) ∼ CN (0, I N M ), • stands for element-wise product and ψ A,p and ψ D,p are the AoA and AoD of the p-th path, respectively. Lastly, h k denotes the channel between the RIS and UE k defined as follows where K R,k is the Rician factor of UE k while h LoS where γ k = d −β k 2,k is the large-scale fading coefficient and β k the pathloss exponent. The NLoS component of the RIS-UE k link is defined as the following where η k,p ∼ CN (0, 1), P k and ψ k,p denote the small-scale fading coefficient, the number of scattered paths and the steering angle of the p-th scattered path related to the RIS-UE k link, respectively.

B. Power scaling law
We derive the power scaling law of the channel model proposed in Section V-A. For the sake of clarity, we focus on a single UE and single BS antenna case, i.e., M = 1 and hence G ≡ g and w MRT ≡ w MRT . Moreover, we assume that h ∼ CN (0, γI N ), g ∼ CN (0, γ G I N ) and The average receive power at the UE is given by In Eq. (46) we assume that h, g and h d are statistically independent and Eq. works on pathloss modelling [11], [12], [23], [25]). Hence, by increasing the number of RIS antenna elements, we can counteract the decrease in receive power due to the distance of the combined path from the BS to RIS and from the RIS to the UE. This notably suggests that RISs can be used smartly to effectively increase the coverage area of wireless networks.

C. Scenario and setting parameters
We consider a circular single-cell network of radius R N with a central BS as depicted in distance R N from the BS and angles 0, π/2, π and 3π/2, respectively. Hence, for each RIS d 1 = R N , ψ A,x = π, 3π/2, 0 and π/2 with ψ A,z = 0, respectively. Furthermore, the AoD are ψ D = 0, π/2, π and 3π/2, respectively. Each UE k is served by a single RIS, according to the highest average channel power gain δ k of the corresponding link, defined as the following We assume that β k =β, ∀k such that each UE k is served by the closest RIS in terms of distance 6 . For simplicity we let K R,k =K R , P k =P , P d,k = P d , K d,k = K d and β d,k = β d , ∀k.
We setβ =β LoS ,K R =K R,LoS ,  Table I, unless otherwise stated. Val. N 100

D. Single user case
In the single UE case, we set N x = N y = 5, K d = 0,K R = 2.5, β d = 4,β = 2 and θ = 0. In addition, we assume that a single RIS is at distance d 1 = 25m from the BS with AoD ψ D = π/4 and AoA ψ A = 5π/4 while we vary d as the distance from the BS to the UE. The distance from the RIS to the UE and the AoD ψ are thus calculated based on the aforementioned parameters. q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q P = 0 dBm P = 12 dBm P = 24 dBm In Fig. 4    against two benchmark schemes, namely MMSE precoding defined as per [51]: In Fig. 6, for a fixed network area radius R N = 150 m and transmit power P = 24 dBm, we vary the number of BS antennas M and compare the proposed RISMA algorithm against both MMSE and ZF precoding in terms of sum rate. We evaluate three different scenarios by increasing the number of simultaneous UEs up to K = 100, which reasonably unveils a classical IoT environment. Note that the gain brought by adding BS antennas is larger in RISMA algorithm than the two considered benchmarks since they are limited by interference due to neighboring UEs. In addition, the proposed method benefits in terms of sum rate from an increase in the number of UEs while maintaining a simple and scalable optimization routine, demonstrating its relevance in IoT scenarios. Moreover, RISMA is considerably more energy-efficient. This is made evident in Fig. 7 that shows the number of equivalent antennas needed by either our MMSE and ZF benchmarks to achieve the same sum gain performance than our approach with M = {8, 12, 16, 20, 24, 28} antennas. For instance, given a target sum rate equal to 100 bps/HZ, RISMA requires a number of BS antennas that is ∼ 67% lower.
Lastly, Fig. 8 shows the average sum rate R obtained with the proposed Lo-RISMA, i.e., when the RIS is a low resolution metasurface, the proposed RISMA algorithm, i.e., with an ideal RIS, conventional MMSE and ZF precoding versus the number of quantization bits b for fixed network area radius R N = 100 m and transmit power P = 24 dBm. As the number of quantization bits increases, the Lo-RISMA algorithm approaches the performance of the ideal RISMA algorithm. Moreover, even for a single bit quantization our proposed methods achieves better performance than the considered benchmark schemes thus demonstrating the feasibility of RIS-aided networks.
Remarkably, both the proposed RISMA and Lo-RISMA algorithms converge within few iterations, specifically, between 3 to 10 iterations. Note that the observed lower limit in the number of iterations is due to the random initialization of the optimization variables W and v in both the proposed algorithms.

VI. CONCLUSIONS
In this work RIS-aided beamforming solutions have been proposed, RISMA and Lo-RISMA, for addressing massive IoT access challenges in beyond 5G networks. In particular, we have analyzed RISs benefits to cope with NLOS issues in dense urban environments where massive IoT deployments are expected in the near future.
Our contributions are: i) a novel mathematical framework to minimize the SMSE of RIS-aided beamforming communication systems, ii) RISMA, a low-complexity scheme that finds a simple and effective solution for such systems, iii) Lo-RISMA, an efficient algorithm for deployments with low-resolution meta-surfaces, and iv) a numerical evaluation that shows substantial gains in terms of sum rate performance, i.e. 40% gain over an MMSE precoder and 20% to 120% with respect to a ZF precoder, depending on the network radius.

APPENDIX
A. Proof of Eq. (22) Problem 4 is convex and thus the optimal solution solves the KKT conditions. Let the Lagrangian and its gradient as respectively. Note that to find the derivative of the real part of v HĤ k e k we have used again the property in Eq. (61). The KKT conditions of Problem 4 can be written as |v i | 2 ≤ 1 i = 1, . . . , N ; v N +1 = 1; µ ≥ 0; µ i (|v i | 2 − 1) = 0 i = 1, . . . , N whose solution is given by with µ ≥ 0 found in the following way µ i = 0 and |v i | 2 ≤ 1, µ i ≥ 0 and |v i | 2 = 1, ∀i = 1, . . . , N.
Lastly, ν is determined by forcing where we have defined and z = kH k w k . Hence we have that B. Proof of Eq. (28) Problem 5 is convex and thus the optimal solution solves the KKT conditions. Let the Lagrangian and its gradient as respectively. Note that to find the derivative of the real part of tr(H H W) we have used the following property, valid for any given scalar function f (z) of 29 The KKT conditions of Problem 5 can be written as the following (HH H + µI M )W =H; W 2 F ≤ P ; µ ≥ 0; µ( W 2 F − P ) = 0; (62) whose solution is given by W = (HH H + µI M ) −1H , with µ ≥ 0 chosen such that W 2 F = P (e.g., by bisection).