Scalar vs Vector Fields
From the book
Chapter 11: Matrix Calculus. In the chapter mind map this icon labels Scalar vs Vector Fields. The discussion below is excerpted and lightly edited from § Scalar and Vector Fields in Mathematics for AI and Machine Learning.
Before diving into matrix calculus, we introduce the fundamental concepts of scalar fields and vector fields, which are central to vector calculus and will be important in later chapters on score functions and diffusion models.
Fields assign mathematical quantities to points in space $\mathbb{R}^d$:
1. Scalar Field: A function $f: \mathbb{R}^d \to \mathbb{R}$ assigning a real scalar $f(\mathbf{x})$ to each position $\mathbf{x} \in \mathbb{R}^d$ (e.g., temperature $T(\mathbf{x})$, probability density $p(\mathbf{x})$, log-likelihood $\log p(\mathbf{x})$, or an energy function $E(\mathbf{x})$ in energy-based models).
2. Vector Field: A function $\mathbf{F}: \mathbb{R}^d \to \mathbb{R}^d$ assigning a vector $\mathbf{F}(\mathbf{x})$ to each position $\mathbf{x} \in \mathbb{R}^d$ (e.g., fluid velocity field $\mathbf{v}(\mathbf{x})$, physical forces, a gradient field $\nabla f(\mathbf{x})$, or the score field $\nabla_\mathbf{x} \log p(\mathbf{x})$ in score-based generative models).
Every scalar field $f$ yields the vector field $\nabla f$, but not conversely: $\nabla f = (-y, x)$ would need $\partial^2 f/\partial y\,\partial x = -1$ and $\partial^2 f/\partial x\,\partial y = 1$, contradicting the symmetry of second derivatives. A learned score network is such a general field, not necessarily the gradient of a log-density.
What this drawing shows
What you see. Contrasts $f:\mathbb{R}\to\mathbb{R}$ (one scalar output) with $\mathbf{F}:\mathbb{R}^d\to\mathbb{R}^d$ (d-component vector); animation sweeps input $x$ so the yellow scalar box and three vector components update differently.
In the mind map. Chapter 11 — Scalar vs Vector Fields. See From the book above for definitions, figures, and worked examples.
Where to read next
Read the full definitions, figures, and worked examples in Chapter 11: Matrix Calculus — see the mind-map node Scalar vs Vector Fields.