views:

194

answers:

1

How do you generate a 3x3x3 lattice in Mathematica? Is it possible to color some of the lattice points? It seems that it is possible but I cannot get it to work so far

http://reference.wolfram.com/mathematica/ref/LatticeData.html

What I mean by 3x3x3 is something like figure (c) on the right:http://physics.ucsd.edu/was-sdphul/labs/2dl/exp6/exp63.gif

+2  A: 

Must agree with Mark that it is not quite clear what you are asking for -- I'll assume it is the figures you are after. Even then, I can't really tell if there are any obvious generalizations from the FCC/BCC stuff.

Anyways, to just replicate the figures, create the lines and points yourself with something like

Gridlines[n_] := With[{s = Range[0, n - 1]},
  Join @@ (Flatten[#, 1] & /@ 
     NestList[Transpose[#, {3, 1, 2}] &, Outer[List, s, s, s], 2])]
LatticePoints[name_, n_] := Select[
  Tuples[Range[-n, n], 3].LatticeData[name, "Basis"],
  (And @@ ((# >= 0 && # < n) & /@ #) &)]

This works for FCC and BCC:

Graphics3D[{
  {Red, Sphere[#, 0.1] & /@ LatticePoints["FaceCenteredCubic", 3]},
  Line[Gridlines[3]]
  }, Boxed -> False]
Janus
You could also use [`GraphPlot3D`](http://reference.wolfram.com/mathematica/ref/GraphPlot3D.html), but you might need to use the `VertexCoordinateRules` option to manually control vertex layout, and others to control the appearance of the edges and vertices.
Michael Pilat