class32 - PHYS 5900 Class 32 (11/18/2009) Zi-Wei Lin...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: PHYS 5900 Class 32 (11/18/2009) Zi-Wei Lin Example: construct the crystal structure of sodium chloride (NaCl), a face-centered cubic lattice: In[1]:= H * lines * L In[2]:= Table @88 0, j, k < , 8 2, j, k << , 8 j, 0, 2 < , 8 k, 0, 2 <D Out[2]= 8888 0, 0, 0 < , 8 2, 0, 0 << , 88 0, 0, 1 < , 8 2, 0, 1 << , 88 0, 0, 2 < , 8 2, 0, 2 <<< , 888 0, 1, 0 < , 8 2, 1, 0 << , 88 0, 1, 1 < , 8 2, 1, 1 << , 88 0, 1, 2 < , 8 2, 1, 2 <<< , 888 0, 2, 0 < , 8 2, 2, 0 << , 88 0, 2, 1 < , 8 2, 2, 1 << , 88 0, 2, 2 < , 8 2, 2, 2 <<<< In[3]:= ? Join Join @ list 1 , list 2 , … D concatenates lists or other expressions that share the same head. Join @ list 1 , list 2 , … , n D joins the objects at level n in each of the list i . In[4]:= Join @8 1, 2 < , 8 a, b <D Out[4]= 8 1, 2, a, b < In[5]:= Join @ Table @88 0, j, k < , 8 2, j, k << , 8 j, 0, 2 < , 8 k, 0, 2 <D , Table @88 i, 0, k < , 8 i, 2, k << , 8 i, 0, 2 < , 8 k, 0, 2 <D , Table @88 i, j, < , 8 i, j, 2 << , 8 i, 0, 2 < , 8 j, 0, 2 <DD In[6]:= Flatten @ % , 1 D In[7]:= myLines = Line % ; In[8]:= Graphics3D @ myLines, Boxed fi False D Out[8]= In[9]:= H * a nested list of coordinates for points of a simple cubic lattice * L coord = Table @8 i, j, k < , 8 i, 0, 2 < , 8 j, 0, 2 < , 8 k, 0, 2 <D Out[9]= 8888 0, 0, 0 < , 8 0, 0, 1 < , 8 0, 0, 2 << , 88 0, 1, 0 < , 8 0, 1, 1 < , 8 0, 1, 2 << , 88 0, 2, 0 < , 8 0, 2, 1 < , 8 0, 2, 2 <<< , 888 1, 0, 0 < , 8 1, 0, 1 < , 8 1, 0, 2 << , 88 1, 1, 0 < , 8 1, 1, 1 < , 8 1, 1, 2 << , 88 1, 2, 0 < , 8 1, 2, 1 < , 8 1, 2, 2 <<< , 888 2, 0, 0 < , 8 2, 0, 1...
View Full Document

This note was uploaded on 04/25/2010 for the course PHYS 5900 taught by Professor Lin during the Fall '09 term at East Carolina University .

Page1 / 9

class32 - PHYS 5900 Class 32 (11/18/2009) Zi-Wei Lin...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online