Lattices

How many vectors of each length

Counting the lattice points at each distance from the origin turns out to be a question about divisors, and the answer explains something a crystallographer meets every day: why a cubic powder pattern has no line at seven.

Assumes The lattice underneath and Reduction, and the shortest basis.

Stand at a lattice point and count the others by distance. The nearest are all at the same distance and there are a few of them; then a gap; then a shell with more; then a length with nothing at all.

That sequence of counts is the lattice’s theta series, and it is the most natural measurement anybody makes of a lattice. It is also, unexpectedly, a question about divisors.

The shells of the hexagonal lattice. Every point of the hexagonal lattice within a squared distance of 24, with a circle drawn at each length that occurs. The form is x² + xy + y², and the number of points on each circle is a coefficient of the lattice's theta series: 6 at 1, 0 at 2, 6 at 3, 6 at 4, 0 at 5, 0 at 6, 12 at 7, 0 at 8. The gaps matter as much as the counts — a circle with no points on it is a length the lattice does not have, and which lengths those are is a question in number theory rather than in geometry.
Fig. 1 The hexagonal lattice with a circle drawn at every squared length that occurs. Six points on most circles, twelve on some, and nothing at all at 2, 5, 6, 8, 10 or 11.

The counts are divisor sums

Work in squared lengths, because they are integers. For the square lattice, the number of lattice points at squared distance n is the number of ways to write n as a sum of two squares — and Jacobi’s theorem says that is

r2(n)=4(d1(n)d3(n)),r_2(n) = 4\bigl(d_1(n) - d_3(n)\bigr),

where d₁ counts the divisors of n congruent to 1 modulo 4 and d₃ those congruent to 3.

The theta series of the square lattice. How many vectors of each squared length x² + y² has, counted by enumerating points in a box and — where a closed form exists — by summing divisors. Jacobi's theorem says the count is four times the excess of divisors congruent to 1 modulo 4 over those congruent to 3, and the two columns are required to agree at every n. The zeros are lengths the lattice does not realise at all.
Fig. 2 The square lattice’s shells, counted by enumerating points in a box and by summing divisors. The two columns are required to agree at every n, and the divisors are printed so the arithmetic can be followed.

The 4 is not decoration. It is the number of units in the Gaussian integers — 1, −1, i and −i — because writing n as a sum of two squares is factoring n in ℤ[i], and every factorisation comes with four multiples of itself. The theorem is a statement about a ring, dressed as a statement about a lattice.

The hexagonal lattice tells the same story with different numbers:

rhex(n)=6(d1(n)d2(n))mod3,r_{\text{hex}}(n) = 6\bigl(d_1(n) - d_2(n)\bigr) \bmod 3,

and the 6 is the number of units in the Eisenstein integers. Two lattices, two rings, two counts of units, and the same theorem twice.

The theta series of the hexagonal lattice. How many vectors of each squared length x² + xy + y² has, counted by enumerating points in a box and — where a closed form exists — by summing divisors. The count is six times the excess of divisors congruent to 1 modulo 3 over those congruent to 2 — the same theorem with the Gaussian integers replaced by the Eisenstein ones, and the four replaced by the six units they have. The zeros are lengths the lattice does not realise at all.
Fig. 3 The hexagonal lattice, whose numbers are the Loeschian numbers — the values of x² + xy + y². The count is six times an excess of divisors modulo three, and the same numbers appeared in this collection already as the indices of sublattices that keep the six-fold symmetry.

Those Loeschian numbers are not new here. They are exactly the indices at which a hexagonal lattice has a sublattice keeping its symmetry, which is why seven turns up as the cell of the snub hexagonal tiling and as a sublattice index and now as a shell containing twelve points. One arithmetic, three appearances.

The shells of the square lattice. Every point of the square lattice within a squared distance of 24, with a circle drawn at each length that occurs. The form is x² + y², and the number of points on each circle is a coefficient of the lattice's theta series: 4 at 1, 4 at 2, 0 at 3, 4 at 4, 8 at 5, 0 at 6, 0 at 7, 4 at 8. The gaps matter as much as the counts — a circle with no points on it is a length the lattice does not have, and which lengths those are is a question in number theory rather than in geometry.
Fig. 4 The square lattice’s shells. Four points on most circles, eight on some, and nothing at all at 3, 6, 7, 11, 12, 14 or 15 — the squared lengths that are not sums of two squares.

Which lengths occur at all

The zeros in those tables are worth as much as the counts, and they are the older question.

Fermat’s two-square theorem says an odd prime is a sum of two squares exactly when it is congruent to 1 modulo 4: 5 = 1 + 4 and 13 = 4 + 9, while 3, 7, 11 and 19 are not sums of two squares at all. A general n is a sum of two squares exactly when every prime congruent to 3 modulo 4 occurs in it to an even power. So the square lattice has no vector of squared length 3, 6, 7, 11, 12, 14, 15 — and each absence is a prime congruent to 3 appearing an odd number of times.

Jacobi’s count is the same statement sharpened: when the excess of divisors is zero the length does not occur, and when it is positive it says exactly how many vectors there are. One formula answers both questions, which is why it is the theorem worth having rather than the existence statement. It also answers a third: how many essentially different ways there are, once the four signs and the swap of the two coordinates are divided out. That number is what a crystallographer would call the number of index families, and it is the multiplicity divided by the size of the orbit.

The hexagonal case runs identically with 3 in place of 4. A prime is a Loeschian number exactly when it is 3 or congruent to 1 modulo 3, so 2, 5, 11 and 17 never occur as squared lengths in the hexagonal lattice and 7, 13 and 19 do.

Both facts are about unique factorisation. ℤ[i] and the Eisenstein integers are both principal ideal domains, so a rational prime either stays prime in them or splits into a conjugate pair, and which of the two happens is decided by a congruence. A lattice’s shells are the norms of its ring, and the shells that are empty are the primes that stayed prime.

How much symmetry a lattice has, as a picture

The five plane lattices, by their lengths. Each row is one lattice's theta series drawn as a bar per squared length. The hexagonal lattice's is the sparsest and its bars the tallest, because it has six vectors in every shell it has at all; the oblique lattice's is the densest and shortest, because almost every length occurs and almost none occurs twice. The amount of symmetry a lattice has is visible as the height of its bars, which is the orbit–stabiliser theorem: a shell is a union of orbits under the holohedry, so a lattice with a large holohedry has shells in large multiples.
Fig. 5 The five plane lattices, each drawn as a bar per squared length. The tall sparse rows are the symmetric lattices; the short dense ones are the general ones.

Reading those five rows together says something that is obvious in hindsight and not before.

A shell is a union of orbits under the holohedry. The point group of the lattice permutes the points at a given distance, so every shell’s size is a sum of orbit sizes, and an orbit’s size divides the order of the holohedry. The hexagonal lattice’s holohedry has twelve elements, so its shells come in sixes and twelves; the oblique lattice’s has two, so its shells come in twos and fours.

The consequence is that the sparsity and the height of a lattice’s theta series move together. A symmetric lattice puts many points on few circles; an oblique one puts few points on many. The total number within a radius is nearly the same for all of them — it is the area divided by the cell area, and that is the only thing a lattice’s density knows — but how it is distributed is the symmetry.

Only two of the five have a closed form, and which two is decided by the ring rather than by the symmetry. The square and hexagonal series are divisor sums because their quadratic forms are the norms of ℤ[i] and the Eisenstein integers, and both of those rings factor uniquely. A rectangular lattice with an arbitrary ratio of edges, or an oblique one, has a quadratic form belonging to no such ring, and its shell counts are computed by enumeration and by nothing else — there is no formula to check them against. That is worth naming because it inverts the expectation: the two lattices with the most symmetry are the two whose counts can be predicted, and the reason is not that symmetry makes counting easier but that those two forms happen to be norms.

The shortest vectors, and what they are for

The first non-zero coefficient is a number with its own name: the kissing number, the count of lattice points at minimum distance. It is 4 for the square lattice, 6 for the hexagonal one, and 2 for a general oblique lattice with no coincidences.

Those numbers run through this collection. The kissing number is the coordination number of the corresponding sphere packing, so the hexagonal lattice’s six is why a close-packed layer has six neighbours; it is the number of shortest vectors reduction has to choose a basis from, which is why reduction is not canonical when the count is large; and it is the number of nearest faces of the Wigner–Seitz cell, since each nearest neighbour contributes one.

In three dimensions the same first coefficient is the packing story. The face-centred cubic lattice has twelve shortest vectors and the body-centred cubic has eight, which are the coordination numbers of the two close packings and the structure that is not close-packed. A theta series’ first term is a fact about how many spheres touch.

A powder pattern is a theta series

The connection that makes this practical rather than pretty is in three dimensions.

A powder pattern collapses all the reflections of one spacing into one line. So the intensity of a line depends on how many reflections share that spacing, and that number — the multiplicity — is the number of reciprocal-lattice vectors of that length. It is a theta coefficient, by definition rather than by analogy.

A powder pattern is a theta series. The lines of a cubic powder pattern, with the multiplicity that scales each one's intensity. That multiplicity is the number of reciprocal-lattice vectors of the same length — a theta coefficient — and it is checked here two ways: counted directly, and summed over the index families the line contains. The line at n = 9 has two families, {300} and {221}, and its multiplicity is the sum of theirs. And there is no line at n = 7, 15, 23, 28: those integers are not sums of three squares, so the gap in every cubic powder pattern is a fact about numbers rather than about the crystal.
Fig. 6 The lines of a cubic powder pattern with their multiplicities, computed two ways: counted directly as vectors, and summed over the index families {hkl} that the line contains.

For a cubic cell the multiplicity of the line at h² + k² + l² = n is r₃(n), the number of ways n is a sum of three squares. The check made here is that the two ways of arriving at it agree: counting vectors directly, and adding up the families. The line at n = 9 contains two families, {300} with six vectors and {221} with twenty-four, and its multiplicity is thirty — which is the accidental coincidence that indexing has to live with, appearing here as an addition.

And there is no line at n = 7. Nor at 15, 23 or 28. Those integers are not sums of three squares — Legendre’s theorem says the exceptions are exactly the numbers 4ᵃ(8b + 7) — so no cubic crystal, of any composition, at any wavelength, has a reflection there.

That is a gap in every cubic powder pattern ever measured, and it is not a property of any crystal. It is a property of the integers.

The practical consequence is that a missing line is not evidence. An absence caused by a screw axis or a glide plane is a fact about the structure and is how a space group is determined; an absence at n = 7 is a fact about arithmetic and says nothing at all. Indexing software distinguishes them without comment, and a reader working from a printed line list has to know which kind of gap is in front of them.

Who counted them, and when

Gauss did the two-dimensional case, in the Disquisitiones of 1801 and in his work on the class number: counting representations by a quadratic form is exactly the question the theory of binary forms was invented to answer, and the divisor formulas fall out of it.

Jacobi gave the four-square and two-square counts in 1829 by a route that looks like nothing to do with lattices — manipulating theta functions, infinite products in a complex variable — and the name theta series is his. That a count of lattice points equals a coefficient of a modular form is the beginning of a subject that is still going: the theta series of a lattice in n dimensions is a modular form of weight n/2, and the space of such forms is finite-dimensional, so two lattices in the same dimension have theta series lying in a space with only a few coordinates. That is the reason the question of the next essay has the answer it does.

The Loeschian numbers carry the name of August Lösch, an economist, who used the hexagonal lattice in the 1930s to model the market areas of towns — the same arithmetic reaching crystallography, economic geography and the counting of shells, which is the sort of thing that happens to counts of integer points.

Which indices have a square sublattice. For each index up to 26: how many sublattices of the square lattice are themselves square, found by testing whether the quarter-turn maps each one onto itself; the same count as a sum over divisors, +1 for each divisor one more than a multiple of four and −1 for each one less; and the ways of writing the index as a sum of two squares. The three agree at every row, which is Fermat's theorem — and it says that 3, 7 and 11 have no square sublattice at all while 5, 13 and 17 have two.
Fig. 7 The indices at which a square lattice has a sublattice keeping its four-fold symmetry: the sums of two squares again, counted by a completely different route. The same integers answer a question about lengths and a question about sublattices.

What the round trip checked, and how

What the length counting must refuse. Four things that would make the counts wrong, and the second is the one this module was rewritten for: a lattice and its mirror image are congruent, so the reduced form must identify [a, b, c] with [a, −b, c]. Counting them separately produced eleven hundred isospectral pairs in a search that should find none — every one of them a lattice paired with its own reflection.
Fig. 8 The negative tests. The second is the one that caught a real error.

Every count is made twice. The enumeration counts points in a box whose size is derived from the form rather than guessed; the closed form sums divisors. They agree at every n for the two lattices that have a closed form, and a disagreement anywhere means the figure does not appear at all.

The wrong divisor rule must fail. Applying Jacobi’s four-and-modulo-four rule to the hexagonal lattice gives the wrong answer at n = 3, and the test requires it to.

An unreduced form must not count as a second lattice. 2x² + 2xy + y² is the square lattice in another basis, and the enumeration of lattices must not contain it.

And in three dimensions the multiplicity must agree with the family sum, which is the check that the powder machinery and the number theory are describing the same object.

The theta series of the rectangular lattice. How many vectors of each squared length x² + 3y² has, counted by enumerating points in a box and — where a closed form exists — by summing divisors. This lattice has no such closed form here, so the count is the enumeration. The zeros are lengths the lattice does not realise at all.
Fig. 9 The rectangular lattice x² + 3y², whose counts have no divisor formula available here and are enumerations. Its shells are smaller and more frequent than the symmetric lattices’, which is the orbit-size argument seen from below.

Where else the same count appears

Once the shape of the question is visible it turns up repeatedly in this collection, and the appearances are not analogies.

The Patterson function puts a peak at every interatomic vector, so the map that needs no phases has, at the origin’s neighbourhood, a peak whose weight counts vectors of each length — the theta series of the structure rather than of the lattice, but the same construction.

The Debye scattering equation for a powder is a sum over pairs of atoms of sin(Qr)/Qr, and grouping the pairs by distance turns it into a sum over shells weighted by their multiplicities. Every calculation of a powder pattern from a structure is a theta series being evaluated.

A superlattice’s extra reflections are the vectors the sublattice adds, and how many appear at each length is the difference of two theta series.

And the coincidence-site lattice of a grain boundary has an index Σ, which is a value of a quadratic form; every such index is odd for the cubic case, which is a statement about which integers a form represents — the same question as which lengths occur, asked of a different form.

Where the exactness stops

A theta series is a series and everything here is a truncation. The counts are exact as far as they go and the box is sized from the form so that nothing inside the range is missed, but a statement about “the theta series” is a statement about infinitely many coefficients and no computation makes one.

The closed forms are for two lattices, not five. The square and hexagonal lattices have divisor formulas because their quadratic forms have class number one — every form of that discriminant is equivalent to the principal one, so representing n is a question about factorisation and nothing else. The rectangular, rhombic and oblique lattices here have no such formula available, and their counts are enumerations. That is a fact about the arithmetic of quadratic forms rather than a limitation of the code, and it is the first place in this collection where a lattice’s metric rather than its symmetry decides how hard a question is.

The bar chart compares series, not lattices. Five lattices drawn on one axis of squared length are five lattices at five different scales, since each form was chosen with its own coefficients. Scaling a lattice scales every squared length by the same factor, so the pattern of a row is meaningful and its horizontal position is not; comparing two rows at a fixed n is comparing nothing.

Multiplicity is not intensity. A powder line’s height depends on the multiplicity, the structure factor, the Lorentz–polarisation factor and the temperature factor. Only the first is counted here, and an essay that read a line’s height as a count of reflections would be wrong about every real pattern.

The shells of the centred rectangular lattice. Every point of the centred rectangular lattice within a squared distance of 24, with a circle drawn at each length that occurs. The form is 2x² + xy + 2y², and the number of points on each circle is a coefficient of the lattice's theta series: 4 at 2, 2 at 3, 2 at 5, 8 at 8, 6 at 12, 4 at 17, 4 at 18, 6 at 20. The gaps matter as much as the counts — a circle with no points on it is a length the lattice does not have, and which lengths those are is a question in number theory rather than in geometry.
Fig. 10 The centred rectangular lattice’s shells, which come in twos and fours because its holohedry has four elements. Compare the hexagonal plate at the top of this essay, whose shells come in sixes and twelves.

The generating function, briefly

There is a compact way to write all of this that is worth naming even though nothing here computes with it.

Collect the counts into a power series, Θ(q) = Σ rₙ qⁿ, one term per shell. For the lattices in this collection that series is not an arbitrary sequence: it is a modular form, an object satisfying strong transformation rules, and the space of forms of a given weight and level is finite-dimensional.

That is the structural reason theta series are as rigid as they are. Knowing a modular form’s first few coefficients can determine all of them, because there are not enough dimensions in the space for two different forms to agree for long. It is also the reason the next essay’s counterexample lives where it does: in sixteen dimensions the relevant space of forms is one-dimensional, so any two even unimodular lattices of that rank have identical theta series, and there happen to be two.

Nothing in this collection computes with modular forms, and the counts here are all enumerations or divisor sums. The remark is here because a reader who meets the phrase “theta series” elsewhere will meet it in that context, and because it explains why a question that looks like bookkeeping has an answer at all.

Where the ladder goes next

The theta series is a measurement of a lattice, and the obvious question about any measurement is whether it determines what it measures. Two lattices with the same lengths at every distance — are they the same lattice? In the plane the answer is yes and the search that confirms it is exhaustive. In sixteen dimensions the answer is no, and the counterexample is sixty years old.

Why some dimensions have formulas and others do not

The plane gives a divisor sum and three dimensions gives nothing so tidy, which looks like bad luck. It is not luck, and the reason says which dimensions to expect a formula in.

Collect the counts into one function. Write Θ(q)=nr(n)qn\Theta(q) = \sum_n r(n)\,q^n, with r(n)r(n) the number of vectors of squared length nn. For the square lattice this is the square of a simpler series, for a lattice in dd dimensions it is a dd-th power of it, and the function that results is not an arbitrary power series.

It is a modular form, of weight d/2d/2. That is a strong constraint: the space of forms of a given weight is finite-dimensional, so a theta series is a combination of finitely many standard forms, and its coefficients are combinations of their coefficients.

In even dimensions the weight is a whole number, and the standard forms are the Eisenstein series, whose coefficients are divisor sums. That is exactly why the plane’s counts are divisor sums, and why four dimensions gives another one — the number of ways of writing nn as a sum of four squares is eight times the sum of the divisors of nn that are not multiples of four.

In odd dimensions the weight is a half-integer, and the theory is genuinely harder. There is no Eisenstein series to expand in, and the count of representations as a sum of three squares is instead tied to the class numbers of quadratic forms — the objects counted elsewhere in this collection, and not the kind of thing that reduces to a divisor sum.

So the shape of the answer alternates with the dimension, and crystallography is unlucky in living in three.

The counts are powder multiplicities

There is a use for these numbers that a diffractionist meets before ever meeting a divisor sum, and it is the same table read as an experiment.

A powder pattern collapses direction. Grinding a crystal into randomly oriented grains means every reflection appears at a scattering angle set by its length alone, so all the reflections of a given length land on top of one another as a single line.

So the line’s intensity carries a factor of the count. A reflection with a multiplicity of forty-eight contributes forty-eight times as much to its line as one with a multiplicity of six, before any structure factor is considered — and getting that factor wrong is a straightforward way to misfit a pattern.

And the counts are exactly this essay’s numbers. The multiplicity of a powder line is the number of reciprocal-lattice points at that length, which is r(n)r(n) for the reciprocal lattice.

The awkward case is when two different reflections share a length by accident. Indices unrelated by symmetry can have the same squared length, and their reflections then overlap in a powder pattern with no way to separate them. That is the loss a powder pattern suffers, and this table is where it can be predicted: any nn whose count exceeds the symmetry’s own orbit size has an accidental coincidence in it.

What this makes readable

Essays that name this one as a prerequisite.

Named alongside this one

Essays reaching for the same objects. Nobody chose these; they are what the concept index makes visible.

What links here

The 8 essays that link to this one and share the most of its objects, of 17 that link here.

The objects this essay names

Each one links to every other essay that touches it.

Divisor sumGaussian integerHolohedryKissing numberLatticeMultiplicityOrbitPowder diffractionQuadratic formSum of two squaresTheta series