Post · 16 min read· pp. 37–44

Polynomial magic I : Chebyshev polynomials

Orthogonal polynomials pop up everywhere in applied mathematics and in particular in numerical analysis. Within machine learning and optimization, typically (a) they provide natural basis functions which are easy to manipulate, or (b) they can be used to model various acceleration mechanisms.

In this post, I will describe one class of such polynomials, the Chebyshev polynomials (Tchebychev in French, Чебышёв in Russian), whose extremal properties (beyond being orthogonal) are useful in the analysis of accelerated algorithms.

Definition and first properties

The kk-th Chebyshev polynomial TkT_k is classically defined as the unique polynomial such that

∀θ∈[0,2π], cos⁡(kθ)=Tk(cos⁡θ).\forall \theta \in [0,2\pi], \ \cos (k\theta) = T_k(\cos \theta).

Recurrence. Summing the two equations cos⁡[(k±1)θ]=cos⁡(kθ)cos⁡θ∓sin⁡(kθ)sin⁡θ\cos [(k\pm 1)\theta] = \cos (k\theta) \cos \theta \mp \sin (k\theta) \sin \theta, the following recurrence relationship can be deduced:

∀k>0, Tk+1(X)=2XTk(X) –Tk−1(X).\forall k >0, \ T_{k+1}(X) = 2X T_k(X) \, – T_{k-1}(X).

Together with the first two polynomials T0(X)=1T_0 (X) = 1 and T1(X)=XT_1(X) = X, this leads to T2(X)=2X2–1T_2(X) = 2X^2 – 1, T3(X)=4X3–3XT_3(X) = 4X^3 – 3X, and so on.

From the recurrence relationships, one can easily deduce that TkT_k has the parity of kk and that TkT_k has degree kk, with leading coefficient 2k−12^{k-1}.

Oscillatory behavior. For kθ=jπk\theta = j \pi, for jj integer, we have cos⁡(kθ)=(−1)j\cos (k \theta)=(-1)^j, while when jj goes from kk to 00, cos⁡θ=cos⁡ ⁣(jπk)\cos \theta = \cos\! \big( \frac{ j \pi}{k}\big) goes from -1 to 1. Thus, on [−1,1][-1,1], Tk(x)T_k(x) oscillates between −1-1 and 11, with equality for cos⁡ ⁣(jπk)\cos\! \big( \frac{j \pi}{k} \big) for j=0,…,kj = 0,\dots,k. This oscillatory behavior is illustrated below and crucial for the extremal properties below.

First 33 Chebyshev polynomials, plotted between -1 and 1. Note the stronger oscillatory behavior between -1 and 1 as kk grows.

Orthogonality. Using the orthogonality of the Fourier basis on [0,2π][0,2\pi], we have for k≠ℓk \neq \ell, ∫0πcos⁡(kθ)cos⁡(ℓθ)dθ=0\int_0^{\pi} \cos (k\theta) \cos (\ell\theta) d\theta=0, and with the change of variable x=cos⁡θx = \cos \theta, we obtain

∫−11Tk(x)Tℓ(x)1−x2dx=0.\int_{-1}^1 \frac{T_k(x) T_\ell(x)}{\sqrt{1-x^2}} dx = 0.
Thus the Chebyshev polynomials inherit from many properties from such orthogonal polynomials (such as the two-term recursion above, but for the Chebyshev polynomials, these can obtained more directly). For further properties, see [1].

Extremal properties

Chebyshev polynomials exhibit many “extremal properties”, of the form: among all polynomials of degree kk with some form of normalization (e.g., fixed kk-th order coefficient or value at given point), the one with smallest specific norm is proportional to TkT_k.

The most classical one is as follows: the polynomial PP of degree kk with kk-th order coefficient equal to one, and with minimum ℓ∞\ell_\infty-norm max⁡x∈[−1,1] ⁣∣P(x)∣\max_{ x \in [-1,1]} \! | P(x)| on [−1,1][-1,1], is P=12k−1TkP = \frac{1}{2^{k-1}}T_k. The proof is particularly elegant and simple (see here). Since this is not the property that we need for optimization, we will consider another one.

Proposition (largest value outside of [−1,1][-1,1]). For any polynomial PP of degree kk such that ∣P(x)∣≤1|P(x)| \leq 1 for x∈[−1,1]x \in [-1,1], and any z>1z > 1, ∣P(z)∣≤Tk(z)|P(z)| \leq T_k(z).

Proof. By contradiction, we assume that there exists z>1z > 1 such that P(z)>Tk(z)P(z)>T_k(z) (the other possibility P(z)<−Tk(z)P(z) < -T_k(z) is done by replacing PP by −P-P). Without loss of generality, we can assume that max⁡x∈[−1,1]∣P(x)∣<1\max_{x \in [-1,1]} |P(x) | < 1 (by potentially rescaling PP). Then, the polynomial Q=P–TkQ = P – T_k of degree kk has alternatively strictly positive and negative values between −1-1 and z>1z>1. Indeed, Q(z)>0Q(z) > 0, and (−1)jQ(cos⁡ ⁣(jπk))<0(-1)^j Q\big(\cos\! \big(\frac{j \pi}{k}\big)\big) < 0 for all j=0,…,kj = 0,\dots,k. Therefore there are k+2k+2 alternating signs, and thus k+1k+1 zeros, which implies that Q=0Q=0 since QQ has degree kk. This is a contradiction with the existence of zz.

Note that for any θ\theta, Tk(cosh⁡θ)=cosh⁡(kθ)T_k( \cosh \theta) = \cosh (k\theta) (which can be shown by induction), and TkT_k is thus increasing on [1,+∞)[1,+\infty) with values quickly increasing as kk grows. See an illustration below.

First 33 Chebyshev polynomials, plotted between 1 and 4 in logarithmic scale. Note the exploding behavior as kk grows.

Chebyshev acceleration

We consider a recursion in Rn\mathbb{R}^n of the form xk=Axk−1–bx_k = A x_{k-1} – b, with A∈Rn×nA \in \mathbb{R}^{n \times n} a symmetric matrix and eigenvalues in [−ρ,ρ][-\rho,\rho] with ρ∈[0,1)\rho \in [0,1). Such recursions are ubiquitous in data science, as (1) gradient descent on a strongly-convex quadratic function, or (b) gossip for distributed averaging [2] (see an example in a section below).

The recursion converges to the unique (because ρ∈[0,1)\rho \in [0,1)) fixed point x∗∈Rnx_\ast \in \mathbb{R}^n such that x∗=Ax∗–bx_\ast = A x_\ast – b. We have, by unrolling the recursion:

xk–x∗=A(xk−1–x∗)=Ak(x0–x∗).x_k – x_\ast = A ( x_{k-1} – x_\ast) = A^k (x_0 – x_\ast).

This leads to the usual exponential convergence rate ∥xk–x∗∥2≤ρk∥x0–x∗∥2\| x_k – x_\ast\|_2 \leq \rho^k \| x_0 – x_\ast\|_2. In the following, writing ρ=1–(1−ρ)\rho = 1 – ( 1-\rho) makes explicit the importance of 1−ρ1-\rho, which is the gap between 11 and the largest eigenvalue of AA. Increasing this gap is equivalent to accelerating the convergence rate.

In order to speed-up convergence, a classical idea is to take linear combinations of all past iterates. That is, we consider yk=∑i=0kνikxiy_k = \sum_{i=0}^k \nu_i^k x_i for some weights νik\nu_i^k such that ∑i=0kνik=1\sum_{i=0}^k \nu_i^k=1 (so that if all iterates are already at x∗x_\ast, then the weighted average stays there). We have

yk–x∗=∑i=0kνik(xi–x∗)=∑i=0kνikAi(x0−x∗)=Pk(A)(x0−x∗),y_k – x_\ast = \sum_{i=0}^k \nu_i^k ( x_i – x_\ast) = \sum_{i=0}^k \nu_i^k A^i (x_0-x_\ast) = P_k(A) (x_0-x_\ast),
where Pk(X)=∑i=0kνikXiP_k(X) = \sum_{i=0}^k \nu_i^k X^i is a polynomial such that Pk(1)=1P_k(1)=1. Therefore, we have:
∥yk–x∗∥2≤max⁡λ∈[−ρ,ρ]∣Pk(λ)∣⋅∥x0–x∗∥2.\| y_k – x_\ast\|_2 \leq \max_{\lambda \in [-\rho, \rho]} |P_k(\lambda)| \cdot \|x_0 – x_\ast\|_2.

In order to select the best polynomial, we are looking for PkP_k such that Pk(1)=1P_k(1)=1 and max⁡λ∈[−ρ,ρ] ⁣∣Pk(λ)∣\max_{\lambda \in [-\rho,\rho]}\! |P_k(\lambda)| is as small as possible. Up to mapping [−ρ,ρ][-\rho,\rho] to [−1,1][-1,1], we know from the extremal property above that the optimal polynomial is exactly a rescaled Chebyshev polynomial, that is,

Pk(X)=Tk(X/ρ)Tk(1/ρ).P_k(X) = \frac{T_k(X/\rho)}{T_k(1/\rho)}.

The maximal value on [−ρ,ρ][-\rho,\rho] is then (Tk(1/ρ))−1(T_k(1/\rho))^{-1}. In order to compare to ρk\rho^k (no acceleration), we can provide an equivalent of [Tk(1/ρ)]−1/k[T_k(1/\rho)]^{-1/k} as ρ1+1−ρ2\frac{\rho}{ 1+ \sqrt{1-\rho^2}} (see end of the post). There is no real acceleration when ρ\rho is bounded away from 1, but as ρ\rho tends to 11, this can be shown (see also the end of the post) to be equivalent to 1–2(1 ⁣− ⁣ρ)1 – \sqrt{2(1\!-\!\rho)}, with the usual “square root” acceleration: 1 ⁣− ⁣ρ1\!-\!\rho is essentially replaced by 1 ⁣− ⁣ρ\sqrt{1\!-\!\rho}.

We thus get an acceleration, but as is, computing yky_k seems to require to store all values of x1,…,xkx_1,\dots,x_k, which is not practical. Since there is a second-order recursion for Chebyshev polynomials, one can derive one as well, directly for the sequence (yk)(y_k). A somewhat lengthy calculation (see end of the post) leads to the recursion

yk+1=ωk+1(Ayk–b)+(1−ωk+1)yk−1,y_{k+1} = \omega_{k+1} ( Ay_{k} – b) + (1-\omega_{k+1}) y_{k-1},
with a sequence ωk+1\omega_{k+1} also defined by recursion as ωk+1=(1–ρ24ωk)−1\omega_{k+1} = ( 1 – \frac{\rho^2}{4} \omega_k)^{-1}, initialized with ω1=2\omega_1 = 2, y0=x0y_0 = x_0, y1=Ax0–by_1 = Ax_0 – b. Therefore, on top of the usual computation of Ayk−bA y_k -b, Chebyshev acceleration comes at no extra computational cost.

Simpler stationary recursion. In the recursion above, the parameter ωk\omega_k varies with kk. A similar (then non totally optimal) acceleration can be obtained by replacing all ωk\omega_k’s by their limit ω\omega when kk tends to infinity, which is characterized by the equation ω=(1−ρ24ω)−1\omega = ( 1-\frac{\rho^2}{4} \omega)^{-1} with smallest solutions 1/ρ–1/ρ2−1ρ/2\frac{ 1/\rho – \sqrt{1/\rho^2 -1}}{\rho/2} (see end of the post for detailed computations). The now stationary recursion then becomes

yk+1=ω(Ayk–b)+(1−ω)yk−1,y_{k+1} = \omega ( Ay_{k} – b) + (1-\omega) y_{k-1},
and is exponentially convergent with rate proportional to ρω/2=11/ρ+1/ρ2–1=ρ1+1–ρ2\rho \omega/2 = \frac{1}{1/\rho + \sqrt{ 1/\rho^2 – 1}} = \frac{\rho}{1+ \sqrt{ 1 – \rho^2}}. Thus, the recursion is simpler and the final speed asymptotically the same as full Chebyshev acceleration.

Relationship with other acceleration mechanisms

Non-adaptive schemes. As seen above for an affine operator F:Rn→RnF:\mathbb{R}^n \to \mathbb{R}^n (i.e., F(x)=Ax−bF(x) = Ax-b), Chebyshev acceleration takes a recursion of the form

xk+1=F(xk),x_{k+1} = F(x_{k}),
and linearly combines iterates; it ends up creating second-order recursions of the form
yk+1=ωk+1F(yk)+(1−ωk+1)yk−1,y_{k+1} = \omega_{k+1} F(y_k) + (1-\omega_{k+1}) y_{k-1},
with the same fixed points. Other formats (with fixed point preservation) can be considered such as
yk+1=F(yk)+δk+1(yk–yk−1),y_{k+1} = F(y_k) + \delta_{k+1}(y_k – y_{k-1}),
or
yk+1=F(yk)+δk+1(F(yk)–F(yk−1)),y_{k+1} = F(y_k) + \delta_{k+1}(F(y_k) – F(y_{k-1})),
for some constants δk+1\delta_{k+1}.

When FF is affine, the format does not matter much (and all end up being essentially equivalent), but for gradient descent algorithms where F(x)=x–γf′(x)F(x) = x – \gamma f'(x) for some non-quadratic function ff and γ\gamma a step-size, there is a difference, the last one corresponding to Nesterov acceleration (see a nice post on it here), and the one before to classical momentum, also known as the heavy-ball method (see [3]).

Adaptive schemes. The methods above need to know the bound on the spectrum ρ\rho. They have to commit to such a value (which is typically only known through upper bounds) and cannot “get lucky”, that is, even if the best value ρ\rho is known, they cannot benefit from additional better properties of the spectrum of AA (e.g., clustered eigenvalues). The conjugate gradient method, which accesses the matrix AA with the slightly stronger oracle of computing AxAx any xx (and not only Ax–bAx – b), or Anderson acceleration (which does not need a stronger oracle), are adaptive for similar problems [4, 5]. Again, Chebyshev polynomials are present; probably more on this in future posts!

Application to accelerated gossip

A interesting linear recursion pops out in distributed optimization, where we assume that computers or processors are placed in nn nodes in a network, and the goal is to minimize an average of function f1,…,fnf_1,\dots,f_n, each of them only accessible by the corresponding node. The nodes are allowed to communicate messages along each edge of a network.

Two-dimensional grid with d=8×8=64d = 8 \times 8 = 64 nodes.

The simplest of such problem is the network averaging problem where fi(θ)=12(θ–ξi)2f_i(\theta) = \frac{1}{2} (\theta – \xi_i)^2, for a uni-dimensional parameter θ\theta and ξ∈Rn\xi \in \mathbb{R}^n. The solution of this consensus is θ∗=1n ⁣∑i=1n ⁣ξi\theta_\ast = \frac{1}{n} \! \sum_{i=1}^n \! \xi_i.

The gossip algorithm [2] consists in iteratively replacing the value θi\theta_i at a given node by a weighted average ∑j∼iWijθj\sum_{j \sim i} W_{ij} \theta_j of the values at neighboring nodes (and node ii). If all nn nodes communicate simultaneously, then the vector θ\theta is replaced by WθW \theta, hence a linear recursion

θk+1=Wθk,\theta_{k+1} = W \theta_{k},
initialized at θ0=ξ\theta_0 = \xi. Assuming that WW is symmetric, with non-negative off-diagonal elements, and such that W1n=1nW 1_n = 1_n (where 1n∈Rn1_n \in \mathbb{R}^n is the vector of all ones), then all eigenvalues of WW except the largest one are included in the interval [−ρ,ρ][-\rho, \rho], with ρ∈(0,1)\rho \in (0,1) for a connected graph. A simple such matrix WW can be obtained from the adjacency matrix AA of the graph, such that Aij=1A_{ij} = 1 if nodes ii and jj are connected, and zero otherwise, as W=I–αLW = I – \alpha L, with L=Diag(A1n)–AL = {\rm Diag}(A 1_n) – A the Laplacian matrix and α\alpha selected so that the eigenvalues are all between −ρ-\rho and ρ\rho, except one, which is equal to 1 (see values of ρ\rho and α\alpha at the end of the post). We will see below that this extra eigenvalue which is equal to one is in fact not a problem for analyzing the convergence of this network averaging procedure.

When applying the gossip matrix WW iteratively to θ0=ξ\theta_0 = \xi, the projection on the eigensubspace corresponding to the unit eigenvalue is not changed, while all other projections on the other eigensubspaces converge to zero at rate at most ρk\rho^k. Thus θk\theta_k converges to the constant vector 1n1n1n⊤ξ\frac{1}{n} 1_n 1_n^\top \xi at rate ρk\rho^k, and thus to a constant vector, with the average 1n ⁣∑i=1n ⁣ξi\frac{1}{n} \! \sum_{i=1}^n \! \xi_i in all components.

Given that we have a linear recursion, we can use Chebyshev acceleration defined above and obtain substantial improvements, as illustrated below. For the use of this acceleration within distributed optimization algorithms, see [6] and references therein.

Comparison of gossip algorithms on a two-dimensional grid (each cell correspond to a value ξi∈[−1,1]\xi_i \in [-1,1] to average): (left) regular gossip, (center) accelerated second-order recursion with constant coefficients, (right) Chebyshev acceleration. Convergence is much faster with acceleration, (only) slightly better for Chebyshev acceleration, which is the optimal polynomial acceleration.

Conclusion

Among classical classes of orthogonal polynomials, Chebyshev polynomials are special, because beyond being orthogonal, they satisfy extremal properties that are particularly useful in numerical analysis.

In future posts, I plan to go over Jacobi polynomials (which include Legendre, Gegenbauer and Chebyshev polynomials), Hermite polynomials, and finally Bernoulli polynomials (which are not orthogonal but still very special). For all of these, there are natural applications in machine learning.

Acknowledgements. I would like to thank Raphaël Berthier for proofreading this blog post and making good clarifying suggestions.

References

[1] John C. Mason, and David C. Handscomb. Chebyshev polynomials. Chapman and Hall/CRC, 2002. [2] Stephen Boyd, Arpita Ghosh, Balaji Prabhakar, Devavrat Shah. Randomized gossip algorithms. IEEE/ACM Transactions on Networking, 14:2508-2530, 2006. [3] Euhanna Ghadimi, Hamid Reza Feyzmahdavian, and Mikael Johansson. Global convergence of the heavy-ball method for convex optimization. European Control Conference (ECC), 2015. [4] Homer F. Walker, Peng Ni. Anderson acceleration for fixed-point iterations. SIAM Journal on Numerical Analysis, 49(4):1715-1735, 2011. [5] Damien Scieur, Alexandre d’Aspremont, Francis Bach. Regularized Nonlinear Acceleration. Mathematical Programming, 2018. [6] Kevin Scaman, Francis Bach, Sébastien Bubeck, Yin-Tat Lee, Laurent Massoulié. Optimal algorithms for smooth and strongly convex distributed optimization in networks. Proceedings of the International Conference on Machine Learning (ICML), 2017. [7] Mieczysław A. Kłopotek. Spectral Analysis of Laplacians of an Unweighted and Weighted Multidimensional Grid Graph — Combinatorial versus Normalized and Random Walk Laplacians. Technical report, ArXiv:1707.05210, 2019.

Detailed Computations

Limit of [Tk(1/ρ)]−1/k[T_k(1/\rho)]^{-1/k}. For z≥1z \geq 1, then a well-known property of Chebyshev polynomials is that Tk(z)=cosh⁡[k acosh(z)]T_k(z) = \cosh [ k \, {\rm acosh} (z)] (which can be shown by induction using basic hyperbolic trigonometry identities). Moreover, we have acosh(z)=log⁡(z+z2−1){\rm acosh} (z) = \log( z + \sqrt{z^2-1} ) and thus

Tk(z)=12[(z+z2−1)k+(z–z2−1)k].T_k(z) = \frac{1}{2} \big[ \big( z + \sqrt{z^2-1} \big)^k + \big(z – \sqrt{z^2-1}\big)^k \big].
For z=1/ρz = 1/\rho, and taking limits, we get that [Tk(z)]1/k[T_k(z)]^{1/k} tends to z+z2−1z + \sqrt{z^2-1}, which leads to the limit ρ1+1−ρ2\frac{\rho}{ 1+ \sqrt{1-\rho^2}} for [Tk(z)]−1/k[T_k(z)]^{-1/k}. Then a classical Taylor expansion in 1−ρ1-\rho leads to 1–2(1−ρ)1 – \sqrt{2(1-\rho)}.

Recurrence for Chebyshev acceleration. We have, using the recursion for Chebyshev polynomials

yk+1–x∗=2Tk+1(1/ρ)(A/ρ)Tk(A/ρ)(x0–x∗) –1Tk+1(1/ρ)Tk−1(A/ρ)(x0–x∗).y_{k+1} – x_\ast = \frac{ 2 }{T_{k+1}(1/\rho)} (A/\rho) T_k(A/\rho) ( x_0 – x_\ast) \ – \frac{ 1 }{T_{k+1}(1/\rho)} T_{k-1}(A/\rho) ( x_0 – x_\ast).
Using the equality x∗=Ax∗−bx_\ast = A x_\ast -b, the terms in x∗x_\ast cancel (they have to anyway, because Pk(1)=1P_k(1)=1). We then get
yk+1=(2/ρ)Tk(1/ρ)Tk+1(1/ρ)(Ayk–b) –Tk−1(1/ρ)Tk+1(1/ρ)yk−1.y_{k+1} = \frac{ (2/\rho) T_{k}(1/\rho)}{T_{k+1}(1/\rho)} ( A y_k – b) \, – \frac{ T_{k-1}(1/\rho) }{T_{k+1}(1/\rho)} y_{k-1}.

Using Tk−1(1/ρ)=(2/ρ)Tk(1/ρ)–Tk+1(1/ρ)T_{k-1}(1/\rho) = (2/\rho) T_{k}(1/\rho) – T_{k+1}(1/\rho), and denoting ωk+1=(2/ρ)Tk(1/ρ)Tk+1(1/ρ)\omega_{k+1} = \frac{ (2/\rho) T_{k}(1/\rho)}{T_{k+1}(1/\rho)}, we get

yk+1=ωk+1(Ayk–b)+(1−ωk+1)yk−1.y_{k+1} = \omega_{k+1} ( A y_{k} – b) + ( 1- \omega_{k+1}) y_{k-1}.
Reusing one last time the Chebyshev recursion, we get
ωk+1−1=Tk+1(1/ρ)(2/ρ)Tk(1/ρ)=1–Tk−1(1/ρ)(2/ρ)Tk(1/ρ)=1–ρ24ωk,\omega_{k+1}^{-1} = \frac{T_{k+1}(1/\rho)}{ (2/\rho) T_{k}(1/\rho)}= 1 – \frac{T_{k-1}(1/\rho)}{ (2/\rho) T_{k}(1/\rho)} =1 – \frac{\rho^2}{4} \omega_{k},
which is the desired recursion.

Convergence of stationary recursion. The roots of ω=(1−ρ24ω)−1\omega = ( 1-\frac{\rho^2}{4} \omega)^{-1} are the ones of ρ24ω2–ω+1=0\frac{\rho^2}{4} \omega^2 – \omega + 1 = 0, with smallest solutions ω=1/ρ–1/ρ2−1ρ/2\omega = \frac{ 1/\rho – \sqrt{1/\rho^2 -1}}{\rho/2}. In order to study the second-order recursion

yk+1=ω(Ayk–b)+(1−ω)yk−1,y_{k+1} = \omega ( Ay_{k} – b) + (1-\omega) y_{k-1},
with constant coefficient, we need to compute the roots of r2=ωλr+(1−ω)r^2 = \omega \lambda r + (1-\omega), for ∣λ∣≤ρ|\lambda| \leq \rho. The discriminant of this equation is λ2ω2+4(1−ω)≤ρ2ω2+4(1−ω)=0\lambda^2 \omega^2 + 4 (1-\omega) \leq \rho^2 \omega^2 + 4(1-\omega) = 0, and thus the roots are complex conjugate with squared modulus (ω –1)=14ρ2ω2(\omega\ – 1) = \frac{1}{4} \rho^2 \omega^2 independent of λ\lambda. Thus, as kk tends to infinity, ∥yk–x∗∥21/k\| y_k – x_\ast\|_2^{1/k} tends to 12ρω=(1/ρ–1/ρ2–1)=11/ρ+1/ρ2–1\frac{1}{2} \rho \omega = ( 1/\rho – \sqrt{ 1/\rho^2 – 1} ) = \frac{1}{1/\rho + \sqrt{ 1/\rho^2 – 1}}, which is exactly the rate for Chebyshev acceleration.

Eigenvalues of the Laplacian matrix of a square grid. Given a chain of length mm such as depicted below, the m×mm \times m Laplacian matrix can be shown (see [7]) to have eigenvalues 2+2cos⁡kπm2 + 2 \cos \frac{k\pi}{m} for k=1,…,mk =1,\dots,m.

One-dimensional grid with m=8m = 8.

For a two-dimensional grid of size m×mm \times m, then the m2×m2m^2 \times m^2 Laplacian matrix can be shown (see [7]) to have eigenvalues 4+2cos⁡k1πm+2cos⁡k2πm4 + 2\cos \frac{k_1\pi}{m} + 2\cos \frac{k_2\pi}{m} for k1,k2=1,…,mk_1,k_2 =1,\dots,m. Therefore, the second smallest eigenvalue is \lambda_\min = 2 – 2 \cos \frac{\pi}{m} and the largest eigenvalue is \lambda_\max = 4 + 4 \cos \frac{\pi}{m}. We then select α\alpha such that 1-\alpha \lambda_\min = \rho and 1-\alpha \lambda_\max = -\rho, leading to \alpha = \frac{2}{\lambda_\min + \lambda_\max} = \frac{2}{6 + 2 \cos \frac{\pi}{m}} and finally \rho = \frac{\lambda_\max – \lambda_\min}{\lambda_\max + \lambda_\min} = \frac{2 +6 \cos \frac{\pi}{m} }{6 + 2 \cos \frac{\pi}{m}}\sim \frac{8 – 3 \frac{\pi^2}{m^2}}{8 – \frac{\pi^2}{m^2}}\sim 1 – \frac{\pi^2}{4 m^2}. Thus, as a function of n=m2n = m^2, the eigengap is proportional to 1/n1/n.

More generally, for the grid of size mm in dimension dd, then we get \lambda_\min = 2 – 2 \cos \frac{\pi}{m} and \lambda_\max = 2d + 2d \cos \frac{\pi}{m}, and \rho = \frac{\lambda_\max – \lambda_\min}{\lambda_\max + \lambda_\min} = \frac{2d-2 +(2d+2) \cos \frac{\pi}{m} }{2d+2 + (2d-2) \cos \frac{\pi}{m}}\sim \frac{4d – (d+1) \frac{\pi^2}{m^2}}{4d – (d-1)\frac{\pi^2}{m^2}}\sim 1 – \frac{\pi^2}{2d m^2}. Thus, as a function of n=mdn = m^d, the eigengap is proportional to 1/n2/d1/n^{2/d}. Moreover, when mm is large, the normalizing factor α\alpha tends to 1/(2d)1/(2d).