I was wondering how to create a 3D cubic lattice and vizualize with A and B atoms in alternate sites?
Regards
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityI was wondering how to create a 3D cubic lattice and vizualize with A and B atoms in alternate sites?
Regards
You could generate the coordinates as a list, in the "XYZ" format, and then read it in as such, at which point Mathematica will create a molecular model for you:
coords = Flatten[
Table[
{If[
OddQ@Total@{x, y, z}
, "Na", "Cl"], x bondlength, y bondlength, z bondlength},
{x, 6},
{y, 6},
{z, 6}], 2];
ImportString[
ExportString[
coords, "Table"], "XYZ"]
Then you create an XYZ file as a string and read it in,
ImportString[
ExportString[
coords, "Table"], "XYZ"]
Straight Outta help:
b = Normal@LatticeData["SimpleCubic", "Basis"];
l2 = Tuples[Range[0, 5], 3].b;
Graphics3D[{{Red, Green}[[Mod[Tr@#, 2, 1]]], Sphere[#, .2]} & /@ l2]
Tuples[Range[0, 5], 3].b
and (2) on the following question. One can have a simple cubic lattice (denoted by P from "primitive"), but if there is more than one atom in the cell, the crystallographic group may be still different. Do you have an approach to deal with different crystallographic groups with the primitive cubic lattice?
$\endgroup$
– Alexei Boulbitch
Mar 23 '16 at 8:37
Tuples[ etc].b
is replicating the basis vectors b
across the crystal. 2) yes, you're right the crystallographic can be different, but I don't have an approach for that
$\endgroup$
– Dr. belisarius
Mar 23 '16 at 8:53