## 2 System Model
### Uplink Data Transmission  
The symbol sent from the \(k_{th}\) UE to all APs is symbolized by \(x_{k}\), and it can be detected by applying hybrid beamforming to the received signal at \(m_{th}\) AP. Then, the received signal is expressed as  
\[r_{m}=\sqrt{\rho}W_{\text{HBF}_{m}^{H}}\hat{h}_{k,m}x_{k}+\sqrt{\rho}W_{\text{ HBF}_{m}^{H}}\sum_{k\
eq k}^{K}\hat{h}_{k,m}x_{k}+W_{\text{HBF}_{m}^{H}}n_{m}, \tag{10}\]  
where \(\rho\) is the average transmit power from all UEs, and \(x_{k}\) represents the transmitted symbol by \(k_{th}\) UE, and thus \(x=[x_{1},\ldots,x_{K}]^{T}\) with \(\mathbb{E}\{xx^{H}\}=I_{K}\). In addition, \(n_{m}\sim\mathcal{CN}(0,\sigma^{2})\) is a vector of the noise, while the hybrid analog/digital combining is \(W_{\text{HBF}_{m}^{H}}=W_{m}w_{BB,k,m}\), where \(w_{BB,k}\in\mathbb{C}^{K\times 1}\) denotes the digital combining vector for \(x_{k}\) at \(m_{th}\) AP, and \(W_{m}\in\mathbb{C}^{N_{r}\times K}\) is the analog combining matrix at \(m_{th}\) AP. Note that the first term in (10) represents the received desired signal at \(m_{th}\) AP, the second term describes the interference that happened due to utilizing the imperfect CSI, and the last term is the additive noise. In addition, the sum of the second and third terms is considered to be the interference plus noise, which is also known as effective noise. These two terms are uncorrelated. Moreover, the uncorrelated Gaussian noise is the worst case of the capacity. Furthermore, the received signal at each AP is forwarded to the CPU, and it is simultaneously processed using \(w_{BB,k,m}\). The \(w_{BB,k,m}\) can be obtained by the MMSE beamforming scheme, which uses the effective channel \(\hat{H}_{m}^{e}=W_{m}\hat{H}_{m}\)[22, 31]. Specifically, the \(w_{BB,k,m}\) is expressed as  
\[w_{BB,k,m}=(1+\frac{\rho}{\sigma^{2}}(\hat{H}_{m}^{e}\hat{H}_{m}^{e^{H}}))^{-1 }\hat{h}_{k,m,e^{\prime}}^{H},\ k=1,2,\ldots,K \tag{11}\]  
where \(\hat{h}_{k,m,e}^{H}\) is the \(k_{th}\) column of \(\hat{H}_{m}^{e}\). There are two main stages to obtain \(W_{m}\), as mentioned in [22]. The first stage is to consider all switches in the active state, and the switching matrices corresponding to \(\Delta_{m}\) and \(\Delta_{k,m}\) are symbolized by \(\hat{\Delta}_{m}\) and \(\hat{\Delta}_{k,m}\), respectively, with the same matrix sizes. As a consequence, the previously mentioned constraints are modified for each AP as \(\sum_{i=1}^{N_{0}}[\hat{\Delta}_{k,m}]_{n,i}=1\), and \(\sum_{i=1}^{N_{0}}\sum_{n=1}^{N_{r}}[\hat{\Delta}_{k,m}]_{n,i}=N_{r}\). Thus, \(\hat{W}_{m}\in\mathbb{C}^{N_{r}\times K}\) denotes the analog combiner that has non-zero elements due to the active states for all switches at \(m_{th}\) AP. Euclidean distance is adopted to design the switching matrix \(\hat{\Delta}_{m}\in\mathcal{B}^{N_{r}N_{0}\times K}\). Wealso utilize QR decomposition to express \(\hat{H}_{m}=\hat{H}_{m}Q_{m}\) in which \(\hat{H}_{m}\in\mathbb{C}^{N_{r}\times K}\) and \(Q_{m}\in\mathbb{C}^{K\times K}\) are orthogonal and right-triangular matrices, respectively. In addition, CPSs with their phase of the channel coefficient of \(n_{th}\) antenna in each AP \(\hat{\theta}_{k,m_{n}}\) from \(\omega_{m}\) corresponding to \([\hat{h}_{k,m}]_{n}\) can be selected by the antenna's switch in \(\hat{\Delta}_{k,m}\) based on the shortest Euclidean distance. Thus, \(\bar{\theta}_{k,m_{n}}\) can be obtained by  
\[\bar{\theta}_{k,m_{n}}=\frac{2\pi(\bar{q}-1)}{N_{Q}}, \tag{12}\]  
where \(\bar{q}\) is the index of the selected CPSs, which is given by  
\[\bar{q}=\arg\min_{q\in\{1,...,N_{Q}\}}\mid\theta_{k,m}-\frac{2\pi(q-1)}{N_{Q} }\mid, \tag{13}\]  
where \(\theta_{k,m}=[\tilde{h}_{k,m}]_{n}\). Thus, the \(n_{th}\) antenna switch that corresponds to \(\bar{q}\) is in an active state. The next stage considers a strategy to convert \(\hat{\Delta}_{m}\), which can be generated in the previous stage by considering all antennas for each AP as active, to \(\Delta_{m}\) which describes the selected antennas for each RF chain in each AP.