{ "cells": [ { "cell_type": "markdown", "metadata": { "collapsed": false }, "source": [ "# Lattice Visualization\n", "\n", "CoCalc lets you build 3D models of lattice structure that can be rotated to see periodicity along different vectors. \n", "The two figures in this worksheet provide simple movable examples of face centered cubic structures.\n", "\n", "Face-centered cubic lattice is one of the 14 possible Bravais lattices in 3 dimensions.\n", "\n", "References:\n", "\n", "* Miller, David A. \"Chapter 8 Quantum mechanics in crystalline materials.\" In _[Quantum Mechanics for Scientists and Engineers](https://www-ee.stanford.edu/~dabm/QMbook.html), p.207ff_, Cambridge University Press, 2008.\n", "\n", "* [Quantum Mechanics for Scientists and Engineers 2](https://lagunita.stanford.edu/courses/course-v1:Engineering+QMSE02+Winter2018/about), Winter 2018, free online course from Stanford University by David A. Miller.\n", "\n", "* _Principles of Semiconductor Devices, section 2.2.1_, [Face centered cubic lattice](https://ecee.colorado.edu/~bart/book/bravais.htm#fcc).\n", "\n" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ ], "source": [ "from sage.plot.plot3d.shapes import Sphere" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ ], "source": [ "def fcc(obj=Sphere(.7, color='red'), offset=None):\n", " \"\"\"\n", " return a list of 3D objects\n", " for face centered cubic lattice\n", " corner at origin\n", " cube edge 10 units\n", " \n", " offset is a triple offseting the lattice in x, y, z directions\n", " \"\"\"\n", " S = []\n", " ofx = ofy = ofz = 0\n", " if offset is not None:\n", " ofx, ofy, ofz = offset\n", " # corners\n", " for ix in [0,10]:\n", " for iy in [0,10]:\n", " for iz in [0,10]:\n", " S.append(obj.translate(ix, iy, iz))\n", " # object at center of each of 6 faces\n", " # for each axis, add object at 0 and 10 on that axis and 5,5 on other axes\n", " S.append(obj.translate(0, 5, 5))\n", " S.append(obj.translate(10, 5, 5))\n", " S.append(obj.translate(5, 0, 5))\n", " S.append(obj.translate(5, 10, 5))\n", " S.append(obj.translate(5, 5, 0))\n", " S.append(obj.translate(5, 5, 10))\n", " return S" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": "\n\n" }, "execution_count": 3, "metadata": { }, "output_type": "execute_result" } ], "source": [ "# Display part of a simple face-centered cubic lattice\n", "# https://ecee.colorado.edu/~bart/book/bravais.htm#fcc\n", "S = sum(fcc())\n", "S.show(viewer='threejs', online=True)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": "\n