Salta al contenuto
Note per Studenti Supercirculant and Circulant Matrices Report

Supercirculant and Circulant Matrices

In questa pagina 3

Two families handled with algorithms sublinear in the number of entries: supercirculant (SC), built recursively from quadrants, and circulant (CR), obtained by rotating the first row. Cost model: scalar operations cost 11, assignments and copies 00 (Matrix Multiplication - Iterative and Recursive Block ProductCost model on n x n matrices (scalar operations, size n or N = n^2); sum in n^2 operations (optimal); iterative row-by-column product with exact cost 2n^3 - n^2; the fractal property of the block product proved on indices; recursive algorithm RMUL with T(n) = 8T(n/2) + n^2, Theta(n^3) and exact solution 2n^3 - n^2: it performs the same operations as the iterative one.Matrix Multiplication - Iterative and Recursive Block Product →). Entries are real or complex; n=2kn=2^k for SC.

Supercirculant matrices

Definition. AA of order n=2kn=2^k is supercirculant if n=1n=1 (any scalar), or n>1n>1 and A=(A1A2A2A1)A=\begin{pmatrix}A_1&A_2\\A_2&A_1\end{pmatrix} with A1,A2A_1,A_2 SC of order n2\frac n2 (alternating quadrants).

Example: from (abba)\begin{pmatrix}a&b\\b&a\end{pmatrix}, (cddc)\begin{pmatrix}c&d\\d&c\end{pmatrix} one gets A=(abcdbadccdabdcba)A=\begin{pmatrix}a&b&c&d\\b&a&d&c\\c&d&a&b\\d&c&b&a\end{pmatrix}.

Properties

  1. Symmetric; every row is a permutation of the first (induction on the two halves; AT=AA^T=A since A1,A2A_1,A_2 are symmetric). So at most nn distinct values: an SC is determined by its first row r(A)r(A).
  2. Entry (h,k)(h,k): with indices from 00, Ahk=r(A)h⊕kA_{hk}=r(A)_{h\oplus k} (⊕\oplus = bitwise XOR).
  3. Closure: sum, difference, scalar multiple and product of SC are SC.
  4. Commutativity: AB=BAAB=BA for SC.

Proof of 3 and 4 (induction on kk). Base: scalars. Step, with A=(A1A2A2A1)A=\begin{pmatrix}A_1&A_2\\A_2&A_1\end{pmatrix}, B=(B1B2B2B1)B=\begin{pmatrix}B_1&B_2\\B_2&B_1\end{pmatrix}: A+B=(A1+B1A2+B2A2+B2A1+B1)A+B=\begin{pmatrix}A_1+B_1&A_2+B_2\\A_2+B_2&A_1+B_1\end{pmatrix} has alternating SC quadrants. For the product, the fractal property gives AB=(C1C2C2C1),C1=A1B1+A2B2,C2=A1B2+A2B1,AB=\begin{pmatrix}C_1&C_2\\C_2&C_1\end{pmatrix},\qquad C_1=A_1B_1+A_2B_2,\quad C_2=A_1B_2+A_2B_1, sums of products of SC of order n2\frac n2, hence SC. BABA gives C1′=B1A1+B2A2C_1'=B_1A_1+B_2A_2, C2′=B1A2+B2A1C_2'=B_1A_2+B_2A_1, equal to C1,C2C_1,C_2 by commutativity at order n2\frac n2. ■\blacksquare SC form a commutative subring of the symmetric matrices.

Sum, difference, scalar product

S_SUM(A, B)               { A, B SC of order n = 2^k }
  n <- rows(A)
  if n = 1 then return [a11 + b11]
  * A = [A1 A2; A2 A1], B = [B1 B2; B2 B1] *
  C1 <- S_SUM(A1, B1)
  C2 <- S_SUM(A2, B2)
  return [C1 C2; C2 C1]

TS(1)=1T_S(1)=1, TS(n)=2TS(n2)T_S(n)=2T_S(\frac n2): s=2s=2, w=0w=0, only leaves, TS(n)=nT_S(n)=n (the length of a row). S_SUB and S_SCALPROD cost nn as well. The output matrix is built by copying C1,C2C_1,C_2; copies are quadratic but free in the model. If assignments cost 11, T(n)=T(n2)+Θ(n2)T(n)=T(\frac n2)+\Theta(n^2) (Case 3 of the Master TheoremThe Master Theorem for T(n) = aT(n/b) + w(n) compares w(n) with the threshold n^(log_b a). Case 1 (w polynomially smaller): Theta(n^(log_b a)); case 2 (same order): Theta(n^(log_b a) log n); case 3 (polynomially larger and regular): Theta(w(n)). Full proof from the levels of the tree, extended version with floors and ceilings, a table of applications, and the misuse when no case applies (w = n log n).Master Theorem →) would give Θ(n2)\Theta(n^2): no gain.

Product: from 4 calls to 2

Computing the distinct quadrants C1,C2C_1,C_2 directly needs 4 recursive calls and 22 sums of SC of order n2\frac n2: T(n)=4T(n2)+nT(n)=4T(\frac n2)+n, threshold n2n^2, Case 1, Θ(n2)\Theta(n^2) (exact 2n2−n2n^2-n). As with Strassen, fewer calls and more Divide/Conquer work: U=(A1+A2)(B1+B2),V=(A1−A2)(B1−B2),U+V=2C1,  U−V=2C2,U=(A_1+A_2)(B_1+B_2),\qquad V=(A_1-A_2)(B_1-B_2),\qquad U+V=2C_1,\ \ U-V=2C_2, so C1=12(U+V)C_1=\frac12(U+V), C2=12(U−V)C_2=\frac12(U-V). The factors A1±A2A_1\pm A_2, B1±B2B_1\pm B_2 are SC (closure).

S_MUL(A, B)
  n <- rows(A)
  if n = 1 then return [a11 * b11]
  * A = [A1 A2; A2 A1], B = [B1 B2; B2 B1] *
  Ap <- S_SUM(A1, A2);  Bp <- S_SUM(B1, B2)           { DIVIDE: 4 operations on SC of order n/2 }
  Am <- S_SUB(A1, A2);  Bm <- S_SUB(B1, B2)
  U <- S_MUL(Ap, Bp)                                  { RECURSE: 2 calls }
  V <- S_MUL(Am, Bm)
  C1 <- S_SCALPROD(1/2, S_SUM(U, V))                  { CONQUER: 4 operations }
  C2 <- S_SCALPROD(1/2, S_SUB(U, V))
  return [C1 C2; C2 C1]

Internal work: 88 operations on SC of order n2\frac n2, each costing n2\frac n2, i.e. 4n4n: TM(n)={1n=12TM(n2)+4nn>1.T_M(n)=\begin{cases}1&n=1\\2T_M(\frac n2)+4n&n>1.\end{cases} Threshold n=Θ(w)n=\Theta(w): Case 2, Θ(nlog⁡n)\Theta(n\log n). Exact: each level costs 2ℓ⋅4n2ℓ=4n2^\ell\cdot4\frac n{2^\ell}=4n, with kk levels and 2k=n2^k=n leaves: TM(n)=4nlog⁡2n+nT_M(n)=4n\log_2n+n.

Example (n=4n=4). r(A)=(1,2,3,4)r(A)=(1,2,3,4), r(B)=(1,0,2,1)r(B)=(1,0,2,1): A1↔(1,2)A_1\leftrightarrow(1,2), A2↔(3,4)A_2\leftrightarrow(3,4), B1↔(1,0)B_1\leftrightarrow(1,0), B2↔(2,1)B_2\leftrightarrow(2,1). Divide: A1+A2↔(4,6)A_1+A_2\leftrightarrow(4,6), B1+B2↔(3,1)B_1+B_2\leftrightarrow(3,1), A1−A2↔(−2,−2)A_1-A_2\leftrightarrow(-2,-2), B1−B2↔(−1,−1)B_1-B_2\leftrightarrow(-1,-1). U=S_MUL((4,6),(3,1))U=\text{S\_MUL}((4,6),(3,1)): sums 1010 and 44, differences −2-2 and 22, products 4040 and −4-4, so U=(40−42,40+42)=(18,22)U=(\frac{40-4}2,\frac{40+4}2)=(18,22). V=S_MUL((−2,−2),(−1,−1))=(4,4)V=\text{S\_MUL}((-2,-2),(-1,-1))=(4,4). Conquer: C1=12(U+V)=(11,13)C_1=\frac12(U+V)=(11,13), C2=12(U−V)=(7,9)C_2=\frac12(U-V)=(7,9). First row of the product: (11,13,7,9)(11,13,7,9) (check by definition: C1=A1B1+A2B2↔(1,2)+(10,11)C_1=A_1B_1+A_2B_2\leftrightarrow(1,2)+(10,11), C2↔(4,5)+(3,4)C_2\leftrightarrow(4,5)+(3,4)).

Diagonalization and the Hadamard transform

SC commute, and commuting diagonalizable matrices share a basis of eigenvectors (Av=αvAv=\alpha v and AB=BAAB=BA give A(Bv)=αBvA(Bv)=\alpha Bv). The common basis is explicit.

The basis B(n)\mathcal B(n)

B(1)={[1]}\mathcal B(1)=\{[1]\} and, for n≥2n\ge2, B(n)={(ww):w∈B(n2)}∪{(w−w):w∈B(n2)}.\mathcal B(n)=\Bigl\{\begin{pmatrix}w\\w\end{pmatrix}:w\in\mathcal B(\tfrac n2)\Bigr\}\cup\Bigl\{\begin{pmatrix}w\\-w\end{pmatrix}:w\in\mathcal B(\tfrac n2)\Bigr\}. The nn vectors have entries ±1\pm1 and first entry 11, and are pairwise orthogonal (three cases for distinct vectors: (w;w),(u;u)(w;w),(u;u): 2 w⋅u=02\,w\cdot u=0; (w;−w),(u;−u)(w;-w),(u;-u): 2 w⋅u=02\,w\cdot u=0; (w;w),(u;−u)(w;w),(u;-u): w⋅u−w⋅u=0w\cdot u-w\cdot u=0), hence a basis of Rn\mathbb R^n. The matrices H(n)H(n) with these columns are the Hadamard (Sylvester) matrices: H(1)=[1]H(1)=[1], H(n)=(H(n2)H(n2)H(n2)−H(n2)),H(4)=(11111−11−111−1−11−1−11).H(n)=\begin{pmatrix}H(\frac n2)&H(\frac n2)\\H(\frac n2)&-H(\frac n2)\end{pmatrix},\quad H(4)=\begin{pmatrix}1&1&1&1\\1&-1&1&-1\\1&1&-1&-1\\1&-1&-1&1\end{pmatrix}. They are symmetric with H(n)H(n)=nIH(n)H(n)=nI (induction), so H(n)−1=1nH(n)H(n)^{-1}=\frac1nH(n).

Theorem. For every SC AA of order nn and v∈B(n)v\in\mathcal B(n): Av=αvAv=\alpha v with α=r(A)⋅v\alpha=r(A)\cdot v.

Proof (induction on kk). n=1n=1 is trivial. For v=(w;εw)v=(w;\varepsilon w), w∈B(n2)w\in\mathcal B(\frac n2), ε=±1\varepsilon=\pm1: Av=((A1+εA2)wε(A1+εA2)w)(ε2=1).Av=\begin{pmatrix}(A_1+\varepsilon A_2)w\\\varepsilon(A_1+\varepsilon A_2)w\end{pmatrix}\quad(\varepsilon^2=1). A1+εA2A_1+\varepsilon A_2 is SC of order n2\frac n2, so by hypothesis (A1+εA2)w=βw(A_1+\varepsilon A_2)w=\beta w with β=r(A1)⋅w+ε r(A2)⋅w=r(A)⋅v\beta=r(A_1)\cdot w+\varepsilon\,r(A_2)\cdot w=r(A)\cdot v. Hence Av=βvAv=\beta v. ■\blacksquare

Since the first component of each vv is 11, only the first row is needed: (α1,…,αn)T=H(n) r(A)T(\alpha_1,\dots,\alpha_n)^T=H(n)\,r(A)^T. The eigenvalues of an SC are the Hadamard transform of its first row. Eigenvectors with ε=+1\varepsilon=+1 are those of A1+A2A_1+A_2, with ε=−1\varepsilon=-1 those of A1−A2A_1-A_2: AA is invertible iff A1±A2A_1\pm A_2 are, and det⁡A=det⁡(A1+A2)det⁡(A1−A2)\det A=\det(A_1+A_2)\det(A_1-A_2). The values at the leaves of S_MUL's recursion are exactly the eigenvalues.

Fast Hadamard Transform (FHT)

With x=(u;v)x=(u;v), H(n) x=(H(n2)(u+v)H(n2)(u−v))H(n)\,x=\begin{pmatrix}H(\frac n2)(u+v)\\H(\frac n2)(u-v)\end{pmatrix}: an instance of size nn becomes two of size n2\frac n2, with n2\frac n2 sums and n2\frac n2 differences.

FHT(x)                      { x of length n = 2^k }
  n <- length(x)
  if n = 1 then return x
  for i <- 1 to n/2 do
    s[i] <- x[i] + x[i + n/2]
    d[i] <- x[i] - x[i + n/2]
  return concatenate(FHT(s), FHT(d))

T(1)=0T(1)=0, T(n)=2T(n2)+nT(n)=2T(\frac n2)+n: T(n)=nlog⁡2nT(n)=n\log_2n. The inverse (FHT plus nn products by 1n\frac1n) costs nlog⁡2n+nn\log_2n+n.

Example (n=4n=4). r(A)=(1,2,3,4)r(A)=(1,2,3,4): u+v=(4,6)u+v=(4,6), u−v=(−2,−2)u-v=(-2,-2); H(2)(4,6)=(10,−2)H(2)(4,6)=(10,-2), H(2)(−2,−2)=(−4,0)H(2)(-2,-2)=(-4,0). Eigenvalues (10,−2,−4,0)(10,-2,-4,0) (the first two for A1+A2A_1+A_2, the others for A1−A2A_1-A_2). One is 00: AA is singular, det⁡A=0\det A=0.

Product through the diagonalizing basis

Theorem. For SC A,BA,B with c(A)=r(A)Tc(A)=r(A)^T etc.: c(C)=H(n)−1[(H(n)c(A))⊗(H(n)c(B))]c(C)=H(n)^{-1}\bigl[(H(n)c(A))\otimes(H(n)c(B))\bigr], with ⊗\otimes the componentwise product.

Eigenvalues of ABAB are the products αjβj\alpha_j\beta_j (same basis). Cost: two FHT (2nlog⁡2n2n\log_2n), nn products, one inverse (nlog⁡2n+nn\log_2n+n): 3nlog⁡2n+2n=O(nlog⁡n)3n\log_2n+2n=O(n\log n), cheaper than S_MUL (4nlog⁡2n+n4n\log_2n+n) for n≥4n\ge4. The eigenvalue route also solves inversion (invertible iff no eigenvalue is 00; take reciprocals and return to the first row) and the determinant det⁡A=∏jαj\det A=\prod_j\alpha_j with nlog⁡2n+n−1n\log_2n+n-1 operations, which the block substructure alone cannot do.

Circulant matrices

Definition. AA (n×nn\times n, any nn) is circulant if each row is the previous one rotated one place to the right: A(h+ℓ) mod n,(k+ℓ) mod n=Ah,kA_{(h+\ell)\bmod n,(k+\ell)\bmod n}=A_{h,k}.

With indices from 00: Ahk=r(A)(k−h) mod nA_{hk}=r(A)_{(k-h)\bmod n}; e.g. r(A)=(1,2,0,3)r(A)=(1,2,0,3) gives rows (1,2,0,3),(3,1,2,0),(0,3,1,2),(2,0,3,1)(1,2,0,3),(3,1,2,0),(0,3,1,2),(2,0,3,1). CR model time-invariant linear systems with nn-periodic inputs.

The rotation matrix RR

RR is the CR with first row (0,1,0,…,0)(0,1,0,\dots,0): Rx=(x1,…,xn−1,x0)Rx=(x_1,\dots,x_{n-1},x_0), Rn=IR^n=I.

  • AA is CR iff RA=ARRA=AR: (RA)h,k=Ah+1,k(RA)_{h,k}=A_{h+1,k} and (AR)h,k=Ah,k−1(AR)_{h,k}=A_{h,k-1} (indices mod nn); equality for all h,kh,k is the definition.
  • Every CR is a polynomial in RR: A=∑k=0n−1A0kRkA=\sum_{k=0}^{n-1}A_{0k}R^k (above: A=I+2R+3R3A=I+2R+3R^3).

So CR are closed under sum and product and commute (a commutative subring).

Product == cyclic convolution

A product of polynomials in RR is computed modulo zn−1z^n-1 (since Rn=IR^n=I). The cyclic convolution c=a⊛bc=a\circledast b has pc=papb mod (zn−1)p_c=p_ap_b\bmod(z^n-1), ck=∑i=0n−1aib(k−i) mod nc_k=\sum_{i=0}^{n-1}a_ib_{(k-i)\bmod n}. With A=∑akRkA=\sum a_kR^k, B=∑bkRkB=\sum b_kR^k: AB=∑k(∑i+j≡kaibj)RkAB=\sum_k\bigl(\sum_{i+j\equiv k}a_ib_j\bigr)R^k, i.e. r(AB)=r(A)⊛r(B)r(AB)=r(A)\circledast r(B): multiplying circulants is cyclically convolving their first rows (see Polynomials - Representations and ConvolutionA polynomial with degree bound n is represented by n coefficients or by n values at n distinct points (interpolation theorem, Vandermonde matrix). By coefficients the sum costs n and the product, the linear convolution, n^2 products and (n-1)^2 sums; by values the product costs only componentwise multiplication but needs at least 2n-1 points. General conversions cost too much: evaluation n times with Horner 2n(n-1), interpolation with Gauss-Jordan n^3 or Lagrange n^2. A special base is needed: the DFT.Polynomials - Representations and Convolution →).

Diagonalization: the DFT appears

For a diagonalizable R=M diag(λj)M−1R=M\,\mathrm{diag}(\lambda_j)M^{-1}, p(R)=M diag(p(λj))M−1p(R)=M\,\mathrm{diag}(p(\lambda_j))M^{-1} for every polynomial pp. Let ωn=ei2π/n\omega_n=e^{i2\pi/n} and wj=(ωn0j,ωn1j,…,ωn(n−1)j)w_j=(\omega_n^{0j},\omega_n^{1j},\dots,\omega_n^{(n-1)j}): component kk of RwjRw_j is ωn(k+1)j=ωnjωnkj\omega_n^{(k+1)j}=\omega_n^j\omega_n^{kj} (for k=n−1k=n-1 use ωnnj=1\omega_n^{nj}=1), so Rwj=ωnjwjRw_j=\omega_n^jw_j: the eigenvalues of RR are the nn distinct nn-th roots of unity, and MM is the Fourier matrix F(n)F^{(n)} (DFT and Roots of UnityThe DFT of order n evaluates a polynomial with degree bound n at the n n-th roots of unity, y_i = p(w^i) with w = e^{2 pi i/n}; it is the product by the Fourier matrix F_n, an invertible Vandermonde matrix. The roots form a multiplicative group and satisfy three lemmas: cancellation (w_{dn}^{dk} = w_n^k, w_n^{n/2} = -1), halving (the squares of the n roots are the n/2 roots of order n/2, each twice) and summation (the sum of the powers of w^k is n if k is a multiple of n, 0 otherwise). Linear convolution theorem: (c|0) = DFT^{-1}{2n}(DFT{2n}(a|0) times DFT_{2n}(b|0)).DFT and Roots of Unity →). It diagonalizes all CR, with eigenvalues pA(ωnj)=∑kA0kωnjkp_A(\omega_n^j)=\sum_kA_{0k}\omega_n^{jk}: (α0,…,αn−1)T=F(n)r(A)T.(\alpha_0,\dots,\alpha_{n-1})^T=F^{(n)}r(A)^T. The eigenvalues of a CR are the DFT of its first row.

Theorem (cyclic convolution, matrix form). r(C)T=(F(n))−1[(F(n)r(A)T)⊗(F(n)r(B)T)]r(C)^T=\bigl(F^{(n)}\bigr)^{-1}\bigl[\bigl(F^{(n)}r(A)^T\bigr)\otimes\bigl(F^{(n)}r(B)^T\bigr)\bigr].

With the FFT (Fast Fourier TransformThe FFT computes the DFT_n (n a power of two) by divide and conquer: split the coefficients by index parity, p(x) = p0(x^2) + x p1(x^2), and by the halving lemma two DFTs of order n/2 suffice; y_i = y0_i + w^i y1_i and y_{i+n/2} = y0_i - w^i y1_i. The recurrence T(n) = 2T(n/2) + 2n with T(1) = 0 has exact solution 2 n log2 n. The inverse has matrix F^{-1}_{ij} = w^{-ij}/n and is obtained with the FFT on negative powers (then dividing by n outside the recursion) or with a reversed DFT_n(y). LIN_CONV multiplies two polynomials with n coefficients in 12 n log2(2n) + 4n operations.Fast Fourier Transform →) two transforms and one inverse cost O(nlog⁡n)O(n\log n), plus nn products: two circulants multiply in O(nlog⁡n)O(n\log n) (the FHT only diagonalizes SC; for CR the Fourier transform is needed).

Example (n=4n=4). ω4=i\omega_4=i, w1=(1,i,−1,−i)w_1=(1,i,-1,-i), Rw1=(i,−1,−i,1)=i w1Rw_1=(i,-1,-i,1)=i\,w_1. For a=(1,2,0,3)a=(1,2,0,3), b=(2,1,1,0)b=(2,1,1,0): DFT(a)=(6,1−i,−4,1+i)(a)=(6,1-i,-4,1+i), DFT(b)=(4,1+i,2,1−i)(b)=(4,1+i,2,1-i), componentwise product (24,2,−8,2)(24,2,-8,2), inverse transform a⊛b=(5,8,3,8)a\circledast b=(5,8,3,8).

Versione ripasso

Supercirculant (SC): n=2kn=2^k; n=1n=1 scalar, else A=(A1A2A2A1)A=\begin{pmatrix}A_1&A_2\\A_2&A_1\end{pmatrix} with A1,A2A_1,A_2 SC of order n2\frac n2. n=4n=4, first row (a,b,c,d)(a,b,c,d): rows (a,b,c,d),(b,a,d,c),(c,d,a,b),(d,c,b,a)(a,b,c,d),(b,a,d,c),(c,d,a,b),(d,c,b,a).

  • Properties: symmetric; every row a permutation of the first; only nn distinct values, determined by the first row r(A)r(A); Ahk=r(A)h⊕kA_{hk}=r(A)_{h\oplus k} (XOR, indices from 00).
  • Closure and commutativity (induction on kk): A+BA+B has quadrants A1+B1A_1+B_1, A2+B2A_2+B_2; ABAB has C1=A1B1+A2B2C_1=A_1B_1+A_2B_2, C2=A1B2+A2B1C_2=A_1B_2+A_2B_1 alternating, sums of products of SC; BABA gives the same by commutativity at order n2\frac n2. SC = commutative subring of symmetric matrices.
  • Sum/difference/scalar: S_SUM recurses on A1+B1A_1+B_1, A2+B2A_2+B_2 and copies: T(n)=2T(n2)T(n)=2T(\frac n2), T(1)=1T(1)=1, so T=nT=n (leaves only). Copies free; if they cost 11, T=T(n2)+Θ(n2)T=T(\frac n2)+\Theta(n^2), Case 3, Θ(n2)\Theta(n^2).
  • Product, 4 calls: T=4T(n2)+nT=4T(\frac n2)+n, threshold n2n^2, Case 1: Θ(n2)\Theta(n^2) (exact 2n2−n2n^2-n).
  • Product with the trick: U=(A1+A2)(B1+B2)U=(A_1+A_2)(B_1+B_2), V=(A1−A2)(B1−B2)V=(A_1-A_2)(B_1-B_2); U+V=2C1U+V=2C_1, U−V=2C2U-V=2C_2, so C1=12(U+V)C_1=\frac12(U+V), C2=12(U−V)C_2=\frac12(U-V). Internal work 4+2+2=84+2+2=8 operations on size n2\frac n2, i.e. 4n4n: T(n)=2T(n2)+4n,T(n)=∑ℓ=0k−14n+n=4nlog⁡2n+n.T(n)=2T(\tfrac n2)+4n,\qquad T(n)=\sum_{\ell=0}^{k-1}4n+n=4n\log_2n+n. Threshold nn, Case 2 (Master TheoremThe Master Theorem for T(n) = aT(n/b) + w(n) compares w(n) with the threshold n^(log_b a). Case 1 (w polynomially smaller): Theta(n^(log_b a)); case 2 (same order): Theta(n^(log_b a) log n); case 3 (polynomially larger and regular): Theta(w(n)). Full proof from the levels of the tree, extended version with floors and ceilings, a table of applications, and the misuse when no case applies (w = n log n).Master Theorem →): Θ(nlog⁡n)\Theta(n\log n). Example: r(A)=(1,2,3,4)r(A)=(1,2,3,4), r(B)=(1,0,2,1)r(B)=(1,0,2,1), U=(18,22)U=(18,22), V=(4,4)V=(4,4), r(AB)=(11,13,7,9)r(AB)=(11,13,7,9).
  • Diagonalizing basis B(n)\mathcal B(n): B(1)={[1]}\mathcal B(1)=\{[1]\}; B(n)={(w;w)}∪{(w;−w)}\mathcal B(n)=\{(w;w)\}\cup\{(w;-w)\}, w∈B(n2)w\in\mathcal B(\frac n2). Entries ±1\pm1, first entry 11, pairwise orthogonal (three cases).
  • Theorem: for every SC and v∈B(n)v\in\mathcal B(n), Av=(r(A)⋅v) vAv=(r(A)\cdot v)\,v. Induction: A(w;εw)=((A1+εA2)w;ε(A1+εA2)w)A(w;\varepsilon w)=((A_1+\varepsilon A_2)w;\varepsilon(A_1+\varepsilon A_2)w), and A1+εA2A_1+\varepsilon A_2 is SC. Eigenvalues =H(n) r(A)T=H(n)\,r(A)^T; AA invertible iff A1±A2A_1\pm A_2 are; det⁡A=det⁡(A1+A2)det⁡(A1−A2)\det A=\det(A_1+A_2)\det(A_1-A_2).
  • Hadamard and FHT: H(n)=(HHH−H)H(n)=\begin{pmatrix}H&H\\H&-H\end{pmatrix}, H(n)H(n)=nIH(n)H(n)=nI, H−1=1nHH^{-1}=\frac1nH. H(n)(u;v)=(H(n2)(u+v);H(n2)(u−v))H(n)(u;v)=(H(\frac n2)(u+v);H(\frac n2)(u-v)), T=2T(n2)+n=nlog⁡2nT=2T(\frac n2)+n=n\log_2n; inverse nlog⁡2n+nn\log_2n+n. Example r=(1,2,3,4)r=(1,2,3,4): H(4)r=(10,−2,−4,0)H(4)r=(10,-2,-4,0); a zero eigenvalue, so singular.
  • Via eigenvalues: c(C)=H−1[(Hc(A))⊗(Hc(B))]c(C)=H^{-1}[(Hc(A))\otimes(Hc(B))], cost 3nlog⁡2n+2n3n\log_2n+2n (cheaper than S_MUL for n≥4n\ge4); det⁡A=∏αj\det A=\prod\alpha_j in nlog⁡2n+n−1n\log_2n+n-1; inverse by reciprocals of eigenvalues (the block substructure alone cannot give invertibility).

Circulant (CR): Ahk=r(A)(k−h) mod nA_{hk}=r(A)_{(k-h)\bmod n}, each row is the right rotation of the previous one, any nn.

Teoria collegata