In linear algebra, a tridiagonal matrix is a band matrix that has nonzero elements only on the main diagonal, the subdiagonal/lower diagonal (the first diagonal below this), and the supradiagonal/upper diagonal (the first diagonal above the main diagonal). For example, the following matrix is tridiagonal:
\begin{pmatrix} 1&4&0&0\\ 3&4&1&0\\ 0&2&3&4\\ 0&0&1&3\\ \end{pmatrix}.
The determinant of a tridiagonal matrix is given by the continuant of its elements.[1]
An orthogonal transformation of a symmetric (or Hermitian) matrix to tridiagonal form can be done with the Lanczos algorithm.
A tridiagonal matrix is a matrix that is both upper and lower Hessenberg matrix.[2] In particular, a tridiagonal matrix is a direct sum of p 1-by-1 and q 2-by-2 matrices such that — the dimension of the tridiagonal. Although a general tridiagonal matrix is not necessarily symmetric or Hermitian, many of those that arise when solving linear algebra problems have one of these properties. Furthermore, if a real tridiagonal matrix A satisfies ak,k+1 ak+1,k > 0 for all k, so that the signs of its entries are symmetric, then it is similar to a Hermitian matrix, by a diagonal change of basis matrix. Hence, its eigenvalues are real. If we replace the strict inequality by ak,k+1 ak+1,k ≥ 0, then by continuity, the eigenvalues are still guaranteed to be real, but the matrix need no longer be similar to a Hermitian matrix.[3]
The set of all n × n tridiagonal matrices forms a 3n-2dimensional vector space.
Many linear algebra algorithms require significantly less computational effort when applied to diagonal matrices, and this improvement often carries over to tridiagonal matrices as well.
See main article: continuant (mathematics). The determinant of a tridiagonal matrix A of order n can be computed from a three-term recurrence relation.[4] Write f1 = |a1| = a1 (i.e., f1 is the determinant of the 1 by 1 matrix consisting only of a1), and let
fn=\begin{vmatrix} a1&b1\\ c1&a2&b2\\ &c2&\ddots&\ddots\\ &&\ddots&\ddots&bn-1\\ &&&cn-1&an \end{vmatrix}.
The sequence (fi) is called the continuant and satisfies the recurrence relation
fn=anfn-1-cn-1bn-1fn-2
with initial values f0 = 1 and f−1 = 0. The cost of computing the determinant of a tridiagonal matrix using this formula is linear in n, while the cost is cubic for a general matrix.
The inverse of a non-singular tridiagonal matrix T
T=\begin{pmatrix} a1&b1\\ c1&a2&b2\\ &c2&\ddots&\ddots\\ &&\ddots&\ddots&bn-1\\ &&&cn-1&an \end{pmatrix}
is given by
(T-1)ij=\begin{cases} (-1)i+jbi … bj-1\thetai-1\phij+1/\thetan&ifi<j\\ \thetai-1\phij+1/\thetan&ifi=j\\ (-1)i+jcj … ci-1\thetaj-1\phii+1/\thetan&ifi>j\\ \end{cases}
where the θi satisfy the recurrence relation
\thetai=ai\thetai-1-bi-1ci-1\thetai-2 i=2,3,\ldots,n
with initial conditions θ0 = 1, θ1 = a1 and the ϕi satisfy
\phii=ai\phii+1-bici\phii+2 i=n-1,\ldots,1
with initial conditions ϕn+1 = 1 and ϕn = an.[5] [6]
Closed form solutions can be computed for special cases such as symmetric matrices with all diagonal and off-diagonal elements equal[7] or Toeplitz matrices[8] and for the general case as well.[9] [10]
In general, the inverse of a tridiagonal matrix is a semiseparable matrix and vice versa.[11] The inverse of a symmetric tridiagonal matrix can be written as a single-pair matrix (a.k.a. generator-representable semiseparable matrix) of the form[12] [13]
\begin{pmatrix} \alpha1&-\beta1\\ -\beta1&\alpha2&-\beta2\\ &\ddots&\ddots&\ddots&\\ &&\ddots&\ddots&-\betan-1\\ &&&-\betan-1&\alphan \end{pmatrix}-1=\begin{pmatrix} a1b1&a1b2& … &a1bn\\ a1b2&a2b2& … &a2bn\\ \vdots&\vdots&\ddots&\vdots\\ a1bn&a2bn& … &anbn \end{pmatrix} =\left(amin(i,j)bmax(i,j)\right)
where
\begin{cases}\displaystyleai=
\betai … \betan-1 | |
\deltai … \deltanbn |
\ \displaystyle bi=
\beta1 … \betai-1 | |
d1 … di |
\end{cases}
\begin{cases} dn=\alphan, di-1=\alphai-1-
| |||||||
di |
,&i=n,n-1, … ,2, \\ \delta1=\alpha1, \deltai+1=\alphai+1-
| |||||||
\deltai |
,&i=1,2, … ,n-1. \end{cases}
See main article: tridiagonal matrix algorithm. A system of equations Ax = b for
b\in\Rn
When a tridiagonal matrix is also Toeplitz, there is a simple closed-form solution for its eigenvalues, namely:[15] [16]
a-2\sqrt{bc}\cos\left(
k\pi | |
n+1 |
\right), k=1,\ldots,n.
A real symmetric tridiagonal matrix has real eigenvalues, and all the eigenvalues are distinct (simple) if all off-diagonal elements are nonzero.[17] Numerous methods exist for the numerical computation of the eigenvalues of a real symmetric tridiagonal matrix to arbitrary finite precision, typically requiring
O(n2)
n x n
O(nlogn)
As a side note, an unreduced symmetric tridiagonal matrix is a matrix containing non-zero off-diagonal elements of the tridiagonal, where the eigenvalues are distinct while the eigenvectors are unique up to a scale factor and are mutually orthogonal.[19]
For unsymmetric or nonsymmetric tridiagonal matrices one can compute the eigendecomposition using a similarity transformation.Given a real tridiagonal, nonsymmetric matrix
T=\begin{pmatrix} a1&b1\\ c1&a2&b2\\ &c2&\ddots&\ddots\\ &&\ddots&\ddots&bn-1\\ &&&cn-1&an \end{pmatrix}
bi ≠ ci
bici>0
D
D:=\operatorname{diag}(\delta1,...,\deltan) for \deltai:= \begin{cases} 1&,i=1 \\ \sqrt{
ci-1...c1 | |
bi-1...b1 |
D-1TD
J
J:=D-1TD=\begin{pmatrix} a1&sgnb1\sqrt{b1c1}\\ sgnb1\sqrt{b1c1}&a2&sgnb2\sqrt{b2c2}\\ &sgnb2\sqrt{b2c2}&\ddots&\ddots\\ &&\ddots&\ddots&sgnbn-1\sqrt{bn-1cn-1
T
J
A transformation that reduces a general matrix to Hessenberg form will reduce a Hermitian matrix to tridiagonal form. So, many eigenvalue algorithms, when applied to a Hermitian matrix, reduce the input Hermitian matrix to (symmetric real) tridiagonal form as a first step.[22]
A tridiagonal matrix can also be stored more efficiently than a general matrix by using a special storage scheme. For instance, the LAPACK Fortran package stores an unsymmetric tridiagonal matrix of order n in three one-dimensional arrays, one of length n containing the diagonal elements, and two of length n - 1 containing the subdiagonal and superdiagonal elements.
\partialu(t,x) | |
\partialt |
=\alpha
\partial2u(t,x) | |
\partialx2 |
\begin{pmatrix} | \partialu1(t) | \\ |
\partialt |
\partialu2(t) | |
\partialt |
\\ \vdots\\
\partialuN(t) | |
\partialt |
\end{pmatrix} =
\alpha | |
\Deltax2 |
\begin{pmatrix} -2&1&0&\ldots&0\\ 1&-2&1&\ddots&\vdots\\ 0&\ddots&\ddots&\ddots&0\\ \vdots&&1&-2&1\\ 0&\ldots&0&1&-2 \end{pmatrix} \begin{pmatrix} u1(t)\\ u2(t)\\ \vdots\\ uN(t)\\ \end{pmatrix}
\Deltax
ai=-2
bi=ci=1
a+2\sqrt{bc}\cos(k\pi/{(n+1)})
\cos(x)=-\cos(\pi-x)