How do you construct a lattice from its basis or its Gram Matrix? I'm really having trouble trying to understand this. A few weeks back, I got pretty interested in sphere packing and I'm trying to grasp the idea of using a matrix to represent the basis of a lattice. I've been using lattices like this one $\left(\begin{array}\12 & 0 & 0\\ 1 & \sqrt3 & 0\\1 & \frac{1}{\sqrt3} &\frac{2\sqrt6}{3}\end{array}\right)$ for the fcc lattice, because this represents the three vectors $(2,0,0)$, $(1,\sqrt3,0)$, and $(1,\frac{1}{\sqrt3},\frac{2\sqrt6}{3})$ that make the fundamental parallelipipid for the lattice. I think this lattice is also represented by $A_3$. It says here (archive) that the Gram Matrix of $A_3$ is $\left(\begin{array}\12 & -1 & 0\\-1 & 2 & -1\\0 & -1 & 2\end{array}\right)$. How is the Gram Matrix related to the basis I've been using? What about the basis they give? Is there a fast way to construct a lattice and find its density from a Gram Matrix? Everything I've found so far is over my head.
 A: What they actually do on the website, which saves a bunch of square root signs, is to realize the lattice in $\mathbb R^4$ as 
$$  
 \left(  \begin{array}{rrrr}
  1  &  -1  &  0 & 0 \\
  0   &  1  &  -1  & 0\\
  0  &  0   &  1  & -1
\end{array} 
  \right)  \cdot
 \left(  \begin{array}{rrr}
  1  &  0  &  0  \\
  -1   &  1  &   0\\
  0     &  -1  & 1 \\
  0 & 0 & -1
\end{array} 
  \right) = 
 \left(  \begin{array}{rrr}
  2  &  -1  &  0  \\
  -1   &  2  &   -1\\
  0     &  -1  & 2 
\end{array} 
  \right). 
  $$
Here you are given basis vectors as the three rows of the rectangular matrix on the left, or the columns of the matrix on the right, which is its transpose. That is the fundamental relation, call it
$$  B  \; B^T = G.   $$ 
For the version you want, squre matrices over the integers are possible:
$$  
 \left(  \begin{array}{rrr}
  0  &  1  &  1  \\
  1   &  0  &  1  \\
  1  &  1   &  0  
\end{array} 
  \right)  \cdot
 \left(  \begin{array}{rrr}
  0  &  1  &  1  \\
  1   &  0  &  1  \\
  1  &  1   &  0  
\end{array} 
  \right) = 
 \left(  \begin{array}{rrr}
  2  &  1  &  1  \\
  1   &  2  &   1\\
  1     &  1  & 2 
\end{array} 
  \right). 
  $$
If you really want, you can write this in lower/upper triangular square matrices. This can be done with CHOLESKY, which can be done by hand here. You should have been using 
$$  
 \left(  \begin{array}{rrr}
  \sqrt 2  &  0  &  0  \\
  \sqrt{ \frac{1}{2} }  &   \sqrt{ \frac{3}{2} }  &  0 \\
    \sqrt{ \frac{1}{2} }  &    \sqrt{ \frac{1}{6} }   &    \sqrt{ \frac{4}{3} } 
\end{array} 
  \right)  \cdot
 \left(  \begin{array}{rrr}
   \sqrt 2  &   \sqrt{ \frac{1}{2} }  &   \sqrt{ \frac{1}{2} }  \\
  0   &   \sqrt{ \frac{3}{2} }   &    \sqrt{ \frac{1}{6} } \\
  0 & 0 &  \sqrt{ \frac{4}{3} }
\end{array} 
  \right) = 
 \left(  \begin{array}{rrr}
  2  &  1  &  1  \\
  1   &  2  &   1\\
  1     &  1  & 2 
\end{array} 
  \right). 
  $$
Finally, the relationship required for distinct gram matrices to represent the same lattice is called "equivalence." If you have gram matrices $G,H,$ equivalence means there is an integer matrix $P$ with $\det P = 1$ such that
$$  P G P^T = H.  $$
Naturally, if you take $Q = P^{-1}$ you get
$$ Q H Q^T = G  $$ as well. 
Gaze in awe: 
$$  
 \left(  \begin{array}{rrr}
  1  &  0  &  0  \\
  -1   &  1  &  0  \\
  0  &  -1   &  1  
\end{array} 
  \right)  \cdot
 \left(  \begin{array}{rrr}
  2  &  1  &  1  \\
  1   &  2  &   1\\
  1     &  1  & 2 
\end{array} 
  \right) \cdot
 \left(  \begin{array}{rrr}
  1  &  -1  &  0  \\
  0   &  1  &  -1  \\
  0  &  0   &  1  
\end{array} 
  \right) = 
 \left(  \begin{array}{rrr}
  2  &  -1  &  0  \\
  -1   &  2  &   -1\\
  0     &  -1  & 2 
\end{array} 
  \right). 
  $$
