## 3 The Hybrid HM-QAM Scheme for Multi-User Scenario
```
0: The THz channel power gain \(h_{1},h_{2},h_{3}\) of farther user, closer user on the common frequency and closer user on the remaining frequency, the available bandwidth of closer and farther users \(B1\) and \(B2\), the total power of base station \(P_{\text{total}}\) and iteration step size \(t\). 0: The optimal transmit power \(P_{1}^{*}\), \(P_{2}^{*}\) and \(P_{3}^{*}\) and modulation order \(M_{1}^{*}\), \(M_{2}^{*}\) and \(M_{3}^{*}\) and the maximal data rate \(R^{*}\). 1:\(P_{1}=0.01:t:P_{\text{total}}\)
2:for\(P_{1}\)do
3: Obtain the optimal \(P_{2}\) by deriving of \(R\) with respect to \(P_{2}\). 4: Obtain the value of \(P_{3}\) according to \(P_{3}=P_{\text{total}}-P_{1}-P_{2}\). 5: Substitute the obtained \(P_{1},P_{2}\) and \(P_{3}\) into \(R\) to get the maximal data rate \(R\). 6: Substitute the obtained \(P_{1},P_{2}\) and \(P_{3}\) into \(M_{1},M_{2}\) and \(M_{3}\) to get the optimal modulation order. 7:endfor
8: Obtain the final \(R^{*}\) according to \(\max(R)\) and the corresponding the optimal \(P_{1}^{*},P_{2}^{*},P_{3}^{*},M_{1}^{*},M_{2}^{*}\) and \(M_{3}^{*}\). ```  
**Algorithm 1** 1-D Search Extreme Point Algorithm  
Algorithm 1 includes one outer loop, and in each iteration, there are 6 mathematical operation. Therefore, the total computation complexity is \(\frac{6P_{\text{total}}}{t}\), where \(t\) is the search step size. Due to the convexity of the optimization problem in each iteration, Algorithm 1 can finally attain an optimal value. Therefore, we can see that the computational cost is determined by the step size. When the step is smaller, the computation cost is larger and vice versa. However, when the step size \(t\) is smaller, the optimal solution is more accurate. For large-scale or high-dimensional problems, due to low efficiency and scalability, exhaustive search algorithms can lead to extremely high computational and time costs. In practice, if the search process or stopping conditions are improperly set, it might only find local optimal solutions. Therefore, it is necessary to consider various optimization strategies, such as using heuristic methods to reduce the search space, or utilizing high-performance computing resources to enhance the processing speed, thereby improving the usability and efficiency of exhaustive search algorithms in real-world problems. For HM, the modulation scheme is formulated as  
\[ \begin{split}&\text{HM}:\max_{M_{1},M_{2},P_{1},P_{2}}B\log_{2}M_{1}+B \log_{2}M_{2}\\ & s.t.\\ & C1:M_{1}\leq 1+\frac{-1.5}{\log_{2}5P_{3}}\frac{P_{1}|h_{2}|^{2}}{ \log_{2}8}\\ & C2:M_{2}\leq 1+\frac{-1.5}{\log_{2}5P_{3}}\bigg{(}\frac{P_{2}|h_{1}|^{ 2}}{P_{1}|h_{1}|^{2}+N_{0}B}+\frac{P_{1}|h_{2}|^{2}}{N_{0}B}\\ &\qquad\qquad\qquad\qquad\qquad\qquad\qquad+\frac{-1.5}{\log_{2 }5P_{3,2}}\frac{P_{1}|h_{1}|^{2}}{N_{0}B}\frac{P_{2}|h_{1}|^{2}}{P_{1}|h_{1}|^{ 2}+N_{0}B}\bigg{)}\\ & C3:P_{1}+P_{2}\leq P_{total}.\end{split}  \tag{9}\]  
According to the convex theory, when C1 and C2 takes equality, the data rate is maximized with  
\[ \begin{split}& R=B\log_{2}\bigg{(}1+\frac{P_{2}h_{1}}{P_{1}h_{1}+N_{ 0}B}\frac{-1.5}{\log_{2}5P_{b,1}}\bigg{)}\\ &+B\log_{2}\bigg{(}1+\frac{P_{2}h_{2}}{N_{0}B}\frac{-1.5}{\log_{2 }5P_{b,2}}\bigg{)}\\ &+B\log_{2}\bigg{(}1+\frac{P_{1}h_{1}}{N_{0}B}\frac{-1.5}{\log_{2 }5P_{b,1}}\bigg{)}.\end{split}  \tag{10}\]By replacing \(P_{2}\) with \(P_{2}=P_{total}-P_{1}\), due to \(\frac{d^{2}R}{dP_{1}^{2}}\leq 0\), \(R\) is convex with respect to \(P_{1}\). By setting \(\frac{dR}{dP_{1}}=0\), we can obtain the optimal value of \(P_{1}\). Substituting \(P_{1}^{*}\) and \(P_{2}^{*}=P_{total}-P_{1}^{*}\) into (10), we can get the maximal data rate. For HBM, the modulation scheme is formulated as  
\[