Chapter 1
12 min read
Section 4 of 70

Fractional Coordinates

The Architecture of Crystals — Real Space

Why Fractional Coordinates?

Imagine trying to give directions to every atom in a crystal. You could use ordinary Cartesian coordinates — metres along x, y, and z — but crystals are periodic, and their axes are not always orthogonal. A much more natural choice is fractional coordinates (also called direct coordinates), which express every atomic position as a fraction of the lattice vectors.

In fractional coordinates, the unit cell is always a cube that runs from 0 to 1 along each axis, regardless of how the real-space lattice vectors are oriented or how long they are. This makes symmetry operations, periodic boundary conditions, and VASP input files dramatically simpler.

Intuition: Think of fractional coordinates as a GPS that always works in units of "how far along each lattice vector." A coordinate of (0.5,0.5,0.0)(0.5,\, 0.5,\, 0.0) means "halfway along a1\mathbf{a}_1, halfway along a2\mathbf{a}_2, zero along a3\mathbf{a}_3."

Direct vs Cartesian Coordinates

There are two equivalent ways to specify an atomic position r\mathbf{r} inside a crystal:

Cartesian Coordinates

The atom's position is given in a fixed, orthogonal reference frame, typically in angstroms (Å):

rcart=(x,y,z)in A˚\mathbf{r}_{\text{cart}} = (x,\, y,\, z) \quad \text{in } \text{\AA}

These are the coordinates you would measure with a ruler. They are intuitive but cumbersome for non-orthogonal lattices because symmetry operations look complicated.

Fractional (Direct) Coordinates

The atom's position is expressed as a linear combination of the lattice vectors a1,a2,a3\mathbf{a}_1, \mathbf{a}_2, \mathbf{a}_3:

r=f1a1+f2a2+f3a3\mathbf{r} = f_1 \, \mathbf{a}_1 + f_2 \, \mathbf{a}_2 + f_3 \, \mathbf{a}_3

where f1,f2,f3[0,1)f_1, f_2, f_3 \in [0, 1) are dimensionless fractions. The triplet (f1,f2,f3)(f_1, f_2, f_3) is the fractional coordinate.

PropertyCartesianFractional
UnitsAngstromsDimensionless
RangeDepends on cell[0, 1) for each component
OrthogonalityAlways orthogonal axesFollows lattice vectors
Symmetry opsComplex matricesOften simple fractions
Periodic wrappingRequires modular arithmetic on real lengthsSimply mod 1
VASP keywordCartesianDirect

When to Use Which

Use fractional coordinates whenever you are defining or reading crystal structures. Use Cartesian coordinates when computing interatomic distances, forces, or visualising structures in 3D.

The Conversion Matrix

To convert between fractional and Cartesian coordinates we need the lattice matrix. If the three lattice vectors are written as column vectors, the matrix M\mathbf{M} is:

M=(a1xa2xa3xa1ya2ya3ya1za2za3z)\mathbf{M} = \begin{pmatrix} a_{1x} & a_{2x} & a_{3x} \\ a_{1y} & a_{2y} & a_{3y} \\ a_{1z} & a_{2z} & a_{3z} \end{pmatrix}

Each column of M\mathbf{M} is one lattice vector expressed in the Cartesian frame. The conversion from fractional to Cartesian is then a simple matrix-vector product:

rcart=Mrfrac\mathbf{r}_{\text{cart}} = \mathbf{M} \cdot \mathbf{r}_{\text{frac}}

Written out component-by-component:

(xyz)=(a1xa2xa3xa1ya2ya3ya1za2za3z)(f1f2f3)\begin{pmatrix} x \\ y \\ z \end{pmatrix} = \begin{pmatrix} a_{1x} & a_{2x} & a_{3x} \\ a_{1y} & a_{2y} & a_{3y} \\ a_{1z} & a_{2z} & a_{3z} \end{pmatrix} \begin{pmatrix} f_1 \\ f_2 \\ f_3 \end{pmatrix}

Example: Simple Cubic Lattice

For a simple cubic lattice with parameter aa, the lattice vectors are a1=ax^\mathbf{a}_1 = a\hat{x}, a2=ay^\mathbf{a}_2 = a\hat{y}, a3=az^\mathbf{a}_3 = a\hat{z}, so:

Mcubic=(a000a000a)\mathbf{M}_{\text{cubic}} = \begin{pmatrix} a & 0 & 0 \\ 0 & a & 0 \\ 0 & 0 & a \end{pmatrix}

In this special case, Cartesian and fractional coordinates are related by a simple scaling: rcart=arfrac\mathbf{r}_{\text{cart}} = a \cdot \mathbf{r}_{\text{frac}}.

Example: FCC Conventional Cell

For the zinc blende (FCC-based) structure of CdSe with lattice parameter a=6.077a = 6.077 Å, the conventional cell has:

MFCC=(6.0770006.0770006.077)\mathbf{M}_{\text{FCC}} = \begin{pmatrix} 6.077 & 0 & 0 \\ 0 & 6.077 & 0 \\ 0 & 0 & 6.077 \end{pmatrix}

An atom at fractional position (0.25,0.25,0.25)(0.25,\, 0.25,\, 0.25) maps to Cartesian position (1.519,1.519,1.519)(1.519,\, 1.519,\, 1.519) Å.


Inverse Transformation

Going the other way — from Cartesian back to fractional — requires the inverse of the lattice matrix:

rfrac=M1rcart\mathbf{r}_{\text{frac}} = \mathbf{M}^{-1} \cdot \mathbf{r}_{\text{cart}}

The inverse exists whenever the three lattice vectors are linearly independent (which they always are for a valid crystal). For the simple cubic case:

Mcubic1=(1/a0001/a0001/a)\mathbf{M}^{-1}_{\text{cubic}} = \begin{pmatrix} 1/a & 0 & 0 \\ 0 & 1/a & 0 \\ 0 & 0 & 1/a \end{pmatrix}

For a general triclinic cell the inverse is more involved, but any linear algebra library (NumPy, LAPACK) computes it in one line.

Practical Calculation with Python

🐍python
1import numpy as np
2
3# CdSe zinc blende lattice vectors (conventional cell, angstroms)
4a = 6.077
5M = np.array([
6    [a, 0, 0],
7    [0, a, 0],
8    [0, 0, a],
9])
10
11# Fractional -> Cartesian
12r_frac = np.array([0.25, 0.25, 0.25])
13r_cart = M @ r_frac
14print(f"Cartesian: {r_cart}")  # [1.519 1.519 1.519]
15
16# Cartesian -> Fractional
17M_inv = np.linalg.inv(M)
18r_frac_back = M_inv @ r_cart
19print(f"Fractional: {r_frac_back}")  # [0.25 0.25 0.25]

Hexagonal Cells

In a hexagonal cell (e.g., wurtzite CdSe), the lattice matrix is non-diagonal because a2\mathbf{a}_2 has components along both xx and yy. The inverse transformation is essential for correctly interpreting atomic positions.

Zinc Blende Positions

The zinc blende structure (space group F4ˉ3mF\bar{4}3m) is the prototypical structure for CdSe and many III-V and II-VI semiconductors. Its conventional cell contains 4 formula units (4 Cd + 4 Se), and the atomic positions in fractional coordinates are beautifully simple:

Cd Sublattice (FCC Positions)

Atomf1f2f3
Cd 10.0000.0000.000
Cd 20.5000.5000.000
Cd 30.5000.0000.500
Cd 40.0000.5000.500

Se Sublattice (Offset by 1/4, 1/4, 1/4)

Atomf1f2f3
Se 10.2500.2500.250
Se 20.7500.7500.250
Se 30.7500.2500.750
Se 40.2500.7500.750

Notice how the Se sublattice is simply the Cd (FCC) sublattice shifted by (14,14,14)(\frac{1}{4},\, \frac{1}{4},\, \frac{1}{4}). This shift is the defining feature of the zinc blende structure: two interpenetrating FCC lattices with a quarter-body-diagonal offset.

Bond Length from Fractional Coordinates

The nearest-neighbour distance in zinc blende is d=a34d = \frac{a\sqrt{3}}{4}. For CdSe with a=6.077a = 6.077 Å, this gives d2.63d \approx 2.63 Å, matching experimental Cd–Se bond lengths.

Periodicity and Wrapping

Because crystals are periodic, fractional coordinates are inherently defined modulo 1. Two positions that differ by an integer in any component refer to the same site in different unit cells:

(f1,f2,f3)(f1+n1,f2+n2,f3+n3)for n1,n2,n3Z(f_1, f_2, f_3) \equiv (f_1 + n_1,\, f_2 + n_2,\, f_3 + n_3) \quad \text{for } n_1, n_2, n_3 \in \mathbb{Z}

By convention, we wrap all fractional coordinates into the interval [0,1)[0, 1). For example:

Raw coordinateWrapped coordinateExplanation
1.2500.250Subtract 1
-0.2500.750Add 1
2.7500.750Subtract 2
0.0000.000Already in range
1.0000.0001.0 wraps to 0.0

In Python, wrapping is a one-liner:

🐍python
1# Wrap fractional coordinates to [0, 1)
2f_wrapped = f % 1.0

Why Wrapping Matters

Wrapping is not just a convention — it is essential for:

  1. Avoiding duplicate atoms: If you accidentally place an atom at (1.0,0.0,0.0)(1.0, 0.0, 0.0) and another at (0.0,0.0,0.0)(0.0, 0.0, 0.0), they are the same atom. VASP will sometimes warn about atoms that are too close together.
  2. Computing distances correctly: The minimum image convention requires checking whether the shortest distance between two atoms crosses a periodic boundary.
  3. Symmetry analysis: Fractional coordinates make it trivial to check whether two positions are symmetry-related — they differ by a symmetry operation applied to the fractional triplet.

Common Mistake

When building supercells by hand, forgetting to wrap coordinates is the most common source of "atoms too close" errors in VASP. Always apply mod 1\text{mod } 1 before writing the POSCAR file.

VASP Connection: POSCAR Format

In VASP, the choice between fractional and Cartesian coordinates is specified on line 8 of the POSCAR file. The keyword Direct indicates fractional coordinates; Cartesian indicates Cartesian coordinates in angstroms.

POSCAR Example: CdSe Zinc Blende (Direct Coordinates)

📝text
1CdSe zinc blende
21.0
3   6.077000   0.000000   0.000000
4   0.000000   6.077000   0.000000
5   0.000000   0.000000   6.077000
6Cd  Se
7 4   4
8Direct
9  0.000000  0.000000  0.000000   ! Cd 1
10  0.500000  0.500000  0.000000   ! Cd 2
11  0.500000  0.000000  0.500000   ! Cd 3
12  0.000000  0.500000  0.500000   ! Cd 4
13  0.250000  0.250000  0.250000   ! Se 1
14  0.750000  0.750000  0.250000   ! Se 2
15  0.750000  0.250000  0.750000   ! Se 3
16  0.250000  0.750000  0.750000   ! Se 4

POSCAR Line-by-Line Breakdown

Line(s)ContentDescription
1CdSe zinc blendeComment / system name
21.0Universal scaling factor
3-5Lattice vectorsThree rows defining a1, a2, a3 in angstroms
6Cd SeAtomic species in order
74 4Number of each species
8DirectCoordinate type: Direct (fractional) or Cartesian
9+PositionsOne line per atom with f1 f2 f3

Same Structure in Cartesian Coordinates

📝text
1CdSe zinc blende
21.0
3   6.077000   0.000000   0.000000
4   0.000000   6.077000   0.000000
5   0.000000   0.000000   6.077000
6Cd  Se
7 4   4
8Cartesian
9  0.000000  0.000000  0.000000   ! Cd 1
10  3.038500  3.038500  0.000000   ! Cd 2
11  3.038500  0.000000  3.038500   ! Cd 3
12  0.000000  3.038500  3.038500   ! Cd 4
13  1.519250  1.519250  1.519250   ! Se 1
14  4.557750  4.557750  1.519250   ! Se 2
15  4.557750  1.519250  4.557750   ! Se 3
16  1.519250  4.557750  4.557750   ! Se 4

Both POSCAR files describe the identical structure. VASP converts everything to Cartesian internally, but using Direct coordinates is standard practice because the fractional positions are universal — they do not change when you scale the lattice parameter.

VASP Best Practice

Always use Direct coordinates in your POSCAR files. When you change the lattice parameter (e.g., during equation-of-state calculations), the fractional positions remain the same while Cartesian positions would all need recalculating.

Summary

Fractional coordinates provide a compact, lattice-adapted way to describe atomic positions that exploits the periodicity of crystals. Here are the key takeaways:

  1. Fractional coordinates (f1,f2,f3)(f_1, f_2, f_3) express positions as fractions of the lattice vectors, always in [0,1)[0, 1).
  2. The lattice matrix M\mathbf{M} converts fractional to Cartesian: rcart=Mrfrac\mathbf{r}_{\text{cart}} = \mathbf{M} \cdot \mathbf{r}_{\text{frac}}.
  3. The inverse matrix M1\mathbf{M}^{-1} converts Cartesian back to fractional.
  4. In zinc blende CdSe, Se atoms sit at (14,14,14)(\frac{1}{4}, \frac{1}{4}, \frac{1}{4}) relative to each Cd — a clean quarter-diagonal offset.
  5. Fractional coordinates are periodic modulo 1, making wrapping trivial and symmetry operations elegant.
  6. In VASP, use the Direct keyword in POSCAR to specify fractional coordinates — this is the recommended standard.
Looking Ahead: In the next section we will use fractional coordinates as the foundation for understanding symmetry operations — rotations, reflections, and inversions that map the crystal onto itself. These operations are most naturally expressed as matrices acting on fractional coordinates.
Loading comments...