Algorithm Search⌘K

Algorithmadvanced

Weighted MMSE precoding

Also called WMMSE algorithm.

Maximizes the weighted sum rate of a MIMO broadcast or interference channel by alternating updates of an equivalent MSE problem.

Time
O(T (K M^2 + K^2 M + B M^2 (M + K))) worst
Space
O(M^2 + M K) extra
Where
B = the number of Newton steps for the multiplier; K = the number of users; M = the number of base station antennas; T = the number of iterations
Properties
deterministicnot global optimumiterativelinearmonotoneneeds channel at transmitter
Origin
Qingjiang Shi, Meisam Razaviyayn, Zhi Quan Luo, Chen He, Søren Skovgaard Christensen, Rajiv Agarwal, Elisabeth de Carvalho, John M. Cioffi, 2011

Weighted MMSE (WMMSE) precoding finds the precoders of a multiuser downlink that maximize a weighted sum rate, ∑kaklog⁡2(1+SINRk)\sum_k a_k \log_2(1 + \mathrm{SINR}_k). The rate problem is not convex, but it has the same solutions as a weighted mean square error problem with extra variables, and that problem is easy in each block of variables. WMMSE updates the receive gains, the MSE weights and the precoders in turn, and the rate never decreases. Regularized zero-forcing precoding is a closed form with one regularization for all users and no target. WMMSE has the same kind of regularized inverse in each step, but it iterates, adapts a weight for each user, and aims at any weighted sum rate. The cost is several iterations, and the result is a stationary point, which is not always the global optimum.

In plain words

A base station sends to several phones at once, and each phone has a priority. The base station wants the largest total speed, where faster speed for a high priority phone counts more. The direct problem is hard. So the base station pretends each phone has a simple receiver and asks how much error that receiver makes. It then repeats three easy steps: tune each receiver for the current beams, give each phone a weight from its error, and choose the beams that make the weighted errors smallest with the power it has. Each round makes the total speed better or keeps it the same. After some rounds the beams stop changing. The answer is good, but a different start can sometimes give a better one.

The problem

User kk has one antenna and receives yk=hkHx+wky_k = h_k^H x + w_k, with hk∈CMh_k \in \mathbb{C}^M known at the base station and wk∼CN(0,N0)w_k \sim \mathcal{CN}(0, N_0). The base station sends x=∑kvkskx = \sum_k v_k s_k with independent unit-energy symbols sks_k and the power constraint ∑k∥vk∥2≤P\sum_k \|v_k\|^2 \le P. With

SINRk=∣hkHvk∣2∑j≠k∣hkHvj∣2+N0,\mathrm{SINR}_k = \frac{|h_k^H v_k|^2}{\sum_{j \ne k} |h_k^H v_j|^2 + N_0},

the goal is to maximize R=∑kaklog⁡2(1+SINRk)R = \sum_k a_k \log_2(1 + \mathrm{SINR}_k) for given weights ak>0a_k > 0. This is weighted sum rate maximization for the multiple-input single-output (MISO) downlink. The problem is NP-hard in general. The same method works for users with several antennas and for several base stations, with matrices in place of the scalars uku_k and wkw_k; the code on this page covers the MISO case.

The algorithm

User kk estimates sks_k as uˉkyk\bar u_k y_k with the mean square error ek=E∣uˉkyk−sk∣2e_k = E|\bar u_k y_k - s_k|^2. WMMSE minimizes ∑kak(wkek−ln⁡wk)\sum_k a_k (w_k e_k - \ln w_k) over the gains uku_k, the weights wk>0w_k > 0 and the precoders, one block at a time.

  1. WMMSE(h₁, ..., h_K, a, P, N0)
  2. 1V ← a start with Σ‖v_k‖² ≤ P ▷ for example the beams h_k, scaled to the power P
  3. repeat
  4. for each user k:
  5. T_k ← Σ_j |h_kᴴ v_j|² + N0
  6. 2u_k ← h_kᴴ v_k / T_k ▷ the MMSE receive gain
  7. 3w_k ← 1 / (1 - ū_k h_kᴴ v_k) ▷ the inverse of the smallest MSE
  8. 4A ← Σ_k a_k w_k |u_k|² h_k h_kᴴ; b_k ← a_k w_k u_k h_k
  9. 5μ ← the smallest μ ≥ 0 with Σ_k ‖(A + μI)⁻¹ b_k‖² ≤ P; v_k ← (A + μI)⁻¹ b_k
  10. 6R ← Σ_k a_k log₂(1 + SINR_k)
  11. 7until R grows by less than a tolerance
  12. return V

Line L2 is the scalar MMSE receiver for the current beams. Line L3 sets the weight to 1/ek=1+SINRk1/e_k = 1 + \mathrm{SINR}_k. Lines L4 and L5 solve a convex quadratic problem with one power constraint, whose KKT conditions give a regularized inverse with a Lagrange multiplier μ\mu. The power decreases in μ\mu, so the implementation finds μ\mu by Newton steps inside a bracket. Each round is one pass of block coordinate descent.

Example

Take three users with orthogonal channels h1=2e1h_1 = 2 e_1, h2=e2h_2 = e_2 and h3=0.5e3h_3 = 0.5 e_3, so the gains are g=(4,1,1/4)g = (4, 1, 1/4). Let the weights be a=(1,2,1.5)a = (1, 2, 1.5), with P=3P = 3 and N0=1N_0 = 1. There is no interference, so the best powers are the weighted water-filling pk=(ak/λ−1/gk)+p_k = (a_k / \lambda - 1/g_k)^+ with ∑kpk=3\sum_k p_k = 3. With users 1 and 2 active, 3/λ−1/4−1=33/\lambda - 1/4 - 1 = 3 gives 1/λ=17/121/\lambda = 17/12, so p1=7/6p_1 = 7/6 and p2=11/6p_2 = 11/6. User 3 gets no power, because a3g3=0.375a_3 g_3 = 0.375 is below λ=12/17\lambda = 12/17. The best weighted sum rate is log⁡2(17/3)+2log⁡2(17/6)=5.508\log_2(17/3) + 2 \log_2(17/6) = 5.508 bits per channel use.

WMMSE starts with the beams hkh_k scaled to the power 3.

iteration p1p_1 p2p_2 p3p_3 weighted sum rate
0 2.286 0.571 0.143 4.722
1 1.924 1.042 0.034 5.198
2 1.669 1.323 0.008 5.376
3 1.500 1.498 0.002 5.450
10 1.186 1.814 0.000 5.505
35 1.167 1.833 0.000 5.508

The rate grows in every row and the powers move toward (7/6,11/6,0)(7/6, 11/6, 0). Equal powers of 1 give only 4.805. With equal weights, water-filling would give p1=1.875p_1 = 1.875 and p2=1.125p_2 = 1.125; the weight 2 of user 2 moves power toward that user.

Correctness

The proof is in proofs/correctness.md. Lemma 1 shows that line L2 minimizes the MSE and that the minimum is 1/(1+SINRk)1/(1 + \mathrm{SINR}_k). Lemma 2 shows that line L3 is the best weight. Together they give min⁡u,wG=∑kak−ln⁡2⋅R\min_{u, w} G = \sum_k a_k - \ln 2 \cdot R, so the MSE problem and the rate problem have the same solutions. Lemma 3 shows that lines L4 and L5 give the best precoders for fixed uu and ww. Theorem 1 shows that each iteration keeps the power at most PP and never decreases RR, so the rates converge. Theorem 2 shows that every fixed point satisfies the KKT conditions of the weighted sum rate problem. Theorem 3 shows that with one user WMMSE gives maximum ratio transmission, and Theorem 4 shows that with orthogonal channels the optimum is weighted water-filling, as in the example.

Proof: The WMMSE iteration never decreases the weighted sum rate, meets the power constraint, and its fixed points are KKT points of the weighted sum rate problemfull

The model is yk=hkHx+wky_k = h_k^H x + w_k for k=1,…,Kk = 1, \ldots, K, with hk∈CMh_k \in \mathbb{C}^M, wk∼CN(0,N0)w_k \sim \mathcal{CN}(0, N_0), N0>0N_0 > 0, and x=∑kvkskx = \sum_k v_k s_k with independent unit-energy symbols. Let Tk(V)=∑j∣hkHvj∣2+N0T_k(V) = \sum_j |h_k^H v_j|^2 + N_0 and SINRk(V)=∣hkHvk∣2/(Tk−∣hkHvk∣2)\mathrm{SINR}_k(V) = |h_k^H v_k|^2 / (T_k - |h_k^H v_k|^2). For weights ak>0a_k > 0, the problem is

maximize R(V)=∑kaklog⁡2(1+SINRk(V))subject to∑k∥vk∥2≤P.\text{maximize } R(V) = \sum_k a_k \log_2(1 + \mathrm{SINR}_k(V)) \quad \text{subject to} \quad \sum_k \|v_k\|^2 \le P.

The receiver of user kk estimates sks_k as uˉkyk\bar u_k y_k. Its MSE is ek(uk,V)=E∣uˉkyk−sk∣2=∣uk∣2Tk−2Re(uˉkhkHvk)+1e_k(u_k, V) = E|\bar u_k y_k - s_k|^2 = |u_k|^2 T_k - 2 \mathrm{Re}(\bar u_k h_k^H v_k) + 1. WMMSE works on

G(u,w,V)=∑kak(wkek(uk,V)−ln⁡wk),wk>0.G(u, w, V) = \sum_k a_k \bigl(w_k e_k(u_k, V) - \ln w_k\bigr), \qquad w_k > 0.

Lines L2, L3 and L4 to L6 minimize GG over uu, over ww and over VV, in turn.

Lemma 1 (the receive step). For fixed VV, eke_k is minimized by uk=hkHvk/Tku_k = h_k^H v_k / T_k (line L2), with the minimum ek⋆=1−uˉkhkHvk=1/(1+SINRk)e_k^\star = 1 - \bar u_k h_k^H v_k = 1 / (1 + \mathrm{SINR}_k), which lies in (0,1](0, 1].

Proof. eke_k is a convex quadratic in uku_k with the positive coefficient Tk≥N0T_k \ge N_0, and its gradient with respect to uˉk\bar u_k is Tkuk−hkHvkT_k u_k - h_k^H v_k. At the zero, ek=∣hkHvk∣2/Tk−2∣hkHvk∣2/Tk+1=1−∣hkHvk∣2/Tke_k = |h_k^H v_k|^2 / T_k - 2 |h_k^H v_k|^2 / T_k + 1 = 1 - |h_k^H v_k|^2 / T_k, which is 1−uˉkhkHvk1 - \bar u_k h_k^H v_k and equals (Tk−∣hkHvk∣2)/Tk=1/(1+SINRk)(T_k - |h_k^H v_k|^2) / T_k = 1 / (1 + \mathrm{SINR}_k). It is positive because Tk−∣hkHvk∣2≥N0>0T_k - |h_k^H v_k|^2 \ge N_0 > 0. □\square

Lemma 2 (the weight step). For e>0e > 0, we−ln⁡ww e - \ln w over w>0w > 0 has the unique minimizer w=1/ew = 1/e (line L3), with the value 1+ln⁡e1 + \ln e.

Proof. The function is strictly convex in ww, and its derivative e−1/we - 1/w is zero only at w=1/ew = 1/e. □\square

So, with F(V)=min⁡u,wG(u,w,V)F(V) = \min_{u, w} G(u, w, V), Lemmas 1 and 2 give

F(V)=∑kak(1+ln⁡ek⋆)=∑kak−ln⁡2⋅R(V).F(V) = \sum_k a_k \bigl(1 + \ln e_k^\star\bigr) = \sum_k a_k - \ln 2 \cdot R(V).

Minimizing FF is the same as maximizing RR.

Lemma 3 (the precoder step). For fixed uu and ww, let A=∑jajwj∣uj∣2hjhjHA = \sum_j a_j w_j |u_j|^2 h_j h_j^H and bk=akwkukhkb_k = a_k w_k u_k h_k. Then G(u,w,V)=∑k(vkHAvk−2Re(bkHvk))+cG(u, w, V) = \sum_k \bigl(v_k^H A v_k - 2 \mathrm{Re}(b_k^H v_k)\bigr) + c, where cc does not depend on VV. A minimizer over ∑k∥vk∥2≤P\sum_k \|v_k\|^2 \le P is vk=(A+μI)−1bkv_k = (A + \mu I)^{-1} b_k, with μ=0\mu = 0 if this choice with μ=0\mu = 0 is defined and meets the power, and otherwise the μ>0\mu > 0 with ∑k∥(A+μI)−1bk∥2=P\sum_k \|(A + \mu I)^{-1} b_k\|^2 = P.

Proof. Expand ∑kakwkek\sum_k a_k w_k e_k. The quadratic part is ∑kakwk∣uk∣2∑j∣hkHvj∣2=∑jvjHAvj\sum_k a_k w_k |u_k|^2 \sum_j |h_k^H v_j|^2 = \sum_j v_j^H A v_j, and the linear part is −2Re∑kakwkuˉkhkHvk=−2Re∑kbkHvk-2 \mathrm{Re} \sum_k a_k w_k \bar u_k h_k^H v_k = -2 \mathrm{Re} \sum_k b_k^H v_k. AA is positive semidefinite, so the problem is convex, and V=0V = 0 is strictly feasible, so the KKT conditions are necessary and sufficient: (A+μI)vk=bk(A + \mu I) v_k = b_k, μ≥0\mu \ge 0, ∑k∥vk∥2≤P\sum_k \|v_k\|^2 \le P and μ(∑k∥vk∥2−P)=0\mu (\sum_k \|v_k\|^2 - P) = 0. If AA is invertible and f(0)≤Pf(0) \le P, where f(μ)=∑k∥(A+μI)−1bk∥2f(\mu) = \sum_k \|(A + \mu I)^{-1} b_k\|^2, then μ=0\mu = 0 satisfies them. Otherwise, in the eigenbasis A=∑iλiqiqiHA = \sum_i \lambda_i q_i q_i^H, f(μ)=∑i,k∣qiHbk∣2/(λi+μ)2f(\mu) = \sum_{i, k} |q_i^H b_k|^2 / (\lambda_i + \mu)^2, which is continuous and strictly decreasing on (0,∞)(0, \infty) (unless all bk=0b_k = 0, when V=0V = 0 is optimal) and tends to 0. Each bkb_k is 0 or a multiple of hkh_k with uk≠0u_k \ne 0, and then hkh_k is in the range of AA, so bkb_k has no component on the eigenvectors with λi=0\lambda_i = 0. So f(0+)=lim⁡μ→0f(μ)f(0^+) = \lim_{\mu \to 0} f(\mu) is finite. If f(0+)>Pf(0^+) > P, there is a unique μ>0\mu > 0 with f(μ)=Pf(\mu) = P, and it satisfies the KKT conditions. If f(0+)≤Pf(0^+) \le P, the limit μ→0+\mu \to 0^+ gives the minimum norm solution of Avk=bkA v_k = b_k, which satisfies them with μ=0\mu = 0. □\square

The implementation finds the root of f(μ)=Pf(\mu) = P by Newton's method on f−1/2f^{-1/2}, kept inside a bracket [lo,hi][\mathrm{lo}, \mathrm{hi}] with f(lo)>P≥f(hi)f(\mathrm{lo}) > P \ge f(\mathrm{hi}); the start hi=∑k∥bk∥2/P\mathrm{hi} = \sqrt{\sum_k \|b_k\|^2 / P} is valid because f(μ)≤∑k∥bk∥2/μ2f(\mu) \le \sum_k \|b_k\|^2 / \mu^2. It stops when ∣f−P∣≤10−14P|f - P| \le 10^{-14} P, or returns the precoder at hi\mathrm{hi}, which meets the power.

Theorem 1 (monotone rate). Let VtV^t be the precoder after iteration tt, with V0V^0 feasible. Then every VtV^t is feasible and R(Vt+1)≥R(Vt)R(V^{t+1}) \ge R(V^t). The sequence R(Vt)R(V^t) converges.

Proof. Let (ut,wt)(u^t, w^t) be the outputs of lines L2 and L3 for VtV^t. By Lemmas 1 and 2, G(ut,wt,Vt)=F(Vt)G(u^t, w^t, V^t) = F(V^t). By Lemma 3, Vt+1V^{t+1} minimizes G(ut,wt,⋅)G(u^t, w^t, \cdot) over the feasible set, which contains VtV^t, so Vt+1V^{t+1} is feasible and G(ut,wt,Vt+1)≤G(ut,wt,Vt)G(u^t, w^t, V^{t+1}) \le G(u^t, w^t, V^t). By the definition of FF as a minimum, F(Vt+1)≤G(ut,wt,Vt+1)F(V^{t+1}) \le G(u^t, w^t, V^{t+1}). So F(Vt+1)≤F(Vt)F(V^{t+1}) \le F(V^t), which is R(Vt+1)≥R(Vt)R(V^{t+1}) \ge R(V^t). The rate is bounded: SINRk≤∣hkHvk∣2/N0≤P∥hk∥2/N0\mathrm{SINR}_k \le |h_k^H v_k|^2 / N_0 \le P \|h_k\|^2 / N_0. A bounded nondecreasing sequence converges. □\square

Theorem 2 (fixed points are KKT points). If VV is a fixed point of one iteration, then VV satisfies the KKT conditions of the weighted sum rate problem: ∇vˉkR(V)=λvk\nabla_{\bar v_k} R(V) = \lambda v_k for all kk with one λ≥0\lambda \ge 0, and λ(∑k∥vk∥2−P)=0\lambda (\sum_k \|v_k\|^2 - P) = 0.

Proof. Lemma 1 gives u(V)u(V) and Lemma 2 gives w(V)w(V) as smooth functions of VV (as functions of the real and imaginary parts), because Tk>0T_k > 0 and ek⋆>0e_k^\star > 0. So F(V)=G(u(V),w(V),V)F(V) = G(u(V), w(V), V) is smooth, and by the chain rule

∇VF=∇VG+(∇uG) ∂u∂V+(∇wG) ∂w∂V=∇VGat (u(V),w(V),V),\nabla_V F = \nabla_V G + (\nabla_u G)\, \frac{\partial u}{\partial V} + (\nabla_w G)\, \frac{\partial w}{\partial V} = \nabla_V G \quad \text{at } (u(V), w(V), V),

since ∇uG=0\nabla_u G = 0 and ∇wG=0\nabla_w G = 0 at the minimizers u(V)u(V) and w(V)w(V), which are interior points. At a fixed point, VV is the output of Lemma 3 for (u(V),w(V))(u(V), w(V)), so ∇vˉkG+μvk=0\nabla_{\bar v_k} G + \mu v_k = 0 with μ≥0\mu \ge 0 and μ(∑k∥vk∥2−P)=0\mu (\sum_k \|v_k\|^2 - P) = 0. Hence ∇vˉkF+μvk=0\nabla_{\bar v_k} F + \mu v_k = 0. With F=∑kak−ln⁡2⋅RF = \sum_k a_k - \ln 2 \cdot R, this is ∇vˉkR=(μ/ln⁡2)vk\nabla_{\bar v_k} R = (\mu / \ln 2) v_k, the KKT condition with λ=μ/ln⁡2\lambda = \mu / \ln 2. □\square

The problem is not convex, so a KKT point can be a local maximum or a saddle point and not the global maximum. The tests include a two-user channel where the default start converges to a worse point than another start.

Theorem 3 (one user). For K=1K = 1, every precoder step returns a multiple of h1h_1, and the only fixed points are v1=ejϕP h1/∥h1∥v_1 = e^{j \phi} \sqrt{P}\, h_1 / \|h_1\|, the maximum ratio transmission beam with the rate a1log⁡2(1+P∥h1∥2/N0)a_1 \log_2(1 + P \|h_1\|^2 / N_0), which is the global maximum.

Proof. Here A=c h1h1HA = c\, h_1 h_1^H with c=a1w1∣u1∣2c = a_1 w_1 |u_1|^2 and b1=a1w1u1h1b_1 = a_1 w_1 u_1 h_1. h1h_1 is an eigenvector of A+μIA + \mu I, so (A+μI)−1b1(A + \mu I)^{-1} b_1 is a multiple of h1h_1 (the minimum norm solution for μ→0+\mu \to 0^+ too). For the fixed points, let v1=βh1v_1 = \beta h_1 with p=∣β∣2∥h1∥2≤Pp = |\beta|^2 \|h_1\|^2 \le P and S=∣h1Hv1∣2=p∥h1∥2S = |h_1^H v_1|^2 = p \|h_1\|^2. If μ=0\mu = 0 at a fixed point, then v1=h1/(uˉ1∥h1∥2)v_1 = h_1 / (\bar u_1 \|h_1\|^2), so p=1/(∣u1∣2∥h1∥2)=(S+N0)2/(S∥h1∥2)p = 1 / (|u_1|^2 \|h_1\|^2) = (S + N_0)^2 / (S \|h_1\|^2), and with S=p∥h1∥2S = p \|h_1\|^2 this gives S2=(S+N0)2S^2 = (S + N_0)^2, which is impossible for N0>0N_0 > 0. So μ>0\mu > 0 and p=Pp = P. The rate log⁡2(1+∣h1Hv1∣2/N0)\log_2(1 + |h_1^H v_1|^2 / N_0) is at most log⁡2(1+P∥h1∥2/N0)\log_2(1 + P \|h_1\|^2 / N_0) by the Cauchy-Schwarz inequality, with equality exactly for these beams. □\square

Theorem 4 (orthogonal channels). If hk=gkN0 qkh_k = \sqrt{g_k N_0}\, q_k for orthonormal q1,…,qKq_1, \ldots, q_K, the maximum of RR is ∑kaklog⁡2(1+gkpk)\sum_k a_k \log_2(1 + g_k p_k) with the weighted water-filling powers pk=(ak/λ−1/gk)+p_k = (a_k / \lambda - 1 / g_k)^+, where λ>0\lambda > 0 is set by ∑kpk=P\sum_k p_k = P.

Proof. For any feasible VV, SINRk≤∣hkHvk∣2/N0≤gk∥vk∥2\mathrm{SINR}_k \le |h_k^H v_k|^2 / N_0 \le g_k \|v_k\|^2, so R(V)≤∑kaklog⁡2(1+gk∥vk∥2)R(V) \le \sum_k a_k \log_2(1 + g_k \|v_k\|^2) with ∑k∥vk∥2≤P\sum_k \|v_k\|^2 \le P. The right side is a concave function of the powers ∥vk∥2\|v_k\|^2, and its KKT conditions give akgk/(1+gkpk)=λa_k g_k / (1 + g_k p_k) = \lambda for pk>0p_k > 0 and akgk≤λa_k g_k \le \lambda for pk=0p_k = 0 (the factor 1/ln⁡21 / \ln 2 is put into λ\lambda), which is the formula. The choice vk=pk qkv_k = \sqrt{p_k}\, q_k gives no interference and SINRk=gkpk\mathrm{SINR}_k = g_k p_k, so it reaches the bound. □\square

The tests check Theorem 1 (the rate never drops by more than 10−1210^{-12} in 15 iterations, for up to 8 users and 8 antennas), the power within 10−910^{-9}, Theorem 2 by a finite difference gradient at convergence, Theorem 3, Theorem 4 (WMMSE reaches the weighted water-filling value), a grid search over the beam parameters for two users (the best of six starts matches the grid within 10−310^{-3} and is never below it), and the local optimum mentioned after Theorem 2.

Complexity

One iteration computes the K×KK \times K matrix of values hkHvjh_k^H v_j in O(K2M)O(K^2 M) and the matrix AA in O(KM2)O(K M^2). Each Newton step of line L5 solves a linear system with MM unknowns and KK right sides in O(M3+M2K)O(M^3 + M^2 K), and BB steps are needed. With TT iterations, the time is O(T(KM2+K2M+BM2(M+K)))O(T (K M^2 + K^2 M + B M^2 (M + K))). An eigendecomposition of AA once per iteration makes each later evaluation of the power cheaper. The extra space is O(M2)O(M^2) for AA and O(MK)O(M K) for the precoders. The number of iterations depends on the channel and the start; it is often tens, but there is no small bound.

Properties

  • Monotone. The weighted sum rate never decreases from one iteration to the next (theorem).
  • Feasible. Each iterate meets the power constraint, and the power is exactly PP whenever μ>0\mu > 0 (theorem).
  • Stationary limit. Every fixed point is a KKT point of the weighted sum rate problem (theorem).
  • Not always global. The problem is not convex, and WMMSE can stop at a local optimum.
  • Regularized inverse structure. Each precoder has the form (A+μI)−1hk(A + \mu I)^{-1} h_k times a scalar, the same structure as the optimal beams.
  • Exact special cases. One user gives maximum ratio transmission, and orthogonal channels give weighted water-filling (theorems).
  • Linear. The output is a linear precoder, so the cost per symbol is O(MK)O(M K).

Variants and improvements

  • Users with several antennas. Replace uku_k by a receive matrix and wkw_k by a weight matrix; the steps stay closed forms, and the method then optimizes the rate of each MIMO link.
  • Interfering broadcast channel. Shi, Razaviyayn, Luo and He apply the same steps to several base stations, each with its own power constraint, and each base station can compute its own update.
  • Other utilities. A change of the weight update handles proportional fairness, the harmonic mean rate and other utilities of the rates.
  • Scheduling weights. In a scheduler, the weights aka_k come from queue lengths or from average rates, as in proportional fair scheduling.
  • Several starts. Run from the maximum ratio transmission beams, from the zero-forcing beams and from random beams, and keep the best result.
  • Linear alternatives. Zero-forcing and block diagonalization are cheaper and close to WMMSE at high SNR; dirty paper coding is the nonlinear scheme that reaches the capacity of the broadcast channel.

When to use it

Use WMMSE when the base station has good channel knowledge, the users have different priorities, and there is time for a few tens of matrix inversions per channel update. It is a standard reference design for the weighted sum rate of the MIMO downlink and for coordinated base stations. When all weights are equal and the SNR is high, regularized zero-forcing precoding is close and much cheaper. In massive MIMO with many more antennas than users, the gain over regularized zero forcing is often small.

Pitfalls

  • Local optima. On one random two-user channel with the weights 1 and 1.915 and P=13.33P = 13.33, the default start converges to a point that serves both users with the weighted sum rate 9.660. Serving only user 2 by maximum ratio transmission gives 10.418. Try several starts.
  • A zero start. If vk=0v_k = 0, then uk=0u_k = 0 and user kk stays off forever. Start with all beams nonzero.
  • Singular AA. When K<MK < M, AA has a null space, and μ=0\mu = 0 is not defined. Use the smallest positive μ\mu, or the minimum norm solution.
  • The stopping rule. The rate can grow slowly for many iterations. Stop on a relative change, and also limit the number of iterations.
  • Stale channel. The steps use hkh_k exactly; with old channel estimates the computed SINR values are too high.

Implementations

Each implementation follows the pseudocode above. A comment @line links a line of code to a line of the pseudocode. Point at a line of the pseudocode to see the matching code. The build runs the native tests of each language.

cbb.pyI0RawGitHub
# SPDX-License-Identifier: MIT
# Shared helper of the communications pages of https://algorithm.tamnd.com/. The authors are listed in prov/.

"""Complex baseband tools for the communications pages.

Vectors are lists of complex numbers. Matrices are lists of rows. The
functions here are plain building blocks: small linear algebra, convolution,
the DFT as a direct sum, the Gaussian Q function, dB conversion, complex
Gaussian noise and the Wilson score interval. No page algorithm (equalizer,
estimator, synchronizer, detector, precoder, demapper or power allocation)
lives in this file.

Conventions (prompts of the communications area):
- dft is X[k] = sum_n x[n] e^(-j 2 pi k n / N) with no factor; idft has 1/N.
- udft and uidft are the unitary pair, with 1/sqrt(N) on both sides.
- qfunc(x) = 0.5 erfc(x / sqrt(2)); it never computes 1 - Phi(x).
- cn(rng, var) draws CN(0, var): real and imaginary parts are independent
  with variance var / 2 each, so E|w|^2 = var.
"""

import cmath
import math
import random


# ---------------------------------------------------------------- vectors and matrices


def zeros(rows: int, cols: int | None = None) -> list:
    """A zero vector of length rows, or a rows by cols zero matrix."""
    if cols is None:
        return [0j] * rows
    return [[0j] * cols for _ in range(rows)]


def eye(n: int) -> list[list[complex]]:
    """The n by n identity matrix."""
    return [[1 + 0j if i == k else 0j for k in range(n)] for i in range(n)]


def add(a: list, b: list) -> list:
    """Elementwise a + b for two vectors or two matrices of the same shape."""
    if len(a) != len(b):
        raise ValueError("shapes differ")
    if a and isinstance(a[0], list):
        return [add(r, s) for r, s in zip(a, b)]
    return [x + y for x, y in zip(a, b)]


def sub(a: list, b: list) -> list:
    """Elementwise a - b for two vectors or two matrices of the same shape."""
    if len(a) != len(b):
        raise ValueError("shapes differ")
    if a and isinstance(a[0], list):
        return [sub(r, s) for r, s in zip(a, b)]
    return [x - y for x, y in zip(a, b)]


def scale(c: complex, a: list) -> list:
    """The scalar c times a vector or a matrix."""
    if a and isinstance(a[0], list):
        return [scale(c, r) for r in a]
    return [c * x for x in a]


def matmul(a: list[list[complex]], b: list[list[complex]]) -> list[list[complex]]:
    """The matrix product a b."""
    if not a or not b or len(a[0]) != len(b):
        raise ValueError("inner dimensions differ")
    cols = list(zip(*b))
    return [[sum(x * y for x, y in zip(row, col)) for col in cols] for row in a]


def matvec(a: list[list[complex]], x: list[complex]) -> list[complex]:
    """The matrix times vector product a x."""
    if a and len(a[0]) != len(x):
        raise ValueError("inner dimensions differ")
    return [sum(p * q for p, q in zip(row, x)) for row in a]


def herm(a: list) -> list:
    """The conjugate transpose of a matrix. A vector gives its conjugate."""
    if a and isinstance(a[0], list):
        return [[complex(a[i][k]).conjugate() for i in range(len(a))] for k in range(len(a[0]))]
    return [complex(x).conjugate() for x in a]


def dot(x: list[complex], y: list[complex]) -> complex:
    """The inner product x^H y = sum of conj(x_i) y_i."""
    if len(x) != len(y):
        raise ValueError("lengths differ")
    return sum(complex(p).conjugate() * q for p, q in zip(x, y))


def norm2(x: list) -> float:
    """The squared Euclidean norm sum |x_i|^2 (squared Frobenius norm for a matrix)."""
    if x and isinstance(x[0], list):
        return sum(norm2(r) for r in x)
    return sum(abs(v) ** 2 for v in x)


# ---------------------------------------------------------------- linear systems


def _lu(a: list[list[complex]]) -> tuple[list[list[complex]], list[int], int]:
    """LU factorization with partial pivoting. Returns (lu, perm, sign)."""
    n = len(a)
    if any(len(r) != n for r in a):
        raise ValueError("matrix is not square")
    m = [[complex(v) for v in r] for r in a]
    perm = list(range(n))
    sign = 1
    for k in range(n):
        p = max(range(k, n), key=lambda i: abs(m[i][k]))
        if abs(m[p][k]) == 0.0:
            raise ValueError("matrix is singular")
        if p != k:
            m[k], m[p] = m[p], m[k]
            perm[k], perm[p] = perm[p], perm[k]
            sign = -sign
        for i in range(k + 1, n):
            f = m[i][k] / m[k][k]
            m[i][k] = f
            if f != 0:
                rk, ri = m[k], m[i]
                for c in range(k + 1, n):
                    ri[c] -= f * rk[c]
    return m, perm, sign


def _lu_solve(lu: list[list[complex]], perm: list[int], b: list[complex]) -> list[complex]:
    n = len(lu)
    y = [complex(b[perm[i]]) for i in range(n)]
    for i in range(n):
        for c in range(i):
            y[i] -= lu[i][c] * y[c]
    for i in range(n - 1, -1, -1):
        for c in range(i + 1, n):
            y[i] -= lu[i][c] * y[c]
        y[i] /= lu[i][i]
    return y


def solve(a: list[list[complex]], b: list) -> list:
    """Solve a x = b by Gaussian elimination with partial pivoting.

    b is a vector, or a matrix whose columns are right-hand sides.
    Raises ValueError if a is singular.
    """
    lu, perm, _ = _lu(a)
    if b and isinstance(b[0], list):
        cols = [list(c) for c in zip(*b)]
        xs = [_lu_solve(lu, perm, c) for c in cols]
        return [list(r) for r in zip(*xs)]
    if len(b) != len(a):
        raise ValueError("lengths differ")
    return _lu_solve(lu, perm, b)


def inv(a: list[list[complex]]) -> list[list[complex]]:
    """The inverse of a square matrix."""
    return solve(a, eye(len(a)))


def det(a: list[list[complex]]) -> complex:
    """The determinant of a square matrix (0 for a singular matrix)."""
    try:
        lu, _, sign = _lu(a)
    except ValueError as e:
        if "singular" in str(e):
            return 0j
        raise
    d = complex(sign)
    for i in range(len(lu)):
        d *= lu[i][i]
    return d


def cholesky(a: list[list[complex]]) -> list[list[complex]]:
    """The lower triangular L with a = L L^H, for a Hermitian positive definite a.

    Raises ValueError if a is not positive definite (to rounding).
    """
    n = len(a)
    low = zeros(n, n)
    for i in range(n):
        for k in range(i + 1):
            s = complex(a[i][k]) - sum(low[i][c] * low[k][c].conjugate() for c in range(k))
            if i == k:
                if s.real <= 0.0:
                    raise ValueError("matrix is not positive definite")
                low[i][i] = complex(math.sqrt(s.real))
            else:
                low[i][k] = s / low[k][k].real
    return low


# ---------------------------------------------------------------- convolution and the DFT


def conv(a: list[complex], b: list[complex]) -> list[complex]:
    """Linear convolution, of length len(a) + len(b) - 1."""
    if not a or not b:
        return []
    out = [0j] * (len(a) + len(b) - 1)
    for i, x in enumerate(a):
        for k, y in enumerate(b):
            out[i + k] += x * y
    return out


def cconv(a: list[complex], b: list[complex], n: int | None = None) -> list[complex]:
    """Circular convolution of length n (default: the longer length).

    Both inputs are padded with zeros to length n, or must not be longer than n.
    """
    if n is None:
        n = max(len(a), len(b))
    if len(a) > n or len(b) > n:
        raise ValueError("input longer than n")
    out = [0j] * n
    for i, x in enumerate(a):
        for k, y in enumerate(b):
            out[(i + k) % n] += x * y
    return out


def _twiddles(n: int, sign: int) -> list[complex]:
    return [cmath.exp(sign * 2j * math.pi * t / n) for t in range(n)]


def dft(x: list[complex]) -> list[complex]:
    """X[k] = sum over n of x[n] e^(-j 2 pi k n / N), as a direct O(N^2) sum."""
    n = len(x)
    w = _twiddles(n, -1)
    return [sum(x[t] * w[(k * t) % n] for t in range(n)) for k in range(n)]


def idft(xf: list[complex]) -> list[complex]:
    """x[n] = (1/N) sum over k of X[k] e^(j 2 pi k n / N), the inverse of dft."""
    n = len(xf)
    w = _twiddles(n, 1)
    return [sum(xf[k] * w[(k * t) % n] for k in range(n)) / n for t in range(n)]


def udft(x: list[complex]) -> list[complex]:
    """The unitary DFT: dft(x) / sqrt(N)."""
    s = 1.0 / math.sqrt(len(x)) if x else 1.0
    return [v * s for v in dft(x)]


def uidft(xf: list[complex]) -> list[complex]:
    """The unitary inverse DFT: sqrt(N) idft(X), the inverse of udft."""
    s = math.sqrt(len(xf)) if xf else 1.0
    return [v * s for v in idft(xf)]


# ---------------------------------------------------------------- Q function and dB


def qfunc(x: float) -> float:
    """Q(x) = P(Z > x) for a standard normal Z, computed as 0.5 erfc(x / sqrt(2))."""
    return 0.5 * math.erfc(x / math.sqrt(2.0))


def qinv(p: float) -> float:
    """The x with Q(x) = p, for 0 < p < 1, by bisection on Q (which decreases)."""
    if not 0.0 < p < 1.0:
        raise ValueError("p must be in (0, 1)")
    lo, hi = -40.0, 40.0
    for _ in range(200):
        mid = 0.5 * (lo + hi)
        if qfunc(mid) > p:
            lo = mid
        else:
            hi = mid
        if hi - lo <= 1e-15 * max(1.0, abs(mid)):
            break
    return 0.5 * (lo + hi)


def db(x: float) -> float:
    """10 log10(x), for a ratio of powers or energies."""
    return 10.0 * math.log10(x)


def undb(d: float) -> float:
    """10^(d / 10), the inverse of db."""
    return 10.0 ** (d / 10.0)


# ---------------------------------------------------------------- noise and statistics


def cn(rng: random.Random, var: float) -> complex:
    """One sample of CN(0, var): independent real and imaginary parts of variance var / 2."""
    s = math.sqrt(var / 2.0)
    return complex(rng.gauss(0.0, s), rng.gauss(0.0, s))


def awgn(rng: random.Random, x: list[complex], n0: float) -> list[complex]:
    """x plus independent CN(0, n0) noise on each sample."""
    return [v + cn(rng, n0) for v in x]


def wilson(k: int, n: int, z: float = 3.29) -> tuple[float, float]:
    """The Wilson score interval for k successes in n trials (z = 3.29 is about 0.999 two-sided)."""
    if n <= 0 or not 0 <= k <= n:
        raise ValueError("need 0 <= k <= n and n > 0")
    p = k / n
    z2 = z * z
    den = 1.0 + z2 / n
    mid = (p + z2 / (2 * n)) / den
    half = z * math.sqrt(p * (1 - p) / n + z2 / (4 * n * n)) / den
    return max(0.0, mid - half), min(1.0, mid + half)
weighted_mmse_precoding.py 118 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/weighted-mmse-precoding/. The authors are listed in prov/9QVSR3.jsonl.

"""Weighted MMSE (WMMSE) precoding for the multiuser MISO downlink.

User k receives y_k = h_k^H x + w_k with w_k ~ CN(0, N0), and the base
station sends x = sum_k v_k s_k with sum_k ||v_k||^2 <= P. The goal is a
local maximum of the weighted sum rate sum_k a_k log2(1 + SINR_k).

WMMSE solves the equivalent problem

    minimize over (u, w, V)   sum_k a_k (w_k e_k - log w_k),
    e_k = E|conj(u_k) y_k - s_k|^2,

by block coordinate descent: the MMSE receive gains u (line L2), the weights
w = 1 / e (line L3), and the precoders V, a convex problem solved by a
Lagrange multiplier mu found by a safeguarded Newton search (lines L4 to L6). After the u and w
steps the objective equals sum_k a_k (1 - ln(1 + SINR_k)), so the weighted
sum rate never decreases from one iteration to the next.
"""

import math

import cbb


def sinr(h: list[list[complex]], v: list[list[complex]], n0: float) -> list[float]:
    """SINR_k = |h_k^H v_k|^2 / (sum over j != k of |h_k^H v_j|^2 + N0); v has the v_k as columns."""
    e = cbb.matmul(h, v)
    out = []
    for k in range(len(h)):
        sig = abs(e[k][k]) ** 2
        out.append(sig / (sum(abs(x) ** 2 for x in e[k]) - sig + n0))
    return out


def weighted_sum_rate(h, v, n0: float, weights: list[float]) -> float:
    """sum_k a_k log2(1 + SINR_k) in bits per channel use."""
    return sum(a * math.log2(1.0 + s) for a, s in zip(weights, sinr(h, v, n0)))


def _solve_mu(a: list[list[complex]], b: list[list[complex]], p_total: float):
    """The precoder (A + mu I)^(-1) B with the smallest mu >= 0 that keeps the power at most P.

    The power f(mu) = ||(A + mu I)^(-1) B||_F^2 decreases in mu, and
    f(mu) <= ||B||_F^2 / mu^2 because A is positive semidefinite, so
    mu = ||B||_F / sqrt(P) is an upper bound. The root of f(mu) = P is found
    by Newton's method on f^(-1/2) - P^(-1/2), which is close to linear in
    mu, with a bisection step whenever Newton leaves the bracket.
    Returns (V, mu).
    """
    m = len(a)

    def shifted(mu: float):
        return [[a[i][j] + (mu if i == j else 0.0) for j in range(m)] for i in range(m)]

    lo, hi = 0.0, math.sqrt(cbb.norm2(b) / p_total)
    try:
        v = cbb.solve(a, b)
        if cbb.norm2(v) <= p_total:
            return v, 0.0
        mu = 0.0
    except ValueError:
        mu = 1e-9 * hi  # A is singular, so start a little above 0
    v_hi = None
    for _ in range(100):
        am = shifted(mu)
        v = cbb.solve(am, b)
        f = cbb.norm2(v)
        if abs(f - p_total) <= 1e-14 * p_total:
            return v, mu
        if f > p_total:
            lo = mu
        else:
            hi, v_hi = mu, v
        y = cbb.solve(am, v)
        df = -2.0 * sum((v[i][k].conjugate() * y[i][k]).real for i in range(m) for k in range(len(v[0])))
        nxt = mu - (f ** -0.5 - p_total ** -0.5) / (-0.5 * f ** -1.5 * df) if df < 0 else -1.0
        mu = nxt if lo < nxt < hi else 0.5 * (lo + hi)
        if hi - lo <= 1e-15 * hi:
            break
    if v_hi is None:
        v_hi = cbb.solve(shifted(hi), b)
    return v_hi, hi


def wmmse(h: list[list[complex]], p_total: float, n0: float, weights=None, v0=None, iters: int = 200, tol: float = 1e-12):
    """Run WMMSE on the K by M channel h. Returns (v, rates) with the precoders as columns of v.

    rates[t] is the weighted sum rate after iteration t (rates[0] is the start).
    The start is v0, or by default the matched beams h_k scaled to the power P.
    """
    k_users, m = len(h), len(h[0])
    a = weights if weights is not None else [1.0] * k_users
    if v0 is None:
        v0 = cbb.herm(h)
        v0 = cbb.scale(math.sqrt(p_total / cbb.norm2(v0)), v0)
    v = [row[:] for row in v0]  # @line L1
    rates = [weighted_sum_rate(h, v, n0, a)]
    for _ in range(iters):
        e = cbb.matmul(h, v)
        tot = [sum(abs(x) ** 2 for x in e[k]) + n0 for k in range(k_users)]
        u = [e[k][k] / tot[k] for k in range(k_users)]  # @line L2
        w = [1.0 / (1.0 - (u[k].conjugate() * e[k][k]).real) for k in range(k_users)]  # @line L3
        amat = [[0j] * m for _ in range(m)]
        bmat = [[0j] * k_users for _ in range(m)]
        for k in range(k_users):
            c = a[k] * w[k] * abs(u[k]) ** 2
            hk = [complex(z).conjugate() for z in h[k]]  # the column h_k
            for i in range(m):
                for j in range(m):
                    amat[i][j] += c * hk[i] * hk[j].conjugate()  # @line L4
                bmat[i][k] = a[k] * w[k] * u[k] * hk[i]
        v, _ = _solve_mu(amat, bmat, p_total)  # @line L5
        rates.append(weighted_sum_rate(h, v, n0, a))  # @line L6
        if rates[-1] - rates[-2] < tol:
            break  # @line L7
    return v, rates
test_weighted_mmse_precoding.py 151 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/weighted-mmse-precoding/. The authors are listed in prov/9QVSR3.jsonl.

import math
import random

import cbb
from weighted_mmse_precoding import sinr, weighted_sum_rate, wmmse


def rand_h(rng: random.Random, k: int, m: int) -> list[list[complex]]:
    return [[cbb.cn(rng, 1.0) for _ in range(m)] for _ in range(k)]


def test_example() -> None:
    # Orthogonal channels with gains 4, 1 and 1/4 and weights 1, 2 and 1.5 (the example of the page).
    h = [[2, 0, 0], [0, 1, 0], [0, 0, 0.5]]
    a = [1.0, 2.0, 1.5]
    v, rates = wmmse(h, 3.0, 1.0, weights=a, iters=2000)
    p = [cbb.norm2([row[k] for row in v]) for k in range(3)]
    assert abs(p[0] - 7 / 6) < 1e-6 and abs(p[1] - 11 / 6) < 1e-6 and p[2] < 1e-6
    want = math.log2(1 + 4 * 7 / 6) + 2 * math.log2(1 + 11 / 6)
    assert abs(rates[-1] - want) < 1e-9
    assert abs(rates[0] - weighted_sum_rate(h, cbb.scale(math.sqrt(3 / 5.25), cbb.herm(h)), 1.0, a)) < 1e-12


def test_single_user_is_maximum_ratio_transmission() -> None:
    rng = random.Random(1)
    for m in (1, 3, 8):
        h = rand_h(rng, 1, m)
        v, rates = wmmse(h, 5.0, 0.5)
        assert abs(rates[-1] - math.log2(1 + 5.0 * cbb.norm2(h[0]) / 0.5)) < 1e-10
        assert abs(abs(cbb.matmul(h, v)[0][0]) ** 2 - 5.0 * cbb.norm2(h[0])) < 1e-9


def test_orthogonal_channels_give_weighted_water_filling() -> None:
    # With h_k = g_k e_k, the optimum is p_k = (a_k / lam - 1 / g_k)^+ with sum P.
    rng = random.Random(2)
    for _ in range(2):
        g = [rng.uniform(0.1, 5.0) for _ in range(3)]
        a = [rng.uniform(0.5, 2.0) for _ in range(3)]
        pt = rng.uniform(0.5, 10.0)
        h = [[math.sqrt(g[k]) if i == k else 0.0 for i in range(3)] for k in range(3)]
        lo, hi = 1e-12, 1e3
        for _ in range(200):
            lam = 0.5 * (lo + hi)
            if sum(max(0.0, a[k] / lam - 1 / g[k]) for k in range(3)) > pt:
                lo = lam
            else:
                hi = lam
        p = [max(0.0, a[k] / lam - 1 / g[k]) for k in range(3)]
        want = sum(a[k] * math.log2(1 + g[k] * p[k]) for k in range(3))
        _, rates = wmmse(h, pt, 1.0, weights=a, iters=3000, tol=1e-14)
        assert abs(rates[-1] - want) < 1e-7


def test_monotone_and_power() -> None:
    rng = random.Random(3)
    for k, m in [(2, 2), (3, 4), (4, 4), (3, 6), (8, 8)]:
        h = rand_h(rng, k, m)
        a = [rng.uniform(0.5, 2.0) for _ in range(k)]
        pt = rng.uniform(1.0, 30.0)
        v, rates = wmmse(h, pt, 1.0, weights=a, iters=15, tol=-1.0)
        assert len(rates) == 16
        for t in range(15):
            assert rates[t + 1] >= rates[t] - 1e-12
        assert cbb.norm2(v) <= pt * (1 + 1e-12)
        assert abs(cbb.norm2(v) - pt) < 1e-9 * pt


def test_kkt_at_convergence() -> None:
    # At a stationary point the gradient of the weighted sum rate is lam v for one lam >= 0.
    rng = random.Random(4)
    h = rand_h(rng, 3, 3)
    a = [1.0, 1.5, 0.7]
    v, _ = wmmse(h, 4.0, 1.0, weights=a, iters=3000, tol=1e-15)
    eps = 1e-6
    grad = [[0j] * 3 for _ in range(3)]
    for i in range(3):
        for k in range(3):
            parts = []
            for d in (eps, 1j * eps):
                vp = [row[:] for row in v]
                vm = [row[:] for row in v]
                vp[i][k] += d
                vm[i][k] -= d
                parts.append((weighted_sum_rate(h, vp, 1.0, a) - weighted_sum_rate(h, vm, 1.0, a)) / (2 * eps))
            grad[i][k] = complex(parts[0], parts[1])
    lam = sum((grad[i][k] * v[i][k].conjugate()).real for i in range(3) for k in range(3)) / cbb.norm2(v)
    assert lam > 0
    res = math.sqrt(cbb.norm2(cbb.sub(grad, cbb.scale(lam, v))))
    assert res < 1e-5 * math.sqrt(cbb.norm2(grad))


def test_grid_search_two_users() -> None:
    # For two users, the best beams have the form (I + sum_j lam_j h_j h_j^H / N0)^(-1) h_k with
    # lam_1 + lam_2 = P. A grid over lam_1 and the power split gives a lower bound on the optimum.
    # WMMSE finds a stationary point, which can be a local optimum, so the test keeps the best of 6 starts.
    rng = random.Random(5)
    for _ in range(2):
        h = rand_h(rng, 2, 2)
        a = [1.0, rng.uniform(0.5, 2.0)]
        pt, n0, n = rng.uniform(1.0, 20.0), 1.0, 60
        best = -1.0
        for start in range(6):
            v0 = None
            if start > 0:
                v0 = rand_h(rng, 2, 2)
                v0 = cbb.scale(math.sqrt(pt / cbb.norm2(v0)), v0)
            _, rates = wmmse(h, pt, n0, weights=a, v0=v0, iters=400, tol=1e-11)
            best = max(best, rates[-1])
        cols = cbb.herm(h)
        grid = 0.0
        for i in range(n + 1):
            lam = [pt * i / n, pt * (n - i) / n]
            am = [
                [(1.0 if r == c else 0.0) + sum(lam[j] * cols[r][j] * cols[c][j].conjugate() for j in range(2)) / n0 for c in range(2)]
                for r in range(2)
            ]
            d = cbb.solve(am, cols)
            d = [[d[r][k] / math.sqrt(abs(d[0][k]) ** 2 + abs(d[1][k]) ** 2) for k in range(2)] for r in range(2)]
            g = [[abs(x) ** 2 for x in row] for row in cbb.matmul(h, d)]  # g[q][k] = |h_q^H d_k|^2
            for t in range(n + 1):
                p = [pt * t / n, pt * (n - t) / n]
                s0 = g[0][0] * p[0] / (g[0][1] * p[1] + n0)
                s1 = g[1][1] * p[1] / (g[1][0] * p[0] + n0)
                grid = max(grid, a[0] * math.log2(1 + s0) + a[1] * math.log2(1 + s1))
        assert grid <= best + 1e-9
        assert best - grid < 1e-3


def test_local_optimum() -> None:
    # On this channel the default start converges to a point that serves both users,
    # while serving only user 2 is better. Both points are stationary.
    rng = random.Random(5)
    h = rand_h(rng, 2, 2)
    a = [1.0, rng.uniform(0.5, 2.0)]
    pt = rng.uniform(1.0, 20.0)
    v, rates = wmmse(h, pt, 1.0, weights=a, iters=1000, tol=1e-13)
    assert min(cbb.norm2([row[k] for row in v]) for k in range(2)) > 1.0
    v2 = [[0j, math.sqrt(pt) * complex(h[1][r]).conjugate() / math.sqrt(cbb.norm2(h[1]))] for r in range(2)]
    one_user = weighted_sum_rate(h, v2, 1.0, a)
    assert one_user > rates[-1] + 0.5


def test_sinr_formula() -> None:
    h = [[1, 0], [1, 1]]
    v = [[1, 0], [0, 2]]
    s = sinr(h, v, 0.5)
    assert abs(s[0] - 1 / 0.5) < 1e-12
    assert abs(s[1] - 4 / (1 + 0.5)) < 1e-12

History

The link between rate and MSE is old: for a Gaussian channel, the rate is −log⁡2-\log_2 of the smallest MSE of the symbol. Christensen, Agarwal, de Carvalho and Cioffi (2008) used this link to design the precoders of the MIMO broadcast channel by an iteration over the receivers, the MSE weights and the precoders. Shi, Razaviyayn, Luo and He (2011) gave the general WMMSE algorithm for the MIMO interfering broadcast channel, showed that the weighted sum rate problem and the weighted MSE problem have the same optimal precoders, and showed that the iteration converges to stationary points of the weighted sum rate. Björnson, Bengtsson and Ottersten (2014) described the structure of the optimal beams as regularized inverses with one parameter per user, and why the weighted sum rate problem is hard.

References

  1. Qingjiang Shi, Meisam Razaviyayn, Zhi-Quan Luo and Chen He, An iteratively weighted MMSE approach to distributed sum-utility maximization for a MIMO interfering broadcast channel, IEEE Transactions on Signal Processing 59(9), 4331-4340, 2011, the equivalence between weighted sum rate maximization and weighted MSE minimization, the WMMSE algorithm, and its convergence to stationary points
  2. Søren Skovgaard Christensen, Rajiv Agarwal, Elisabeth de Carvalho and John M. Cioffi, Weighted sum-rate maximization using weighted MMSE for MIMO-BC beamforming design, IEEE Transactions on Wireless Communications 7(12), 4792-4799, 2008, the relation between the weighted sum rate and the weighted MMSE of the MIMO broadcast channel, and the iterative precoder design
  3. Emil Björnson, Mats Bengtsson and Björn Ottersten, Optimal multiuser transmit beamforming: a difficult problem with a simple solution structure, IEEE Signal Processing Magazine 31(4), 142-148, 2014, the structure of the optimal beams as regularized inverses with one nonnegative parameter per user, and the difficulty of the weighted sum rate problem

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH1 sketch
  • a full proof of time.worst
  • a full proof of space.extra
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
Code (python)I0 not checked yet
  • the tests did not run in this build
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • a scene preset for the example