{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

class32 - PHYS 5900 Class 32 Zi-Wei Lin Example construct...

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

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 <

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

View Full Document
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, 0 < , 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 < , 8 2, 0, 2 << , 88 2, 1, 0 < , 8 2, 1, 1 < , 8 2, 1, 2 << , 88 2, 2, 0 < , 8 2, 2, 1 < , 8 2, 2, 2 <<<< In[10]:= myCoord = Flatten @ coord, 2 D Out[10]= 88 0, 0, 0 < , 8 0, 0, 1 < , 8 0, 0, 2 < , 8 0, 1, 0 < ,
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern