  Simultaneously transmitting and reflecting (STAR) reconfigurable intelligent
surface (RIS), which serves users located on both sides of the surface, has
recently emerged as a promising enhancement to the traditional reflective only
RIS. Due to the lack of a unified comparison of communication systems equipped
with different modes of STAR-RIS and the performance degradation caused by the
constraints involving discrete selection, this paper proposes a unified
optimization framework for handling the STAR-RIS operating mode and discrete
phase constraints. With a judiciously introduced penalty term, this framework
transforms the original problem into two iterative subproblems, with one
containing the selection-type constraints, and the other subproblem handling
other wireless resource. Convergent point of the whole algorithm is found to be
at least a stationary point under mild conditions. As an illustrative example,
the proposed framework is applied to a sum-rate maximization problem in the
downlink transmission. Simulation results show that the algorithms from the
proposed framework outperform other existing algorithms tailored for different
STAR-RIS scenarios. Furthermore, it is found that 4 or even 2 discrete phases
STAR-RIS could achieve almost the same sum-rate performance as the continuous
phase setting, showing for the first time that discrete phase is not
necessarily a cause of significant performance degradation.
