01 | Prerequisite: vectors and matrices#
Word count: 0 words
Reading Time: 0 minutes
There are many much better resources available for learning the vector and maxtrix math. Grant Sanderson’s 3b1b series on linear algebra is one of the best and leaves you with a more intuitive understanding of what these mathematical tools are and what their relations are to one another. If you do not have a solid background in linear algebra I strongly recommend you go through this entire series. Linear algebra is perhaps the most important field of intermediate mathematics for materials chemists, scientists, and engineers. The good news is that there isn’t much to it and you can potentially gain a powerful set of analytical tools by spending a few hours becoming comfortable with a few basic applications.
Here we’ll focus on the basic mechanics of using vectors for the sole purpose of positioning atoms in space and transforming their relative coordinates.
A vector can be thought of a relative coordinate in space or simply an ordered list of numbers. Consider the vector
which can be though of as a set of instructions that can be read as “move 1 unit along the \(x\) axis, then move 2 units along the \(y\) axis, then move 3 units along the \(z\) axis”.
Vector addition and scalar multiplication#
Vectors can be summed using index-wise addition
Vectors can be scaled by multiplication with a scalar, for example:
Basis vectors#
Very often we are working in the privileged Cartesian space where the the \(x\) and \(y\) axes are perpendicular and their unit are equally spaced to form a square grid. In this case we can fully describe what we mean when we say “move along the \(x\) axis” using what is called a basis vector, \(\bf{\hat{x}}\). A basis vector (like all vectors) has two properties (1) a direction and (2) a magnitude. For a basis vector the magnitude define the spacing between increments on our grid (e.g. 1 mm graph paper or 0.5 mm graph paper), and the direction encodes the axis’ angle relative to the other basis vectors. The cartesian basis vectors in three dimensions are
and the position vector we started with can be written explicitly as
This is a bit cumbersome. In three dimensional space the three basis vectors are instead expressed as a 3x3 matrix where each column in the matrix corresponds to the \(\bf{\hat{x}}\), \(\bf{\hat{y}}\), and \(\bf{\hat{z}}\) basis vectors respectively, as in
which in the case of a Cartesian space is
and our example vector’s position can be described using matrix multiplication as
Here we end up with a trivial example of a coordinate system whose basis vectors form the identity matrix. As with a bit of reorganization can describe the multiplication of a 3x3 matrix with a column vector. This multiplication of a 3x3 matrix by a position vector, we shall see, can be used to describe all linear transformations of atomic coordinates (i.e. rotation, reflection, inversion, and scale). Paired with vector addition (i.e. translation) we can describe all symmetry operations that can be expressed in a crystal.