ArticleslgStudy

science

Diagonal matrix

Diagonal matrix is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Diagonal matrix rather than just read about it. In short: In linear algebra, a diagonal matrix is a matrix in which the entries outside the main diagonal are all zero; the term usually refers to square matrices. Elements of the main diagonal can either be zero or nonzero.

Key takeaways

  • Diagonal matrix belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Diagonal matrix to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Diagonal matrix from memory before moving on to harder problems.

Reference excerpt

In linear algebra, a diagonal matrix is a matrix in which the entries outside the main diagonal are all zero; the term usually refers to square matrices. Elements of the main diagonal can either be zero or nonzero. An example of a 2×2 diagonal matrix is [3002], while an example of a 3×3 diagonal matrix is[600050004]. An identity matrix of any size, or any multiple of it is a diagonal matrix called a scalar matrix, for example, [0.5000.5]. In geometry, a diagonal matrix may be used as a scaling matrix, since matrix multiplication with it results in changing scale (size) and possibly also shape; only a scalar matrix results in uniform change in scale.

Definition As stated above, a diagonal matrix is a matrix in which all off-diagonal entries are zero. That is, the matrix D = (di,j) with n columns and n rows is diagonal if ∀i,j∈{1,2,…,n},i≠j⟹di,j=0. However, the main diagonal entries are unrestricted. The term diagonal matrix may sometimes refer to a rectangular diagonal matrix, which is an m-by-n matrix with all the entries not of the form di,i being zero. For example: [10004000−3000]or[100000400000−300] More often, however, diagonal matrix refers to square matrices, which can be specified explicitly as a square diagonal matrix. A square diagonal matrix is a symmetric matrix, so this can also be called a symmetric diagonal matrix. The following matrix is square diagonal matrix: [10004000−2] If the entries are real numbers or complex numbers, then it is a normal matrix as well. In the remainder of this article we will consider only square diagonal matrices, and refer to them simply as "diagonal matrices".

Vector-to-matrix diag operator A diagonal matrix D can be constructed from a vector 𝐚=[a1…an]𝖳 using the diag operator: 𝐃=diag⁡(a1,…,an). This may be written more compactly as 𝐃=diag⁡(𝐚). The same operator is also used to represent block diagonal matrices as 𝐀=diag⁡(𝐀1,…,𝐀n) where each argument Ai is a matrix. The diag operator may be written as diag⁡(𝐚)=(𝐚𝟏𝖳)∘𝐈, where ∘ represents the Hadamard product, and 1 is a constant vector with elements 1.

Matrix-to-vector diag operator The inverse matrix-to-vector diag operator is sometimes denoted by the identically named diag⁡(𝐃)=[a1…an]𝖳, where the argument is now a matrix, and the result is a vector of its diagonal entries. The following property holds: diag⁡(𝐀𝐁)=∑j(𝐀∘𝐁𝖳)ij=(𝐀∘𝐁𝖳)𝟏.

Scalar matrix A diagonal matrix with equal diagonal entries is a scalar matrix; that is, a scalar multiple λ of the identity matrix I. Its effect on a vector is scalar multiplication by λ. For example, a 3×3 scalar matrix has the form: [λ000λ000λ]≡λ𝑰3 The scalar matrices are the center of the algebra of matrices: that is, they are precisely the matrices that commute with all other square matrices of the same size. By contrast, over a field (like the real numbers), a diagonal matrix with all diagonal elements distinct only commutes with diagonal matrices (its centralizer is the set of diagonal matrices). That is because if a diagonal matrix 𝐃=diag⁡(a1,…,an) has ai≠aj, then given a matrix M with mij≠0, the (i, j) term of the products are: (𝐃𝐌)ij=aimij and (𝐌𝐃)ij=mijaj, and ajmij≠mijai (since one can divide by mij), so they do not commute unless the off-diagonal terms are zero. Diagonal matrices where the diagonal entries are not all equal or all distinct have centralizers intermediate between the whole space and only diagonal matrices. For an abstract vector space V (rather than the concrete vector space Kn), the analog of scalar matrices are scalar transformations. This is true more generally for a module M over a ring R, with the endomorphism algebra End(M) (algebra of linear operators on M) replacing the algebra of matrices. Formally, scalar multiplication is a linear map, inducing a map R→End⁡(M), (from a scalar λ to its corresponding scalar transformation, multiplication by λ) exhibiting End(M) as a R-algebra. For vector spaces, the scalar transforms are exactly the center of the endomorphism algebra, and, similarly, scalar invertible transforms are the center of the general linear group GL(V). The former is more generally true free modules M≅Rn, for which the endomorphism algebra is isomorphic to a matrix algebra.

Vector operations Multiplying a vector by a diagonal matrix multiplies each of the terms by the corresponding diagonal entry. Given a diagonal matrix 𝐃=diag⁡(a1,…,an) and a vector 𝐯=[x1⋯xn]𝖳, the product is: 𝐃𝐯=diag⁡(a1,…,an)[x1⋮xn]=[a1⋱an][x1⋮xn]=[a1x1⋮anxn]. This can be expressed more compactly by using a vector instead of a diagonal matrix, 𝐝=[a1⋯an]𝖳, and taking the Hadamard product of the vectors (entrywise product), denoted 𝐝∘𝐯: 𝐃𝐯=𝐝∘𝐯=[a1⋮an]∘[x1⋮xn]=[a1x1⋮anxn]. This is mathematically equivalent, but avoids storing all the zero terms of this sparse matrix. This product is thus used in machine learning, such as computing products of derivatives in backpropagation or multiplying IDF weights in TF-IDF, since some BLAS frameworks, which multiply matrices efficiently, do not include Hadamard product capability directly.

Matrix operations The operations of matrix addition and matrix multiplication are especially simple for diagonal matrices. Write diag(a1, ..., an) for a diagonal matrix whose diagonal entries starting in the upper left corner are a1, ..., an. Then, for addition, we have diag⁡(a1,…,an)+diag⁡(b1,…,bn)=diag⁡(a1+b1,…,an+bn) and for matrix multiplication, diag⁡(a1,…,an)diag⁡(b1,…,bn)=diag⁡(a1b1,…,anbn). The diagonal matrix diag(a1, ..., an) is invertible if and only if the entries a1, ..., an are all nonzero. In this case, we have diag⁡(a1,…,an)−1=diag⁡(a1−1,…,an−1). In particular, the diagonal matrices form a subring of the ring of all n-by-n matrices. Multiplying an n-by-n matrix A from the left with diag(a1, ..., an) amounts to multiplying the i-th row of A by ai for all i; multiplying the matrix A from the right with diag(a1, ..., an) amounts to multiplying the i-th column of A by ai for all i.

Operator matrix in eigenbasis

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Diagonal matrix

Start with the simplest possible case. Write down what Diagonal matrix claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Diagonal matrix before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Diagonal matrix ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Diagonal matrix

In research
Diagonal matrix appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Diagonal matrix in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Diagonal matrix is common in secondary-school and first-year university syllabi. It links to neighbouring topics Matrix normal forms, Sparse matrices, so understanding it makes those chapters shorter.
In everyday life
Look for Diagonal matrix outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Diagonal matrix” →

How to study Diagonal matrix in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Diagonal matrix means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Diagonal matrix out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Diagonal matrix in simple terms?

In linear algebra, a diagonal matrix is a matrix in which the entries outside the main diagonal are all zero; the term usually refers to square matrices. Elements of the main diagonal can either be zero or nonzero.

Why does Diagonal matrix matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Diagonal matrix?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Diagonal matrix.

Tags

  • Matrix normal forms
  • Sparse matrices

Keep exploring