Tugdual Gaillard

Notes / Blog

Covariant and contravariant bases

When working with curvilinear or arbitrary coordinate systems, some problems are better described in terms of covariant or contravariant vectors. For example, the conservation laws in geophysical fluid dynamics.

These notes informally explain the relation between coordinate systems and their basis vectors, providing a first intuitive approach. Ultimately, the terms covariant and contravariant should be used in the context of differential forms and refer to two complementary vector spaces (the tangent space and its dual space). However, this is not within the scope of this document.

Here, we will only concern ourselves with the flat Euclidian space, so that it is not necessary to introduce differential geometry concepts.

Coordinates are made of scalar fields

It is useful to recall that each coordinate component is just a scalar field. It is a trivial fact, but that is the easiest way to understand what covariant and contravariant vectors really are.

A common way of representing a coordinate system is to draw a grid. A grid is made from the isolines of the coordinate fields, i.e, the x grid lines are the isolines of x.

If the coordinate system is orthogonal, the x grid lines are locally tangent to the gradient of the y field.

Vector bases

Lets take a vector v in a two-dimensional space. We want v to represent a spatial quantity which should not depend on the way we measure space.

We can use a reference coordinate system, let's say the Cartesian coordinates (x,y) , and the associated vector basis {ex,ey}.

We can also use another arbitrary coordinate system, with the coordinates (q1,q2), and the vector basis {e1,e2}. This arbitrary coordinate system can be later transformed as we like. We do not know yet how to obtain the vector basis, but it doesn't matter.

isoline
q1: black lines, q2: white lines

The Cartesian coordinates will be used as a reference, i.e., the components of v will not change in the Cartesian system. Why would we need that? Because otherwise, how would we know that something changed without any reference? But we have yet to create a vector basis in order to express the components of v.

There are two main ways of building a vector basis from a given coordinate system, note that this basis can be local. Let's try both.

Tangent vectors and contravariant components

The most common way to obtain a basis is to take the derivative of the position of a point, ei=rqi

This yields vectors which are tangent to the other coordinate isolines (isosurfaces in 3D).

The components of v are written vi and thus, v=v1e1+v2e2

Now, what will happen if we divide the whole field q1 by two? We can see that the length of e1 will be multiplied by two.
v should stay the same, so the component v1 will be divided by two. That's why the components vi are called contravariant (relative to the ei basis ), and, v1e1+v2e2 is called a contravariant vector. Contravariant components are written with upper indices.

transformed coordinate
Original grid and transformed grid with local contravariant bases

Gradient vectors and covariant components

We can use the gradient of each coordinate to build another vector basis for (q1,q2), ei=qi

But how is the gradient defined? We could use our reference Cartesian basis to assess how (q1,q2) and (x,y) are related. However, we should not really care, since the gradient field doesn't depend on the coordinate system, and we do not need its expression.

Thus, the vector v can be written, v=v1e1+v2e2

Again, we divide the field q1 by two. We see that the length of e1 will also be divided by two. In consequence, the component v1 has to be multiplied by two. That's the contrary of the previous basis.

So we say that the components vi are covariant (relative to the previously described basis, ei), and that v1e1+v2e2 is a covariant vector. Covariant components are written with lower indices.

transformed coordinate
Original grid and transformed grid with local covariant bases

Conclusion / Terminology

The names covariant and contravariant are given relative to the ei basis. Indeed, if we apply a transform M to the ei basis,

Moreover, we see that the basis vectors ei are contravariant, and that the ei are covariant (relatively to themselves).

The basis for covariant vectors is made from the contravariant vectors ei. That way the vector v stays the same after the transformations of ei.

In the same fashion, the basis for contravariant vectors is made from the covariant vectors ei.

It should have become clear that the terminology is quite misleading, a vector representing a physical quantity should be the same independently of the way it is written. The terms covariant and contravariant should be used when talking about bases and components. In fact, ei and ei do not even reside in the same space but this is another story.