Techniqueresearch
Interference alignment
Also called Cadambe-Jafar alignment.
Precode so interference at each receiver fills half its space. K users get K/2 degrees of freedom asymptotically, over time-varying or frequency-selective channels with ever longer symbol extensions.
Interference alignment is a way to choose the transmit beams of several users who share a band, so that at each receiver all the interference falls into one subspace, and the rest of the receive space is free for the wanted signal. In a -user interference channel, each receiver has interferers. Without alignment, each interferer takes its own dimensions, and the users must share the band, so the sum rate grows like times a constant that does not grow with . Cadambe and Jafar (2008) showed that, when the channel coefficients vary in time or frequency, the interference at every receiver can be packed into half of its signal space at once. Each user then gets half of its interference-free rate at high SNR, and the sum has degrees of freedom: the sum rate grows like . The is reached only in the limit: the scheme codes over symbol extensions, blocks of many channel uses, whose length grows without bound as the fraction approaches . With multiple antennas and constant channels, a closed form works for three users, and iterative methods find aligned beams for small systems.
In plain words
Many pairs of radios talk at the same time on the same frequency, and each receiver hears all the other senders as noise. A receiver can listen in several independent directions, like several separate ears. Normally each unwanted sender takes up some of these directions, and soon none are left for the wanted sender. Interference alignment chooses how each sender transmits so that, at every receiver, all the unwanted senders arrive from the same few directions. The receiver ignores those directions and listens in the others, where only its own sender is heard. With careful choices, every receiver can keep half of its directions clean. This only works fully when the channels change over time or frequency and the senders plan over very long blocks.
When it applies
- An interference network. Several transmitter-receiver pairs share a band, each receiver wants only its own transmitter, and no pair can cancel the others' data (the transmitters do not share messages, unlike in dirty paper coding).
- Channel knowledge at the transmitters. Each transmitter must know the channels of all links, or at least those it affects, to compute its beam. This is global channel state information.
- Enough dimensions. Alignment needs spare signal dimensions: antennas, subcarriers or time slots. With constant channels and one antenna per node, the dimensions must come from symbol extensions over channels that vary, or from more abstract constructions.
- High SNR. The gain is in degrees of freedom, the slope of the sum rate against . It shows at high SNR, where interference, not noise, limits the rates.
- Generic channels. The constructions need the channel matrices to be in general position, which holds with probability for continuous fading laws.
The template
Signal model. Transmitter sends streams through a precoder (a matrix with columns). Receiver gets
where is the channel from transmitter to receiver over all antennas and channel uses. Receiver applies a filter with columns.
Alignment conditions. The interference is removed when
The first condition says that all interference lies in the orthogonal complement of the columns of ; the second, that the wanted streams remain separable there. In terms of subspaces: at receiver , the span of all with must have dimension at most , where is the receive dimension.
The 3-user 2x2 MIMO closed form. Three pairs, two antennas each, one stream per user: in dimensions, so each receiver needs its two interferers on the same line. The three conditions are , and . The last two give and from , and the first makes an eigenvector of a fixed matrix:
ALIGN-THREE-USERS(H)- 1
E ← (H_13 H_23^{-1} H_21)^{-1} H_12 H_32^{-1} H_31 - 2
v_1 ← an eigenvector of E - 3
v_2 ← H_32^{-1} H_31 v_1 - 4
v_3 ← H_23^{-1} H_21 v_1 - 5
for k ← 1 to 3: u_k ← a unit vector orthogonal to H_kj v_j for one j ≠ k - 6
return v_1, v_2, v_3 and u_1, u_2, u_3
Line L5 uses one interferer, since the other one is parallel to it. Each user then sends one stream free of interference, for streams in total, while any one pair alone could send . With antennas at every node, the same idea gives three users degrees of freedom; for odd it needs an extension over two channel uses.
Symbol extensions. With one antenna and coefficients that change in every channel use, take uses together: each becomes an diagonal matrix, and the alignment conditions are solved in this larger space. For three users, Cadambe and Jafar give user 1 streams and users 2 and 3 streams each over uses, for degrees of freedom per use, which tends to . For users, the construction aligns exactly in some dimensions and approximately in the count, and the fraction per user tends to as the extension grows.
Classic examples
A real 3-user example. Take the integer channels
Line L1 gives , with eigenvalues . For , , then and . At receiver 1, both interferers arrive along ; at receiver 2 along ; at receiver 3 along . Each receiver projects onto the orthogonal line, where the wanted signal has a nonzero gain, so all three streams are free of interference. The other eigenvalue gives a second solution.
The K-user interference channel. With time-varying or frequency-selective channels and one antenna per node, the sum has degrees of freedom, reached in the limit of long symbol extensions; with two users, it is , which time sharing already gets. For users, each user gets about half its own interference-free rate at high SNR, while time sharing gives each one tenth.
The X channel. Two transmitters each have a message for each of two receivers. Maddah-Ali, Motahari and Khandani (2008) aligned the unwanted messages at each receiver; with antennas per node, the X channel has degrees of freedom (Jafar and Shamai), more than the of the interference channel with two users.
Variations
- Iterative alignment. For constant MIMO channels with more users, Gomadam, Cadambe and Jafar (2011) proposed alternating minimization of the leakage : fix the precoders and take as the eigenvectors of the smallest eigenvalues of the interference covariance at receiver , then do the same for the reverse network. The leakage decreases at each step. A max-SINR version replaces leakage by the SINR and works better at moderate SNR.
- Feasibility for constant channels. With users, transmit and receive antennas and streams each, a necessary condition for alignment in general position is ; for some sizes it is also sufficient. Without extensions, constant channels allow only a fixed number of users to align.
- Ergodic alignment. With fading, pair each channel state with a complementary state and send the same symbols in both; the interference cancels in the sum. Each user gets half of its interference-free rate at every SNR, not only at high SNR.
- Real interference alignment. For constant scalar channels, alignment on rationally independent dimensions of the real line (lattice and number-theoretic arguments) also reaches for almost all channels, but only in the high-SNR limit.
- Blind and partial alignment. Schemes that exploit known patterns of channel change (for example reconfigurable antennas) need no channel knowledge at the transmitters, at a smaller gain.
Pitfalls
- K/2 is asymptotic. The fraction per user is a limit over symbol extensions of growing length; any finite scheme gets less, for example for three users. With constant scalar channels and no extensions, alignment gives no gain.
- Degrees of freedom are a high-SNR measure. At low and moderate SNR, the noise boost of the receive projection can make alignment worse than treating interference as noise or than weighted sum rate methods such as WMMSE.
- Channel knowledge. Every transmitter needs accurate channels of the whole network. Errors leave residual interference whose power grows with the transmit power, so the rate stops growing at high SNR unless the feedback precision grows like bits per coefficient.
- Long extensions. The extension length needed for a fraction near grows very fast with , and the channels must stay different across the uses of the extension.
- Ill-conditioned channels. When the channel matrices are close to singular, the closed form uses near-singular inverses, the wanted gain can be tiny, and the scheme loses at any practical SNR.
Code
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.
# 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)
interference_alignment.py 98 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/interference-alignment/. The authors are listed in prov/BAD5BM.jsonl.
"""Interference alignment for the 3-user 2x2 MIMO interference channel.
Three transmitters and three receivers each have 2 antennas. h[k][j] is the
2x2 channel matrix from transmitter j to receiver k (users 0, 1, 2). Each
user sends one stream with the beam v[j]. Receiver k sees the two interfering
directions h[k][j] v[j], j != k, in its 2-dimensional space. If the two are
parallel, they fill only one dimension, and the receiver projects onto the
other dimension with u[k] to see its own stream free of interference. Then
all three users get one stream each, 3 streams in total in a space where
any one user alone could send 2.
The closed form of Cadambe and Jafar: with all channel matrices invertible,
v[0] = an eigenvector of E = (h02 h12^-1 h10)^-1 (h01 h21^-1 h20),
v[1] = h21^-1 h20 v[0], v[2] = h12^-1 h10 v[0].
"""
import cmath
import math
from cbb import dot, inv, matmul, matvec
def _unit(x: list[complex]) -> list[complex]:
n = math.sqrt(sum(abs(c) ** 2 for c in x))
if n == 0.0:
raise ValueError("zero vector")
return [c / n for c in x]
def eigvec2(a: list[list[complex]], which: int = 0) -> tuple[complex, list[complex]]:
"""An eigenvalue and a unit eigenvector of a 2x2 matrix (which = 0 or 1 picks the root)."""
tr = a[0][0] + a[1][1]
dt = a[0][0] * a[1][1] - a[0][1] * a[1][0]
root = cmath.sqrt(tr * tr - 4 * dt)
lam = (tr + root) / 2 if which == 0 else (tr - root) / 2
# (a - lam I) x = 0: use the row with the larger entries for a stable null vector
r0 = [a[0][0] - lam, a[0][1]]
r1 = [a[1][0], a[1][1] - lam]
row = r0 if abs(r0[0]) + abs(r0[1]) >= abs(r1[0]) + abs(r1[1]) else r1
if abs(row[0]) + abs(row[1]) == 0.0:
return lam, [1 + 0j, 0j]
return lam, _unit([-row[1], row[0]])
def orthogonal_unit(a: list[complex]) -> list[complex]:
"""A unit vector u in C^2 with u^H a = 0."""
return _unit([-complex(a[1]).conjugate(), complex(a[0]).conjugate()])
def align_three_users(h: list[list[list[list[complex]]]], which: int = 0) -> tuple[list[list[complex]], list[list[complex]]]:
"""Beams v[k] and receive filters u[k] that align the interference of the 3-user 2x2 channel."""
a = matmul(h[0][1], matmul(inv(h[2][1]), h[2][0])) # @line L1
b = matmul(h[0][2], matmul(inv(h[1][2]), h[1][0]))
e = matmul(inv(b), a)
_, v0 = eigvec2(e, which) # @line L2
v1 = _unit(matvec(inv(h[2][1]), matvec(h[2][0], v0))) # @line L3
v2 = _unit(matvec(inv(h[1][2]), matvec(h[1][0], v0))) # @line L4
v = [v0, v1, v2]
u = []
for k in range(3): # @line L5
j = (k + 1) % 3
u.append(orthogonal_unit(matvec(h[k][j], v[j])))
return v, u # @line L6
def leakage(h, v, u) -> float:
"""Total interference power after the filters, sum over k and j != k of |u_k^H h_kj v_j|^2."""
total = 0.0
for k in range(3):
for j in range(3):
if j != k:
total += abs(dot(u[k], matvec(h[k][j], v[j]))) ** 2
return total
def desired_gains(h, v, u) -> list[float]:
"""The gains |u_k^H h_kk v_k|^2 of the wanted streams."""
return [abs(dot(u[k], matvec(h[k][k], v[k]))) ** 2 for k in range(3)]
def parallel_defect(x: list[complex], y: list[complex]) -> float:
"""|det [x y]| / (|x| |y|): 0 exactly when the two vectors of C^2 are parallel."""
nx = math.sqrt(sum(abs(c) ** 2 for c in x))
ny = math.sqrt(sum(abs(c) ** 2 for c in y))
return abs(x[0] * y[1] - x[1] * y[0]) / (nx * ny)
def sum_rate(h, v, u, snr: float) -> float:
"""Sum rate in bit/s/Hz with power snr per user, unit noise and the filters u (interference included)."""
total = 0.0
for k in range(3):
s = snr * abs(dot(u[k], matvec(h[k][k], v[k]))) ** 2
i = sum(snr * abs(dot(u[k], matvec(h[k][j], v[j]))) ** 2 for j in range(3) if j != k)
total += math.log2(1.0 + s / (1.0 + i))
return total
test_interference_alignment.py 100 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/interference-alignment/. The authors are listed in prov/BAD5BM.jsonl.
import math
import random
import pytest
from cbb import cn, dot, matvec
from interference_alignment import (
align_three_users,
desired_gains,
eigvec2,
leakage,
orthogonal_unit,
parallel_defect,
sum_rate,
)
def page_channels():
m = {
(1, 1): [[1, 0], [0, 1]], (2, 2): [[1, 1], [0, 1]], (3, 3): [[2, 0], [1, 1]],
(1, 2): [[1, 2], [0, 1]], (1, 3): [[1, 0], [1, 1]],
(2, 1): [[2, 1], [1, 1]], (2, 3): [[1, 0], [0, 2]],
(3, 1): [[0, 1], [1, 0]], (3, 2): [[1, 1], [1, 2]],
}
return [[[[complex(x) for x in row] for row in m[k + 1, j + 1]] for j in range(3)] for k in range(3)]
def random_channels(rng: random.Random):
return [[[[cn(rng, 1.0) for _ in range(2)] for _ in range(2)] for _ in range(3)] for _ in range(3)]
def direction(x):
"""x scaled so that its first entry is 1."""
return [c / x[0] for c in x]
def test_page_example() -> None:
h = page_channels()
v, u = align_three_users(h)
assert leakage(h, v, u) < 1e-18
lam = (math.sqrt(17) - 3) / 2
assert direction(v[0]) == pytest.approx([1, (lam - 1) / 2], abs=1e-12)
assert direction(v[1]) == pytest.approx([1, -2.4384471871911697 / 2.8768943743823394], abs=1e-12)
assert direction(v[2]) == pytest.approx([1, 0.7807764064044151 / 3.5615528128088303], abs=1e-12)
# the interference directions at the three receivers
assert direction(matvec(h[0][1], v[1])) == pytest.approx([1, 2.4384471871911697 / 2], abs=1e-12)
assert direction(matvec(h[1][0], v[0])) == pytest.approx([1, 1.5615528128088303 / 3.5615528128088303], abs=1e-12)
assert direction(matvec(h[2][0], v[0])) == pytest.approx([1, 2 / -0.4384471871911697], abs=1e-12)
assert min(desired_gains(h, v, u)) > 0.1
def test_eigvec2() -> None:
lam, x = eigvec2([[2, 1], [1, 2]], 0)
assert lam == pytest.approx(3)
assert abs(x[0] - x[1]) < 1e-12
lam, x = eigvec2([[1, 0], [0, 1]], 1)
assert lam == pytest.approx(1)
assert sum(abs(c) ** 2 for c in x) == pytest.approx(1)
def test_orthogonal_unit() -> None:
rng = random.Random(5)
for _ in range(50):
a = [cn(rng, 1.0), cn(rng, 1.0)]
u = orthogonal_unit(a)
assert abs(dot(u, a)) < 1e-12
assert sum(abs(c) ** 2 for c in u) == pytest.approx(1.0, abs=1e-12)
def test_zero_leakage_on_random_channels() -> None:
rng = random.Random(2008)
for _ in range(200):
h = random_channels(rng)
for which in (0, 1):
v, u = align_three_users(h, which)
assert leakage(h, v, u) < 1e-9
for k in range(3):
i, j = [x for x in range(3) if x != k]
assert parallel_defect(matvec(h[k][i], v[i]), matvec(h[k][j], v[j])) < 1e-9
assert min(desired_gains(h, v, u)) > 0.0
def test_random_beams_leak() -> None:
rng = random.Random(77)
h = random_channels(rng)
v = [[cn(rng, 1.0), cn(rng, 1.0)] for _ in range(3)]
u = [orthogonal_unit(matvec(h[k][(k + 1) % 3], v[(k + 1) % 3])) for k in range(3)]
assert leakage(h, v, u) > 1e-3
def test_three_degrees_of_freedom() -> None:
rng = random.Random(11)
h = random_channels(rng)
v, u = align_three_users(h)
lo, hi = sum_rate(h, v, u, 1e6), sum_rate(h, v, u, 1e10)
# each factor 10^4 in power adds 3 log2(10^4) bits when 3 streams are free of interference
assert (hi - lo) == pytest.approx(3 * math.log2(1e4), abs=1e-3)
Exercises
- In the 3-user 2x2 closed form, show that the two eigenvectors of give two different aligned solutions, and that if has a repeated eigenvalue with a single eigenvector, only one remains.
- Verify the example: compute and and show that they are parallel.
- Show that for users with one antenna each, time sharing already gets degree of freedom, the same as , so alignment gives nothing.
- For three single-antenna users over channel uses, count the dimensions of the interference at receiver 1 when user 1 sends streams and the others each, and explain why the interference must fill at most dimensions.
- Write the leakage minimization for three 2x2 users as alternating steps, and show that the leakage does not increase from one step to the next.
Proof: The 3-user 2x2 closed form aligns the interference at every receiverfull
Three transmitter-receiver pairs have two antennas each. is the channel from transmitter to receiver , and every cross channel , , is invertible. Each transmitter sends one stream along a nonzero beam , and receiver applies a unit vector . Two nonzero vectors are parallel, , when for some , which holds exactly when .
Lemma 1 (orthogonal vector). For nonzero , is a unit vector with , and every also has .
Proof. . . If , then .
Lemma 2 (2x2 eigenvector). For and a root of , let be a nonzero row of . Then is a nonzero vector with . If both rows are zero, and every nonzero vector is an eigenvector.
Proof. is an eigenvalue, so , and has rank at most . If its rank is , both rows are multiples of the nonzero row , and its null space is the line of vectors orthogonal (in the bilinear sense) to : , so is in the null space of every row. If the rank is , .
The code picks the row with the larger entries, which is a nonzero row whenever , and returns the vector scaled to unit length.
Theorem (alignment). Let and , both invertible, and . Let be an eigenvector of with eigenvalue , and put , . Then , and
With orthogonal to one interference vector at receiver as in Lemma 1, for both .
Proof. and are images of under invertible matrices, so they are nonzero. and by construction, which gives the first two relations with . For the third, and . From we get , so . Since is invertible and , , so the two vectors are nonzero multiples of each other. At each receiver, the two interference vectors are parallel and nonzero, so by Lemma 1 the vector built from either one is orthogonal to both.
Wanted signal. The wanted gain is nonzero unless falls on the interference line at receiver . The beams and filters do not depend on , so for direct channels drawn from any continuous law, independent of the cross channels, this happens with probability : for fixed and , the set of with is a proper linear subspace of . Then each receiver sees its stream with gain and no interference, and with power per user and unit noise the sum rate is , which grows like : three degrees of freedom. The tests check this slope.
The code. Lines L1 to L4 of the page compute , , and as in the theorem; the code scales each beam to unit length, which keeps every parallel relation. Line L5 builds from the interferer by Lemma 1. In floating point the relations hold up to rounding, which the tests bound by for random Gaussian channels.
References
- Viveck R. Cadambe and Syed A. Jafar, Interference alignment and degrees of freedom of the K-user interference channel, IEEE Transactions on Information Theory 54(8), 2008, pages 3425 to 3441, the K/2 degrees of freedom of the K-user interference channel with time-varying or frequency-selective coefficients, the alignment scheme over symbol extensions, the 3-user scheme over 2n + 1 symbols with 3n + 1 streams, and the closed form for the 3-user MIMO channel with constant coefficients
- Mohammad Ali Maddah-Ali, Abolfazl S. Motahari and Amir K. Khandani, Communication over MIMO X channels: interference alignment, decomposition, and performance analysis, IEEE Transactions on Information Theory 54(8), 2008, pages 3457 to 3470, the alignment of interference in the two-user MIMO X channel, and the resulting gain in multiplexing over the interference channel
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.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H2 full proof |
|
| Lean | L0 no Lean part |
|
| Code (python) | I0 not checked yet |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag BAD5BM Edit this page History Report an error Markdown