Reconfigurable Intelligent Surface Assisted Two–Way Communications: Performance Analysis and Optimization

In this paper, we investigate the two-way communication between two users assisted by a reconfigurable intelligent surface (RIS). The scheme that two users communicate simultaneously over Rayleigh fading channels is considered. The channels between the two users and RIS can either be reciprocal or non-reciprocal. For reciprocal channels, we determine the optimal phases at the RIS to maximize the signal-to-interference-plus-noise ratio (SINR). We then derive exact closed-form expressions for the outage probability and spectral efficiency for single-element RIS. By capitalizing the insights obtained from the single-element analysis, we introduce a gamma approximation to model the product of Rayleigh random variables which is useful for the evaluation of the performance metrics in multiple-element RIS. Asymptotic analysis shows that the outage decreases at <inline-formula> <tex-math notation="LaTeX">$\left ({\log (\rho)/\rho }\right)^{L}$ </tex-math></inline-formula> rate where <inline-formula> <tex-math notation="LaTeX">$L$ </tex-math></inline-formula> is the number of elements, whereas the spectral efficiency increases at <inline-formula> <tex-math notation="LaTeX">$\log (\rho)$ </tex-math></inline-formula> rate at large average SINR <inline-formula> <tex-math notation="LaTeX">$\rho $ </tex-math></inline-formula>. For non-reciprocal channels, the minimum user SINR is targeted to be maximized. For single-element RIS, closed-form solution is derived whereas for multiple-element RIS the problem turns out to be non-convex. The latter one is solved through semidefinite programming relaxation and a proposed greedy-iterative method, which can achieve higher performance and lower computational complexity, respectively.


I. INTRODUCTION
Multiple antenna systems exploit spatial diversity not only to increase throughput but also to enhance the reliability of the wireless channel.Alternatively, radio signal propagation via man-made intelligent surfaces has emerged recently as an attractive and smart solution to replace power-hungry active components [2].Such smart radio environments, that have the ability of transmitting data without generating new radio waves but reusing the same radio waves, can thus be implemented with the aid of reflective surfaces.This novel concept utilizes S. Atapattu and J.Evans are with the Department of Electrical and Electronic Engineering, The University of Melbourne, Victoria, Australia (emails: {saman.atapattu,jse}@unimelb.edu.au).
R. Fan is with the School of Information and Electronics, Beijing Institute of Technology, Beijing 100081, P. R.China (email: fanrongfei@bit.edu.cn).
P. Dharmawansa is with Department of Electronic and Telecommunications Engineering, University of Moratuwa, Moratuwa, Sri Lanka (email: prathapa@uom.lk).
G. Wang is with the School of Computer and Information Technology, Beijing Jiaotong University, Beijing 100044, P. R.China (email: gpwang@bjtu.edu.cn).
Theodoros A. Tsiftsis is with the Institute of Physical Internet and the School of Intelligent Systems Science and Engineering, Jinan University, Zhuhai 519070, China (e-mail: theo tsiftsis@jnu.edu.cn).
A part of this work (outage and throughput analysis) has been accepted in the IEEE Wireless Communications and Networking Conference (WCNC) 2020 [1] electromagnetically controllable surfaces that can be integrated into the existing infrastructure, for example, along the walls of buildings.Such a surface is frequently referred to as Reconfigurable Intelligent Surface (RIS) , Large Intelligent Surface (LIS) or Intelligent Reflective Surface (IRS) 1 .Its tunable and reconfigurable reflectors are made of passive or almost passive electromagnetic devices which exhibit a negligible energy consumption compared to the active elements or nodes.This brand-new concept has already been proposed to incorporated into various wireless techniques including multipleinput multiple-output (MIMO) systems, massive MIMO, nonorthogonal multiple access (NOMA) and backscatter communications [3]- [5].The RIS can make the radio environment smart by collaboratively adjusting the phase shifts of reflective elements in real time.Therefore, most existing work on RIS focus on phase optimization of RIS elements [6]- [15].However, there are very limited research efforts explored the communication-theoretic performance limits [16]- [21].

A. Related Work
An RIS-enhanced point-to-point multiple-input singleoutput (MISO) system is considered in [6], which aims to maximize the total received signal power at the user by jointly optimizing the (active) transmit beamforming at the access point and (passive) reflect beamforming at RIS.A similar system model is also considered in [7] where the beamformer at the access point and the RIS phase shifts are jointly optimized to maximize the spectral efficiency.For a phase dependent amplitude in the reflection coefficient, in [8], the transmit beamforming and the RIS reflect beamforming are jointly optimized based on an alternating optimization technique to achieve a low-complex sub-optimal solution.For downlink multi-user communication helped by RIS from a multi-antenna base station, both the transmit power allocation and the phase shifts of the reflecting elements are designed to maximize the energy efficiency on subject to individual link budget in [9].The weighted sum-rate of all users is maximized by joint optimizing the active beamforming at the base-station and the passive beamforming at the RIS for multi-user MISO systems in [10].Moreover, optimization problems on physical layer security issues and hybrid beamforming schemes where the continuous digital beamforming at the access point or base station and discrete reflect beamforming at the RIS are considered in [11]- [15].However, a few work have focused on analytical performance evaluation, and therefore very limited number of results are available so far.For an RIS-assisted large-scale antenna system, an upper bound on the ergodic capacity is first derived and then a procedure for phase shift design based on the upper bound is discussed in [16].In [17], an optimal precoding strategy is proposed when the line-of-sight (LoS) channel between the base station and the RIS is of rank-one, and some asymptotic results are also derived for the LoS channel of highrank case.An asymptotic analysis of the data rate and channel hardening effect in an RIS-based large antenna-array system is presented in [18] where the estimation errors and interference are taken into consideration.For a large RIS system, some theoretical performance limits are also explored in [19] where the symbol error probability is derived by characterizing the receive SNR using the central limit theorem (CLT).In [20], the RIS transmission with phase errors is considered and the composite channel is shown to be equivalent to a point-to-point Nakagami fading channel.On the other hand, two-way communications exchange messages of two or more users over the same shared channel [22], and thereby improve the spectral efficiency of the network.Since two-way network provides full-duplex type information exchange for the RIS networks, the benefits of twoway network are thus contingent on proper self-interference and loop-interference cancellations, which is possible with the recent signal processing breakthroughs [23].Moreover, twoway communications have been recently attracted considerable attention, and have already been thoroughly investigated with respect to most of the novel 4G and 5G wireless technologies.Therefore, RIS-assisted two-way networks may also serve as a potential candidate for further performance improvement for Beyond 5G or 6G systems.However, to the best of our knowledge, all these previous work on RIS considered the one-way communications.Motivated by this reason, as the first work, we study the RIS for two-way communications in view of quantifying the performance limits, which is the novelty of this paper.

B. Summary of Contributions
Generally speaking, although the RIS can introduce a delay, it may be negligible compared to the actual data transmission time duration.Therefore, the transmission protocol and analytical model of the RIS-assisted two-way communication may differ from the traditional relay-assisted two-way communications [22], [24].Fig. 1 illustrates two possible RIS-assisted transmission schemes which require different number of time slots to achieve the bi-directional data exchange between two users.
• Scheme 1 (one time-slot transmission): As shown in Fig. 1 (a), two end-users simultaneously transmit their own data to the RIS which reflects received signals with negligible delay.Therefore, it needs only one time-slot to exchange both users information.Since the signal is received without delay at both ends, each end-user should be implemented with a pair of antennas each for signal transmission and reception.Hence each user experiences a full-duplex type communication and loop-interference and self-interference as well.• Scheme 2 (two time-slots transmission): As shown in Fig. 1 (b), user 1 transmits its data to user 2 in time-slot 1, and vice versa in time-slot 2, which needs two time-slots to exchange both users information.Therefore, each enduser may use a single antenna for signal transmission and reception.Since the two users are allocated to orthogonal channels (in terms of time), they have no interference at all.This can also be interpreted as twice one-way communications.
Since Scheme 1 is more exciting and interesting; and also Scheme 2 can be deduced from Scheme 1, we develop our analytical framework based on Scheme 1.
Although the RIS may be implemented with large number of reflective elements for the future wireless networks, fundamental communication-theoretic foundations for single and moderate number of elements of the RIS have not been well-understood under multi-path fading.However, such knowledge is very critical for network design, e.g., distributed RIS systems.To support such research directions, this paper analyzes a general two-way RIS system where the number of reflective elements can range from one to any arbitrary value, and provides several communication-theoretic aspects which have not been well-understood yet.The main contributions of the paper are summarized as follows: 1) For reciprocal channels with a single-element RIS, we first derive the exact outage probability and spectral efficiency in closed-form for the optimal phase adjust-  ment at the RIS.We then provide asymptotic results for sufficiently large transmit power compared to the noise and interference powers.Our analysis reveals that the outage decreases at log(ρ)/ρ rate, whereas the spectral efficiency increases at log(ρ) rate for asymptotically large signal-to-interference-plus-noise ratio (SINR), ρ.

2) For reciprocal channels with a multiple-element RIS,
where the number of elements, L, is more than one.In this respect, the instantaneous SINR turns out to take the form of a sum of product of two Rayleigh random variables (RVs).Since this does not admit a tractable PDF or CDF expression, we first approximate the product of two Rayleigh RVs with a Gamma RV, and then evaluate the outage probability and spectral efficiency.Surprisingly, this approximation works well and more accurately than the CLT approximation (which is frequently used in LIS literature), even for a moderate number of elements such as L = 32 or L = 64.Finally, we show that the outage decreases at (log(ρ)/ρ) L rate, whereas the spectral efficiency still increases at log(ρ) rate.3) For non-reciprocal channels, system performance analysis seems an arduous task, since four different channel phases are involved.In this case, we turn to optimize the phase so as to maximize an important measure: the minimum user SINR, which represents user fairness.
For multiple-element RIS, the associated problem is non-convex.To find the solution, through some transformations, we relax the formulated problem to be a semidefinite programming (SDP), the optimal solution of which is achievable and can further render a suboptimal solution for our originally formulated optimization problem.Moreover, a low-complexity method is proposed, which discretizes the searching space of each element's phase and improves elements' phases one-byone iteratively.
Overall, this paper attempts to strike the correct balance between the performance analysis and optimization of twoway communications with the RIS.
Notation: Before proceeding further, here we introduce a list of symbols that have been used in the manuscript.We use lowercase and uppercase boldface letters to denote vectors and matrices respectively.A complex Gaussian random variable X with zero mean and variance σ 2 is denoted by X ∼ CN (µ, σ 2 ), whereas a real Gaussian random variable is denoted by X ∼ N (0, σ 2 ).The magnitude of a complex number z is denoted by |z| and E [•] represents the mathematical expectation operator.

II. SYSTEM MODEL
A RIS-aided two-way wireless network that consists of two end users (namely, U 1 and U 2 ) and a reflective surface (R) where the two-way networks with reciprocal and nonreciprocal channels are shown in Figs.2a and 2b, respectively.The two users exchange their information symbols concurrently via the passive RIS, which only adjusts the phases of incident signals.The reflection configuration of the RIS is controlled by a micro-controller, which gets necessary knowledge from the users over a backhaul link as described in Section II-C.Each user is equipped with a pair of antennas for the transmission and reception.The RIS contains L reconfigurable reflectors where the ℓth passive element is denoted as I ℓ .We assume that the direct link between two users is sufficiently weak to be ignored due to obstacles and/or deep fading.For simplicity, we assume that both users use the same codebook.The unit-energy information symbols from U 1 and U 2 , randomly selected from the codebook, are denoted by s 1 and s 2 , respectively.The power budgets are P 1 and P 2 for end users U 1 and U 2 , respectively.We assume that all fading channels are independent.By placing the antennas of users and elements of RIS sufficiently apart, the channel gains between different antenna pairs fade more or less independently and no correlation exist.

A. Reciprocal Channels
The wireless channel can be assumed to be reciprocal if the overall user-to-RIS and RIS-to-user transmission time falls within a coherence interval of the channel and the pair of antennas are placed at sufficiently close distance.Therefore, the forward and backward channels between user and RIS are the same, see Fig. 2a.
In this case, we denote the fading coefficients from U 1 to the I ℓ and from U 2 to the I ℓ as h ℓ = α ℓ e −jϕ ℓ and g ℓ = β ℓ e −jψ ℓ , respectively.The channels are reciprocal such that the channels from the I ℓ to the two end users are also h ℓ and g ℓ , respectively.All channels are assumed to be independent and identically distributed (i.i.d.) complex Gaussian fading with zero-mean and σ 2 variance, i.e., h ℓ , g ℓ ∼ CN (0, σ 2 ).
Therefore, magnitudes of h ℓ and g ℓ (i.e., α ℓ and β ℓ ) follow the Rayleigh distribution.It is assumed that the two end users know all channel coefficients, h 1 , ..., h L and g 1 , ..., g L , and the I ℓ knows its own channels' phase values ϕ ℓ and ψ ℓ .
Each user receives a superposition of the two signals via the RIS.Thus, the receive signal at U 1 at time t can be given as h ℓ e jφ ℓ h ℓ s 1 (t) where φ ℓ is the adjustable phase induced by the I ℓ , i 1 (t) is the receive residual loop-interference resulting from several stages of cancellation and w 1 (t) is the additive white Gaussian noise (AWGN) at U 1 which is assumed to be i.i.d. with distribution CN (0, σ 2 w1 ).Further, the vectors of channel coefficients between the two users and RIS are given as . The phase shifts introduced by the RIS are given by a diagonal matrix as . Then, we can write (1) as which shows that U 1 receives an observation that is a combination of the other user's symbol s 2 and its own symbol s 1 .Thus, √ P h T Φhs 1 (t) is the self-interference term.Since the U 1 has the knowledge of Φ, h and s 1 , it can completely eliminate the self-interference.Therefore, after the elimination, the received instantaneous SINR at U 1 can be written as To avoid loop interference, similar to full-duplex communications, the U 1 applies some sophisticated loop interference cancellations, which results in residual interference.Among different models used in the literature for full-duplex communications, in this paper, we adopt the model where i 1 (t) is i.i.d. with zero-mean, σ 2 i1 variance, additive and Gaussian, which has similar effect as the AWGN [25].Further, the variance is modeled as σ 2 i1 = ωP ν 1 for P 1 ≥ 1, where the two constants, ω > 0 and ν ∈ [0, 1], depend on the cancellation scheme used at the user.With the aid of (3), the instantaneous SINR at U p where p = 1 or 2 can be given as where w2 is the noise variance and σ 2 i2 is the variance of residual interference at the U 2 .It can also be modeled as σ 2 i2 = ωP ν 2 .

B. Non-Reciprocal Channels
Even though the overall user-to-RIS and RIS-to-user transmission time falls within a coherence interval of the channel, the wireless channel can be assumed to be non-reciprocal when the pair of antennas are implemented far apart each other or non-reciprocal hardware for transmission and reception.Therefore, the forward and backward channels between user and RIS may be different, see Fig. 2b.
Thus, the receive signal at U 1 at time t can be written as where √ P 1 L ℓ=1 h r,ℓ e jφ ℓ h t,ℓ s 1 (t) denotes the selfinterference, which can be eliminated due to global CSI.Subsequently, loop-interference cancellation can be applied.We assume the same statistical properties for loop-interference as in (1) for comparison purposes.Then, the SINR at U 1 can be written as By performing the similar signal processing techniques as in U 1 , the SINR of U 2 can be written as

C. Channel Estimation Procedure
For the channel estimate stage, we use Scheme 2 which uses one-way communications twice, where U 1 communicates with U 2 in the first time-slot, and vice versa in the next time-slot.Therefore, we can readily use any one-way channel estimation technique proposed in the literature, e.g., [3], [26].Then, for reciprocal channels, both end-users have knowledge of (h, g); and, for non-reciprocal channels, end-users U 1 and U 2 have knowledge of (h r , g t ) and (h t , g r ), respectively.For reciprocal channels, one of the end users, say U 1 , then provides information on the required RIS reflection configuration (i.e.ϕ ℓ and ψ ℓ , ∀ℓ) to the micro-controller connected to the RIS (see Fig. 2a).For non-reciprocal channels, both end users provide information on the required RIS reflection configuration (i.e.(ϕ r,ℓ , ψ t,ℓ ) from U 1 and (ϕ t,ℓ , ψ r,ℓ ) from U 2 , ∀ℓ) to the micro-controller connected to the RIS (see Fig. 2b).These information can be provided via a low-latency high-frequency (e.g., millimeter-wave) wireless or a separate wired backhaul link.

A. Optimum Phase Design at RIS
A careful inspection of the structure of γ p given in (4) reveals that the optimal φ ℓ , which maximizes the instantaneous SINR of each user, admits the form This is usually feasible at the RIS as it has the global phase information of the respective channels.Now with the aid of (4), the maximum SINRs at U p can be given as γ ⋆ p where In general, the instantaneous SINR of each user can be written as We define ρ as the average SINR.We assume

B. Outage Probability
By definition, the outage probability of each user can be expressed as P out = Pr [γ ≤ γ th ], where γ th is the SINR threshold.This in turn gives us the important relation where F γ (x) is the cumulative distribution function (CDF) of γ.To evaluate the average spectral efficiency, we need the distributions of the RV γ.For general case, RV γ is a summation of L independent RVs each of which is a product of two independent Rayleigh RVs.Since the analysis of the general case may give rise to some technical difficulties, we evaluate the average spectral efficiency for L = 1 and L ≥ 2 cases separately.
Since α 1 and β 1 are identical Rayleigh RVs with parameter σ, the PDF and CDF expressions can be written as f X (x) = (2x/σ 2 ) e −x 2 /σ 2 and F X (x) = 1 − e −x 2 /σ 2 , respectively.Since the RV ζ 1 is a product of two i.i.d.Rayleigh RVs, its CDF can be derived as , from which we obtain where the last equality results from denoting the modified Bessel function of the second kind [27, eq. 3.324.1].For a RV Y = aX 2 with a > 0, X ≥ 0, we can write its CDF as F Y (y) = F X ( y/a).By using this fact, the CDF of γ = ρ ζ 1 can be derived as Thus, the outage probability can be written as 2) When L ≥ 2: In this case, the instantaneous SINR of each user is given in (10).Let us now focus on deriving the CDF of the RV ζ = L ℓ=1 ζ ℓ .However, by using the exact CDF of ζ ℓ given in (12), an exact statistical characterization of the CDF ζ seems an arduous task.To circumvent this difficulty, we first seek an approximation for the PDF and CDF of ζ ℓ .
Among different techniques of approximating distributions [28], the moment matching technique is a popular one.In the existing literature, the regular Gamma distribution is commonly used to approximate some complicated distributions because it has freedom of tuning two parameters: 1) the shape parameter k; and 2) the scale parameter θ.The mean and variance of such Gamma distribution are kθ and kθ 2 , respectively.The following Lemma gives the Gamma approximation for the CDF F ζ1 (t).

Lemma 1. The distribution of the product of two i.i.d. Rayleigh RVs with parameter σ can be approximated with a Gamma distribution which has the CDF
where Further, γ (•, •) is the lower incomplete gamma function [27].Note that, by definition, the lower and upper incomplete gamma functions satisfy Γ (a, x) + γ (a, x) = Γ(a).
Proof: Since the first and second moments of , the RV ζ ℓ has πσ 2 /4 mean and (16 − π 2 )σ 4 /16 variance.By matching the mean and variance of the RV ζ ℓ with the kθ mean and kθ 2 variance of the Gamma distribution, we have (15).
Here we assess the accuracy of the approximation using the Kullback-Leibler (KL) divergence.In particular, we consider the KL divergence between the exact PDF of ζ ℓ and its approximated PDF which is defined as D KL = E log fExt(t) fApp(t) [28] where the expectation is taken with respect to the exact probability density function (PDF) of ζ ℓ which can be derived as f Ext (t) = 4tK 0 2t/σ 2 /σ 4 .With the aid of [29, Eq.(a) The KL divergence vs σ.Fig. 3: The comparison between the exact and approximation.
where ǫ is the is Euler's constant.
With numerical calculation, we plot the KL divergence vs σ for σ ∈ (0.05, 25) in Fig. 3a.We get D KL ≈ 2.3 × 10 −4 where this very small value confirms the accuracy of the approximation.Numerical result also clarifies that σ has a little impact on D KL .Moreover, Fig. 3b plots the complementary cumulative distribution function (CCDF) of ζ ℓ based on the simulation, the exact CDF in (12) and the approximate CDF in (15) for σ 2 = 0.1, 1.0, 10 which represent very small, moderate and large variance values.The exact CCDF match tightly with the Gamma approximation for the simulated t range for all σ 2 , confirming the validity of the approximation.The accuracy of the approximation is also shown by the performance curves in Section VI.
The instantaneous SINR in (10) admits the alternative decomposition Armed with the above lemma, now we are in a position to derive an approximate average spectral efficiency expression pertaining to the case L ≥ 2. It is worth mentioning here that the RV ζ is then a sum of L i.i.d.Gamma RVs with the parameters k and θ.Therefore, the RV ζ also follows a Gamma distribution with Lk and θ parameters.By using the similar variable transformation as in (13), the CDF of γ can be approximated as Therefore, the outage probability can be written as

C. Spectral Efficiency
The spectral efficiency can be expressed as log 2 (1 + SINR) [bits/sec/Hz].Then, the average value can be evaluated as R = ∞ 0 log 2 (1 + x) f γ (x) dx where f γ (x) is the PDF of γ.By employing integration by parts, R can be evaluated as 1) When L = 1: With the aid of ( 20) and ( 13), the average spectral efficiency is evaluated as where G m,n p,q (•) is the Meijer G function [27].Here we have represented the Bessel function in terms of Meijer G function and subsequently use [27, Eq. 7.811.5].

D. Asymptotic Analysis 1) High SINR:
The behavior of the outage probability at high SINR regime is given in the following theorem.
Theorem 1.For high SINR, i.e., ρ ≫ 1, the user outage probability of L elements RIS-assisted two-way networks decreases with the rate of (log(ρ)/ρ) L over Rayleigh fading channels.
Proof: See Appendix A. However, with a traditional multiple-relay network, we observe (1/ρ) L rate.Since the end-to-end effective channel behaves as a product of two Rayleigh channels, we observe (log(ρ)/ρ) L rate with a RIS network.This is one of the important observations found through this analysis, and, to the best of our knowledge, this behavior has not been captured in any of the previously published work.
The behavior of the average throughout at high SINR regime is given in the following theorem.
Theorem 2. For high SINR, i.e., ρ ≫ 1, the user average spectral efficiency of L elements RIS-assisted two-way networks increases with the rate of log(ρ) over Rayleigh fading channels.
Proof: See Appendix B Since the residual loop-interference may also be a function of the transmit power, it is worth discussing the behavior of the outage probability and average spectral efficiency when the transmit power is relatively larger than the noise and loop interference powers.For brevity, without loss of generality, we assume P 1 = P 2 = P .The following lemmas provide important asymptotic results.
Lemma 2. When the transmit power is relatively larger than the noise and loop interference, i.e., P ≫ ω, σ2 w , the outage probabilities for L = 1 and L ≥ 2 vary, respectively, as and where G(L, γ th , ω, σ) ≈ (γth(σ 2 w +ω)) is the array gain.While the outage probability decreases with the rate log(P ) P L for σ 2 i = ω, there is an outage floor for σ 2 i = ω P .
Proof: In particular, we consider the following two extreme cases: 1) When σ 2 i = ω, where the interference is independent of the transmit power, we have ρ = P/(ω + σ 2 w ) P ≫ω,σ 2 w − −−−−− → ρ ∝ P .Therefore, results can easily be deduced from Theorem 2. Since we derive L ≥ 2 case with upper and lower bounds, which are, in general, not tight.Therefore, we can derive an approximation for the array gain by using the series expansion of (19) at large P , which , where the interference is proportional to the transmit power, we have ρ = P/(ωP + This means that the loopinterference variance dominates the outage probability, and respective asymptotic results can be obtained from ( 14) and (19) replacing ρ by 1/ω.This completes the proof.
When σ 2 i = ωP ν where ν ∈ (0, 1), it is not trivial to expand the outage probability expressions with respect to P for rational ν, we omit this case.However, the performance of this case is in between ν = 0 and ν = 1 cases.Lemma 3.For P ≫ ω, σ 2 w , the average spectral efficiency for L = 1 and L ≥ 2 vary, respectively, as and ; While the average spectral efficiency increases with the rate log(P ) for σ 2 i = ω, there is a spectral efficiency floor for σ 2 i = ω P .Proof: Since the proof follows the similar steps as Lemma 2, we omit the details.
Lemma 3 also reveals that the average spectral efficiency increases with L because ψ (0) (x) is an increasing function.
Further, when number of elements increases from L 1 to L 2 (≥ L 1 ), we have ∆R spectral efficiency improvements for any given P where On the other hand, we can also save ∆P power for any given R where Based on the behavior of ψ (0) (x) function, the rates of ∆R increment and ∆P saving decrease with L. Thus, use of a very large number of elements at the RIS may not be effective compared to the required overhead cost for large number of channel estimations and phase adjustments.
2) For Large L (or LIS): For a sufficiently large number L, according to the central limit theorem (CLT), the RV ζ = L ℓ=1 ζ ℓ converges to a Gaussian random variable with µ = Lπσ 2 /4 mean and η = L(16 − π 2 )σ 4 /16 variance which has the CDF expression where erf [•] is the Gauss error function [27].Since the CDF of γ = ρ ζ 2 is given as the outage probability can be evaluated as where Q m (•, •) is the Marcum's Q-function and the second equality follows from the results in [30].However, this CLT approximation may not be helpful to derive the average spectral efficiency in closed-form or with inbuilt special functions, which may also be a disadvantage of this approach.
By looking at the structures of γ 1 and γ 2 , finding the optimal φ ℓ , which maximizes the instantaneous SINR of each user, is not straightforward as in the case with reciprocal channels.This stems from the fact that the optimal φ ℓ in this case depends on phases of all channels ϕ r,ℓ , ψ t,ℓ , ψ r,ℓ and ϕ t,ℓ , and also the SINR γ 1 is a function of ϕ r,ℓ , ψ t,ℓ , and the SINR γ 2 is a function of ψ r,ℓ , ϕ t,ℓ .In this section, the optimization problem for maximizing the minimum user SINR, i.e.,min(γ 1 , γ 2 ), is to be formulated by optimizing the phase of the ℓth element of the RIS, i.e., φ ℓ , ∀l ∈ L. We consider L = 1 and L ≥ 2 cases separately.
T , and the optimization problem that maximizes min(γ 1 , γ 2 ) can be written as the following form which is equivalent with the following optimization problem Problem 2.
Problem 2 is hard to solve directly, since both γ 1 and γ 2 are non-convex functions with Φ.

C. For L ≥ 2: Solution
To get the optimal solution of Problem 2, we will make the following transformations.In the first step, by resorting to (32), we can re-write γ p where p ∈ {1, 2} as in (35), which is given on the top of this page.For p ∈ {1, 2}, define following 2L-dimensional vectors: γ p can be further written as γ p = Tr((C p + D p ) A) = Tr(F p A) = F p • A. For the matrix A, since it is composed of sin(φ l ) and cos(φ l ), and sin(φ l ) 2 + cos(φ l ) 2 = 1 for l ∈ L, A has to satisfy the following constraint I l • A = 1, ∀l ∈ L where I l is the square matrix with (2l −1)th and 2lth diagonal element being 1 and all the other elements being 0. In addition, the rank of A should be 1.Collecting the aforementioned constraints on A, Problem 2 can be reformulated as the following optimization problem Problem 3.
where A 0 indicates that the matrix A is semi-definite matrix.In Problem 3, (39a) and (39b) are equivalent with (34a).In addition, the constraints (39c), (39d) and (39e) together guarantees that the matrix A can be decomposed to be αα T where the α is as defined in (36).Collecting these facts, Problem 3 is equivalent with Problem 2. This kind of equivalent transformation has also been broadly used in literature [31].
Problem 3 is also a non-convex optimization problem due to the constraint (39d).We relax Problem 3 by dropping the constraint (39d), then Problem 3 turns to be the following optimization problem For given t, Problem 4 is a SDP feasibility problem, which can be solved with the help of CVX toolbox [32].Note that the complexity for solving Problem 4 with t given can be at the scale of O( √ 2L) according to [33].Then we need to find the maximal achievable t, which can be found by resorting to bisection-search method.Denote the initial two boundary value of t are t L and t U respectively, where t L makes Problem 4 feasible and t U makes Problem 4 infeasible.Hence the number of iterations to achieve ε-tolerance, which can guarantee the difference between the searched t and the maximal t enabling Problem 4 to be feasible lies between ε, is O(log Note that this complexity is polynomial with L. In real application, t L and t U can be found by following Algorithm 1.
Algorithm 1 Search procedure for t L and t U .
1: Initiate i = 1 and randomly select a t s value such that t s > 0. It is hard to predict the complexity of Algorithm 1, but with every step of t s increasing or decreasing exponentially, the convergence speed would be very fast.To this end, the optimal solution of Problem 4 has been found and the associated complexity has been characterized.
In the last step, we need to find a rank-1 solution of Problem 4. One broadly used method is "Gaussian randomization procedure" in [31].By following the idea of Gaussian random procedure, the rank-1 solution can be found in Algorithm 2. For brevity, the aforementioned whole procedure to solve Problem 1 when L ≥ 2 is called as SDP-relax method.
Algorithm 2 Gaussian randomization procedure for Problem 4.

4:
for l=1, 2, ..., L do 5: Normalize (2l − 1)th element and 2lth element of ξ k , denoted as ξ k 2l−1 and ξ k 2l by setting Remark: In the real application, when K is larger, better solution for Problem 4 can be achieved, which, however, will lead to higher computation complexity.A balanced selection of K is required.
To further save computational complexity, a simple iterative optimization method is also proposed, which is called as greedy-iterative method for brevity.In one iteration, only the phase of one element is optimized while keeping the phases of all the other elements unchanged.The phases of multiple elements are optimized sequentially over the iterations.In terms of optimizing the phase of one element, say φ l , the search space of [0, 2π) is quantized into a set of discretized angles {0, ∆φ, 2∆φ, ..., (K − 1)∆φ} where ∆φ = 2π K .With the discretization of the search space, K calculations are required to find the optimal selection of φ l that makes (γ 1 , γ 2 ) maximal.In this proposed method, system utility is improved in each iteration.The searching will stop when the improvement in system utility is below a predefined threshold.Suppose the number of iterations is N r , then the total computational complexity of the proposed method is O(N r K).One can adjust the number K to find a balance between complexity and performance.

A. Discussion on Scheme 2
While two users communicate simultaneously within a single time-slot in Scheme 1, U 1 and U 2 transmit the first and second time-slots, respectively, in Scheme 2. Therefore, there is no self-interference and loop-interference and this scheme can be treated as two times one-way communications.Then, the maximum instantaneous SNR of each user can be given with the aid of (10) as where P is the transmit power.The corresponding optimal phases are i) with reciprocal channels: φ ⋆ ℓ = ϕ ℓ + ψ ℓ for both users; and ii) with non-reciprocal channels: φ ⋆ ℓ = ϕ r,ℓ + ψ t,ℓ for U 1 and φ ⋆ ℓ = ϕ t,ℓ + ψ r,ℓ for U 2 .Since there is no loop interference (σ 2 i = 0) in (41), the SNR of Scheme 2 is always larger than the SINR of Scheme 1 for non-zero loop-interference, i.e., γ (10).Therefore, Scheme 2 achieves lower outage probability which can easily be deduced from ( 14) and ( 19) replacing ρ as ρ = P/σ 2 w .From Theorem 1, we can conclude that the user outage probability decreases with the rate of (log(ρ)/ρ) L over Rayleigh fading channels.
Since only one user communicates in a given frequency or time resource block, we have factor 1/2 for the average spectral efficiency in (20).It can then be derived by multiplying factor 1/2 and replacing ρ as ρ = P/σ 2 w of ( 21) and (22).With respect to the average spectral efficiency, we now discuss which transmission scheme is better for a given transmit power P .Since the direct comparison by using the spectral efficiency expressions in ( 21) and ( 22) for Scheme 1 and Scheme 2 does not yield any tractable analytical expressions for P , we compare their asymptotic expressions where the corresponding spectral efficiency expressions for Scheme 2 can be given with the aid of ( 25) and ( 26) as ; for L = 1 ; for L ≥ 2 .
Now we seek the condition for which Scheme 1 outperforms Scheme 2.

Lemma 4. The transmit power boundary where Scheme 1 outperforms Scheme 2 can be approximately given
• for σ 2 i = ω as Proof: We can derive these with direct comparisons L≥2 by using ( 25), ( 26) and (42).
Since there are no simultaneous user transmissions, these analytical expressions are also valid for non-reciprocal channels.

B. With Phase Adjustment Errors or Uncertainties
For reciprocal channels, we assume that element I ℓ introduces phase adjustment error ǫ ℓ due to channel estimation error or phase discretization error at RIS.Under these scenarios, with the aid of (10), the equivalent instantaneous SINR of each user can be written as where ǫ ℓ is an i.i.d.RV which may be distributed as uniform, i.e., ǫ ℓ ∼ U(−δ, δ) and f ǫ ℓ (t) = 1 2δ , or as the von Mises, i.e., f ǫ ℓ (t) = e κ cos(t−µ) 2πI0(κ) , t ∈ [0, 2π] where I 0 (κ) is the modified Bessel function of order zero.The parameters µ which is a measure of location (the distribution is clustered around µ) and 1/κ which is a measure of concentration are analogous to µ and σ 2 (the mean and variance) in the normal distribution [34] 3 .
• For ǫ ℓ ∼ U(−π, π): For the uniform distribution, this may be the worst case scenario.Then, the CDF of SINR can be given as in the following lemma.
, and a uniformly distributed where ρ > 0 can be given as where K n (•) is the modified Bessel function of the second kind of order n.Proof: By using the CDF of a cascade channel in [35, eq. ( 7)] and a linear RV transformation, we can conclude the proof.Thus, the exact outage probability can be evaluated by using (46) as P out = F γ (γ th ).With the aid of ( 20), ( 21) and (46) , the exact average spectral efficiency can be evaluated as • For ǫ ℓ ∼ U(−δ, δ) where δ = π or ǫ ℓ ∼ von Mises distribution: We can re-write (45) as where the derivation of F γ (t) may be difficult in these cases.One can approximate each sum by a gamma RV, and then use the bi-variate gamma distribution to derive an approximation for F γ (t).Since this is a challenging problem, we leave it as a future work.For non-reciprocal channels, optimization based on CSI is involved.In this case, two models are usually utilized to describe the CSI measurement error [36], [37].In the first model, the CSI error of the concatenated channel from user U 1 (or U 2 ) to user U 2 (or U 1 ) through the RIS is bounded, which indicates the Frobenius norm of the cascaded channel is upper limited.By resorting to the methods in [36], [37], a combination of S-procedure and penalty convex-concave procedure (CCP) can help to find the phase setting at the RIS to realize a given minimum user SINR.In the second model, the CSI error of the concatenated channel from user U 1 (or U 2 ) to user U 2 (or U 1 ) through the RIS is subject to Gaussian random distribution, rate outage probability should be imposed on every link in this case.By utilizing the methods in [36], including Bernstein-type inequality and penalty CCP, we are also able to find the phase setting at the RIS to realize a given minimum user SINR.Then bisection search of the minimum user SINR can be adopted to find the maximal achievable one under both of the above two models.Due to the limit of space, details are not presented here.The interested reader may refer to [36], [37].

VI. SIMULATION RESULTS
In this section, we investigate the performance of the RISaided two-way networks.We set channel variance σ 2 = 1.Since the thermal noise floor for 1 Hz bandwidth at room temperature can even be -174 dBm, we use -70 dBm to represent a more noisy scenario.All presented illustrations include average results over 10 6 and 10 3 independent channel realizations for the outage probability and the average spectral efficiency calculations, respectively.

A. For L = 1 with Reciprocal Channels
Fig. 4 shows the outage probability and average spectral efficiency vs P for L = 1.Several observations are gained: i) Our analytical results in ( 14) and ( 21) exactly match with the simulation results, which confirms the accuracy of our analysis; ii) For different loop interference σ 2 i − ωP ν , we notice that the outage decreases at a rate of log(P )/P and the spectral efficiency increases at a rate of log(P ) when ν = 0, and both have floors when ν = 1 due to the transmit-power dependent interference.These have been analytically proved in (23) and (25).As we expect, when ν ∈ (0, 1), e.g., ν = 0.2, the outage and spectral efficiency are in between ν = 0 and ν = 1 cases; iii) When ω reduces from 10 −4 to 10 −5 , the outage and spectral efficiency improve around 9 dB and 3.32 [bits/sec/Hz], respectively, for each case; and iv) two-way communications with Scheme 2 outperforms Scheme 1 when P < 5 dBm and P < 25 dBm for ω = 10 −5 and ω = 10 −4 , respectively, with ν = 0.For ν = 1, Scheme 2 outperforms Scheme 1 in the entire simulated region 4 .Therefore, it is important to keep the effect of loop interference independent of transmit power if two-way communications use Scheme 1.

B. For L ≥ 2 with Reciprocal Channels
For L ≥ 2, Fig. 5 shows the outage probability vs P , when loop-interference is independent of transmit power P , (a) The outage probability vs P .i.e., σ 2 i = ω.For a given L, the outage probability decreases with [log(P )/P ] L which confirms Lemma 2. Although the outage probability decreases with L, the diminishing rate also decreases, as discussed earlier with respect to (28).For example, when we increase L from 2 to 4, we can save power around 14 dBm at 10 −3 outage.However, for the same outage, we can only save power around 8 dBm when we increase L from 32 to 64.Interestingly, this figure confirms the accuracy of our gamma approximation.Moreover, it is more accurate than the CLT approximation even for L = 32 or L = 64.
For L ≥ 2, Fig. 6 shows the spectral efficiency vs P , when loop-interference is independent of transmit power P , i.e., σ 2 i = ω, and linearly dependent of transmit power P , i.e., σ 2 i = ωP .For any L, as shown in Fig. 6a and (26), the average spectral efficiency increases in order of log(P ) when σ 2 i = ω, which confirms Lemma 3.According to the figure and (28), while transmit power reduces by around 19 dBm when L increases from 2 to 16, we can only save 12 dBm when L increases from 16 to 64.We also plot the spectral efficiency of Scheme 1 and Scheme 2 in Fig. 6a where Scheme 1 starts to outperform Scheme 2 when P increases where transition happens at P ≈ 17.5, − 1.8, −14.0 dBm for L = 2, 16, 64, respectively.This compliments Lemma 4. Fig. 6b is for σ 2 i = ωP where we have spectral efficiency floors because loop-interference enhances with transmit power in Scheme 1. Due to this reason, as shown in the figure, Scheme 2 outperforms Scheme 1 when P increases.Fig. 7 shows the transition boundary of transmit power P where Scheme 1 outperforms Scheme 2 or vice versa.Based on the results in Lemma 4 and simulations, we plot P vs ω for both cases σ 2 i = ω and σ 2 i = ωP in Fig. 7a and Fig. 7b, respectively.For σ 2 i = ω, Scheme 1 outperforms at high P , and the P decreases when L increases for given ω.We have opposite observation for the other case σ 2 i = ωP .Moreover, when loop interference power is less than the noise power, i.e., ω < 10 −10 , the noise power dominates, and we have power floor.For example, the power floor is around -120 dBm with L = 16 for σ 2 i = ω case.

C. For Phase Adjustment Errors
Fig. 8 shows the outage probability and average spectral efficiency vs P for different L when there exists a phase adjustment error or uncertainty ǫ ℓ at the ℓth element of RIS.We assume that ǫ ℓ is an i.i.d.uniformly distributed RV as ǫ ℓ ∼ U[−δ, δ], where δ = 0 and δ = π represent no phase adjustment error (our main results of this paper) and random phase adjustment (the worst case scenario), respectively.we also assume that σ 2 i = ω = 10 −4 .Several observations are made: i) Our analytical results for δ = π in (46) and (47) exactly match with the simulation results, which confirms the accuracy of our analysis; ii) For different δ, we notice that the outage decreases when δ decreases where diversity gain changes from log(P )/P at δ − → π to (log(P )/P ) L at δ − → 0.

D. For Non-reciprocal Channels
Fig. 9a plots the spectral efficiency vs transmit power of both users for three types of phase adjustment techniques: 1) two fairness algorithms (SDP-relax method and greedyiterative method); 2) phase is adjusted based on U 1 , i.e., φ ℓ = ϕ r,ℓ +ψ t,ℓ ; and 3) phase is randomly adjusted.Both users U 1 and U 2 have the almost same spectral efficiency with both fairness methods, which confirms the user fairness and also corroborates that both methods provide almost same numerical values.When phase is adjusted based on U 1 , U 1 has the best performance among all, and it has around 7.5% spectral efficiency improvement at P = 0 dBm compared to two fairness algorithms.However, U 2 has the worst performance which is very similar to the case of random phase adjustment where both users have similar poor performance.The spectral efficiency reduction is around 10.5% at P = 0 dBm compared to the fairness algorithms.
Fig. 9b plots the spectral efficiency vs transmit power of U 1 for reciprocal and non-reciprocal channels with different L. When L = 1, both cases show the same spectral efficiency as phase adjustment does not effect the performance.However, when L ≥ 2, the reciprocal channel case outperforms the nonreciprocal channel case.The reason is that, for each reflective element with reciprocal channels, the effective phase for the SINR is common for both users and the corresponding optimum phase can also maximize the each user SINR.However, for each reflective element with non-reciprocal channels, the effective phases for the SINRs of two users are different and the corresponding optimum phases which maximize the minimum user SINR do not maximize the each user SINR.Therefore, we lose some spectral efficiency compared with reciprocal channel case.As illustrated in Fig. 9b, the spectral efficiency gap between these two cases increases when L increases, e.g., the difference between transmit powers which achieve spectral efficiency 15 [bits/sec/Hz] are 0.3, 2.0 and 6.5 dBm for L = 2, 4 and 16, respectively.

VII. CONCLUSION
In this work, RIS assisted systems have been proposed for two-way wireless communications.Two possible transmission schemes are introduced where Scheme 1 and Scheme 2 require one and two resource blocks (time or frequency), respectively.For both reciprocal and non-reciprocal channels, Scheme 1 is the main focus of this work.For the optimal phases of the RIS elements over reciprocal channels, the exact SINR outage probability and average spectral efficiency have been derived for a single-element RIS.Since the exact performance analysis for a multiple-element RIS seems intractable, approximations have been derived for the outage probability and average spectral efficiency.In this respect, a product of two Rayleigh random variables approximated by a gamma random variable.Moreover, asymptotic analysis has been conducted for high SINR ρ regime.Our analysis reveals that the outage probability decreases at the rate of (log(ρ)/ρ) L , whereas spectral efficiency increases at the rate of log(ρ).Moreover, we observe either an outage or spectral efficiency floor caused by transmit power dependent loop interference.Cross over boundary, where Scheme 1 outperforms Scheme 2 and vice versa, has also been approximately derived based on the asymptotic results.For non-reciprocal channels, an optimization problem is formulated, which optimizes the phases of RIS elements so as to maximize the minimum user SINR.Although being non-convex, sub-optimal solution is found by relaxing and then transforming the original optimization problem to be a SDP problem for multiple-element RIS and closed-form solution is found for single-element RIS.Simulation results have illustrated that the rate of spectral efficiency increment or transmit power saving reduces when number of elements increases.A network with reciprocal channels outperforms in terms of outage or spectral efficiency the same with nonreciprocal channels.

APPENDIX A PROOF OF THEOREM 1
With the aid of asymptotic expansion of K 1 (x) at x ≈ 0 [27, eq.8.446], we have, for a > 0,

Fig. 1 :
Fig. 1: Two transmission schemes for two-way communications.(a) Scheme 1: User 1 and User 2 transmit simultaneously in time-slot 1; and (b) Scheme 2: User 1 and User 2 transmit in time-slot 1 and time-slot 2, respectively.
(a) With reciprocal channels.(b) With non-reciprocal channels.
Then γ p where p ∈ {1, 2} can be written as γ p = c T p αα T c p +d T p αα T d p which is a quadratic form of α.Define A = αα T , C p = c p c T p , D p = d p d T p , and F p = C p + D p .It can be easily checked that the matrices A, C p , D p , and F p are all semi-definite positive matrices.With the above denotations, max The spectral efficiency vs P .

Fig. 7 :
Fig. 7: The boundary of transmit power for Scheme 1 and Scheme 2.
The spectral efficiency vs P for L = 4, 32.
Output t L and t U as the most recent t values that make Problem 4 feasible and infeasible respectively.
2: while A pair of values of t that make Problem 4 feasible and infeasible respectively have not been found do 3: if Problem 4 is feasible for t = t s then