MathIsimple
LA-8.3
Available
Advanced

Multilinear Algebra & Tensors

Tensors generalize vectors and matrices to higher dimensions. They are fundamental in physics (general relativity, continuum mechanics) and modern machine learning. This introduction covers the essential concepts of multilinear maps, tensor products, and index notation.

Learning Objectives
  • Define multilinear maps and their properties
  • Understand the tensor product of vector spaces
  • Compute tensor products of vectors
  • Use Einstein summation notation
  • Distinguish covariant and contravariant indices
  • Understand tensors as multilinear maps
  • Apply tensors in physics (stress, strain, inertia)
  • See connections to machine learning and data science
Prerequisites
  • Dual spaces and linear functionals (LA-3.5)
  • Bilinear forms and quadratic forms (LA-8.2)
  • Linear maps and matrices (LA-3.1-3.4)
  • Basis and dimension (LA-2.5)

1. Multilinear Maps

Definition 8.6: Bilinear Map

A map B:V×WUB: V \times W \to U is bilinear if:

  • B(αv1+βv2,w)=αB(v1,w)+βB(v2,w)B(\alpha v_1 + \beta v_2, w) = \alpha B(v_1, w) + \beta B(v_2, w)
  • B(v,αw1+βw2)=αB(v,w1)+βB(v,w2)B(v, \alpha w_1 + \beta w_2) = \alpha B(v, w_1) + \beta B(v, w_2)
Example 8.5: Examples of Bilinear Maps
  • Dot product: ,:V×VR\langle \cdot, \cdot \rangle: V \times V \to \mathbb{R}
  • Matrix multiplication: Mm×n×Mn×pMm×pM_{m \times n} \times M_{n \times p} \to M_{m \times p}
  • Cross product: R3×R3R3\mathbb{R}^3 \times \mathbb{R}^3 \to \mathbb{R}^3
Definition 8.7: Multilinear Map

A k-linear map T:V1××VkUT: V_1 \times \cdots \times V_k \to U is linear in each argument separately.

Example 8.5a: Determinant as Multilinear Map

The determinant det: (ℝⁿ)ⁿ → ℝ is n-linear and alternating:

det(v1,...,αvi+βw,...,vn)=αdet(v1,...,vi,...,vn)+βdet(v1,...,w,...,vn)\det(v_1, ..., \alpha v_i + \beta w, ..., v_n) = \alpha \det(v_1, ..., v_i, ..., v_n) + \beta \det(v_1, ..., w, ..., v_n)
Remark 8.5a: Bilinear ≠ Linear

A bilinear map is NOT linear as a map V × W → U. For example:

B(2v,w)=2B(v,w)B(v+v,w+w)=2B(v,w)+2B(v,w)B(2v, w) = 2B(v, w) \neq B(v+v, w+w) = 2B(v,w) + 2B(v,w)

Bilinear means linear in each slot separately.

Theorem 8.5a: Bilinear Map Representation

If {ei}\{e_i\} is basis for V and {fj}\{f_j\} for W, then B(v, w) is determined by:

B(v,w)=i,jviwjB(ei,fj)B(v, w) = \sum_{i,j} v^i w^j B(e_i, f_j)

A bilinear form on ℝⁿ is represented by an n×n matrix.

Example 8.5b: Bilinear Form Computation

For B(v,w)=vTAwB(v, w) = v^T A w with A=(1234)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}:

B((1,0)T,(1,1)T)=(1,0)(1234)(11)=3B((1, 0)^T, (1, 1)^T) = (1, 0) \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} \begin{pmatrix} 1 \\ 1 \end{pmatrix} = 3

2. Tensor Product

Definition 8.8: Tensor Product Space

The tensor product VWV \otimes W is a vector space with a bilinear map :V×WVW\otimes: V \times W \to V \otimes W such that any bilinear map B:V×WUB: V \times W \to U factors uniquely through VWV \otimes W.

Theorem 8.6: Dimension of Tensor Product
dim(VW)=dim(V)dim(W)\dim(V \otimes W) = \dim(V) \cdot \dim(W)

If {ei}\{e_i\} is basis for VV and {fj}\{f_j\} for WW, then {eifj}\{e_i \otimes f_j\} is basis for VWV \otimes W.

Example 8.6: Outer Product

For uRm,vRnu \in \mathbb{R}^m, v \in \mathbb{R}^n, the outer product uv=uvTu \otimes v = uv^T is an m×nm \times n matrix:

(uv)ij=uivj(u \otimes v)_{ij} = u_i v_j
Example 8.6a: Concrete Outer Product

For u=(1,2)Tu = (1, 2)^T and v=(3,4,5)Tv = (3, 4, 5)^T:

uv=(12)(345)=(3456810)u \otimes v = \begin{pmatrix} 1 \\ 2 \end{pmatrix} \begin{pmatrix} 3 & 4 & 5 \end{pmatrix} = \begin{pmatrix} 3 & 4 & 5 \\ 6 & 8 & 10 \end{pmatrix}
Remark 8.6a: Universal Property

The tensor product is characterized by its universal property:

For any bilinear B: V × W → U, there exists a unique linear L: V ⊗ W → U such that B(v, w) = L(v ⊗ w).

Theorem 8.6a: Properties of Tensor Product
  • (v1+v2)w=v1w+v2w(v_1 + v_2) \otimes w = v_1 \otimes w + v_2 \otimes w
  • v(w1+w2)=vw1+vw2v \otimes (w_1 + w_2) = v \otimes w_1 + v \otimes w_2
  • (αv)w=v(αw)=α(vw)(\alpha v) \otimes w = v \otimes (\alpha w) = \alpha (v \otimes w)
Definition 8.8a: Simple vs General Tensors

Simple tensors (or decomposable) have form v ⊗ w.

General tensors are sums of simple tensors: iviwi\sum_i v_i \otimes w_i.

Not every tensor is simple! Most tensors require multiple terms.

Example 8.6b: Non-Simple Tensor

In R2R2\mathbb{R}^2 \otimes \mathbb{R}^2, the tensor:

e1e1+e2e2e_1 \otimes e_1 + e_2 \otimes e_2

cannot be written as a single u ⊗ v (verify by trying to factor).

Remark 8.6b: SVD Connection

The SVD A = UΣVᵀ expresses a matrix as sum of simple tensors:

A=i=1rσiuiviA = \sum_{i=1}^r \sigma_i u_i \otimes v_i

Rank = minimum number of simple tensors needed.

3. Einstein Summation Convention

Definition 8.9: Einstein Convention

Repeated indices (one upper, one lower) imply summation:

aibiiaibi,TijvjjTijvja_i b^i \equiv \sum_i a_i b^i, \quad T^i{}_j v^j \equiv \sum_j T^i{}_j v^j
Remark 8.6: Index Position
  • Upper indices (viv^i): contravariant (vector components)
  • Lower indices (viv_i): covariant (dual/covector components)
Example 8.7: Matrix-Vector Product

Using Einstein notation: (Av)i=Aijvj(Av)^i = A^i{}_j v^j

The jj index is summed (appears up and down).

Example 8.7a: Matrix Multiplication

Product C = AB in Einstein notation:

Cik=AijBjkC^i{}_k = A^i{}_j B^j{}_k

Index j appears up and down, so we sum over j.

Example 8.7b: Trace

The trace of a matrix:

tr(A)=Aii=iAii\text{tr}(A) = A^i{}_i = \sum_i A^i{}_i
Definition 8.9a: Index Raising and Lowering

The metric tensor gijg_{ij} converts between index types:

  • Lower: vi=gijvjv_i = g_{ij} v^j
  • Raise: vi=gijvjv^i = g^{ij} v_j

where gijg^{ij} is inverse of gijg_{ij}.

Example 8.7c: Euclidean Metric

In Euclidean space with orthonormal basis: gij=δijg_{ij} = \delta_{ij} (Kronecker delta).

So vi=viv_i = v^i — no distinction between upper and lower indices.

Remark 8.7: Free vs Dummy Indices
  • Free indices: Appear once, indicate tensor type
  • Dummy indices: Repeated (summed), can be renamed

In TijvjT^i{}_j v^j: i is free, j is dummy.

4. Tensors

Definition 8.10: (p,q)-Tensor

A (p,q)-tensor is a multilinear map:

T:V××Vp×V××VqRT: \underbrace{V^* \times \cdots \times V^*}_{p} \times \underbrace{V \times \cdots \times V}_{q} \to \mathbb{R}

It has pp contravariant and qq covariant indices: Ti1ipj1jqT^{i_1 \ldots i_p}{}_{j_1 \ldots j_q}.

Example 8.8: Common Tensors
  • (0,0): Scalar
  • (1,0): Vector viv^i
  • (0,1): Covector ωi\omega_i
  • (1,1): Linear map AijA^i{}_j
  • (0,2): Bilinear form gijg_{ij} (metric)
Definition 8.10a: Tensor Transformation Law

Under change of basis ei=Pjieje'_i = P^j{}_i e_j, a (p,q)-tensor transforms as:

Ti1ipj1jq=(P1)i1k1Pl1j1Tk1l1T'^{i_1 \ldots i_p}{}_{j_1 \ldots j_q} = (P^{-1})^{i_1}{}_{k_1} \cdots P^{l_1}{}_{j_1} \cdots T^{k_1 \ldots}{}_{l_1 \ldots}

This transformation law DEFINES what a tensor is!

Definition 8.10b: Tensor Contraction

Contraction sets one upper and one lower index equal and sums:

TijjkjTijjk=SikT^{ij}{}_{jk} \to \sum_j T^{ij}{}_{jk} = S^i{}_k

Reduces rank by 2 (one upper, one lower index removed).

Example 8.8a: Contraction Examples
  • Trace: AiiA^i{}_i contracts a (1,1)-tensor to scalar
  • Dot product: viwiv^i w_i contracts two vectors (one raised)
  • Matrix-vector: AijvjA^i{}_j v^j contracts (1,1)⊗(1,0) to (1,0)
Definition 8.10c: Tensor Product of Tensors

If S is (p₁,q₁) and T is (p₂,q₂), then S⊗T is (p₁+p₂, q₁+q₂):

(ST)i1ip1j1jp2k1l1=Si1k1Tj1l1(S \otimes T)^{i_1 \ldots i_{p_1} j_1 \ldots j_{p_2}}{}_{k_1 \ldots l_1 \ldots} = S^{i_1 \ldots}{}_{k_1 \ldots} T^{j_1 \ldots}{}_{l_1 \ldots}
Remark 8.8: Tensor Algebra

Tensors form an algebra with:

  • Addition: Same type tensors
  • Scalar multiplication: Multiply all components
  • Tensor product: Combines tensors
  • Contraction: Reduces rank
Definition 8.10d: Symmetric and Antisymmetric Tensors

A (0,2)-tensor is:

  • Symmetric: Tij=TjiT_{ij} = T_{ji}
  • Antisymmetric: Tij=TjiT_{ij} = -T_{ji}

Any tensor can be decomposed: T=Tsym+TantiT = T^{sym} + T^{anti}

Example 8.8b: Symmetrization

For any (0,2)-tensor T:

Tijsym=12(Tij+Tji),Tijanti=12(TijTji)T^{sym}_{ij} = \frac{1}{2}(T_{ij} + T_{ji}), \quad T^{anti}_{ij} = \frac{1}{2}(T_{ij} - T_{ji})

5. Applications

General Relativity

Metric tensor, Riemann curvature, Einstein field equations—all tensor equations.

Continuum Mechanics

Stress tensor, strain tensor, elasticity tensor relate forces and deformations.

Machine Learning

Data as tensors (images, sequences). Tensor decomposition for compression and analysis.

Quantum Mechanics

State spaces as tensor products. Entanglement is non-separability in tensor product.

Example 8.9: Stress Tensor

The stress tensor σij\sigma_{ij} relates force to surface orientation:

Fi=σijnjAF_i = \sigma_{ij} n^j \cdot A

where njn^j is surface normal and A is area. It's a (0,2) symmetric tensor.

Example 8.9a: Moment of Inertia

The inertia tensor IijI_{ij} relates angular momentum to angular velocity:

Li=IijωjL^i = I^{ij} \omega_j

Diagonalizing I gives principal axes and principal moments.

Example 8.9b: Metric Tensor

The metric tensor gijg_{ij} defines inner product and distance:

ds2=gijdxidxj,u,v=gijuivjds^2 = g_{ij} dx^i dx^j, \quad \langle u, v \rangle = g_{ij} u^i v^j

In general relativity, the metric encodes gravitational effects.

Remark 8.9: Physics Notation

Physicists often write tensors with explicit indices:

  • gμνg_{\mu\nu} — spacetime metric (Greek indices: 0-3)
  • TμνT_{\mu\nu} — stress-energy tensor
  • FμνF_{\mu\nu} — electromagnetic field tensor
Example 8.9c: Machine Learning Tensors

In deep learning frameworks:

  • 1D tensor: Vector (features)
  • 2D tensor: Matrix (batch of vectors)
  • 3D tensor: Grayscale video or batch of images
  • 4D tensor: Batch of color images (N×H×W×C)

6. Levi-Civita Symbol

Definition 8.11: Levi-Civita Symbol

The Levi-Civita symbol εijk\varepsilon_{ijk} (in 3D):

εijk={+1if (i,j,k) is even permutation of (1,2,3)1if (i,j,k) is odd permutation0if any index repeated\varepsilon_{ijk} = \begin{cases} +1 & \text{if } (i,j,k) \text{ is even permutation of } (1,2,3) \\ -1 & \text{if } (i,j,k) \text{ is odd permutation} \\ 0 & \text{if any index repeated} \end{cases}
Example 8.10: Cross Product

The cross product in index notation:

(u×v)i=εijkujvk(u \times v)^i = \varepsilon^{ijk} u_j v_k
Example 8.10a: Determinant

The 3×3 determinant:

det(A)=εijkA1iA2jA3k\det(A) = \varepsilon^{ijk} A_{1i} A_{2j} A_{3k}
Remark 8.10: Pseudo-tensors

The Levi-Civita symbol is a pseudo-tensor:

  • Transforms like a tensor under rotations
  • Gets extra (-1) under reflections
  • Cross product is a pseudo-vector (axial vector)

7. Key Concepts Summary

Tensor Product

  • dim(VW)=mn\dim(V \otimes W) = mn
  • vwv \otimes w: simple tensor
  • • Outer product: uvTuv^T

Index Notation

  • • Upper: contravariant
  • • Lower: covariant
  • • Repeated: sum (Einstein)

Tensor Types Table

TypeComponentsExample
(0,0)1Scalar
(1,0)nVector vⁱ
(0,1)nCovector ωᵢ
(1,1)Linear map Aⁱⱼ
(0,2)Metric gᵢⱼ
(p,q)n^(p+q)General tensor

8. Tensor Decompositions

Definition 8.12: Tensor Rank

The rank of a tensor T is the minimum number of simple tensors needed:

T=r=1Rvr(1)vr(2)T = \sum_{r=1}^R v_r^{(1)} \otimes v_r^{(2)} \otimes \cdots

For matrices, this is ordinary matrix rank. For higher-order tensors, it's more complex.

Remark 8.11: Tensor Decomposition Types
  • CP/CANDECOMP: Sum of rank-1 tensors
  • Tucker: Core tensor with factor matrices
  • Tensor Train: Chain of 3D tensors
Example 8.11: Matrix as 2-Tensor

SVD is a tensor decomposition for 2-tensors (matrices):

A=i=1rσiuiviA = \sum_{i=1}^r \sigma_i u_i \otimes v_i

This is the CP decomposition for matrices.

Remark 8.12: Applications of Tensor Decomposition
  • Data compression: Approximate high-dimensional data
  • Recommendation systems: Collaborative filtering
  • Scientific computing: PDE solvers
  • Quantum chemistry: Electronic structure

9. Common Mistakes

Confusing tensor and matrix

A matrix is a specific representation. A tensor is defined by transformation laws. Different bases give different matrices for same tensor.

Wrong index contraction

Can only contract one upper with one lower index. Tⁱʲ cannot contract with Tᵏˡ unless indices match position.

Thinking all tensors are simple

Most tensors require sums of simple tensors. e₁⊗e₁ + e₂⊗e₂ cannot be written as u⊗v.

10. Chapter Summary

Key Takeaways

Core Concepts
  • • Tensors: multilinear maps
  • • V⊗W: tensor product space
  • • Einstein notation: implied sums
  • • (p,q)-tensor: p upper, q lower indices
Operations
  • • Tensor product: combines tensors
  • • Contraction: reduces rank by 2
  • • Index raising/lowering: via metric
  • • Symmetrization/antisymmetrization
Remark 8.13: Looking Forward

Tensors lead to:

  • Differential geometry: Riemannian manifolds, curvature
  • Physics: General relativity, continuum mechanics
  • Machine learning: Tensor networks, attention mechanisms
  • Category theory: Monoidal categories

Pro Tips

  • • Einstein convention: repeated index (one up, one down) means sum
  • • dim(V⊗W) = dim(V) × dim(W)
  • • Contraction reduces rank by 2
  • • Tensor = defined by transformation law
  • • Use metric to raise/lower indices

11. More Worked Examples

Example 8.12: Tensor Product Basis

Let V = ℝ² with basis {e₁, e₂} and W = ℝ³ with basis {f₁, f₂, f₃}.

Basis for V⊗W (dimension 6):

{e1f1,e1f2,e1f3,e2f1,e2f2,e2f3}\{e_1 \otimes f_1, e_1 \otimes f_2, e_1 \otimes f_3, e_2 \otimes f_1, e_2 \otimes f_2, e_2 \otimes f_3\}
Example 8.12a: Expanding a Tensor

Express (2e1+3e2)(f1f2)(2e_1 + 3e_2) \otimes (f_1 - f_2) in the basis:

=2(e1f1)2(e1f2)+3(e2f1)3(e2f2)= 2(e_1 \otimes f_1) - 2(e_1 \otimes f_2) + 3(e_2 \otimes f_1) - 3(e_2 \otimes f_2)
Example 8.12b: Contraction Calculation

For TijkT^{ij}{}_{k} with components, compute the contraction Ti11T^{i1}{}_{1}:

Si=Tijj=jTijj=Ti11+Ti22+S^i = T^{ij}{}_{j} = \sum_j T^{ij}{}_{j} = T^{i1}{}_{1} + T^{i2}{}_{2} + \cdots
Example 8.12c: Metric Tensor Example

In 2D with polar coordinates, the metric tensor is:

gij=(100r2)g_{ij} = \begin{pmatrix} 1 & 0 \\ 0 & r^2 \end{pmatrix}

Line element: ds2=dr2+r2dθ2ds^2 = dr^2 + r^2 d\theta^2

Example 8.12d: Electromagnetic Field Tensor

The electromagnetic field tensor FμνF_{\mu\nu} is antisymmetric (0,2)-tensor:

Fμν=(0ExEyEzEx0BzByEyBz0BxEzByBx0)F_{\mu\nu} = \begin{pmatrix} 0 & E_x & E_y & E_z \\ -E_x & 0 & -B_z & B_y \\ -E_y & B_z & 0 & -B_x \\ -E_z & -B_y & B_x & 0 \end{pmatrix}

Maxwell's equations become tensor equations!

12. Exterior Algebra (Preview)

Definition 8.13: Wedge Product

The wedge product (exterior product) is antisymmetric:

vw=wv,vv=0v \wedge w = -w \wedge v, \quad v \wedge v = 0
Remark 8.14: Exterior vs Tensor Product
  • Tensor: v⊗w ≠ w⊗v in general
  • Exterior: v∧w = -w∧v (antisymmetric)
  • Symmetric: v⊙w = w⊙v (symmetric product)
Example 8.13: Wedge Product in ℝ³

For u=e1+e2u = e_1 + e_2 and v=e2+e3v = e_2 + e_3:

uv=(e1+e2)(e2+e3)=e1e2+e1e3+e2e3u \wedge v = (e_1 + e_2) \wedge (e_2 + e_3) = e_1 \wedge e_2 + e_1 \wedge e_3 + e_2 \wedge e_3

Note: e₂∧e₂ = 0 vanishes.

Remark 8.15: Differential Forms

Exterior algebra is the foundation of differential forms:

  • 0-forms: functions
  • 1-forms: dx, dy, dz
  • 2-forms: dx∧dy, etc.
  • 3-forms: dx∧dy∧dz (volume)

13. Quick Reference

Index Notation Rules

  • • Free indices: appear once, same on both sides
  • • Dummy indices: appear twice, summed
  • • Upper + lower: can contract
  • • Metric: raises/lowers indices

Common Operations

  • • Dot: vⁱwᵢ = scalar
  • • Outer: vⁱwʲ = (1,1)-tensor
  • • Trace: Aⁱᵢ = scalar
  • • Matrix: Aⁱⱼvʲ = vector

Notation Summary

V ⊗ WTensor product of spaces
v ⊗ wSimple tensor (outer product)
Tⁱⱼ(1,1)-tensor components
gᵢⱼMetric tensor
εᵢⱼₖLevi-Civita symbol
δⁱⱼKronecker delta

14. Practice Problems

Example 8.14: Practice Problem 1

Compute the dimension of V⊗W⊗U where dim(V)=2, dim(W)=3, dim(U)=4.

Solution: dim(V⊗W⊗U) = 2×3×4 = 24

Example 8.14a: Practice Problem 2

Write the trace of A in Einstein notation.

Solution: tr(A) = Aⁱᵢ = A¹₁ + A²₂ + ... + Aⁿₙ

Example 8.14b: Practice Problem 3

If Tⁱⱼ is a (1,1)-tensor and vʲ is a (1,0)-tensor, what is Tⁱⱼvʲ?

Solution: A (1,0)-tensor (vector). The j index is contracted.

Example 8.14c: Practice Problem 4

Show that εⁱʲᵏεᵢⱼₖ = 6 in ℝ³.

Solution: Sum over all permutations: each nonzero term contributes ±1×(±1) = 1, and there are 6 such terms (3! = 6).

Remark 8.16: Mastery Checklist

You've mastered tensors when you can:

  • ✓ Define bilinear and multilinear maps
  • ✓ Compute tensor products and contractions
  • ✓ Use Einstein summation convention fluently
  • ✓ Identify tensor types (p,q) from indices
  • ✓ Apply tensors to physics examples

15. Tensors in Quantum Mechanics

Remark 8.17: Quantum State Spaces

In quantum mechanics, composite systems use tensor products:

  • Single particle: state space H\mathcal{H}
  • Two particles: H1H2\mathcal{H}_1 \otimes \mathcal{H}_2
  • n particles: Hn\mathcal{H}^{\otimes n}
Definition 8.14: Product States

A product state (separable) has form |ψ⟩ ⊗ |φ⟩.

An entangled state cannot be written as a single product.

Example 8.15: Bell State

The Bell state (maximally entangled):

Φ+=12(00+11)|\Phi^+\rangle = \frac{1}{\sqrt{2}}(|00\rangle + |11\rangle)

Cannot be written as |a⟩ ⊗ |b⟩ — it's entangled!

Remark 8.18: Quantum Computing

Quantum computers exploit tensor product structure:

  • n qubits: state in (C2)n(\mathbb{C}^2)^{\otimes n}, dim = 2ⁿ
  • Quantum gates: unitary operators on tensor space
  • Entanglement enables quantum speedup

16. Tensor Networks (Preview)

Definition 8.15: Tensor Network

A tensor network is a collection of tensors with some indices contracted between them, represented as a graph.

Remark 8.19: Applications
  • Quantum many-body: MPS, PEPS, MERA
  • Machine learning: Tensor train decomposition
  • Optimization: Efficient representation of high-dimensional data
Example 8.16: Matrix Product State

An MPS represents a many-body state efficiently:

ψ=i1,...,inAi1[1]Ai2[2]Ain[n]i1...in|\psi\rangle = \sum_{i_1,...,i_n} A^{[1]}_{i_1} A^{[2]}_{i_2} \cdots A^{[n]}_{i_n} |i_1...i_n\rangle

Each A^[k] is a matrix, and we multiply them to get coefficients.

17. Historical Context

Remark 8.20: History

Key developments in tensor theory:

  • 1890s: Ricci-Curbastro develops tensor calculus
  • 1915: Einstein uses tensors for general relativity
  • 1920s: Tensor notation becomes standard in physics
  • Modern: Tensor networks in quantum computing and ML

The Power of Tensors

Tensors provide a coordinate-independent way to describe physical laws. Einstein famously said the happiest thought of his life was realizing that physical laws should take the same form in all coordinate systems — which requires tensor equations.

18. Final Synthesis

The Big Picture

Tensors generalize vectors and matrices to arbitrarily many indices. They provide the natural language for:

Physics

Relativity, electromagnetism, continuum mechanics — all tensor theories.

Mathematics

Differential geometry, algebraic topology, representation theory.

Computing

Deep learning, quantum computing, data science — all tensor computations.

Remark 8.21: Where Next?

From here, explore:

  • Applications (LA-8.4): See tensors in action
  • Differential geometry: Manifolds and curvature
  • Representation theory: Tensors and group actions
  • Numerical multilinear algebra: Computational methods

19. Additional Theory

Definition 8.16: Kronecker Product

For matrices A (m×n) and B (p×q), the Kronecker product A⊗B is (mp×nq):

AB=(a11Ba1nBam1BamnB)A \otimes B = \begin{pmatrix} a_{11}B & \cdots & a_{1n}B \\ \vdots & \ddots & \vdots \\ a_{m1}B & \cdots & a_{mn}B \end{pmatrix}
Example 8.17: Kronecker Product Example

For A=(1234)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} and B=(0567)B = \begin{pmatrix} 0 & 5 \\ 6 & 7 \end{pmatrix}:

AB=(0501067121401502018212428)A \otimes B = \begin{pmatrix} 0 & 5 & 0 & 10 \\ 6 & 7 & 12 & 14 \\ 0 & 15 & 0 & 20 \\ 18 & 21 & 24 & 28 \end{pmatrix}
Theorem 8.7: Kronecker Product Properties
  • (AB)(CD)=(AC)(BD)(A \otimes B)(C \otimes D) = (AC) \otimes (BD) (if sizes match)
  • (AB)1=A1B1(A \otimes B)^{-1} = A^{-1} \otimes B^{-1}
  • tr(AB)=tr(A)tr(B)\text{tr}(A \otimes B) = \text{tr}(A) \cdot \text{tr}(B)
  • det(AB)=(detA)p(detB)m\det(A \otimes B) = (\det A)^p (\det B)^m
Remark 8.22: Vectorization

The vec operation stacks columns of a matrix into a vector:

vec(ABC)=(CTA)vec(B)\text{vec}(ABC) = (C^T \otimes A) \text{vec}(B)

This connects matrix equations to Kronecker products.

Definition 8.17: Hadamard Product

The Hadamard product (element-wise) for same-sized matrices:

(AB)ij=aijbij(A \circ B)_{ij} = a_{ij} b_{ij}

20. Computational Aspects

Tensor Libraries
LibraryLanguageFocus
NumPyPythonGeneral arrays, einsum
PyTorchPythonDeep learning, autograd
TensorFlowPythonDeep learning, TPU support
ITensorC++/JuliaTensor networks, physics
Example 8.18: NumPy einsum

Einstein summation in NumPy:

  • Matrix multiply: np.einsum('ij,jk->ik', A, B)
  • Trace: np.einsum('ii->', A)
  • Outer: np.einsum('i,j->ij', u, v)
Remark 8.23: Computational Complexity

Tensor operations can be expensive:

  • Storage: n^k for order-k tensor
  • Contraction: O(n^(k+l-2)) for two tensors
  • Decomposition: often O(n^k) or higher

Tensor networks provide efficient representations!

21. Additional Practice

Example 8.19: Practice Problem 5

Compute (AI)(IB)(A \otimes I)(I \otimes B) for 2×2 matrices A, B.

Solution: By Kronecker product property:

(AI)(IB)=(AI)(IB)=AB(A \otimes I)(I \otimes B) = (AI) \otimes (IB) = A \otimes B
Example 8.19a: Practice Problem 6

If T is a (2,1)-tensor in ℝ³, how many components does it have?

Solution: 3² × 3 = 27 components

Example 8.19b: Practice Problem 7

Show that the trace is basis-independent.

Solution: Under change of basis P:

tr(P1AP)=tr(APP1)=tr(A)\text{tr}(P^{-1}AP) = \text{tr}(AP \cdot P^{-1}) = \text{tr}(A)
Tensors Practice
12
Questions
0
Correct
0%
Accuracy
1
A bilinear map B:V×WUB: V \times W \to U is linear in:
Easy
Not attempted
2
The tensor product vwv \otimes w is:
Easy
Not attempted
3
If dimV=m\dim V = m and dimW=n\dim W = n, then dim(VW)=\dim(V \otimes W) =
Medium
Not attempted
4
The outer product of column vectors uu and vv is:
Easy
Not attempted
5
A (2,1)(2,1)-tensor has:
Medium
Not attempted
6
Einstein summation convention means:
Medium
Not attempted
7
The stress tensor in physics is:
Medium
Not attempted
8
Tensor contraction reduces rank by:
Medium
Not attempted
9
Which is NOT a tensor operation?
Hard
Not attempted
10
In machine learning, a 3D tensor might represent:
Easy
Not attempted
11
The metric tensor gijg_{ij} is used to:
Hard
Not attempted
12
A tensor is characterized by its:
Hard
Not attempted

Frequently Asked Questions

What is a tensor?

A tensor is a multilinear map from products of vector spaces (and their duals) to scalars. Equivalently, it's an array of numbers that transforms in a specific way under change of basis.

How does a tensor differ from a matrix?

A matrix is a 2D array, specifically a (1,1)-tensor or a representation of a linear map. Tensors generalize to any number of indices and include specific transformation rules.

What is the tensor product?

V ⊗ W is a new vector space such that bilinear maps from V × W correspond to linear maps from V ⊗ W. Elements v ⊗ w are 'simple tensors'; general elements are sums of these.

Why is Einstein notation useful?

It compactly expresses sums over indices. Instead of Σᵢ aᵢbⁱ, write aᵢbⁱ. Repeated indices (one up, one down) imply summation. Makes tensor equations cleaner.

What are covariant vs contravariant?

Contravariant (upper indices) transform opposite to basis vectors. Covariant (lower indices) transform like basis vectors. The distinction matters for non-orthonormal bases.

How are tensors used in physics?

Stress, strain, inertia, electromagnetic field, metric in general relativity—all tensors. They express physical laws independent of coordinate choice.

How are tensors used in machine learning?

Data is stored in tensors: images (H×W×C), batches (N×H×W×C), sequences (N×T×D). Deep learning frameworks (PyTorch, TensorFlow) are built around tensor operations.

What is tensor contraction?

Setting one upper and one lower index equal and summing: Tⁱⱼₖ → Tⁱⱼᵢ = Σᵢ Tⁱⱼᵢ. Reduces rank by 2. Matrix trace is a contraction.

What's the relationship to the determinant?

The determinant can be expressed using the Levi-Civita tensor εⁱʲᵏ. det(A) = εⁱʲᵏ a₁ᵢ a₂ⱼ a₃ₖ. This connects determinants to multilinear algebra.

Is the cross product a tensor?

The cross product is actually a pseudovector (axial vector). It uses the Levi-Civita symbol and behaves differently under reflections than true vectors.