Abstract:This paper addresses the problem of maximizing the received power at a user equipment via reconfigurable intelligent surface (RIS) characterized by phase-dependent amplitude (PDA) and discrete phase shifts over a limited phase range. Given complex RIS coefficients, that is, discrete phase shifts and PDAs, we derive the necessary and sufficient conditions to achieve the optimal solution. To this end, we propose an optimal search algorithm that is proven to converge in linear time within at most NK steps, significantly outperforming the exhaustive search approach that would otherwise be needed for RISs with amplitude attenuation. Furthermore, we introduce a practical quantization framework for PDA-introduced RISs termed amplitude-introduced polar quantization (APQ), and extend it to a novel algorithm named extended amplitude-introduced polar quantization (EAPQ) that works with geometric projections. We derive closed-form expressions to assess how closely the performance of the proposed RIS configuration can approximate the ideal case with continuous phases and no attenuation. Our analysis reveals that increasing the number of discrete phases beyond K = 4 yields only marginal gains, regardless of attenuation levels, provided the RIS has a sufficiently wide phase range R. Furthermore, we also show and quantify that when the phase range R is limited, the performance is sensitive to attenuation for larger R, and sensitive to R when there is less attenuation. Finally, the proposed optimal algorithm provides a generic upper bound that could serve as a benchmark for discrete beamforming in RISs with amplitude constraints.