Skip to content
AI360Xpert
Beta

Vector Fields

An arrow pinned at every point of space: wind on a weather map, or the downhill push felt everywhere on a loss landscape.

The rotation field minus y comma x turns every arrow a quarter turn around the origin, circulating forever without any source or sink
The rotation field minus y comma x turns every arrow a quarter turn around the origin, circulating forever without any source or sink

Why Does This Exist?

Scalars vary from point to point, but so do directions. Wind has a speed and a heading at every location. A magnetic needle twists differently wherever you hold it. And the object training follows, the negative gradient, is one arrow per parameter setting: a direction and a strength defined everywhere on the landscape. Any question about flows, forces, or optimization paths is a question about a vector field.

The field view also settles what a gradient is allowed to be. Not every arrow pattern is a gradient of some surface: gradients never circulate, while the rotation field below circulates everywhere. That distinction decides which flows can be descents of a loss and which cannot, and it leads directly to divergence and curl.

The one idea you need first

A vector is a displacement with a length and a direction, and a function assigns outputs to inputs. A vector field is a function assigning one vector to each point of space: feed in a position, get back an arrow. The gradient is the most important example, assigning each parameter setting its steepest-ascent arrow.

Think of It Like This

A weather map of wind

A weather map draws a wind arrow at every city: long where the gale blows, short where the air sits still, each pointing where the air is headed. Nobody confuses the map with the territory: the arrows describe the wind, and a leaf dropped anywhere gets carried along its local arrow.

A vector field is that map made mathematical. Drop a particle anywhere and it drifts along the local arrow; follow the drift and you trace a flow line, the path an optimizer walks. Sources are places arrows flee, sinks are places they gather, and circulation is arrows chasing each other in loops. The leaf never needs the global map, only its local arrow, which is why local rules like gradient descent work at all.

The analogy stops at smoothness. Real wind gusts and eddies at every scale, while the fields in calculus are smooth enough to differentiate, which is what lets divergence and curl measure their sources and swirls exactly.

How It Actually Works

Write a field in two dimensions as F(x,y)=(P(x,y),Q(x,y))F(x, y) = (P(x, y), Q(x, y)): two ordinary functions giving the arrow's components at each point. Three readings of any field:

  • Sources and sinks: where arrows spread out or pile in. Measured by divergence, positive at sources.
  • Circulation: where arrows loop around. Measured by curl, nonzero in swirls.
  • Flow lines: curves everywhere tangent to the arrows, the paths particles follow. Gradient descent traces the flow lines of the negative gradient field.

A field is conservative when it is some function's gradient, equivalently when its circulation is zero everywhere on a simply connected region. Conservative fields have path-independent line integrals: the work along any route between two points is just the potential difference. Non-conservative fields, like the rotation example below, admit no potential function at all.

Worked example

Take the rotation field F(x,y)=(−y,x)F(x, y) = (-y, x).

Sample it. At (1,0)(1, 0) the arrow is (0,1)(0, 1), pointing straight up. At (0,1)(0, 1) it is (−1,0)(-1, 0), pointing left. At (1,1)(1, 1) it is (−1,1)(-1, 1), diagonal, with length 1+1=2≈1.41\sqrt{1 + 1} = \sqrt{2} \approx 1.41. Every arrow is the position turned a quarter turn counterclockwise, so the whole pattern circulates around the origin forever.

Two consequences worth stating. The arrows never point outward or inward anywhere, so this field has no sources or sinks. And no surface has this field as its gradient: walking once around the origin along the arrows never climbs or descends, yet a gradient's line integral over a closed loop must be zero while following ever-circulating arrows feels like perpetual downhill. That impossibility is exactly what non-zero curl detects.

Watch Out For

Assuming every field is a gradient

Optimization intuition says arrows should point downhill toward something, but generic fields circulate, spiral into limit cycles, or point every which way. Game dynamics and adversarial training produce exactly such non-conservative updates, which is why they oscillate instead of converging. Before treating a vector update as descent on some loss, check that a loss exists.

Reading arrow length off an unscaled plot

Plotting libraries rescale arrows to fit, so a fierce gale and a faint breeze can look identical. Always check whether scaling is on and what the reference arrow represents, or compare lengths only within one consistently scaled figure. The worked numbers above, like the 1.41 at (1,1)(1, 1), are the ground truth no picture can override.

The Quick Version

  • A vector field assigns one arrow to every point of space: wind, forces, or the negative gradient.
  • Flow lines trace the paths particles and optimizers follow through the field.
  • Divergence spots sources and sinks; curl spots circulation.
  • The rotation field circulates everywhere with no source, so no surface has it as a gradient.
  • Fields from games and adversarial setups often circulate, which is why they oscillate rather than settle.