0

I am currently investigating the eigenvalue computation of a matrix with a special structure. Consider an $N$-dimensional matrix where all off-diagonal elements are $a$, diagonal elements are typically $b$, but there is a specific diagonal position $k,k$ where the element is $c$. The matrix $A$ can be described as follows for a $N \times N$ matrix with elements $A_{ij}$ defined by:

  • If $i = j$ and $i \neq k$, then $A_{ij} = b$
  • If $i = j$ and $i = k$, then $A_{ij} = c$
  • If $i \neq j$, then $A_{ij} = a$

The general form of the matrix is: $$ \begin{bmatrix} b & a & \cdots & a & \cdots & a \\ a & b & \cdots & a & \cdots & a \\ \vdots & \vdots & \ddots & \vdots & \ddots & \vdots \\ a & a & \cdots & c & \cdots & a \\ \vdots & \vdots & \ddots & \vdots & \ddots & \vdots \\ a & a & \cdots & a & \cdots & b \end{bmatrix} $$

For instance, in a $4 \times 4$ matrix where $a=1$, $b=2$, $c=3$, and $c$ is positioned at the third row and column ($k=3$), the matrix takes the following specific form: $$ \begin{bmatrix} 2 & 1 & 1 & 1 \\ 1 & 2 & 1 & 1 \\ 1 & 1 & 3 & 1 \\ 1 & 1 & 1 & 2 \\ \end{bmatrix} $$ The eigenvalues for this matrix are:

  • $\lambda_1 = 5.3028$
  • $\lambda_2 = 1.6972$
  • $\lambda_3,\lambda_4 = 1$

It is known that if the values of $b$ and $c$ are the same, then the matrix would have eigenvalues:

  • $\lambda_1 = b + (N-1)a$
  • $\lambda_2, \lambda_3, ..., \lambda_N = b-a$

However, in cases where $ a \neq b \neq c$, how can we compute the eigenvalues for such matrices? I would appreciate any methods or references you could provide.

  • Your problem can be formulated as a rank-1 update to a symmetric matrix. See: https://math.stackexchange.com/questions/3052997/eigenvalues-of-a-rank-one-update-of-a-matrix – obareey Sep 10 '24 at 12:00

2 Answers2

2

Short answer: The exact solution is $\lambda_{3,\dots,n} = b-a$ and $$\lambda_{1,2} = \frac{b+c+(n-2)a}{2} \pm \sqrt{\frac{1}{4} \left(b+c+(n-2)a\right)^2 + (n-1)a^2 - (n-2)ac - bc}.$$ Eigenvectors $v=(x_1,\dots,x_n)$ for $\lambda_{3,\dots,n}$ have $x_1=0$, and for $\lambda_{1,2}$ we have $x_{2}=\dots=x_n$.

Longer answer: No fancy tricks required here, just start by explicitly writing out the eigenvalue problem $Av=\lambda v$. I make the arbitrary choice that $c$ is in the first entry of the matrix. Then we have $$cx_1 + a\sum_{j\neq 1} x_j = \lambda x_1, \qquad bx_l + a\sum_{j\neq l} x_j=\lambda x_l$$ for $l=2,\dots,n$. Introduce $S=\sum_jx_j$ to simplify these equations to $$aS = x_1 (\lambda-c+a), \qquad aS = x_l (\lambda-b+a).$$ If $S=0$, we need $x_1 = 0$ or $\lambda = c-a$. The second option gives inconsistencies later on, so we instead have $\lambda = b-a$. Feel free to check that there are $n-2$ such solutions.

The case $S\neq 0$ is more interesting, then we can sum the second type of equation over all $l$ and get $$(n-1)aS=(S-x_1)(\lambda-b+a) = \left(S - \frac{aS}{\lambda-c+a} \right)(\lambda-b+a). $$ Cancelling $S$ and multiplying by $(\lambda-c+a)$ gives $$(n-1)a (\lambda-c+a) = (\lambda-c)(\lambda-b+a),$$ which we can rewrite as $$0=\lambda^2 - \lambda \left( b+c+(n-2)a \right) - (n-1)a^2 + (n-2)ac + bc,$$ and thus the result claimed above.

Here's some lazy Python code for numerical confirmation:

n=6; a=1.351; b=2.1351; c=6.313
m=np.full((n,n), a)
i0=0    # index of 'c' entry
for i in range(n):
    m[i,i]=c if i==i0 else b
ew,ev=np.linalg.eigh(m)
offset = (b+c+(n-2)*a)/2
root = np.sqrt(offset**2 + (n-1)*a**2 - (n-2)*a*c - b*c)
l1, l2 = offset + root, offset - root
print(ew)
print(b-a, l1, l2)
print(np.round(ev, 2))
Noctis
  • 973
2

Here is a solution based on the concept of secular equation.

Consider $A$ written under the following form (indeed, we can assume WLOG that $c$ is in the upper left corner) :

$$A=\begin{bmatrix} c & a & \cdots & a & \cdots & a \\ a & b & \cdots & a & \cdots & a \\ \vdots & \vdots & \ddots & \vdots & \ddots & \vdots \\ a & a & \cdots & b & \cdots & a \\ \vdots & \vdots & \ddots & \vdots & \ddots & \vdots \\ a & a & \cdots & a & \cdots & b \end{bmatrix}$$

can be written as a rank-one perturbation of a diagonal matrix $D$ under the form :

$$\begin{cases}A=D+ ss^T \ \text{where}\\D:= diag(c-a,b-a, \cdots b-a)\end{cases}\tag{1}$$

and $s$ is the column vector with all its entries equal to $\sqrt{a}$ (we can assume $a \ge 0$ ; see remark 2 below).

Let $A':=A-\lambda I$ and

$D':=D-\lambda I= diag(c-a-\lambda,b-a-\lambda, \cdots)$

giving the following relationship, equivalent to (1) :

$$A'=D'+ ss^T\tag{2}$$

Using the result established for example in this answer, we obtain an expression : $$\det(A')=\det(D')\left(1+\frac{a}{c-a-\lambda}+\underbrace{\frac{a}{b-a-\lambda}+\frac{a}{b-a-\lambda}+\cdots+\frac{a}{b-a-\lambda}}_{(n-1) \ \text{times}}\right)\tag{3}$$

Otherwise said, the characteristic polynomial of $A$ is :

$$\underbrace{\det(A-\lambda I)}_{P_A(\lambda)}=\det(D-\lambda I)\left(1+\frac{a}{c-a-\lambda}+\frac{(n-1)a}{b-a-\lambda}\right)\tag{3'}$$

The expression between parentheses in (3') can be written :

$$\begin{cases}\dfrac{Q(\lambda)}{(b-a-\lambda)(c-a-\lambda)} \ \text{with}\\Q(\lambda):=(b-a-\lambda)(c-a-\lambda)+a((n-1)(c-a-\lambda)+(b-a-\lambda))\end{cases}\tag{4}$$

Besides, due to the fact that $$\det(D-\lambda I)=(c-a-\lambda)(b-a-\lambda)^{n-1},$$ (see (1)), the following expression is obtained by cancellation with the denominator in (4) :

$$P_{A}(\lambda)=(b-a-\lambda)^{n-2}Q(\lambda)\tag{5}$$

giving the same eigenvalues as that obtained by @Noctis with the two "exceptional" eigenvalues that are roots of quadratic factor $Q(\lambda)$.

Remarks :

  1. The expression in (3) is classical : when equalled to $0$, it is called a "secular equation" ; references can be found in many different places ; see for example the recent lively talk here making reference to Golub. There are many other reference for secular equation, for example here

  2. About the fact that $a$ can be assumed $\ge 0$ : if this isn't the case, work with $-A$, then take the opposite of the obtained eigenvalues.

  3. A big advantage of this method is its generality : if for example we have an extra "$d$" entry substituted to an "$a$" entry elsewhere on the diagonal of $A$, formula (5) for the characteristic polynomial of $A$ would be :

$$P_{A}(\lambda)=\det(D-\lambda I)=(b-a-\lambda)^{n-3}R(\lambda)$$

for a certain third degree polynomial $R(\lambda)$.

Jean Marie
  • 88,997
  • 1
    Your answer is truly impressive, Professor Jean Marie. Thank you for providing multiple references and remarks. More importantly, your response offers a general approach to calculating eigenvalues for similar matrices. I will certainly consider different elements on the main diagonal in my future work. Thank you very much! – Ivan Sonder Sep 11 '24 at 12:14
  • Interesting references in this question and its answers regarding in particular the efficiency/stability of corresponding algorithms. See as well here. – Jean Marie Sep 11 '24 at 13:17
  • Thank you! This is very helpful! – Ivan Sonder Sep 11 '24 at 13:32
  • @Claude Leibovici Hi Claude! How do you do ? Have you seen this question which boils down to solving a secular equation ? It's fully in your domain of competence... – Jean Marie Sep 11 '24 at 13:35
  • 1
    That is a very nice approach! Compared to my primitive solution, the multiplicities of the eigenvalues are much clearer, too. – Noctis Sep 11 '24 at 16:36
  • Thanks. I appreciate your comment. Your solution has a "plus" : it mentions eigenvectors that I haven't considered. – Jean Marie Sep 11 '24 at 17:06
  • I was wondering if the above method can be used to solve for the eigenvectors? – Ivan Sonder Sep 12 '24 at 06:28
  • I am not sure there is a way to adapt this method to yield eigenvectors as well ; but it remains (if the dimension $n$ isn't too big !) the "good old way" : solve the (homogeneous) system $(A-\lambda_k I)X=0$ for each individual $\lambda_k$, knowing that the case $\lambda_k=b-a$ doesnt deserve to be solved because it is the all the subspace orthogonal to the eigenvector associated to $\lambda_1=c-a$) or orthogonal as well to the eigenvector associated to $\lambda_1=d-a$ is there is a $d$ value, etc. – Jean Marie Sep 12 '24 at 07:11
  • [Ctd] It will remain to find an orthogonal basis for this big eigenspace associated with eigenvalue $b-a$ (remark : orthogonality property of eigenvectors is of course granted by the fact that matrix $A$ is symmetric). – Jean Marie Sep 12 '24 at 07:24
  • I had noticed some errors in my answer that I have "revamped" ... – Jean Marie Sep 12 '24 at 08:17
  • Thank you, @Jean, for your suggestion. Yes, the presence of multiple $b$ values on the diagonal indeed leads to multiple eigenvalues of $b-a$. In fact, based on my calculations, if there are $k$ repeated $b$ values, there should be $k-1$ eigenvalues of $b-a$. However, as mentioned above, I am considering a more general case where there are no repeated elements on the diagonal. In such a general matrix, solving for the eigenvectors might indeed require the "good old way" of solving the (homogeneous) system. – Ivan Sonder Sep 12 '24 at 14:09