ArticleslgStudy

mathematics

Vectorization (mathematics)

Vectorization (mathematics) is a mathematics 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 Vectorization (mathematics) rather than just read about it. In short: In mathematics, especially in linear algebra and matrix theory, the vectorization of a matrix is a linear transformation which converts the matrix into a vector. Specifically, the vectorization of a m × n matrix A, denoted vec(A), is the mn × 1 column vector obtained by stacking the columns of the matrix A on top of one another: vec⁡(A)=[a1,1,…,am,1,a1,2,…,am,2,…,a1,n,…,am,n]⊤ Here, ai,j represents the element in th…

Key takeaways

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

Reference excerpt

In mathematics, especially in linear algebra and matrix theory, the vectorization of a matrix is a linear transformation which converts the matrix into a vector. Specifically, the vectorization of a m × n matrix A, denoted vec(A), is the mn × 1 column vector obtained by stacking the columns of the matrix A on top of one another: vec⁡(A)=[a1,1,…,am,1,a1,2,…,am,2,…,a1,n,…,am,n]⊤ Here, ai,j represents the element in the i-th row and j-th column of A, and the superscript ⊤ denotes the transpose. In other words, vec(A) is a vector containing the entries of A in column-major order. Vectorization expresses, through coordinates, the isomorphism 𝐑m×n≅𝐑mn between these (i.e., of matrices and vectors) as vector spaces. For example, for the 2×2 matrix A=[abcd], the vectorization is vec⁡(A)=[acbd]. The connection between the vectorization of A and the vectorization of its transpose is given by the commutation matrix.

Compatibility with Kronecker products The vectorization is frequently used together with the Kronecker product to express matrix multiplication as a linear transformation on matrices. In particular, vec⁡(ABC)=(C⊤⊗A)vec⁡(B) for matrices A, B, and C of dimensions k×l, l×m, and m×n. For example, if adA(X)=AX−XA (the adjoint endomorphism of the Lie algebra gl(n, C) of all n×n matrices with complex entries), then vec⁡(adA(X))=(A⊗In−In⊗A⊤)vec(X), where In is the n×n identity matrix. There are two other useful formulations: vec⁡(ABC)=(In⊗AB)vec⁡(C)=(C⊤B⊤⊗Ik)vec⁡(A)vec⁡(AB)=(Im⊗A)vec⁡(B)=(B⊤⊗Ik)vec⁡(A) If B is a diagonal matrix (i.e., B=diag⁡(b1,…,bn)), the vectorization can be written using the column-wise Kronecker product ∗ (see Khatri-Rao product) and the main diagonal b=[b1,…,bn]⊤ of B: vec⁡(ABC)=(C⊤∗A)b More generally, it has been shown that vectorization is a self-adjunction in the monoidal closed structure of any category of matrices.

Compatibility with Hadamard products Vectorization is an algebra homomorphism from the space of n × n matrices with the Hadamard (entrywise) product to Cn2 with its Hadamard product: vec⁡(A∘B)=vec⁡(A)∘vec⁡(B).

Compatibility with inner products Vectorization is a unitary transformation from the space of n×n matrices with the Frobenius (or Hilbert–Schmidt) inner product to Cn2: tr⁡(A†B)=vec⁡(A)†vec⁡(B), where the superscript † denotes the conjugate transpose.

Vectorization as a linear sum The matrix vectorization operation can be written in terms of a linear sum. Let X be an m × n matrix that we want to vectorize, and let ei be the i-th canonical basis vector for the n-dimensional space, that is 𝐞i=[0,…,0,1,0,…,0]T. Let Bi be a (mn) × m block matrix defined as follows: 𝐁i=[𝟎⋮𝟎𝐈m𝟎⋮𝟎]=𝐞i⊗𝐈m Bi consists of n block matrices of size m × m, stacked column-wise, and all these matrices are all-zero except for the i-th one, which is a m × m identity matrix Im. Then the vectorized version of X can be expressed as follows: vec⁡(𝐗)=∑i=1n𝐁i𝐗𝐞i Multiplication of X by ei extracts the i-th column, while multiplication by Bi puts it into the desired position in the final vector. Alternatively, the linear sum can be expressed using the Kronecker product: vec⁡(𝐗)=∑i=1n𝐞i⊗𝐗𝐞i

Half-vectorization For a symmetric matrix A, the vector vec(A) contains more information than is strictly necessary, since the matrix is completely determined by the symmetry together with the lower triangular portion, that is, the n(n + 1)/2 entries on and below the main diagonal. For such matrices, the half-vectorization is sometimes more useful than the vectorization. The half-vectorization, vech(A), of a symmetric n × n matrix A is the n(n + 1)/2 × 1 column vector obtained by vectorizing only the lower triangular part of A: vech⁡(A)=[A1,1,…,An,1,A2,2,…,An,2,…,An−1,n−1,An,n−1,An,n]⊤. For example, for the 2×2 matrix A=[abbd], the half-vectorization is vech⁡(A)=[abd]. There exist unique matrices transforming the half-vectorization of a matrix to its vectorization and vice versa called, respectively, the duplication matrix and the elimination matrix.

Programming language Programming languages that implement matrices may have easy means for vectorization. In Matlab/GNU Octave a matrix A can be vectorized by A(:). GNU Octave also allows vectorization and half-vectorization with vec(A) and vech(A) respectively. Julia has the vec(A) function as well. In Python NumPy arrays implement the flatten method, while in R the desired effect can be achieved via the c() or as.vector() functions or, more efficiently, by removing the dimensions attribute of a matrix A with dim(A) <- NULL. In R, function vec() of package 'ks' allows vectorization and function vech() implemented in both packages 'ks' and 'sn' allows half-vectorization.

Applications Vectorization is used in matrix calculus and its applications in establishing e.g., moments of random vectors and matrices, asymptotics, as well as Jacobian and Hessian matrices. It is also used in local sensitivity and statistical diagnostics.

Notes

See also Duplication and elimination matrices Voigt notation Packed storage matrix Column-major order Matricization

References

Worked examples

Example 1 — a first encounter with Vectorization (mathematics)

Start with the simplest possible case. Write down what Vectorization (mathematics) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, 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 Vectorization (mathematics) 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 Vectorization (mathematics) 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 Vectorization (mathematics)

In research
Vectorization (mathematics) appears in mathematics 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 Vectorization (mathematics) 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
Vectorization (mathematics) is common in secondary-school and first-year university syllabi. It links to neighbouring topics Linear algebra, Matrices (mathematics), so understanding it makes those chapters shorter.
In everyday life
Look for Vectorization (mathematics) 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 “Vectorization (mathematics)” →

How to study Vectorization (mathematics) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Vectorization (mathematics) 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 Vectorization (mathematics) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Vectorization (mathematics) in simple terms?

In mathematics, especially in linear algebra and matrix theory, the vectorization of a matrix is a linear transformation which converts the matrix into a vector. Specifically, the vectorization of a m × n matrix A, denoted vec(A), is the mn × 1 column vector obtained by stacking the columns of the…

Why does Vectorization (mathematics) matter?

Because it connects several mathematics 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 Vectorization (mathematics)?

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 Vectorization (mathematics).

Tags

  • Linear algebra
  • Matrices (mathematics)

Keep exploring