## 3 Proposed Optimization Algorithm
### Joint Transmit Constellation and Reflectance Optimization  
In the following, if we find the transmit constellation \(\mathbf{s}\) and the coherent reflectance vector \(\bar{\mathbf{r}}\) that associated with the optimal received constellation \(\mathbf{s}^{\prime*}\), then the original problem (7) is solved. This feasible problem can be written as  
\[(\mathrm{P2}) \quad\underset{\mathbf{s},\bar{\mathbf{r}}}{Find}\quad(\mathbf{H} \bar{\mathbf{r}}+\mathbf{1})\odot\mathbf{s}=\mathbf{s}^{\prime*}\] (18) s.t. \[(\ref{eq:10}),(\ref{eq:11}),(\ref{eq:12})\]  
where \(\odot\) represents the Hadamard product (element-wise product), and \(\mathbf{H}\) is a block diagonal matrix:  
\[\mathbf{H}=\frac{1}{h_{L}} \begin{bmatrix}\mathbf{h}_{NL}^{T}&0&\cdots&0\\ 0&\mathbf{h}_{NL}^{T}&\cdots&0\\ \vdots&\vdots&\ddots&\vdots\\ 0&\cdots&0&\mathbf{h}_{NL}^{T}\end{bmatrix} _{M\times(M\!K)}.\]  
(P2) indicates a constrained system of nonlinear equations, where the decision variables \(\mathbf{s}\) and \(\bar{\mathbf{r}}\) are coupling in (18). Thus, we decompose (P2) into two sub-problems: (P2a)the coherent reflectance vector-solving problem given \(\mathbf{s}\) and (P2b) the transmit constellation-solving problem given \(\bar{\mathbf{r}}\). \[(\mathrm{P2a})\quad \begin{array}{ll}Solve&\mathrm{diag}(\mathbf{s})\mathbf{H \bar{r}}=\mathbf{s^{\prime*}-s},\quad\text{s.t.}\quad(\ref{eq:P2a}),\\ (\mathrm{P2b})\quad\begin{array}{ll}Solve&\mathrm{diag}(\mathbf{H\bar{r}+1}) \mathbf{s}=\mathbf{s^{\prime*}},\quad\text{s.t.}\quad(\ref{eq:P2a}),(\ref{eq:P2b}). \end{array}\end{array} \]  
where \(\mathrm{diag}(\cdot)\) diagonalizes the vector in parentheses. Both (P2a) and (P2b) are groups of linear equations with constraints. (P2a) is an underdetermined system of linear equations that leads to non-unique solutions. The matrix \(\mathrm{diag}(\mathbf{H\bar{r}+1})\) in (P2b) is of full rank, so there is only one optimal solution at most. To avoid the solution selection of (P2a) and the no-solution condition of (P2b), both (P2a) and (P2b) are relaxed as least-square problems:  
\[(\mathrm{P2 aR})\quad\min_{\bar{\mathbf{r}}}\parallel\mathrm{diag}( \mathbf{s})\mathbf{H\bar{r}-\mathbf{s^{\prime*}+s}}\parallel,\quad\text{s.t.} (\ref{eq:P2a})\] \[(\mathrm{P2 bR})\quad\min_{\mathbf{s}}\parallel\mathrm{diag}( \mathbf{H\bar{r}+1})\mathbf{s}-\mathbf{s^{\prime*}}\parallel,\quad\text{s.t.} (\ref{eq:P2a}),(\ref{eq:P2b}).\]  
Under the condition of zero least squares, the relaxed problems are equivalent to the original ones. As such, (P2) can by solved by alternatively solving relaxed sub-problems (P2 aR) and (P2 bR) with an initialized \(\mathbf{s}\) satisfying (9), (10), and (11). After convergence, if the output couple of \(\bar{\mathbf{r}}\) and \(\mathbf{s}\) is a feasible solution of (P2), (18) is solved. Otherwise, it can be rerun from a different initial \(\mathbf{s}\) until (P2) is solved. The optimal received constellation \(\mathbf{s^{\prime*}}\) is obtained by solving (12) with constraints (13), (14), and (15), which guarantees the solvability of (P2). The two-step joint constellation and reflectance optimization algorithm is illustrated in Algorithm 1. The relaxed least square problems with constraints can be solve using the _lsqlin_ function in Matlab or _scipy.optimize.minimize_ function in Python. Because problems (P1), (P2 aR), and (P2 bR) are simple convex problems with linear constraints, the proposed algorithm can be solved with polynomial complexity. ```
Input:\(M\): modulation order \(\bar{\mathbf{s}}\): the dimming coefficient Step1: Slove for \(\mathbf{s^{\prime*}}\) by (P1) Step2: While: 1 Initialize:\(\mathbf{s}\) satisfying (9), (10), and (11).