---
abstract: 'Reconfigurable intelligent surfaces (RIS) are a new and revolutionary technology to achieve spectrum-, energy- and cost-efficient wireless networks.  This paper studies the resource allocation for RIS-empowered device-to-device (D2D) communication underlaying a cellular network, in which an RIS is employed to enhance desired signals and suppress interference between paired D2D and cellular links.  We maximize the sum rate of D2D users and cellular users by jointly optimizing the resource reuse indicators, the transmit power and the RIS’s passive beamforming.  To solve the formulated non-convex problem, we first propose an efficient user-pairing scheme based on relative channel strength to determine the resource reuse indicators.  Then, the transmit power and the RIS’s passive beamforming are jointly optimized by an iterative algorithm, based on the techniques of alternating optimization, successive convex approximation, Lagrangian dual transform and quadratic transform.  Numerical results show that the proposed design outperforms the traditional D2D network without RIS.' 
author:
- |
    Gang Yang$^{\ast}$, *Member, IEEE*, Yating Liao$^{\ast}$, Ying-Chang Liang$^{\ast}$, *Fellow, IEEE*, and Olav Tirkkonen$^{\dagger}$,\
    $^{\ast}$University of Electronic Science and Technology of China, Chengdu, P. R. China\
    $^{\dagger}$Aalto University, Aalto, Finland\
    Email: yanggang@uestc.edu.cn, 2015010913035@std.uestc.edu.cn, liangyc@ieee.org, olav.tirkkonen@aalto.fi
bibliography:
- 'IEEEabrv.bib'
- 'reference20190808.bib'
title: 'Reconfigurable Intelligent Surface Empowered Underlaying Device-to-Device Communication'
---

Device-to-device communication, reconfigurable intelligent surfaces, passive beamforming, power allocation, iterative algorithm. 

Introduction
============

Device-to-device (D2D) communication underlaying cellular networks, which allows a device to communicate with its proximity device over the licensed cellular bandwidth, is recognized as a promising technology in future networks due to its advantages such as high spectrum efficiency, high energy efficiency (EE) and low transmission delay [@asadi2014survey].  Interference management is the most important challenge for underlaying D2D communication[@tehrani2014device].  The D2D link and the cellular link operating in the same licensed band interfere with each other severely[@DSABook2019Liang], and the interference needs to be carefully suppressed via efficient interference management[@feng2013device] and resource allocation[@OlavD2DTWCHC2011].  Recently, reconfigurable intelligent surfaces (RIS) have emerged as a new and revolutionary technology to achieve spectrum-, energy- and cost-efficient wireless networks[@LiangLISA2019][@huang2019holographic].  Specifically, RIS consist of a large number of passive low-cost reflecting elements, each of which can adjust the phase and amplitude of the incident electromagnetic wave and reflect it passively[@8936989][@YangLiangNOMAIRS19].  Thus, RIS are able to enhance desired signals and suppress interference by designing the reflecting coefficient (including phase and amplitude) of each reflecting element.  For instance, the weighted-sum rate of an RIS-aided multiuser multiple-input single-output downlink communication system was maximized in [@8982186], by jointly optimizing the base station’s (BS’s) active beamforming and the RIS’s passive beamforming (i.e., reflecting coefficients).  The EE of an RIS-empowered downlink multi-user communication system was maximized in [@8741198], by jointly optimizing the BS’s transmit power and the RIS’s passive beamforming. 

RIS can be explored to enhance the strengths of desired signals for both D2D links and cellular links, and suppress the severe interference between each paired D2D link and cellular link.  This motivates us to study RIS-empowered D2D communication underlaying a cellular network in this paper.  The main contributions are summarized as follows. 

-   We formulate a problem to maximize the overall network sum rate, by jointly optimizing the resource reuse indicators (i.e., user pairing between D2D users and cellular users (CUs)), the transmit power and the RIS’s passive beamforming, subject to the signal-to-interference-plus-noise ratio (SINR) constraints for both D2D links and cellular links.  However, the problem is challenging to be solved optimally, since the user pairing (involving integer variables) and the resource allocation are closely coupled. 

-   To decouple the problem, we first propose an efficient relative-channel-strength based user-pairing scheme with low complexity.  Under the obtained user-pairing design, an iterative algorithm based on alternating optimization is further proposed.  The successive convex approximation technique is exploited to optimize the transmit power; while the Lagrangian dual transform and quadratic transform techniques are utilized to optimize the passive beamforming.  The algorithm’s convergency is proved and its complexity is analyzed. 

-   Numerical results show that the proposed design achieves significant sum-rate enhancement compared to traditional underlaying D2D without RIS, and suffers from slight degradation compared to the best-achievable performance under ideal user pairing. 

The rest of this paper is organized as follows.  Section \[systemmodel\] presents the system model.  Section \[formulation\] formulates the sum rate maximization problem.  Section \[solution\] designs an efficient solving algorithm.  Section \[simulation\] provides the numerical results.  Section \[conslusion\] concludes this paper. 

System Model {#systemmodel}
============

As shown in Fig.  \[fig:system\_newmodel\], we consider an RIS-empowered cellular network with underlay D2D, which consists of an RIS, $N\geq1$ D2D transmitters (TXs) denoted as $\text{TX 1},\ldots,\text{TX \emph{N}}$, $N$ D2D receivers (RXs) denoted as $\text{RX 1},\ldots,\text{RX \emph{N}}$, $K\geq1$ active CUs (i.e., cellular users) denoted as $\text{CU 1},\ldots,\text{CU \emph{K}}$, and a cellular BS.  The RIS has $M\geq1$ reflecting elements, while each D2D TX, D2D RX, CU and the BS are equipped with a single antenna.  A controller is attached to the RIS to control the reflecting coefficients and communicate with other network components through separate wireless links.  We assume that the D2D links share the uplink (UL) spectrum of the cellular network, since the UL spectrum is typically underutilized compared to the downlink spectrum.  To alleviate interference, we consider that a D2D link shares at most one CU’s spectrum resource, while the resource of a CU can be shared by at most one D2D link [@feng2013device] [@ramezani2017joint] [@8299474]. 

All channels are assumed to experience quasi-static flat-fading.  The channels from $\text{TX \emph{i}} \ (1\leq i\leq N)$ to $\text{RX \emph{l}} \ (1\leq l\leq N)$ and RIS are denoted by $h_{l,i}\in {\mathcal{C}}$ and ${{\mathbf{f}}}_i \in {\mathcal{C}}^{M \times 1}$, respectively.  For notational clarity, we represent each channel related to the cellular network with a tilde.  The channels from $\text{CU \emph{k}} \ (1\leq k\leq K)$ to BS and RIS are denoted by $ \tilde h_{k}\in {\mathcal{C}}$ and $\tilde{{\mathbf{f}}}_k \in {\mathcal{C}}^{M \times 1}$ , respectively; the channels from RIS to $\text{RX \emph{l}}$ and BS are denoted by $\mathbf{g}_l \in {\mathcal{C}}^{M \times 1}$ and $\tilde{\mathbf{g}} \in {\mathcal{C}}^{M \times 1}$, respectively; the interference channels from $\text{TX \emph{i}}$ to BS and from $\text{CU \emph{k}}$ to $\text{RX \emph{l}}$ are denoted by $u_i \in {\mathcal{C}}$ and $v_{l,k} \in {\mathcal{C}}$, respectively. 

\[t\] ![ An RIS-empowered underlaying D2D network.[]{data-label="fig:system_newmodel"}](system_model_BS.eps "fig:"){width=".95\columnwidth"}

The transmitted signals from $\text{TX \emph{i}}$ and $\text{CU \emph{k}}$ are denoted as $s_i$ and $x_k$, respectively, which follow independent circularly symmetric complex Gaussian (CSCG) distribution with zero mean and unit variance, i.e., $s_i \sim {\mathcal{C}}{\mathcal{N}}(0,1)$, $x_k \sim {\mathcal{C}}{\mathcal{N}}(0,1)$. Denote the index set of active D2D pairs as ${\mathcal{D}}\subseteq\{1,\ldots,N\}$. The corresponding SINR for $\text{RX \emph{n}}$ decoding $s_n$ from $\text{D2D TX \emph{n}}\in {\mathcal{D}}$ is $$\begin{aligned}
&\gamma_{n}^d=\frac{P_n^d\left|\mathbf{g}_{n}^H\bm \Phi {{\mathbf{f}}}_n+h_{n,n}\right|^2}{\sum\limits_{k=1}^{K} \rho_{k,n}P_k^c\left|\mathbf{g}_{n}^H\bm \Phi \tilde{{\mathbf{f}}}_k+v_{n,k}\right|^2+\sigma^2}, \label{eq:SINR_newd}\end{aligned}$$ where $P_i^d$ and $P_k^c$ are the transmit power of $\text{TX \emph{i}}$ and $\text{CU \emph{k}}$, respectively; $\bm\Phi=\operatorname{diag}\{\alpha_1e^{j\theta_1},\ldots,\alpha_Me^{j\theta_M}\}$ denotes the reflecting coefficient matrix, where $\alpha_m\in (0,1]$ and $\theta_m\in(0,2\pi]$; $\rho_{k,n}$ is the resource reuse indicator for cellular link $k$ and D2D link $n$, $\rho_{k,n}=1$ when D2D link $n$ reuses the resource of CU $k$, and $\rho_{k,n}=0$ otherwise; $\sigma^{2}$ is the power of additive white Gaussian noise (AWGN) at $\text{RX \emph{n}}$.

The SINR for BS decoding $x_k$ from $\text{CU \emph{k}}$ is $$\begin{aligned}
&\gamma_{k}^c=\frac{P_k^c\left|\tilde{\mathbf{g}}^H\bm \Phi \tilde{{\mathbf{f}}}_k+\tilde h_{k}\right|^2}{\sum\limits_{i=1}^{N} \rho_{k,i}P_i^d\left|\tilde{\mathbf{g}}^H\bm \Phi {{\mathbf{f}}}_i+u_{i}\right|^2+\sigma^2}, \label{eq:SINR_newc}\end{aligned}$$ where $\sigma^{2}$ is the power of AWGN at BS. 

Hence, the overall network’s sum rate in bps/Hz is $$\begin{aligned}
&R\left(\bm\rho,\mathbf{p},\bm\Phi\right)=\sum \limits_{n\in {\mathcal{D}}}\log_2(1+\gamma_n^d)+\sum\limits_{k=1}^{K}\log_2(1+\gamma_k^c),\label{eq:sumrate_new}\end{aligned}$$ where the length-($KN$) resource reuse indicator vector $\bm\rho=\left[\rho_{1,1},\ldots,\rho_{1,N},\rho_{2,1},\ldots,\rho_{K,N}\right]^T$, and the length-($K+N$) power allocation vector $\mathbf p=\left[P_1^d,\ldots,P_N^d,P_1^c,\ldots,P_K^c\right]^T$.

problem formulation {#formulation}
===================

This paper aims to maximize the sum rate in , by jointly optimizing the resource reuse indicator vector $\bm{\rho}$, the transmit power vector $\mathbf p$ and the reflecting coefficients matrix $\bm\Phi$. The optimization problem is formulated as

$$\begin{aligned}
\text{(P1)}: \quad \underset{\bm\rho, \mathbf p, \bm \Phi}{\max}  \quad &R\left(\bm\rho, \mathbf p, \bm \Phi\right) \label{eq:P2objective}\\
\text{s.t.}\quad &\gamma_n^d\geq \gamma_{\min}^d ,  \quad n \in {\mathcal{D}}\label{eq:P2constraint1_new} \\
&\gamma_k^c\geq \gamma_{\min}^c,\quad 1\leq k\leq K  \label{eq:P2constraint2_new} \\
& \sum_{k=1}^{K} \rho_{k,n}\leq 1 \label{eq:P2constraint3_new} \\
& \sum_{n\in{\mathcal{D}}}^{N} \rho_{k,n}\leq 1 \label{eq:P2constraint4_new} \\
& 0\leq P_n^d \leq P_{\max}^d \quad  \label{eq:P2constraint5_new} \\
& 0\leq P_k^c \leq P_{\max}^c \quad \label{eq:P2constraint6_new} \\
& 0< \alpha_m \leq 1, \quad 1\leq m\leq M \label{eq:P2constraint7_new}\\
& 0< \theta_m \leq 2\pi, \;\; 1\leq m\leq M \label{eq:P2constraint8_new}\end{aligned}$$

where and indicate the required minimum SINRs (i.e., quality-of-service) $\gamma_{\min}^d$ and $\gamma_{\min}^c$ for the D2D links and cellular links, respectively; ensures that a D2D link shares at most one CU’s resource, while indicates that the resource of a CU can be shared by at most one D2D link; and are the maximum transmit power constraints on the TXs and CUs, respectively; and are the practical constraints on the reflecting coefficients.  Notice that (P1) is a non-convex problem.  First, (P1) involves integer variables $\bm\rho$ and thus is NP-hard.  Moreover, the objective function and the constraint functions of and are non-concave with respect to the variables $\bm {\rho}$, $\mathbf p$ and $\bm\Phi$, and these variables are all coupled.  There is no standard method to solve such a non-convex problem. 

Solution to (P1) {#solution}
================

In order to solve (P1) effectively, we first propose an efficient user-pairing scheme to determine integer variables $\bm\rho$, then optimize $\mathbf p$ and $\bm\Phi$ in an iterative manner. 

Relative-Channel-Strength based Pairing Scheme
----------------------------------------------

Since the user-pairing design involves integer programming which is hard to solve, we propose a relative-channel-strength (RCS) based low-complexity pairing scheme to design the resource reuse indictors $\bm{\rho}$.

Notice that there are $A_K^N$ different possible pairings denoted as a set $\Pi\triangleq\{\pi_1,\ldots,\pi_{A_K^N}\}$. Each possible pairing can be viewed as an index mapping denoted as $\pi_m: k\in {\mathcal{U}}_m {\longrightarrow} n \in{\mathcal{D}}_m$, for $m=1,\ldots, A_N^K$, i.e., the mapping $\pi_m$ maps each CU index $k \in {\mathcal{U}}_m \subset \{1,2,\ldots,K\}$ to a D2D-link index $n \in {\mathcal{D}}_m \subset {\mathcal{D}}$. The RCS-based pairing scheme determines the pairing $\pi_{m^{\star}}$ by the following criterion$$\begin{aligned}
\pi_{m^{\star}}=\underset{\pi_m \in \Pi}{\arg\max} \sum_{k \in {\mathcal{U}}_m} \frac{|\tilde h_{k}|^2}{|v_{\pi_m(k),k}|^2}.\end{aligned}$$ This heuristic pairing scheme chooses the pairing mapping which maximizes the sum of the ratios of each paired-CU-to-BS channel strength over the paired CU-to-RX interference channel strength.  Clearly, this heuristic pairing scheme that requires only simple comparison features low complexity, but fortunately its resultant design only suffers from slight performance degradation compared to the design with ideal pairing achieved by exhaustive search, as numerically shown in Section \[simulation\]. 

Algorithm for Solving (P1) with Given Pairing Design
----------------------------------------------------

After heuristic pairing, we apply the alternating optimization (AO) [@hong2015unified] algorithm to decouple the variables $\mathbf{p}$ and $\bm\Phi$. For given ${\bm{\Phi}}$, we optimize $\mathbf{p}$ based on the successive convex approximation (SCA) technique [@beck2010sequential].  For given $\mathbf{p}$, we optimize ${\bm{\Phi}}$ based on the Lagrangian dual transform and quadratic transform techniques [@shen2018fractional]. 

### Optimizing Transmit Power Vector $\mathbf{p}$

In each iteration $j$, for given reflecting coefficient matrix $\bm\Phi$, the transmit power vector $\mathbf{p}$ can be optimized by solving

\[eq:P1.1\] $$\begin{aligned}
\text{(P1.1)}: \quad \underset{\mathbf{p}}{\max} \quad &R\left(\mathbf{p}\right) \label{eq:P1.1objective}\\
\text{s.t.}\quad &\eqref{eq:P2constraint1_new}, \eqref{eq:P2constraint2_new}, \eqref{eq:P2constraint5_new}, \eqref{eq:P2constraint6_new}.\end{aligned}$$

The objective function of (P1.1) is non-convex due to its $\mathbf{p}$-dependence.  We exploit the SCA technique to solve (P1.1).  Specifically, we need to find a concave lower bound to approximate the objective function.  Since any convex function can be lower bounded by its first-order Taylor expansion at any point, we obtain the following concave lower bound $R^{\text{lb}}$ at the point $\mathbf{p}^{(j)}$ $$\begin{aligned}
&R \geq \!\sum \limits_{n\in{\mathcal{D}}}\bigg[\log_2\left(\sum_{k=1}^{K}P_n^d Q_{n,n}^{(j)}+A_1\right)\!\!  -\log_2\left(A_1^{(j)}\right)  \nonumber\\
&\quad \quad -\frac{1}{A_1^{(j)}} \sum\limits_{k=1}^{K}\rho_{k,n} \widetilde Q_{n,k}^{(j)}\left(P_k^c-P_k^{c(j)}\right)\bigg] \nonumber\\
&\quad \quad + \!\!  \sum\limits_{k=1}^{K}\bigg[\log_2\left(P_k^c\widetilde Q_{k}^{(j)}+A_2\right)-\log_2\left(A_2^{(j)}\right)\nonumber\\
&\quad \quad -\frac{1}{A_2^{(j)}}\sum\limits_{i=1}^{N} \rho_{k,i}Q_{i}^{(j)}\left(P_i^d-P_i^{d(j)}\right)\bigg]=R^{\text{lb}}, \label{eq:taylor}\end{aligned}$$ where $Q_{n,n}\!\!=\!\!|\mathbf{g}_{n}^H\bm \Phi {{\mathbf{f}}}_n\!+\!h_{n,n}|^2$, $\widetilde Q_{n,k}\!=\!|\mathbf{g}_{n}^H\bm \Phi \tilde{{\mathbf{f}}}_k\!+\!v_{n,k}|^2$, $\widetilde Q_{k}\!=\!|\tilde{\mathbf{g}}^H\bm \Phi \tilde{{\mathbf{f}}}_k\!\!+\!\!\tilde h_{k}|^2$, $Q_{i}\!=\!|\tilde{\mathbf{g}}^H\bm \Phi {{\mathbf{f}}}_i\!+\!u_{i}|^2$, $A_1=\sum_{k=1}^{K}\!\rho_{k,n}P_k^{c}\widetilde Q_{n,k}^{(j)}+\sigma^2$ and $A_2=\sum_{i=1}^{N} \rho_{k,i}P_i^d Q_i^{(j)}\!\!+\!\!\sigma^2$.

With given $\mathbf p^{(j)}$ and $R^{\text{lb}}$, (P1.1) is approximated as

\[eq:P1.2\] $$\begin{aligned}
\text{(P1.2)}:\underset{\mathbf P}{\max} \quad &R^{\text{lb}}  \\
\text{s.t.}\quad &\eqref{eq:P2constraint1_new}, \eqref{eq:P2constraint2_new}, \eqref{eq:P2constraint5_new}, \eqref{eq:P2constraint6_new}.\end{aligned}$$

Problem (P1.2) is a convex problem which can be efficiently solved with standard methods, e.g., CVX[@grant2008cvx]. 

### Optimizing Reflecting Coefficient Matrix $\bm \Phi$

In each iteration $j$, for given transmit power vector $\mathbf p$, the reflecting coefficient matrix $\bm\Phi$ can be optimized by solving

\[eq:P2.1\] $$\begin{aligned}
\text{(P2.1)}:\underset{\bm \Phi}{\max} \quad &R(\bm \Phi) \label{eq:P2objective2.1}\\
\text{s.t.}\quad &\eqref{eq:P2constraint1_new}, \eqref{eq:P2constraint2_new}, \eqref{eq:P2constraint7_new}, \eqref{eq:P2constraint8_new}.\end{aligned}$$

We tackle the logarithm in the objective function via the Lagrangian dual transform technique.  Introducing auxiliary variables $\boldsymbol\eta_n^d=[\eta_1^d,\ldots,\eta_N^d]^T$ and $\boldsymbol\eta_k^c=[\eta_1^c,\ldots,\eta_K^c]^T$, the new objective function can be equivalently expressed as $$\begin{aligned}
&R_a(\bm\Phi)\!=\!\underset{\boldsymbol{\eta_n^d}}{\max} \left(\sum_{n\in{\mathcal{D}}} \log\left(1\!+\!\eta_n^d\right)\!\!-\!\!\sum_{n\in{\mathcal{D}}} \!\eta_n^d\!+\!  \sum_{n\in{\mathcal{D}}}\!  \frac{\!\!(1\!\!+\!\!\eta_n^d)\gamma_n^d}{1+\gamma_n^d} \right)\nonumber\\
& +\!  \underset{\boldsymbol{\eta_k^c}}{\max} \left(\sum_{k=1}^{K} \!\log(1\!+\!\eta_k^c)\!-\!\sum_{k=1}^{K} \eta_k^c\!+\!  \sum_{k=1}^{K}\!  \frac{(1\!\!+\!\!\eta_k^c)\gamma_k^c}{1+\gamma_k^c} \right).  \label{eq:P1Obj}\end{aligned}$$

It is easy to validate that the optimal values of $\boldsymbol{\eta}_{\text{opt}}^{d(j)}$ and $\boldsymbol{\eta}_{\text{opt}}^{c(j)}$ are $\bm\gamma^{d(j)}$ and $\bm\gamma^{c(j)}$, respectively.  We define $\bm\theta^H\bm{\omega}_{n,n}=\mathbf g_{n}^H\bm \Phi {{\mathbf{f}}}_n$, $\bm\theta^H\tilde{\bm{\omega}}_{n,k}=\mathbf g_{n}^H\bm \Phi \tilde{{\mathbf{f}}}_k$, $\bm\theta^H\tilde{\bm{\omega}}_{k}=\tilde{\mathbf{g}}^H\bm \Phi \tilde{{\mathbf{f}}}_k$ and $\bm\theta^H\bm{\omega}_{i}=\tilde{\mathbf{g}}^H\bm \Phi {{\mathbf{f}}}_i$. From and , optimizing the reflecting coefficient $\bm\Phi$ can be equivalently transformed into optimizing $\bm\theta$ in the following objective function $$\begin{aligned}
&R_a(\bm\theta)= \sum_{n\in{\mathcal{D}}} \frac{\left(1+\eta_{\text{opt},n}^{d(j)}\right)P_n^{d(j)}Q_{n,n}^w}{P_n^{d(j)} Q_{n,n}^w+\sum\limits_{k=1}^{K}\rho_{k,n}P_k^{c(j)}\widetilde Q_{n,k}^w+\sigma^2}\nonumber\\
&\qquad \quad +\sum_{k=1}^{K} \frac{ \left(1+\eta_{\text{opt},k}^{c(j)}\right)P_k^{c(j)}\widetilde Q_{k}^w}{P_k^{c(j)}\widetilde Q_{k}^w+\sum\limits_{i=1}^{N}\!\!  \rho_{k,i}P_i^{d(j)}Q_{i}^w+\sigma^2},\label{eq:Lagrangian}\end{aligned}$$ where $Q_{n,n}^w=|\bm\theta^H\bm{\omega}_{n,n}+ h_{n,n}|^2$, $\widetilde Q_{n,k}^w=|\bm\theta^H\tilde{\bm{\omega}}_{n,k}+v_{n,k}|^2$, $\widetilde Q_{k}^w=|\bm\theta^H\widetilde{\bm{\omega}}_{k}+\tilde h_{k}|^2$ and $Q_{i}^w=|\bm\theta^H\bm{\omega}_{i}+ u_{i}|^2$.

Then, utilizing the quadratic transform method proposed in [@shen2018fractional], we introduce an auxiliary variable $\mathbf y =[y_1^d,\ldots,y_N^d,y_1^c,\ldots,y_K^c]^T$, transforming to $$\begin{aligned}
&R_b(\bm\theta, \mathbf y)=\nonumber\\
&\sum_{n\in{\mathcal{D}}}\Bigg[2\sqrt{ \left(1 +\eta_{\text{opt},n}^{d(j)}\right)P_n^{d(j)}} \text{Re} \left\{y_n^{d*}\bm\theta^H\bm{\omega}_{n,n}
+ y_n^{d*} h_{n,n}\right\} \nonumber\\
&-|y_n^d|^2\left(P_n^{d(j)} Q_{n,n}^w+\sum\limits_{k=1}^{K}\rho_{k,n}P_k^{c(j)}\widetilde Q_{n,k}^w+\sigma^2\right)\Bigg]\nonumber\\
&+\sum_{k=1}^{K} \Bigg[2\sqrt{(1 +\eta_{\text{opt},k}^{c(j)})P_k^{c(j)}} \text{Re} \left\{y_k^{c*}\bm\theta^H\widetilde{\bm{\omega}}_{k} + y_k^{c*}\tilde h_{k} \right\}\nonumber\\
&-|y_k^c|^2\left(P_k^{c(j)}\widetilde Q_{k}^w+\sum\limits_{i=1}^{N} \rho_{k,i}P_i^{d(j)}Q_{i}^w+\sigma^2\right)\Bigg].  \label{eq:P2.4objectivetran}\end{aligned}$$

We first optimize $\mathbf y$ with fixed $\bm \theta$, then optimize $\bm \theta$ with fixed $\mathbf y$. It can be easily confirmed that $R_b(\bm \theta, \mathbf y)$ is a concave differentiable function over $\mathbf y$ with fixed $\bm \theta$, so the optimal solution of $\mathbf y$ can be obtained by setting $\partial R_b(\bm \theta^{(j)}, \mathbf y)/\partial \mathbf y=0$. The optimal value of $\mathbf y$ is given by $$\begin{aligned}
&y_{\text{opt},n}^{{d(j)}}=\frac{\sqrt{ \left(1 + \eta_{\text{opt},n}^{d(j)}\right)P_n^{d(j)}} \left[\bm\theta^{H(j)}\bm{\omega}_{n,n} +  h_{n,n}\right]}{P_n^{d(j)} Q_{n,n}^w + \sum\limits_{k=1}^{K}\rho_{k,n}P_k^{c(j)}\widetilde Q_{n,k}^w + \sigma^2} \label{eq:ynopt}\\
&y_{\text{opt},n}^{{c(j)}} = \frac{\sqrt{\left(1+ \eta_{\text{opt},k}^{c(j)}\right)P_k^{c(j)}} \left[\bm\theta^{H(j)}\widetilde{\bm{\omega}}_{k}+ \tilde h_{k}\right]}{P_k^{c(j)}\widetilde Q_{k}^w+\sum\limits_{i=1}^{N} \rho_{k,i}P_i^{d(j)}Q_{i}^w + \sigma^2}.  \label{eq:ycopt}\end{aligned}$$ Then, we replace $y_n^d$ and $y_k^c$ with $y_{\text{opt},n}^{d{(j)}}$ and $y_{\text{opt},k}^{{c(j)}}$, respectively.  Denote $\mathbf B_{1n}=P_n^{d(j)}\bm{\omega}_{n,n}\bm{\omega}_{n,n}^H$, $\mathbf  B_{2n}=\sum_{k=1}^{K}\rho_{k,n}P_k^{c(j)}\tilde{\bm{\omega}}_{n,k}\tilde{\bm{\omega}}_{n,k}^H$, $\mathbf B_{1b}=P_k^{c(j)}\tilde{\bm{\omega}}_{k}\tilde{\bm{\omega}}_{k}^H$, $\mathbf B_{2b}=\sum_{i=1}^{N}\!\!\rho_{k,i}P_i^{d(j)}\bm{\omega}_{i}\bm{\omega}_{i}^H$, $\mathbf e_{1n}=P_n^{d(j)} h_{n,n}^*\bm{\omega}_{n,n}$, $\mathbf e_{2n}=\sum_{k=1}^{K}\rho_{k,n}P_k^{c(j)}v_{n,k}^*\tilde{\bm{\omega}}_{n,k}$, $\mathbf e_{1b}=P_k^{c(j)}\tilde h_{k}^*\tilde{\bm{\omega}}_{k}$ and $\mathbf e_{2b}=\sum_{i=1}^{N}\!\rho_{k,i}P_i^{d(j)}u_{i}^*\bm{\omega}_{i}$. Optimizing $\bm \theta$ for given $\mathbf y$, the objective function is transformed as follows $$\begin{aligned}
&R_b(\bm \theta, \mathbf y)=-\bm \theta^H\mathbf B_1\bm \theta+2\text{Re}\left(\bm \theta^H\mathbf e_1\right)+C_1,\end{aligned}$$ where $C_1$ is a constant, the matrix $\mathbf B_1$ and vector $\mathbf e_1$ are $$\begin{aligned}
&\mathbf B_1 = \sum_{n\in{\mathcal{D}}} \left|y_{\text{opt},n}^{d(j)}\right|^2 \mathbf B_{n} +\sum_{k=1}^{K}\left|y_{\text{opt},k}^{c(j)}\right|^2 \mathbf B_{b} \\
&\mathbf e_1=\!\sum_{n\in{\mathcal{D}}}\bigg[ \!  \sqrt{ \!  \left(1\!  +\!  \eta_{\text{opt},n}^{d(j)}\right)P_n^{d(j)}} \left(y_{\text{opt},n}^{d(j)}\right)^*\!\!\bm{\omega}_{n,n} \!-\!  \left|y_{\text{opt},n}^{d(j)}\right|^2\!\!\mathbf e_{n} \!  \bigg] \nonumber\\
&\!+\!\sum_{k=1}^K\!\bigg[\!  \sqrt{ \!  \left(1\!  +\!  \eta_{\text{opt},k}^{c(j)} \!\right)P_k^{c(j)}} \left(\!y_{\text{opt},k}^{c(j)}\!\right)^*\!\widetilde{\bm{\omega}}_{k}\!-\!\left|y_{\text{opt},k}^{c(j)}\right|^2 \!\mathbf e_{b} \!\bigg],\end{aligned}$$ with $\mathbf B_{n}=\mathbf B_{1n} +\mathbf B_{2n}$, $\mathbf B_{b}=\mathbf B_{1b} +\mathbf B_{2b}$, $\mathbf e_{n}=\mathbf e_{1n}+\mathbf e_{2n}$, and $\mathbf e_{b}=\mathbf e_{1b}+\mathbf e_{2b}$.

Similarly, leveraging the quadratic transform method, the constraints and can be transformed into $$\begin{aligned}
&f_d(\bm\theta)=-\bm \theta^H\mathbf B_2\bm \theta+2\text{Re}\left(\bm \theta^H\mathbf e_2\right)+C_2  \geq \gamma_{\min}^d, \label{eq:con_trand}\end{aligned}$$ $$\begin{aligned}
&f_c(\bm\theta)=-\bm \theta^H\mathbf B_3\bm \theta+2\text{Re}\left(\bm \theta^H\mathbf e_3\right)+C_3  \geq \gamma_{\min}^c, \label{eq:con_tranc}\end{aligned}$$ where $x_d= \frac{\sqrt{P_{n}^{d(j)}}\left(\bm \theta^{H(j)} \bm{\omega}_{n,n}+ h_{n,n}\right)}
{\sum_{k=1}^{K} \rho_{k,n}P_k^{c(j)}\widetilde Q_{n,k}^w+\sigma^2}$, $\mathbf B_2=|x_d|^2\mathbf B_{2n},\mathbf e_2=\sqrt{P_{n}^{d(j)}} x_d^*\bm{\omega}_{n,n}-|x_d|^2\mathbf e_{2n}$, $C_2=2\sqrt{P_{n}^{d(j)}} \text{Re}\left\{x_{d}^* h_{n,n}\right\}-|x_d|^2
(\sum_{k=1}^{K} \rho_{k,n}P_k^{c(j)}|v_{n,k}|^2+\sigma^2); x_c= \frac{\sqrt{P_{k}^{c(j)}}\left(\bm \theta^{H(j)} \tilde{\bm{\omega}}_{k}+\tilde h_{k}\right)}
{\sum_{i=1}^{N} \rho_{k,i}P_i^{d(j)}Q_{b,i}^w+\sigma^2},  \mathbf B_3=|x_c|^2\mathbf B_{2b}$, $\mathbf e_3=\sqrt{P_{k}^{c(j)}} x_c^*\tilde{\bm{\omega}}_{k}-|x_c|^2\mathbf e_{2b}$, and $C_3=2\sqrt{P_{k}^{c(j)}} \text{Re}\left\{x_{c}^*\tilde h_{k}\right\}-|x_c|^2
\left(\sum_{i=1}^{N} \!  \rho_{k,i}P_i^{d(j)}|u_{i}|^2+\sigma^2\right)$.

Hence, (P2.1) is transformed into the following problem $$\begin{aligned}
\text{(P2.2)}:\underset{\bm\theta}{\max}&  -\bm \theta^H\mathbf B_1\bm \theta+2\text{Re}\left(\bm \theta^H\mathbf e_1\right)+C_1  \\
\text{s.t.} & \quad \eqref{eq:con_trand}, \eqref{eq:con_tranc}, \eqref{eq:P2constraint7_new}, \eqref{eq:P2constraint8_new}.\end{aligned}$$ The resulting (P2.2) is a quadratic constrained quadratic programming (QCQP) problem.  Thus, (P2.2) can also be effectively solved by standard methods. 

Overall Algorithm
-----------------

**Step 1**: Initialize ${\mathbf{p}}^{\{0\}}, \ {\bm{\Phi}}^{\{0\}}$, a small threshold constant $\epsilon=10^{-4}$. Let $j=0$.\
**Step 2**: Exploting RCS-based pairing scheme to determine the resource resue indictor vector $\bm \rho$. **Step 3**: Solve problem (P1.2) for given $\bm\Phi^{(j)}$, and obtain the optimal solution as ${\mathbf{p}}^{\{j+1\}}$. **Step 4**: Solve problem (P2.2) for given ${\mathbf{p}}^{\{j+1\}}$, and obtain the optimal solution as $\bm \Phi^{\{j+1\}}$: **Step 5**: Update iteration index $j=j+1$. **Step 6**: Return the suboptimal solution $\bm\rho^{\star}=\bm\rho^{\{j-1\}}$, ${\mathbf{p}}^{\star}={\mathbf{p}}^{\{j-1\}}$ and ${\bm{\Phi}}^{\star}={\bm{\Phi}}^{\{j-1\}}$

Algorithm \[AlgorithmP1\] is guaranteed to converge. 

First, in Step 3, since the optimal solution ${\mathbf{p}}^{\{j+1\}}$ is obtained for given ${\bm{\Phi}}^{\{j\}}$, we have the following inequality on the sum rate $$\begin{aligned}
  R \left({\mathbf{p}}^{\{j\}},{\bm{\Phi}}^{\{j\}}\right)&\stackrel{(a)}{=}R^{\text{lb}}\left({\mathbf{p}}^{\{j\}},{\bm{\Phi}}^{\{j\}}\right) \nonumber\\
  &\stackrel{(b)}{\le} R^{\text{lb}}\left({\mathbf{p}}^{\{j+1\}},{\bm{\Phi}}^{\{j\}}\right) \nonumber\\
  &\stackrel{(c)}{=} R\left({\mathbf{p}}^{\{j+1\}},{\bm{\Phi}}^{\{j\}}\right), \label{eq:convergence1}\end{aligned}$$ where (a) and (c) hold since the Taylor expansion in is tight at given local points ${\mathbf{p}}^{\{j\}}$ and ${\mathbf{p}}^{\{j+1\}}$, respectively, and (b) holds since ${\mathbf{p}}^{\{j+1\}}$ is the optimal solution to (P1.2). 

Second, in Step 4, since ${\bm{\Phi}}^{\{j+1\}}$ is the optimal solution to (P2.2), we can obtain the following inequality $$\begin{aligned}
& R\left({\mathbf{p}}^{\{j+1\}},{\bm{\Phi}}^{\{j\}}\right)\leq R\left({\mathbf{p}}^{\{j+1\}},{\bm{\Phi}}^{\{j+1\}}\right).  \label{eq:convergence2}\end{aligned}$$

From and , it’s straightforward that $$\begin{aligned}
  R\left({\mathbf{p}}^{\{j\}},{\bm{\Phi}}^{\{j\}}\right)\leq R\left({\mathbf{p}}^{\{j+1\}},{\bm{\Phi}}^{\{j+1\}}\right).\end{aligned}$$

Since the objective value is non-decreasing after each iteration and is upper bounded by some positive constant, the overall Algorithm \[AlgorithmP1\] is guaranteed to converge. 

Problems (P1.2) and (P2.2) are alteratively solved in each outer-layer AO iteration.  Specifically, (P1.2) can be solved in $(N+K)\log_2(N+K)$ operations by the extended water-filling algorithm[@liu2013complexity], while (P2.2) is a convex QCQP which can be solved by using interior point methods with complexity ${\mathcal{O}}(M^{3.5})$[@hassanien2008robust].  Hence, the complexity of Algorithm \[AlgorithmP1\] is ${\mathcal{O}}\left(I_{\text{ite}}[(N+K)\log_2(N+K)+M^{3.5}]\right)$, where $I_{\text{ite}}$ denotes the number of outer-layer AO iterations. 

NUMERICAL RESULTS {#simulation}
=================

This section provides numerical results to validate the performance of the proposed RIS-empowered underlaying D2D network.  We assume that $h_{l,i}$, $u_i$, $\tilde h_{k}$ and $v_{l,k}$ are independently Rayleigh fading distributed, while ${{\mathbf{f}}}_i$, $\tilde{{\mathbf{f}}}_k$, $\mathbf{g}_l$ and $\tilde{\mathbf{g}}$ follow independent Rician fading distribution, i.e., $$\begin{aligned}
&{{\mathbf{f}}}_i=\sqrt{\frac{K_1}{K_1+1}} {{\mathbf{f}}}_{\text{L},i} + \sqrt{\frac{1}{K_1+1}} {{\mathbf{f}}}_{N,i}, \label{eq:channel1}\end{aligned}$$ where $K_1$ is the Rician factor of ${{\mathbf{f}}}_i$, ${{\mathbf{f}}}_{\text{L},i}$ is the line of sight (LoS) component, and ${{\mathbf{f}}}_{\text{N},i}$ is the non-LoS (NLOS) component each element of which follows distribution ${\mathcal{C}}{\mathcal{N}}(0,1)$. Set $K_1=10$. Similarly, $\tilde{{\mathbf{f}}}_k$, $\mathbf{g}_l$ and $\tilde{\mathbf{g}}$ are generated in the same way as ${{\mathbf{f}}}_i$ with Rician factors $K_2=K_3=K_4=10$. We assume that the CUs are uniformly distributed in the cellular cell with radius $R=1000$ meters (m).  We adopt the clustered distribution model in [@feng2013device] for D2D users, i.e., the clusters are randomly located in the cell, and each D2D link is uniformly distributed in one cluster with radius $r=100$ m. We set $K=4$ and $N=2$. The RIS is located between two D2D clusters.  The locations of CUs and D2D users are generated by the above method.  The large-scale path losses from TXs and CUs to RXs are $10^{-3}d^{-4}$, from TXs and CU to BS are $10^{-3}d^{-3.8}$, the other pass-losses of RIS-related channels are $10^{-3}d^{-2.2}$[@feng2013device][@8982186], where $d$ is the distance in meters.  We set $M=100$, $P_{\max}^d=P_{\max}^c=20$dBm , $R_{\min}^d=\log_2 (1+\gamma_{\min}^d)=0.1$ bps/Hz, $R_{\min}^c=\log_2(1+\gamma_{\min}^c)=0.1$ bps/Hz, and $\sigma^2=-114$dBm[@feng2013device].  The simulation results are based on 1000 channel realizations. 

For comparison, we consider the following two benchmarks, i.e., (1) underlaying D2D without RIS, (2) RIS-empowered D2D with ideal user pairing.  For the first benchmark, we consider the traditional RIS-empowered D2D underlaying a cellular network without RIS.  We maximize the sum rate by jointly optimizing the resource reuse indicator $\bm{\rho}$ and the transmit power vector $\mathbf{p}$. We use the solving algorithm in [@feng2013device] for this problem, and omit the details herein.  For the second benchmark, we exhaustively search over $A_K^N$ possible user-pairings, and jointly optimize ${\mathbf{p}}$ as well as ${\bm{\Phi}}$ under each pairing.  This benchmark gives an achievable upper-bound sum-rate performance of the RIS-empowered underlaying D2D network. 

![ Sum rate versus maximum transmit power $P_{\max}^d$.[]{data-label="fig:FigSim5"}](D2D_IRS_power_final.eps){width="0.98\columnwidth"}

Fig.  \[fig:FigSim5\] plots the sum rate versus the maximum transmit power $P_{\max}^d$ of the transmitters.  The proposed design achieves significant sum rate gain compared to the first benchmark.  For instance, the sum rate of the proposed RCS-based design is $327.57\%$ and $35.04\%$ higher than that of the first benchmark when $P_{\max}^d$ is 10 and 20 dBm, respectively.  In addition, compared to the second benchmark based on exhaustive search, the proposed design with low complexity has slight degradation of performance.  Furthermore, the sum rate of the proposed design increases as $M$ increases, since more reflecting elements can further enhance equivalent channel strengthes and suppress the inter-link interferences.  Also, the finite-resolution phase shifters of reflecting elements usually degrade the sum-rate performance.  The sum rate increases with the increase of the phase-shift quantization bits $B$. In particular, the 2-bit phase shifter can obtain sufficiently high performance gain with a slight performance degradation compared to the ideal case of continuous phase shifters. 

\[!t\] ![ Sum rate versus rate requirement $R_{\min}^c$ of CUs.[]{data-label="fig:FigSim8"}](D2D_IRS_gamma_BS.eps "fig:"){width=".98\columnwidth"}

Fig.  \[fig:FigSim8\] plots the sum rate versus the CUs’ minimum rate requirement $R_{\min}^c$. The sum rate decreases as $R_{\min}^c$ increases, which reveals the rate tradeoff between the D2D links and the cellular links.  Compared to the first benchmark, the proposed design achieves significant sum-rate gain by introducing the RIS.  Compared to the second benchmark, the proposed design suffers from slight sum-rate performance degradation, but it obviously outperforms this benchmark in terms of computational complexity.  The proposed design solves the joint-resource-allocation optimization problem only once, while this benchmark needs to solve such problem for $A_K^N$ times under all possible pairings, resulting into unaffordable complexity especially for large numbers of D2D and cellular links. 

Conclusion {#conslusion}
==========

This paper has studied an RIS-empowered underlaying D2D communication network.  The overall network sum rate is maximized by jointly optimizing the resource reuse indicators, the transmit power and the passive beamforming.  First, an efficient relative-channel-strength based user-pairing scheme with low complexity is proposed to determine the resource reuse indicators.  Then, the transmit power and the passive beamforming are optimized by utilizing the proposed alternating-optimization based iterative algorithm.  Numerical results show that the proposed design achieves significant performance enhancement compared to traditional underlaying D2D network without RIS, and suffers from slight performance degradation compared to RIS-empowered underlying D2D with ideal user-pairing.  This work can be extended to other scenarios such as multi-antenna BS/users and multiple RISs.