# Wolfram Mathematica

## Use the Smith Decomposition to Analyze a Lattice

Consider the lattice generated by integer multiples of the vectors and .

In:= ```b1 = {3, -3}; b2 = {2, 1};```
In:= `ptsb = Flatten[Table[j b1 + k b2, {j, -12, 12}, {k, -12, 12}], 1];`
In:= ```graphicsb = Graphics[{Blue, PointSize[Large], Point@ptsb}, PlotRange -> 10, Axes -> True]```
Out= Let be the matrix whose rows are and .

In:= `m = {b1, b2};`

The Smith decomposition gives three matrices that satisfy the identity .

In:= `{u, r, v} = SmithDecomposition[m];`
In:= `u.m.v == r`
Out= The matrices and have integer entries and determinant one.

In:= `{u // MatrixForm, v // MatrixForm, Det[u], Det[v]}`
Out= The matrix is integer and diagonal. From its entries it can be seen that the structure of the group is or simply , as is the trivial group.

In:= `r // MatrixForm`
Out//MatrixForm= Multiplying the identity on the right by gives . Because is integer and determinant , generates the same lattice as but is simpler.

In:= ```g = r.Inverse[v]; g // MatrixForm```
Out//MatrixForm= Visualize the lattice generated by the rows of .

In:= ```ptsg = Flatten[ Table[j First[g] + k Last[g], {j, -12, 12}, {k, -12, 12}], 1];```
In:= ```graphicsg = Graphics[{Red, PointSize[Medium], Point@ptsg}, PlotRange -> 10, Axes -> True]```
Out= Superimposing the new lattice on the original confirms that they are the same.

In:= `Show[{graphicsb, graphicsg}]`
Out= 