├── .gitignore ├── .travis.yml ├── LICENSE ├── MANIFEST.in ├── README.md ├── docs ├── Makefile ├── _templates │ └── layout.html ├── changelog.rst ├── conf.py ├── index.rst ├── make.bat ├── modules.rst ├── proBlue │ ├── LICENSE.txt │ ├── README.txt │ ├── static │ │ └── proBlue.css │ └── theme.conf └── symmetry.rst ├── fabfile.py ├── grades ├── Spring2015 │ ├── Final.png │ ├── Grade Stats.ipynb │ ├── Mid-term 1.png │ ├── Mid-term 2.png │ ├── PS1.png │ ├── PS2.png │ ├── PS3.png │ ├── PS4.png │ ├── PS5.png │ └── Weighted Total.png ├── Spring2016 │ └── Grade Stats.ipynb ├── Spring2017 │ └── Grade Stats.ipynb ├── Spring2018 │ └── NANO106_Grades_Spring2018.ipynb ├── Spring2019 │ └── NANO106_Grades_Spring2019.ipynb └── Spring2020 │ └── NANO106_Grades_Spring2020.ipynb ├── lectures ├── handouts │ ├── 32.pdf │ ├── 32.png │ ├── CrystalvsCartesian.graffle │ ├── CrystalvsCartesian.pdf │ ├── Exam Handout.pdf │ ├── Handout 1 - Linear Algebra and Lattice Computations.md │ ├── Handout 1 - Linear Algebra and Lattice Computations.pdf │ ├── Handout 10 - Einstein Notation.md │ ├── Handout 10 - Einstein Notation.pdf │ ├── Handout 11 - Piezoelectric coefficients for the 32 point group.md │ ├── Handout 11 - Piezoelectric coefficients for the 32 point group.pdf │ ├── Handout 12 - Plane Groups.pdf │ ├── Handout 12 - Plane Groups.tex │ ├── Handout 2 - Summary of coordinate transformations.md │ ├── Handout 2 - Summary of coordinate transformations.pdf │ ├── Handout 3 - Graphical symbols for symmetry elements.pdf │ ├── Handout 4 - Point Group Determination Flowchart.graffle │ ├── Handout 4 - Point Group Determination Flowchart.pdf │ ├── Handout 5 - Summary of Point Groups.pdf │ ├── Handout 5 - Summary of Point Groups.tex │ ├── Handout 6 - Determining Symmetry Matrices.md │ ├── Handout 6 - Determining Symmetry Matrices.pdf │ ├── Handout 7 - International Tables for Crystallography 35 - Cmm2 Annotated.pdf │ ├── Handout 8 - International Tables Explanation.pdf │ ├── Handout 9 - International Tables Symmetry Operations.pdf │ ├── Orientation of 32.graffle │ │ ├── data.plist │ │ └── image1.pdf │ ├── PGFlowChart.pdf │ ├── SymmetryOperationsOnCrystal.graffle │ ├── SymmetryOperationsOnCrystal.pdf │ └── planegroups │ │ ├── 1.png │ │ ├── 10.gif │ │ ├── 10.png │ │ ├── 11.png │ │ ├── 12.png │ │ ├── 13.png │ │ ├── 14.png │ │ ├── 15.png │ │ ├── 16.png │ │ ├── 17.png │ │ ├── 2.png │ │ ├── 3.png │ │ ├── 4.png │ │ ├── 5.png │ │ ├── 6.png │ │ ├── 7.png │ │ ├── 8.png │ │ └── 9.png ├── lecture_10_principal_directions_and_representation_quadrics │ └── Representation_quadrics.ipynb ├── lecture_13_xrd │ ├── PDF - alpha CsCl.png │ ├── PDF - beta CsCl.png │ └── XRD CsCl.ipynb ├── lecture_4_point_group_symmetry │ ├── Summary of Point groups.pdf │ ├── Summary of Point groups.tex │ ├── Symmetry Computations on m-3m (O_h) Point Group.ipynb │ └── Symmetry Computations on mmm (D_2h) Point Group.ipynb ├── lecture_5_the_230_space_groups │ └── Datamining the Materials Project for Space Group statistics.ipynb └── molecules │ ├── C1_H1C1Br1Cl1F1.xyz │ ├── C2_H2O2.xyz │ ├── C2v_C1S2.xyz │ ├── C2v_H2O1.xyz │ ├── C3_Triphenylphosphine.xyz │ ├── C3v_H3N1.xyz │ ├── C4v_SF5Cl.xyz │ ├── Ci_H2C2Br2F2.xyz │ ├── Cs_CH2ClF.xyz │ ├── Cs_H1C1Br1Cl1F1.xyz │ ├── D*h_H2C1.xyz │ ├── D2h_H4C2.xyz │ ├── D3h_B1F3.xyz │ ├── D6h_Benzene.xyz │ ├── Oh_P1F6.xyz │ └── Td_H4C1.xyz ├── problem_sets ├── PS1 - Qn 4.ipynb ├── PS1 - Qn 8.ipynb ├── PS1 - Qn 9.ipynb ├── PS3 - Q5b.ipynb ├── PS4 - Qn6.ipynb ├── PbTiO3.cif └── PbTiO3.png ├── requirements.txt ├── setup.cfg ├── setup.py └── symmetry ├── __init__.py ├── groups.py ├── symm_data.json ├── tests ├── __init__.py └── test_groups.py └── vis.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | 5 | # C extensions 6 | *.so 7 | 8 | # Distribution / packaging 9 | .Python 10 | env/ 11 | bin/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | eggs/ 16 | lib/ 17 | lib64/ 18 | parts/ 19 | sdist/ 20 | var/ 21 | *.egg-info/ 22 | .installed.cfg 23 | *.egg 24 | 25 | # Installer logs 26 | pip-log.txt 27 | pip-delete-this-directory.txt 28 | 29 | # Unit test / coverage reports 30 | htmlcov/ 31 | .tox/ 32 | .coverage 33 | .cache 34 | nosetests.xml 35 | coverage.xml 36 | 37 | # Translations 38 | *.mo 39 | 40 | # Mr Developer 41 | .mr.developer.cfg 42 | .project 43 | .pydevproject 44 | .idea 45 | 46 | # Rope 47 | .ropeproject 48 | 49 | # Django stuff: 50 | *.log 51 | *.pot 52 | 53 | # Sphinx documentation 54 | docs/_build/ 55 | 56 | #ipython 57 | .ipynb_checkpoints 58 | 59 | #latex 60 | .aux 61 | .log 62 | .lof 63 | .synctex* 64 | .fls 65 | .out 66 | .fdb_latexmk 67 | .bbl 68 | .DS_Store 69 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | python: 3 | - "2.7" 4 | - "3.6" 5 | script: nosetests 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, Materials Virtual Lab 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * Neither the name of the {organization} nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.md LICENSE 2 | recursive-include symmetry *.py *.json 3 | prune */*/tests 4 | prune */*/*/tests 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NANO106 - Crystallography of Materials 2 | 3 | Welcome to the repo for NANO106. 4 | 5 | NANO106 is UCSD's course on Crystallography of Materials taught by Prof Shyue 6 | Ping Ong. The purpose of this repo is to serve as a persistent and evolving 7 | collection of supplementary course materials that illustrate various symmetry 8 | and crystallography concepts and computations. Most of the code are written in 9 | python and presented in ipython notebooks. Some static material may be created 10 | in LaTeX. 11 | 12 | While this repo is completely open and anyone is welcome to use the materials 13 | contain therein, I would ask that you acknowledge any usage. 14 | 15 | ## Usage 16 | 17 | To fully make use of this repo, it is recommended that you clone and install 18 | the symmetry package included, as well as ipython, numpy, sympy, 19 | and for some more specific materials analysis, [pymatgen](http://www.pymatgen.org). 20 | 21 | However, you can explore a lot of the materials without any installation. 22 | 23 | ### Viewing the Notebooks 24 | 25 | You can explore the notebooks using the excellent online ipython notebook viewer. 26 | To begin, go to this [link](http://nbviewer.ipython.org/github/materialsvirtuallab/nano106/tree/master/lectures/) 27 | which points to the root lectures directory and this 28 | [link](http://nbviewer.ipython.org/github/materialsvirtuallab/nano106/tree/master/problem_sets/) 29 | which points to the problem sets directory. 30 | 31 | ## Acknowledgements 32 | 33 | NANO106 uses the following textbooks and much of the code and material 34 | contained therein is based on concepts in these books. They are highly 35 | recommended for students of crystallography, symmetry and its implications 36 | for material properties. 37 | 38 | 1. Structure of Materials: An Introduction to Crystallography, Diffraction and 39 | Symmetry by Marc De Graef and Michael E. McHenry 40 | 2. Properties of Materials: Anisotropy, Symmetry, Structure by Robert E. 41 | Newnham 42 | 43 | -- 44 | Shyue Ping Ong 45 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | PAPER = 8 | BUILDDIR = _build 9 | 10 | # Internal variables. 11 | PAPEROPT_a4 = -D latex_paper_size=a4 12 | PAPEROPT_letter = -D latex_paper_size=letter 13 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 14 | # the i18n builder cannot share the environment and doctrees with the others 15 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 16 | 17 | .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext 18 | 19 | help: 20 | @echo "Please use \`make ' where is one of" 21 | @echo " html to make standalone HTML files" 22 | @echo " dirhtml to make HTML files named index.html in directories" 23 | @echo " singlehtml to make a single large HTML file" 24 | @echo " pickle to make pickle files" 25 | @echo " json to make JSON files" 26 | @echo " htmlhelp to make HTML files and a HTML help project" 27 | @echo " qthelp to make HTML files and a qthelp project" 28 | @echo " devhelp to make HTML files and a Devhelp project" 29 | @echo " epub to make an epub" 30 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 31 | @echo " latexpdf to make LaTeX files and run them through pdflatex" 32 | @echo " text to make text files" 33 | @echo " man to make manual pages" 34 | @echo " texinfo to make Texinfo files" 35 | @echo " info to make Texinfo files and run them through makeinfo" 36 | @echo " gettext to make PO message catalogs" 37 | @echo " changes to make an overview of all changed/added/deprecated items" 38 | @echo " linkcheck to check all external links for integrity" 39 | @echo " doctest to run all doctests embedded in the documentation (if enabled)" 40 | 41 | clean: 42 | -rm -rf $(BUILDDIR)/* 43 | 44 | html: 45 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 46 | @echo 47 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 48 | 49 | dirhtml: 50 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml 51 | @echo 52 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." 53 | 54 | singlehtml: 55 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml 56 | @echo 57 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." 58 | 59 | pickle: 60 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle 61 | @echo 62 | @echo "Build finished; now you can process the pickle files." 63 | 64 | json: 65 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 66 | @echo 67 | @echo "Build finished; now you can process the JSON files." 68 | 69 | htmlhelp: 70 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp 71 | @echo 72 | @echo "Build finished; now you can run HTML Help Workshop with the" \ 73 | ".hhp project file in $(BUILDDIR)/htmlhelp." 74 | 75 | qthelp: 76 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp 77 | @echo 78 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 79 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:" 80 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/symmetry.qhcp" 81 | @echo "To view the help file:" 82 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/symmetry.qhc" 83 | 84 | devhelp: 85 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp 86 | @echo 87 | @echo "Build finished." 88 | @echo "To view the help file:" 89 | @echo "# mkdir -p $$HOME/.local/share/devhelp/symmetry" 90 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/symmetry" 91 | @echo "# devhelp" 92 | 93 | epub: 94 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub 95 | @echo 96 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub." 97 | 98 | latex: 99 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 100 | @echo 101 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 102 | @echo "Run \`make' in that directory to run these through (pdf)latex" \ 103 | "(use \`make latexpdf' here to do that automatically)." 104 | 105 | latexpdf: 106 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 107 | @echo "Running LaTeX files through pdflatex..." 108 | $(MAKE) -C $(BUILDDIR)/latex all-pdf 109 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 110 | 111 | text: 112 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text 113 | @echo 114 | @echo "Build finished. The text files are in $(BUILDDIR)/text." 115 | 116 | man: 117 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man 118 | @echo 119 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man." 120 | 121 | texinfo: 122 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 123 | @echo 124 | @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." 125 | @echo "Run \`make' in that directory to run these through makeinfo" \ 126 | "(use \`make info' here to do that automatically)." 127 | 128 | info: 129 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 130 | @echo "Running Texinfo files through makeinfo..." 131 | make -C $(BUILDDIR)/texinfo info 132 | @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." 133 | 134 | gettext: 135 | $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale 136 | @echo 137 | @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." 138 | 139 | changes: 140 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes 141 | @echo 142 | @echo "The overview file is in $(BUILDDIR)/changes." 143 | 144 | linkcheck: 145 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 146 | @echo 147 | @echo "Link check complete; look for any errors in the above output " \ 148 | "or in $(BUILDDIR)/linkcheck/output.txt." 149 | 150 | doctest: 151 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 152 | @echo "Testing of doctests in the sources finished, look at the " \ 153 | "results in $(BUILDDIR)/doctest/output.txt." 154 | -------------------------------------------------------------------------------- /docs/_templates/layout.html: -------------------------------------------------------------------------------- 1 | {% extends "!layout.html" %} 2 | 3 | {%- block extrahead %} 4 | {{ super() }} 5 | {% endblock %} 6 | 7 | {% block footer %} 8 | {{ super() }} 9 | 10 | {% endblock %} -------------------------------------------------------------------------------- /docs/changelog.rst: -------------------------------------------------------------------------------- 1 | Change log 2 | ========== 3 | -------------------------------------------------------------------------------- /docs/conf.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # symmetry documentation build configuration file, created by 4 | # sphinx-quickstart on Tue Nov 15 00:13:52 2011. 5 | # 6 | # This file is execfile()d with the current directory set to its containing dir. 7 | # 8 | # Note that not all possible configuration values are present in this 9 | # autogenerated file. 10 | # 11 | # All configuration values have a default; values that are commented out 12 | # serve to show the default. 13 | 14 | import sys 15 | import os 16 | 17 | # If extensions (or modules to document with autodoc) are in another directory, 18 | # add these directories to sys.path here. If the directory is relative to the 19 | # documentation root, use os.path.abspath to make it absolute, like shown here. 20 | sys.path.insert(0, os.path.abspath('.')) 21 | sys.path.insert(0, os.path.dirname('..')) 22 | sys.path.insert(0, os.path.dirname('../symmetry')) 23 | sys.path.insert(0, os.path.dirname('../..')) 24 | 25 | from symmetry import __version__, __author__ 26 | 27 | # -- General configuration ----------------------------------------------------- 28 | 29 | # If your documentation needs a minimal Sphinx version, state it here. 30 | #needs_sphinx = '1.0' 31 | 32 | # Add any Sphinx extension module names here, as strings. They can be extensions 33 | # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. 34 | extensions = ['sphinx.ext.autodoc', 'sphinxcontrib.napoleon', 'sphinx.ext.viewcode'] 35 | exclude_patterns = ['../**/tests*'] 36 | exclude_dirnames = ['../**/tests*'] 37 | autoclass_content = 'both' 38 | 39 | # Add any paths that contain templates here, relative to this directory. 40 | templates_path = ['_templates'] 41 | 42 | # The suffix of source filenames. 43 | source_suffix = '.rst' 44 | 45 | # The encoding of source files. 46 | #source_encoding = 'utf-8-sig' 47 | 48 | # The master toctree document. 49 | master_doc = 'index' 50 | 51 | # General information about the project. 52 | project = u'symmetry' 53 | copyright = u'2014, ' + __author__ 54 | 55 | # The version info for the project you're documenting, acts as replacement for 56 | # |version| and |release|, also used in various other places throughout the 57 | # built documents. 58 | # 59 | # The short X.Y version. 60 | version = __version__ 61 | # The full version, including alpha/beta/rc tags. 62 | release = __version__ 63 | 64 | # The language for content autogenerated by Sphinx. Refer to documentation 65 | # for a list of supported languages. 66 | #language = None 67 | 68 | # There are two options for replacing |today|: either, you set today to some 69 | # non-false value, then it is used: 70 | #today = '' 71 | # Else, today_fmt is used as the format for a strftime call. 72 | #today_fmt = '%B %d, %Y' 73 | 74 | # List of patterns, relative to source directory, that match files and 75 | # directories to ignore when looking for source files. 76 | exclude_patterns = ['_build'] 77 | 78 | # The reST default role (used for this markup: `text`) to use for all 79 | # documents. 80 | #default_role = None 81 | 82 | # If true, '()' will be appended to :func: etc. cross-reference text. 83 | #add_function_parentheses = True 84 | 85 | # If true, the current module name will be prepended to all description 86 | # unit titles (such as .. function::). 87 | add_module_names = False 88 | 89 | # If true, sectionauthor and moduleauthor directives will be shown in the 90 | # output. They are ignored by default. 91 | #show_authors = False 92 | 93 | # The name of the Pygments (syntax highlighting) style to use. 94 | pygments_style = 'sphinx' 95 | 96 | # A list of ignored prefixes for module index sorting. 97 | #modindex_common_prefix = [] 98 | 99 | 100 | # -- Options for HTML output ------------------------------------------------- 101 | 102 | # The theme to use for HTML and HTML Help pages. See the documentation for 103 | # a list of builtin themes. 104 | html_theme = 'proBlue' 105 | 106 | # Theme options are theme-specific and customize the look and feel of a theme 107 | # further. For a list of options available for each theme, see the 108 | # documentation. 109 | #html_theme_options = {} 110 | 111 | # Add any paths that contain custom themes here, relative to this directory. 112 | html_theme_path = ["."] 113 | 114 | # The name for this set of Sphinx documents. If None, it defaults to 115 | # " v documentation". 116 | #html_title = None 117 | 118 | # A shorter title for the navigation bar. Default is the same as html_title. 119 | #html_short_title = None 120 | 121 | # The name of an image file (relative to this directory) to place at the top 122 | # of the sidebar. 123 | #html_logo = None 124 | 125 | # The name of an image file (within the static path) to use as favicon of the 126 | # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 127 | # pixels large. 128 | html_favicon = "favicon.ico" 129 | 130 | # Add any paths that contain custom static files (such as style sheets) here, 131 | # relative to this directory. They are copied after the builtin static files, 132 | # so a file named "default.css" will overwrite the builtin "default.css". 133 | html_static_path = ['_static'] 134 | 135 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, 136 | # using the given strftime format. 137 | #html_last_updated_fmt = '%b %d, %Y' 138 | 139 | # If true, SmartyPants will be used to convert quotes and dashes to 140 | # typographically correct entities. 141 | #html_use_smartypants = True 142 | 143 | # Custom sidebar templates, maps document names to template names. 144 | #html_sidebars = {} 145 | 146 | # Additional templates that should be rendered to pages, maps page names to 147 | # template names. 148 | #html_additional_pages = {} 149 | 150 | # If false, no module index is generated. 151 | #html_domain_indices = True 152 | 153 | # If false, no index is generated. 154 | #html_use_index = True 155 | 156 | # If true, the index is split into individual pages for each letter. 157 | #html_split_index = False 158 | 159 | # If true, links to the reST sources are added to the pages. 160 | #html_show_sourcelink = True 161 | 162 | # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. 163 | #html_show_sphinx = True 164 | 165 | # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. 166 | #html_show_copyright = True 167 | 168 | # If true, an OpenSearch description file will be output, and all pages will 169 | # contain a tag referring to it. The value of this option must be the 170 | # base URL from which the finished HTML is served. 171 | #html_use_opensearch = '' 172 | 173 | # This is the file name suffix for HTML files (e.g. ".xhtml"). 174 | #html_file_suffix = None 175 | 176 | # Output file base name for HTML help builder. 177 | htmlhelp_basename = 'symmetrydoc' 178 | 179 | 180 | # -- Options for LaTeX output ------------------------------------------------ 181 | 182 | latex_elements = { 183 | # The paper size ('letterpaper' or 'a4paper'). 184 | #'papersize': 'letterpaper', 185 | 186 | # The font size ('10pt', '11pt' or '12pt'). 187 | #'pointsize': '10pt', 188 | 189 | # Additional stuff for the LaTeX preamble. 190 | #'preamble': '', 191 | } 192 | 193 | # Grouping the document tree into LaTeX files. List of tuples 194 | # (source start file, target name, title, author, documentclass [howto/manual]). 195 | latex_documents = [ 196 | ('index', 'symmetry.tex', u'symmetry Documentation', __author__, 'manual'), 197 | ] 198 | 199 | # The name of an image file (relative to this directory) to place at the top of 200 | # the title page. 201 | #latex_logo = None 202 | 203 | # For "manual" documents, if this is true, then toplevel headings are parts, 204 | # not chapters. 205 | #latex_use_parts = False 206 | 207 | # If true, show page references after internal links. 208 | #latex_show_pagerefs = False 209 | 210 | # If true, show URL addresses after external links. 211 | #latex_show_urls = False 212 | 213 | # Documents to append as an appendix to all manuals. 214 | #latex_appendices = [] 215 | 216 | # If false, no module index is generated. 217 | #latex_domain_indices = True 218 | 219 | 220 | # -- Options for manual page output ------------------------------------------ 221 | 222 | # One entry per manual page. List of tuples 223 | # (source start file, name, description, authors, manual section). 224 | man_pages = [ 225 | ('index', 'symmetry', u'symmetry Documentation', 226 | [__author__], 1) 227 | ] 228 | 229 | # If true, show URL addresses after external links. 230 | #man_show_urls = False 231 | 232 | 233 | # -- Options for Texinfo output ---------------------------------------------- 234 | 235 | # Grouping the document tree into Texinfo files. List of tuples 236 | # (source start file, target name, title, author, 237 | # dir menu entry, description, category) 238 | texinfo_documents = [ 239 | ('index', 'symmetry', u'symmetry Documentation', 240 | __author__, 'symmetry', 'One line description of project.', 241 | 'Miscellaneous'), 242 | ] 243 | 244 | # Documents to append as an appendix to all manuals. 245 | #texinfo_appendices = [] 246 | 247 | # If false, no module index is generated. 248 | #texinfo_domain_indices = True 249 | 250 | # How to display URL addresses: 'footnote', 'no', or 'inline'. 251 | #texinfo_show_urls = 'footnote' 252 | 253 | 254 | # -- Options for Epub output --------------------------------------------------- 255 | 256 | # Bibliographic Dublin Core info. 257 | epub_title = u'symmetry' 258 | epub_author = __author__ 259 | epub_publisher = u'Shyue Ping Ong' 260 | epub_copyright = copyright 261 | 262 | # The language of the text. It defaults to the language option 263 | # or en if the language is not set. 264 | #epub_language = '' 265 | 266 | # The scheme of the identifier. Typical schemes are ISBN or URL. 267 | #epub_scheme = '' 268 | 269 | # The unique identifier of the text. This can be a ISBN number 270 | # or the project homepage. 271 | #epub_identifier = '' 272 | 273 | # A unique identification for the text. 274 | #epub_uid = '' 275 | 276 | # A tuple containing the cover image and cover page html template filenames. 277 | #epub_cover = () 278 | 279 | # HTML files that should be inserted before the pages created by sphinx. 280 | # The format is a list of tuples containing the path and title. 281 | #epub_pre_files = [] 282 | 283 | # HTML files shat should be inserted after the pages created by sphinx. 284 | # The format is a list of tuples containing the path and title. 285 | #epub_post_files = [] 286 | 287 | # A list of files that should not be packed into the epub file. 288 | #epub_exclude_files = [] 289 | 290 | # The depth of the table of contents in toc.ncx. 291 | #epub_tocdepth = 3 292 | 293 | # Allow duplicate toc entries. 294 | #epub_tocdup = True 295 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | .. symmetry documentation master file, created by 2 | sphinx-quickstart on Tue Nov 15 00:13:52 2011. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Introduction 7 | ============ 8 | 9 | Symmetry is a library for materials symmetry analysis written by Professor 10 | Shyue Ping Ong for his class NANO 106 on Crystallography of Materials. 11 | 12 | *The code is mightier than the pen.* 13 | 14 | Latest Change Log 15 | ================= 16 | 17 | v0.1.0 18 | ------ 19 | 1. First actual working release. 20 | 21 | Stable version 22 | -------------- 23 | 24 | The version at the Python Package Index (PyPI) is always the latest stable 25 | release that will be hopefully, be relatively bug-free. The easiest way to 26 | install symmetry on any system is to use easy_install or pip, as follows:: 27 | 28 | easy_install symmetry 29 | 30 | or:: 31 | 32 | pip install symmetry 33 | 34 | Developmental version 35 | --------------------- 36 | 37 | The bleeding edge developmental version is at the NANO 106's `Github repo 38 | `_. The developmental 39 | version is likely to be more buggy, but may contain new features. The 40 | Github version include test files as well for complete unit testing. After 41 | cloning the source, you can type:: 42 | 43 | python setup.py install 44 | 45 | or to install the package in developmental mode:: 46 | 47 | python setup.py develop 48 | 49 | Running unittests 50 | ~~~~~~~~~~~~~~~~~ 51 | 52 | To run the very comprehensive suite of unittests included with the 53 | developmental version, make sure you have nose installed and then just type:: 54 | 55 | nosetests 56 | 57 | in the symmetry root directory. 58 | 59 | API docs 60 | -------- 61 | 62 | .. toctree:: 63 | :maxdepth: 2 64 | 65 | symmetry 66 | 67 | 68 | Acknowledgements 69 | ==================== 70 | 71 | ## Acknowledgements 72 | 73 | The author uses the following textbooks and much of the code and material 74 | contained therein is based on concepts in these books. They are highly 75 | recommended for students of crystallography, symmetry and its implications 76 | for material properties. 77 | 78 | 1. Structure of Materials: An Introduction to Crystallography, Diffraction and 79 | Symmetry by Marc De Graef and Michael E. McHenry 80 | 2. Properties of Materials: Anisotropy, Symmetry, Structure by Robert E. 81 | Newnham 82 | 83 | License 84 | ======= 85 | 86 | Symmetry is released under the BSD License. The terms of the license are as 87 | follows:: 88 | 89 | Copyright (c) 2014, Materials Virtual Lab 90 | All rights reserved. 91 | 92 | Redistribution and use in source and binary forms, with or without 93 | modification, are permitted provided that the following conditions are met: 94 | 95 | * Redistributions of source code must retain the above copyright notice, this 96 | list of conditions and the following disclaimer. 97 | 98 | * Redistributions in binary form must reproduce the above copyright notice, 99 | this list of conditions and the following disclaimer in the documentation 100 | and/or other materials provided with the distribution. 101 | 102 | * Neither the name of the {organization} nor the names of its 103 | contributors may be used to endorse or promote products derived from 104 | this software without specific prior written permission. 105 | 106 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 107 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 108 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 109 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 110 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 111 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 112 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 113 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 114 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 115 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 116 | 117 | Indices and tables 118 | ================== 119 | 120 | * :ref:`genindex` 121 | * :ref:`modindex` 122 | * :ref:`search` 123 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | REM Command file for Sphinx documentation 4 | 5 | if "%SPHINXBUILD%" == "" ( 6 | set SPHINXBUILD=sphinx-build 7 | ) 8 | set BUILDDIR=_build 9 | set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . 10 | set I18NSPHINXOPTS=%SPHINXOPTS% . 11 | if NOT "%PAPER%" == "" ( 12 | set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% 13 | set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% 14 | ) 15 | 16 | if "%1" == "" goto help 17 | 18 | if "%1" == "help" ( 19 | :help 20 | echo.Please use `make ^` where ^ is one of 21 | echo. html to make standalone HTML files 22 | echo. dirhtml to make HTML files named index.html in directories 23 | echo. singlehtml to make a single large HTML file 24 | echo. pickle to make pickle files 25 | echo. json to make JSON files 26 | echo. htmlhelp to make HTML files and a HTML help project 27 | echo. qthelp to make HTML files and a qthelp project 28 | echo. devhelp to make HTML files and a Devhelp project 29 | echo. epub to make an epub 30 | echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter 31 | echo. text to make text files 32 | echo. man to make manual pages 33 | echo. texinfo to make Texinfo files 34 | echo. gettext to make PO message catalogs 35 | echo. changes to make an overview over all changed/added/deprecated items 36 | echo. linkcheck to check all external links for integrity 37 | echo. doctest to run all doctests embedded in the documentation if enabled 38 | goto end 39 | ) 40 | 41 | if "%1" == "clean" ( 42 | for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i 43 | del /q /s %BUILDDIR%\* 44 | goto end 45 | ) 46 | 47 | if "%1" == "html" ( 48 | %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html 49 | if errorlevel 1 exit /b 1 50 | echo. 51 | echo.Build finished. The HTML pages are in %BUILDDIR%/html. 52 | goto end 53 | ) 54 | 55 | if "%1" == "dirhtml" ( 56 | %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml 57 | if errorlevel 1 exit /b 1 58 | echo. 59 | echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. 60 | goto end 61 | ) 62 | 63 | if "%1" == "singlehtml" ( 64 | %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml 65 | if errorlevel 1 exit /b 1 66 | echo. 67 | echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. 68 | goto end 69 | ) 70 | 71 | if "%1" == "pickle" ( 72 | %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle 73 | if errorlevel 1 exit /b 1 74 | echo. 75 | echo.Build finished; now you can process the pickle files. 76 | goto end 77 | ) 78 | 79 | if "%1" == "json" ( 80 | %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json 81 | if errorlevel 1 exit /b 1 82 | echo. 83 | echo.Build finished; now you can process the JSON files. 84 | goto end 85 | ) 86 | 87 | if "%1" == "htmlhelp" ( 88 | %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp 89 | if errorlevel 1 exit /b 1 90 | echo. 91 | echo.Build finished; now you can run HTML Help Workshop with the ^ 92 | .hhp project file in %BUILDDIR%/htmlhelp. 93 | goto end 94 | ) 95 | 96 | if "%1" == "qthelp" ( 97 | %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp 98 | if errorlevel 1 exit /b 1 99 | echo. 100 | echo.Build finished; now you can run "qcollectiongenerator" with the ^ 101 | .qhcp project file in %BUILDDIR%/qthelp, like this: 102 | echo.^> qcollectiongenerator %BUILDDIR%\qthelp\symmetry.qhcp 103 | echo.To view the help file: 104 | echo.^> assistant -collectionFile %BUILDDIR%\qthelp\symmetry.ghc 105 | goto end 106 | ) 107 | 108 | if "%1" == "devhelp" ( 109 | %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp 110 | if errorlevel 1 exit /b 1 111 | echo. 112 | echo.Build finished. 113 | goto end 114 | ) 115 | 116 | if "%1" == "epub" ( 117 | %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub 118 | if errorlevel 1 exit /b 1 119 | echo. 120 | echo.Build finished. The epub file is in %BUILDDIR%/epub. 121 | goto end 122 | ) 123 | 124 | if "%1" == "latex" ( 125 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 126 | if errorlevel 1 exit /b 1 127 | echo. 128 | echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. 129 | goto end 130 | ) 131 | 132 | if "%1" == "text" ( 133 | %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text 134 | if errorlevel 1 exit /b 1 135 | echo. 136 | echo.Build finished. The text files are in %BUILDDIR%/text. 137 | goto end 138 | ) 139 | 140 | if "%1" == "man" ( 141 | %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man 142 | if errorlevel 1 exit /b 1 143 | echo. 144 | echo.Build finished. The manual pages are in %BUILDDIR%/man. 145 | goto end 146 | ) 147 | 148 | if "%1" == "texinfo" ( 149 | %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo 150 | if errorlevel 1 exit /b 1 151 | echo. 152 | echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. 153 | goto end 154 | ) 155 | 156 | if "%1" == "gettext" ( 157 | %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale 158 | if errorlevel 1 exit /b 1 159 | echo. 160 | echo.Build finished. The message catalogs are in %BUILDDIR%/locale. 161 | goto end 162 | ) 163 | 164 | if "%1" == "changes" ( 165 | %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes 166 | if errorlevel 1 exit /b 1 167 | echo. 168 | echo.The overview file is in %BUILDDIR%/changes. 169 | goto end 170 | ) 171 | 172 | if "%1" == "linkcheck" ( 173 | %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck 174 | if errorlevel 1 exit /b 1 175 | echo. 176 | echo.Link check complete; look for any errors in the above output ^ 177 | or in %BUILDDIR%/linkcheck/output.txt. 178 | goto end 179 | ) 180 | 181 | if "%1" == "doctest" ( 182 | %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest 183 | if errorlevel 1 exit /b 1 184 | echo. 185 | echo.Testing of doctests in the sources finished, look at the ^ 186 | results in %BUILDDIR%/doctest/output.txt. 187 | goto end 188 | ) 189 | 190 | :end 191 | -------------------------------------------------------------------------------- /docs/modules.rst: -------------------------------------------------------------------------------- 1 | symmetry 2 | ======== 3 | 4 | .. toctree:: 5 | :maxdepth: 4 6 | 7 | symmetry 8 | -------------------------------------------------------------------------------- /docs/proBlue/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010, Kasey Kelly, Issac Kelly 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | Neither the name "Kelly Creative Tech" nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 9 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /docs/proBlue/README.txt: -------------------------------------------------------------------------------- 1 | This is the proBlue theme for Sphinx. 2 | 3 | http://www.kellycreativetech.com/Blog/entry/ProBlue_Sphinx_Theme/ 4 | 5 | You can install it by putting it in your docs directory (next to _static) 6 | then you can set in your conf.py 7 | 8 | html_theme = 'proBlue' 9 | html_theme_path = ["."] -------------------------------------------------------------------------------- /docs/proBlue/static/proBlue.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Sphinx stylesheet -- default theme 3 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | */ 5 | 6 | @import url("basic.css"); 7 | 8 | /* -- fontfaces ----------------------------------------------------------- */ 9 | @import url(http://fonts.googleapis.com/css?family=Droid+Sans:regular,bold); 10 | @import url(http://fonts.googleapis.com/css?family=Droid+Sans+Mono); 11 | 12 | @import url(http://fonts.googleapis.com/css?family=Josefin+Sans+Std+Light); 13 | /* -- page layout ----------------------------------------------------------- */ 14 | 15 | body { 16 | font-family: 'Droid Sans', helvetica, arial, serif; 17 | font-size: 100%; 18 | background-color: #111111; 19 | color: #555555; 20 | margin: 0; 21 | padding: 0; 22 | } 23 | 24 | div.documentwrapper { 25 | float: left; 26 | width: 100%; 27 | } 28 | 29 | div.bodywrapper { 30 | margin: 0 0 0 300px; 31 | } 32 | 33 | hr{ 34 | border: 1px solid #B1B4B6; 35 | } 36 | 37 | div.document { 38 | background-color: #ececec; 39 | } 40 | 41 | div.body { 42 | background-color: #fafafa; 43 | color: #3E4349; 44 | padding: 1em 30px 30px 30px; 45 | font-size: 1em; 46 | border-left:1px solid #ddd; 47 | } 48 | 49 | div.footer { 50 | color: #999; 51 | width: 100%; 52 | padding: 9px 0 18px; 53 | text-align: center; 54 | font-size: 60%; 55 | background: #fff; 56 | } 57 | 58 | div.footer a { 59 | color: #444; 60 | } 61 | div.footer a:hover, div.related a:hover { 62 | border-bottom:1px solid #4362b0; 63 | } 64 | div.related { 65 | background-color: #0046c0; 66 | background-image: -moz-linear-gradient(top, #0046c0, #173fa2); /* FF3.6 */ 67 | background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #0046c0),color-stop(1, #173fa2)); /* Saf4+, Chrome */ 68 | filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#0046c0', EndColorStr='#173fa2'); /* IE6,IE7 */ 69 | -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#0046c0', EndColorStr='#173fa2')"; /* IE8 */ 70 | line-height: 54px; 71 | color: #ffffff; 72 | text-shadow: 0px 1px 1px rgba(0,0,0,0.4); 73 | font-size: 1.1em; 74 | } 75 | 76 | div.related a { 77 | color: #fff; 78 | } 79 | 80 | div.related .right { 81 | font-size: 0.9em; 82 | } 83 | 84 | div.sphinxsidebar { 85 | font-size: 0.9em; 86 | line-height: 1.5em; 87 | width: 300px 88 | } 89 | div.sphinxsidebar a{ 90 | display:block; 91 | border-bottom:1px solid #ccc; 92 | } 93 | 94 | div.sphinxsidebarwrapper{ 95 | padding: 20px 0; 96 | } 97 | 98 | div.sphinxsidebar h3, 99 | div.sphinxsidebar h4 { 100 | font-family: 'Josefin Sans Std Light', arial, serif; 101 | color: #222; 102 | font-size: 1.6em; 103 | font-weight: normal; 104 | margin: 0; 105 | padding: 24px 10px 0; 106 | text-shadow: 1px 1px 1px white; 107 | } 108 | 109 | div.sphinxsidebar h3 a { 110 | color: #222; 111 | } 112 | 113 | div.sphinxsidebar p { 114 | color: #888888; 115 | padding: 5px 20px; 116 | margin: 0.5em 0px; 117 | } 118 | 119 | div.sphinxsidebar p.topless { 120 | } 121 | 122 | div.sphinxsidebar ul { 123 | margin: 10px 10px 10px 20px; 124 | padding: 0; 125 | } 126 | 127 | div.sphinxsidebar ul ul, div.sphinxsidebar ul.want-points{ 128 | list-style:none; 129 | margin: 10px 0 10px 20px; 130 | } 131 | div.sphinxsidebar ul li{ 132 | font-size:16px; 133 | } 134 | 135 | div.sphinxsidebar ul li li{ 136 | font-size:12px; 137 | } 138 | 139 | div.sphinxsidebar li a { 140 | color: #333; 141 | display:block; 142 | border-bottom:1px solid #ccc; 143 | } 144 | div.sphinxsidebar li a:hover, div.sphinxsidebar a:hover { 145 | border-bottom:1px solid #c07100; 146 | } 147 | div.sphinxsidebar li li a { 148 | color: #555; 149 | border-bottom:1px solid #ddd; 150 | } 151 | 152 | div.sphinxsidebar a:hover { 153 | color: #c07100; 154 | } 155 | 156 | div.sphinxsidebar input { 157 | border: 1px solid #ddd; 158 | border-bottom: 1px solid #bbb; 159 | font-family: 'Droid Sans', helvetica, arial, serif; 160 | font-size: 1.2em; 161 | padding: 0.2em 0.1em; 162 | -moz-box-shadow: 0px 0px 3px rgba(0,0,0,0.1); 163 | -webkit-box-shadow: 0px 0px 3px rgba(0,0,0,0.1); 164 | box-shadow: 0px 0px 3px rgba(0,0,0,0.1); 165 | } 166 | div.sphinxsidebar input:focus { 167 | border: 1px solid #bbb; 168 | border-bottom: 1px solid #999; 169 | } 170 | div.sphinxsidebar input[type=text]{ 171 | margin-left: 20px; 172 | padding: 0.23em 0.4em; 173 | color:#333; 174 | } 175 | div.sphinxsidebar input[type=submit]{ 176 | background-color: #0046c0; 177 | background-image: -moz-linear-gradient(top, #0046c0, #173fa2); /* FF3.6 */ 178 | background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #0046c0),color-stop(1, #173fa2)); /* Saf4+, Chrome */ 179 | filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#0046c0', EndColorStr='#173fa2'); /* IE6,IE7 */ 180 | -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#0046c0', EndColorStr='#173fa2')"; /* IE8 */ 181 | color:#fff; 182 | cursor: pointer; 183 | } 184 | div.sphinxsidebar input[type=submit]:hover{ 185 | background-color: #0353e3; 186 | background-image: -moz-linear-gradient(top, #0353e3, #063da0); /* FF3.6 */ 187 | background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #0353e3),color-stop(1, #063da0)); /* Saf4+, Chrome */ 188 | filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#0353e3', EndColorStr='#063da0'); /* IE6,IE7 */ 189 | -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#0353e3', EndColorStr='#063da0')"; /* IE8 */ 190 | } 191 | 192 | div.sphinxsidebar input[type=submit]:active{ 193 | background-image: -moz-linear-gradient(top, #0b34ce, #052392); /* FF3.6 */ 194 | background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #0b34ce),color-stop(1, #052392)); /* Saf4+, Chrome */ 195 | filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#0b34ce', EndColorStr='#052392'); /* IE6,IE7 */ 196 | -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#0b34ce', EndColorStr='#052392')"; /* IE8 */ 197 | } 198 | 199 | 200 | 201 | /* -- body styles ----------------------------------------------------------- */ 202 | 203 | a { 204 | color: #0046c0; 205 | text-decoration: none; 206 | } 207 | 208 | a:hover { 209 | color: #c07100; 210 | border-bottom:1px solid #eee; 211 | } 212 | 213 | div.body h1, 214 | div.body h2, 215 | div.body h3, 216 | div.body h4, 217 | div.body h5, 218 | div.body h6 { 219 | font-family: 'Josefin Sans Std Light', arial, serif; 220 | font-weight: normal; 221 | color: #000; 222 | margin: 36px 0px 9px 0px; 223 | padding: 5px 0 5px 0px; 224 | text-shadow: 0px 1px 0 white; 225 | border-bottom: 1px solid #ddd; 226 | } 227 | 228 | div.body h1 { margin-top: 0; font-size: 250%; } 229 | div.body h2 { font-size: 200%; } 230 | div.body h3 { font-size: 180%; } 231 | div.body h4 { font-size: 150%; } 232 | div.body h5 { font-size: 130%; } 233 | div.body h6 { font-size: 120%; } 234 | 235 | a.headerlink { 236 | color: #c07100; 237 | font-size: 0.8em; 238 | padding: 0 4px 0 4px; 239 | text-decoration: none; 240 | } 241 | 242 | a.headerlink:hover { 243 | background-color: #c07100; 244 | color: white; 245 | } 246 | 247 | div.body p, div.body dd, div.body li { 248 | line-height: 1.5em; 249 | } 250 | div.body p{ 251 | margin:1.2em 0; 252 | } 253 | div.admonition p.admonition-title + p { 254 | display: inline; 255 | } 256 | 257 | div.highlight{ 258 | background-color: white; 259 | } 260 | 261 | div.note { 262 | background-color: #eeeeee; 263 | border: 1px solid #cccccc; 264 | } 265 | 266 | div.seealso { 267 | background-color: #ffffcc; 268 | border: 1px solid #ffff66; 269 | } 270 | 271 | div.topic { 272 | background-color: #fafafa; 273 | border-width: 0; 274 | } 275 | 276 | div.warning { 277 | background-color: #ffe4e4; 278 | border: 1px solid #ff6666; 279 | } 280 | 281 | p.admonition-title { 282 | display: inline; 283 | } 284 | 285 | p.admonition-title:after { 286 | content: ":"; 287 | } 288 | 289 | pre { 290 | font: 12px/18px 'Droid Sans Mono', arial, serif; 291 | padding: 10px; 292 | background-color: #fcfeee; 293 | border:1px solid #ddd; 294 | color: #222222; 295 | line-height: 1.5em; 296 | font-size: 1em; 297 | margin: 1.5em 0 1.5em 0; 298 | -webkit-box-shadow: 0px 0px 4px #d8d8d8; 299 | -moz-box-shadow: 0px 0px 4px #d8d8d8; 300 | box-shadow: 0px 0px 4px #d8d8d8; 301 | } 302 | .pre{ 303 | font-family: 'Droid Sans Mono', arial, serif; 304 | 305 | } 306 | 307 | tt { 308 | color: #222222; 309 | padding: 1px 2px; 310 | font-size: 1.2em; 311 | font-family: monospace; 312 | } 313 | 314 | #table-of-contents ul { 315 | padding-left: 2em; 316 | } 317 | -------------------------------------------------------------------------------- /docs/proBlue/theme.conf: -------------------------------------------------------------------------------- 1 | [theme] 2 | inherit = nature 3 | stylesheet = proBlue.css 4 | -------------------------------------------------------------------------------- /docs/symmetry.rst: -------------------------------------------------------------------------------- 1 | symmetry package 2 | ================ 3 | 4 | symmetry.groups module 5 | ---------------------- 6 | 7 | .. automodule:: symmetry.groups 8 | :members: 9 | :undoc-members: 10 | :show-inheritance: 11 | 12 | -------------------------------------------------------------------------------- /fabfile.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """ 4 | Deployment file to facilitate releases of symmetry. 5 | """ 6 | 7 | from __future__ import division 8 | 9 | __author__ = "Shyue Ping Ong" 10 | __copyright__ = "Copyright 2012, The Materials Project" 11 | __version__ = "0.1" 12 | __maintainer__ = "Shyue Ping Ong" 13 | __email__ = "shyue@mit.edu" 14 | __date__ = "Apr 29, 2012" 15 | 16 | import glob 17 | import os 18 | 19 | from fabric.api import local, lcd 20 | from symmetry import __version__ as ver 21 | 22 | 23 | def makedoc(): 24 | with lcd("docs"): 25 | local("sphinx-apidoc -o . -f ../symmetry") 26 | local("rm symmetry*.tests.rst") 27 | for f in glob.glob("docs/*.rst"): 28 | if f.startswith('docs/symmetry') and f.endswith('rst'): 29 | newoutput = [] 30 | suboutput = [] 31 | subpackage = False 32 | with open(f, 'r') as fid: 33 | for line in fid: 34 | clean = line.strip() 35 | if clean == "Subpackages": 36 | subpackage = True 37 | if not subpackage and not clean.endswith("tests"): 38 | newoutput.append(line) 39 | else: 40 | if not clean.endswith("tests"): 41 | suboutput.append(line) 42 | if clean.startswith("symmetry") and not clean.endswith("tests"): 43 | newoutput.extend(suboutput) 44 | subpackage = False 45 | suboutput = [] 46 | 47 | with open(f, 'w') as fid: 48 | fid.write("".join(newoutput)) 49 | 50 | local("make html") 51 | 52 | 53 | def publish(): 54 | local("python setup.py release") 55 | 56 | 57 | def test(): 58 | local("nosetests") 59 | 60 | 61 | def setver(): 62 | local("sed s/version=.*,/version=\\\"{}\\\",/ setup.py > newsetup".format(ver)) 63 | local("mv newsetup setup.py") 64 | 65 | 66 | def release(): 67 | setver() 68 | test() 69 | makedoc() 70 | publish() 71 | 72 | def opendoc(): 73 | import webbrowser 74 | pth = os.path.abspath("docs/_build/html/index.html") 75 | webbrowser.open("file://" + pth) 76 | -------------------------------------------------------------------------------- /grades/Spring2015/Final.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/grades/Spring2015/Final.png -------------------------------------------------------------------------------- /grades/Spring2015/Mid-term 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/grades/Spring2015/Mid-term 1.png -------------------------------------------------------------------------------- /grades/Spring2015/Mid-term 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/grades/Spring2015/Mid-term 2.png -------------------------------------------------------------------------------- /grades/Spring2015/PS1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/grades/Spring2015/PS1.png -------------------------------------------------------------------------------- /grades/Spring2015/PS2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/grades/Spring2015/PS2.png -------------------------------------------------------------------------------- /grades/Spring2015/PS3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/grades/Spring2015/PS3.png -------------------------------------------------------------------------------- /grades/Spring2015/PS4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/grades/Spring2015/PS4.png -------------------------------------------------------------------------------- /grades/Spring2015/PS5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/grades/Spring2015/PS5.png -------------------------------------------------------------------------------- /grades/Spring2015/Weighted Total.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/grades/Spring2015/Weighted Total.png -------------------------------------------------------------------------------- /lectures/handouts/32.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/32.pdf -------------------------------------------------------------------------------- /lectures/handouts/32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/32.png -------------------------------------------------------------------------------- /lectures/handouts/CrystalvsCartesian.graffle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/CrystalvsCartesian.graffle -------------------------------------------------------------------------------- /lectures/handouts/CrystalvsCartesian.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/CrystalvsCartesian.pdf -------------------------------------------------------------------------------- /lectures/handouts/Exam Handout.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/Exam Handout.pdf -------------------------------------------------------------------------------- /lectures/handouts/Handout 1 - Linear Algebra and Lattice Computations.md: -------------------------------------------------------------------------------- 1 | LaTeX input: mmd-mavrldoc-header 2 | Title: NANO106 Handout 1 - Linear Algebra and Lattice Computations 3 | Author: Shyue Ping Ong 4 | Affiliation: University of California, San Diego 5 | Address: 9500 Gilman Drive, Mail Code 0448, La Jolla, CA 92093-0448 6 | Web: http://www.materialsvirtuallab.org 7 | Base Header Level: 2 8 | LaTeX Mode: mavrldoc 9 | LaTeX input: mmd-mavrldoc-begin-doc 10 | LaTeX footer: mmd-mavrldoc-footer 11 | xhtml header: 12 | 13 | 14 | # Introduction 15 | 16 | This document provides a summary of the basic linear algebra concepts and their 17 | application in crystallography. 18 | 19 | # Notation and definitions 20 | 21 | Let us define a series of consistent notations. Note that all vectors are 22 | written in *column* format for consistency. All vectors are **bolded**. 23 | 24 | | Quantity | Notation | 25 | | -------- | -------- | 26 | | Lattice basis vectors | $\mathbf{a_1}$, $\mathbf{a_2}$, $\mathbf{a_3}$ or $\mathbf{a}$, $\mathbf{b}$, $\mathbf{c}$ | 27 | | Cartesian coordinate vectors | $\mathbf{x}$ or $\mathbf{y}$ | 28 | | Crystal coordinate vectors | $\mathbf{p}$ or $\mathbf{q}$ | 29 | | Metric tensor | $g$ | 30 | 31 | \\[\textbf{x} = \begin{pmatrix}x_1\\x_2\\x_3\end{pmatrix}\\] 32 | \\[\textbf{p} = \begin{pmatrix}p_1\\p_2\\p_3\end{pmatrix}\\] 33 | 34 | For matrices, we will use simple $\mathbf{A}$ and $\mathbf{B}$ to denote them. 35 | $\mathbf{E}$ refers to the identity matrix. In the full form, we denote each element 36 | as $a_{ij}$. E.g. 37 | 38 | \\[ 39 | \mathbf{A} = \begin{pmatrix}a_{11} & a_{12} & a_{13}\\ a_{21} & a_{22} & a_{23}\\ a_{31} & a_{32} & a_{33}\end{pmatrix} 40 | \\] 41 | 42 | Transposes and inverses are indicated by superscript $T$ and $-1$ respectively, e.g., 43 | $\mathbf{A}^T$ and $\mathbf{A}^{-1}$. 44 | 45 | # Required Linear Algebra Relations 46 | 47 | We will start with the standard linear algebra relations in Cartesian coordinates. 48 | Make sure you understand the difference between Cartesian and crystal coordinates. 49 | They are not the same thing and you need to use different formulas for them. 50 | 51 | ## Norm of a vector in Cartesian coordinates 52 | 53 | \\[ 54 | \begin{aligned} 55 | |\mathbf{x}| & = \sqrt{\mathbf{x} \cdot \mathbf{x}}\\ 56 | & = \sqrt{\mathbf{x}^T \mathbf{x}}\\ 57 | &= \sqrt{x_1^2 + x_2^2 + x_3^2} 58 | \end{aligned} 59 | \\] 60 | 61 | ## Dot product in Cartesian coordinates 62 | 63 | \\[ 64 | \begin{aligned} 65 | \mathbf{x} \cdot \mathbf{y} &= \begin{pmatrix}x_1\\x_2\\x_3\end{pmatrix} \cdot \begin{pmatrix}y_1\\y_2\\y_3\end{pmatrix}\\ 66 | &= x_1y_1 + x_2y_2 + x_3y_3\\ 67 | & = |\mathbf{x}||\mathbf{y}| \cos \theta 68 | \end{aligned} 69 | \\] 70 | 71 | Finding the angle between two vectors in Cartesian coordinates 72 | \\[ 73 | \theta = \cos^{-1}\frac{\mathbf{x}\cdot\mathbf{y}}{|\mathbf{x}||\mathbf{y}|} 74 | \\] 75 | 76 | ## Cross product in Cartesian coordinates 77 | 78 | \\[ \mathbf{x} \times \mathbf{y} = \begin{pmatrix}x_1\\x_2\\x_3\end{pmatrix} \times \begin{pmatrix}y_1\\y_2\\y_3\end{pmatrix} = \begin{pmatrix}x_2y_3 - x_3y_2\\-(x_1y_3 - x_3y_1)\\x_1y_2 - x_2y_1\end{pmatrix} 79 | \\] 80 | 81 | ## Some matrix relations 82 | 83 | \\[ 84 | \begin{aligned} 85 | (\mathbf{A} \mathbf{B})^T & = \mathbf{B}^T\mathbf{A}^T \\ 86 | (\mathbf{A} + \mathbf{B}) \mathbf{C} & = \mathbf{A}\mathbf{C} + \mathbf{B}\mathbf{C}\\ 87 | \mathbf{A}\mathbf{A}^{-1} & = \mathbf{A}^{-1}\mathbf{A} = \mathbf{E} 88 | \end{aligned} 89 | \\] 90 | 91 | ## Finding the determinant and inverse of a $3 \times 3$ matrix. 92 | 93 | \\[ 94 | \begin{aligned} 95 | \det(\mathbf{A}) &= \begin{vmatrix}a_{11} & a_{12} & a_{13}\\ a_{21} & a_{22} & a_{23}\\ a_{31} & a_{32} & a_{33}\end{vmatrix} 96 | \\&= a_{11} (a_{22}a_{33}-a_{32}a_{23}) - 97 | a_{12} (a_{21}a_{33}-a_{31}a_{23}) + a_{13} (a_{21}a_{32}-a_{31}a_{22}) 98 | \end{aligned} 99 | \\] 100 | 101 | \\[ 102 | \mathbf{A}^{-1} = \frac{1}{\det(\mathbf{A})}\begin{pmatrix}a_{22}a_{33}-a_{32}a_{23} & a_{13}a_{32}-a_{33}a_{12} & a_{12}a_{23}-a_{22}a_{13}\\ a_{23}a_{31}-a_{33}a_{21} & a_{11}a_{33}-a_{31}a_{13} & a_{13}a_{21}-a_{23}a_{11}\\ a_{21}a_{32}-a_{31}a_{22} & a_{12}a_{31}-a_{32}a_{11} & a_{11}a_{22}-a_{21}a_{12}\end{pmatrix} 103 | \\] 104 | 105 | # Crystal Coordinates 106 | 107 | ![Crystal vs Cartesian coordinates](CrystalvsCartesian.pdf) 108 | 109 | Refer to the figure above. The figure on the left represents a crystal. In general, 110 | the lattice vectors $\mathbf{a}$, $\mathbf{b}$, $\mathbf{c}$ may not be orthogonal to 111 | each other, and are not of unit length. On the right, we have the Cartesian 112 | coordinate system where the basis vectors are orthogonal and unit length. 113 | 114 | Consider the point P in the crystal, which has *crystal coordinates* (also known 115 | as *fractional* or *direct* coordinates) denoted by [u, v, w]. In the example 116 | above, the crystal coordinates are [0.25, 0.25, 0.25]. The conversion from 117 | crystal coordinates to Cartesian coordinates is given as: 118 | 119 | \\[ 120 | \mathbf{x} = u \mathbf{a} + v \mathbf{b} + w \mathbf{c} 121 | \\] 122 | 123 | For the sake of illustration, let's say the lattice vectors, when expressed in the 124 | Cartesian coordinate system are: 125 | 126 | \\[ 127 | \begin{aligned} 128 | \mathbf{a} = \begin{pmatrix}2\\0\\0\end{pmatrix}, 129 | \mathbf{b} = \begin{pmatrix}-1\\3\\0\end{pmatrix}, 130 | \mathbf{c} = \begin{pmatrix}0\\0\\4\end{pmatrix} 131 | \end{aligned} 132 | \\] 133 | 134 | The Cartesian coordinates of point P are then: 135 | 136 | \\[ 137 | \mathbf{x} = 0.25 \begin{pmatrix}2\\0\\0\end{pmatrix} + 0.25 \begin{pmatrix}-1\\3\\0\end{pmatrix} + 0.25 \begin{pmatrix}0\\0\\4\end{pmatrix} = \begin{pmatrix}0.25\\0.75\\1\end{pmatrix} 138 | \\] 139 | 140 | Note that the **crystal coordinates are different from the Cartesian coordinates**. 141 | The crystal coordinates are the coordinates defined in the vector space formed by the 142 | lattice vectors. In crystallography, you frequently work with crystal coordinates. 143 | To compute things like distances, angles, etc. you can either convert your crystal 144 | coordinates to Cartesian first before using your usual Cartesian relations, or you 145 | can use the metric tensor to perform the necessary dot products and distances 146 | computations directly from your crystal coordinates. 147 | 148 | # Calculating lattice parameters 149 | 150 | Given a set of basis vectors $\mathbf{a}$, $\mathbf{b}$, $\mathbf{c}$, the lattice parameters are given by: 151 | 152 | \\[ 153 | \begin{aligned} 154 | a & = |\mathbf{a}|\\ 155 | b & = |\mathbf{b}|\\ 156 | c & = |\mathbf{c}|\\ 157 | \alpha & = \cos^{-1}\frac{\mathbf{b}\cdot\mathbf{c}}{|\mathbf{b}||\mathbf{c}|}\\ 158 | \beta & = \cos^{-1}\frac{\mathbf{a}\cdot\mathbf{c}}{|\mathbf{a}||\mathbf{c}|}\\ 159 | \gamma & = \cos^{-1}\frac{\mathbf{a}\cdot\mathbf{b}}{|\mathbf{a}||\mathbf{b}|} 160 | \end{aligned} 161 | \\] 162 | 163 | # Relations in crystal coordinates 164 | 165 | For a lattice with basis vectors $\mathbf{a}$, $\mathbf{b}$, $\mathbf{c}$, the 166 | metric tensor $g$ is given by: 167 | 168 | \\[ 169 | g = \begin{pmatrix}\mathbf{a}\cdot\mathbf{a} & \mathbf{a}\cdot\mathbf{b} & \mathbf{a}\cdot\mathbf{c} \\ \mathbf{b}\cdot\mathbf{a} & \mathbf{b}\cdot\mathbf{b} & \mathbf{b}\cdot\mathbf{c} \\ \mathbf{c}\cdot\mathbf{a} & \mathbf{c}\cdot\mathbf{b} & \mathbf{c}\cdot\mathbf{c} \end{pmatrix} = 170 | \begin{pmatrix} a^2 & ab \cos \gamma & ac \cos \beta \\ ab \cos \gamma & b^2 & bc \cos \alpha \\ ac \cos \beta & bc \cos \alpha & c^2 \end{pmatrix} 171 | \\] 172 | 173 | ## Dot product in crystal coordinates 174 | 175 | Dot products between crystal coordinates is not performed the same way as in 176 | Cartesian! You need to use the metric tensor to perform dot products. The dot product 177 | is given by: 178 | 179 | \\[ 180 | \mathbf{p}^Tg\mathbf{q} 181 | \\] 182 | 183 | ## Distance between points and length of vector in crystal coordinates 184 | 185 | For two points defined by $\mathbf{p}$ and $\mathbf{q}$ in crystal coordinates, 186 | 187 | \\[ 188 | \begin{aligned} 189 | d^2 &= (\mathbf{q} - \mathbf{p})^Tg(\mathbf{q} - \mathbf{p})\\ 190 | d &= \sqrt{(\mathbf{q} - \mathbf{p})^Tg(\mathbf{q} - \mathbf{p})} 191 | \end{aligned} 192 | \\] 193 | 194 | Similarly, the length of a vector $\mathbf{p}$ in crystal coordinates is given as: 195 | 196 | \\[ 197 | d = \sqrt{\mathbf{p}^Tg\mathbf{p}} 198 | \\] 199 | 200 | ## Angles in crystal coordinates 201 | 202 | For three points O, P and Q defined by $\mathbf{o}$, $\mathbf{p}$, and $\mathbf{q}$ in crystal coordinates respectively, 203 | 204 | \\[ 205 | \begin{aligned} 206 | \vec{OP} & = \mathbf{p} - \mathbf{o}\\ 207 | \vec{OQ} & = \mathbf{q} - \mathbf{o}\\ 208 | \hat{POQ} & = \cos^{-1} \frac{\vec{OP}^Tg\vec{OQ}}{|\vec{OP}||\vec{OQ}|} 209 | \end{aligned} 210 | \\] 211 | 212 | -------------------------------------------------------------------------------- /lectures/handouts/Handout 1 - Linear Algebra and Lattice Computations.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/Handout 1 - Linear Algebra and Lattice Computations.pdf -------------------------------------------------------------------------------- /lectures/handouts/Handout 10 - Einstein Notation.md: -------------------------------------------------------------------------------- 1 | LaTeX input: mmd-mavrldoc-header 2 | Title: NANO106 Handout 10 - Einstein Notation 3 | Author: Shyue Ping Ong 4 | Affiliation: University of California, San Diego 5 | Address: 9500 Gilman Drive, Mail Code 0448, La Jolla, CA 92093-0448 6 | Web: http://www.materialsvirtuallab.org 7 | Base Header Level: 2 8 | LaTeX Mode: mavrldoc 9 | LaTeX input: mmd-mavrldoc-begin-doc 10 | LaTeX footer: mmd-mavrldoc-footer 11 | xhtml header: 12 | 13 | # Introduction 14 | 15 | The Einstein notation, or Einstein summation convention, is a convention that 16 | implies summation over repeated indices. It allows us to write many 17 | relationships in a more succinct manner. For the purposes of crystallography, 18 | we will mainly be working with the range of indices over the set {1, 2, 3}. 19 | Therefore, 20 | 21 | \\[ 22 | y = c_i a_i = \sum_{i=1}^3 c_i a_i = c_1 a_1 + c_2 a_2 + c_3 a_3 23 | \\] 24 | 25 | To illustrate the power of this notation, we will now write many expressions 26 | in linear algebra in Einstein notation. 27 | 28 | ## Scalar or dot product of two column vectors 29 | 30 | \\[ 31 | \mathbf{x} \cdot \mathbf{y} = x_i y_i 32 | \\] 33 | 34 | ## Product of a matrix with column vector 35 | 36 | \\[ 37 | \begin{aligned} 38 | \mathbf{y} & = \mathbf{A} \mathbf{x} 39 | & = \begin{pmatrix}a_{11} & a_{12} & a_{13}\\ a_{21} & a_{22} & a_{23}\\ a_{31} & a_{32} & a_{33}\end{pmatrix} \begin{pmatrix}x_1\\x_2\\x_3\end{pmatrix} 40 | \end{aligned} 41 | \\] 42 | 43 | In Einstein notation, this is written as: 44 | 45 | \\[ 46 | y_i = a_{ij} x_j 47 | \\] 48 | 49 | It is important to note that non-repeated indices are "dummy" indices and have no 50 | special meaning. Only *repeated indices on the same side of the equation* implies 51 | summation. 52 | 53 | ## Product of row vector with matrix 54 | 55 | \\[ 56 | \begin{aligned} 57 | \mathbf{y}^T & = \mathbf{x}^T \mathbf{A}\\ 58 | \begin{pmatrix}y_1 & y_2 & y_3\end{pmatrix} & = \begin{pmatrix}x_1 & x_2 & x_3\end{pmatrix} \begin{pmatrix}a_{11} & a_{12} & a_{13}\\ a_{21} & a_{22} & a_{23}\\ a_{31} & a_{32} & a_{33}\end{pmatrix} 59 | \end{aligned} 60 | \\] 61 | 62 | In Einstein notation, this is written as: 63 | 64 | \\[ 65 | y_j = a_{ij} x_i 66 | \\] 67 | 68 | Be very careful about the indices! Note the difference in the order of the 69 | indices in this expression compared to that of the product of the matrix with 70 | a column vector. 71 | 72 | # The Kronecker Delta and Permutation Symbol 73 | 74 | To use the Einstein summation notation effectively, we need to introduce two 75 | additional symbols. Note that this is really more for your information on 76 | the power of this notation. We will be using the Kronecker Delta, but in this 77 | course, we will not actually be using the permutation symbol. It is included 78 | for completeness in case you see this in future. 79 | 80 | * Kronecker Delta 81 | \\[ 82 | \delta_{ij} = \begin{cases} 1, & \mbox{if } i=j\\ 0, & \mbox{if } i \ne j\end{cases} 83 | \\] 84 | * Levi-Civita or Permutation symbol 85 | \\[ 86 | \epsilon_{ijk} = \begin{cases} 0, & \mbox{for } i=j\mbox{, } j=k \mbox{ or } i=k \\ +1, & \mbox{for } (i,j,k) \in \{(1,2,3), (2,3,1), (3,1,2)\}\\-1, & \mbox{for } (i,j,k) \in \{(1,3,2), (2,1,3), (3,2,1)\}\end{cases} 87 | \\] 88 | 89 | ## Some useful relations 90 | 91 | \\[ 92 | \begin{aligned} 93 | \delta_{ij} \delta_{jk} & = \delta_{ik}\\ 94 | \delta_{ij} \epsilon_{ijk} & = 0\\ 95 | \epsilon_{ipq} \epsilon_{jpq} & = 2 \delta_{ij}\\ 96 | \epsilon_{ijk} \epsilon_{ijk} & = 6\\ 97 | \epsilon_{ijk} \epsilon_{pqk} & = \delta_{ip}\delta_{jq} -\delta_{iq}\delta_{jp} 98 | \end{aligned} 99 | \\] 100 | 101 | # Cross-product in Einstein notation 102 | 103 | If $\mathbf{e_1}$, $\mathbf{e_2}$, and $\mathbf{e_3}$ are the Cartesian unit 104 | vectors, the cross product of two vectors can be written in Einstein notation as: 105 | 106 | \\[ 107 | \mathbf{a} \times \mathbf{b} = \epsilon_{ijk} a_i b_j \mathbf{e_k} 108 | \\] 109 | 110 | # Proof of triple product using Einstein notation 111 | 112 | We can derive a formula for the triple product in Einstein notation as follows: 113 | 114 | \\[ 115 | \begin{aligned} 116 | \mathbf{a} \cdot (\mathbf{b} \times \mathbf{c}) & = a_i \mathbf{e_i} \cdot \epsilon_{jkm} b_j c_k \mathbf{e_m}\\ 117 | & = \epsilon_{jkm} a_i b_j c_k \mathbf{e_i} \cdot \mathbf{e_m}\\ 118 | & = \epsilon_{jkm} a_i b_j c_k \delta_{im}\\ 119 | & = \epsilon_{jki} a_i b_j c_k\\ 120 | & = \epsilon_{ijk} a_i b_j c_k\\ 121 | \end{aligned} 122 | \\] 123 | 124 | # Using Einstein notation in tensor properties 125 | 126 | Tensors are geometric objects that describe linear relations between vectors, 127 | scalars, and other tensors. We will be using Einstein notation extensively to 128 | work with tensors. 129 | 130 | * Rank-0 tensor: Scalar, e.g., temperature 131 | * Rank-1 tensor: Vector, e.g., pyroelectricity ($p_i$) 132 | * Rank-2 tensor: Matrix, e.g., diffusivity ($D_{ij}$) 133 | * Rank>3 tensor: Tensor, e.g., piezoelectric coefficient ($d_{ijk}$), elastic constants ($c_{ijkl}$) 134 | 135 | Some examples of denoting relationships using Einstein notation. 136 | 137 | * Relationship between diffusion flux and concentration gradient 138 | \\[ 139 | J_{i} = D_{ij} \nabla \phi_{j} 140 | \\] 141 | * Relationship between stress and strain 142 | \\[ 143 | \sigma_{ij} = c_{ijkl} \varepsilon_{kl} 144 | \\] 145 | 146 | # Transformation of Tensors 147 | 148 | If we denote $\mathbf{A}$ as the direction cosine matrix relating one set of 149 | Cartesian axes to another, i.e., 150 | 151 | \\[ 152 | \begin{pmatrix}\mathbf{e_1'}\\ \mathbf{e_2'} \\ \mathbf{e_3'}\end{pmatrix} = \mathbf{A} \begin{pmatrix}\mathbf{e_1}\\ \mathbf{e_2} \\ \mathbf{e_3}\end{pmatrix} \mbox{ where } \mathbf{A} = \begin{pmatrix}a_{11} & a_{12} & a_{13}\\ a_{21} & a_{22} & a_{23}\\ a_{31} & a_{32} & a_{33}\end{pmatrix} 153 | \\] 154 | 155 | or 156 | 157 | \\[ 158 | \begin{aligned} 159 | \mathbf{e_i'} & = a_{ij} \mathbf{e_j}\\ 160 | \mathbf{e_i} & = a_{ji} \mathbf{e_j'} 161 | \end{aligned} 162 | \\] 163 | 164 | The transformation of a tensor $r$ under the change in axes is given by: 165 | 166 | \\[ 167 | r_{ijk\ldots}' = a_{iI} a_{jJ} a_{kK} \ldots r_{IJK\ldots} 168 | \\] 169 | 170 | Note that the capital letters on the RHS are repeated indices and hence represents 171 | summation. For a rank-2 tensor, the concise notation summarizes $9 \times 9 = 81$ 172 | terms. For a rank-3 tensor, there are 729 terms, and for rank-4, there are 6561 173 | terms! 174 | -------------------------------------------------------------------------------- /lectures/handouts/Handout 10 - Einstein Notation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/Handout 10 - Einstein Notation.pdf -------------------------------------------------------------------------------- /lectures/handouts/Handout 11 - Piezoelectric coefficients for the 32 point group.md: -------------------------------------------------------------------------------- 1 | LaTeX input: mmd-mavrldoc-header 2 | Title: NANO106 Handout 11 - Piezoelectric coefficients for the 32 point group 3 | Author: Shyue Ping Ong 4 | Affiliation: University of California, San Diego 5 | Address: 9500 Gilman Drive, Mail Code 0448, La Jolla, CA 92093-0448 6 | Web: http://www.materialsvirtuallab.org 7 | Base Header Level: 2 8 | LaTeX Mode: mavrldoc 9 | LaTeX input: mmd-mavrldoc-begin-doc 10 | LaTeX footer: mmd-mavrldoc-footer 11 | xhtml header: 12 | 13 | In this handout, we will go through the full exercise of deriving the form of 14 | the piezoelectric matrix for the 32 point group, which is fairly complex. 15 | 16 | # The $32$ point group 17 | 18 | ![The 32 point group][] 19 | 20 | The IEEE standard setting for the $32$ point group is given above. The 21 | 3-fold rotation is oriented parallel to $Z_3$ and one of the 2-fold 22 | rotations is oriented parallel to $Z_1$. 23 | 24 | # General procedure for deriving symmetry restrictions 25 | 26 | The general procedure for deriving symmetry restrictions in tensors is given 27 | below. 28 | 29 | 1. Convert from Voigt to tensor notation if necessary. This is only required 30 | if you are working with higher-order tensors that utilizes the Voigt matrix 31 | form. 32 | 2. Determine the mapping of axes for the symmetry operations of the point 33 | group. 34 | 3. Apply mapping to tensor elements and Neumann's Principle. 35 | 4. Determine equalities and elements with value 0. 36 | 37 | # Piezoelectric matrix and tensor 38 | 39 | The piezoelectric matrix has the following Voigt form: 40 | \\[ 41 | \begin{pmatrix} 42 | d_{11} & d_{12} & d_{13} & d_{14} & d_{15} & d_{16}\\ 43 | d_{21} & d_{22} & d_{23} & d_{24} & d_{25} & d_{26}\\ 44 | d_{31} & d_{32} & d_{33} & d_{34} & d_{35} & d_{36} 45 | \end{pmatrix} 46 | \\] 47 | 48 | If we explicitly write out all the elements in terms of the tensor elements, 49 | we have: 50 | 51 | \\[ 52 | \begin{pmatrix} 53 | d_{111} & d_{122} & d_{133} & d_{123} + d_{132} & d_{113} + d_{131} & d_{112} + d_{121}\\ 54 | d_{211} & d_{222} & d_{233} & d_{223} + d_{232} & d_{213} + d_{231} & d_{212} + d_{221}\\ 55 | d_{311} & d_{322} & d_{333} & d_{323} + d_{332} & d_{313} + d_{331} & d_{312} + d_{321} 56 | \end{pmatrix} 57 | \\] 58 | 59 | # Symmetry constraints of the 2-fold rotation about $Z_1$ 60 | 61 | Let us start with the simpler symmetry operation of the 2-fold rotation 62 | about $Z_1$. The relationship between the rotated axes and the original axes 63 | is given as: 64 | 65 | \\[ 66 | \begin{aligned} 67 | X_1' & = X_1\\ 68 | X_2' & = -X_2\\ 69 | X_3' & = -X_3 70 | \end{aligned} 71 | \\] 72 | 73 | Let us consider the implications of this mapping on a few tensor elements. 74 | 75 | For $d_{11}$, we have $d_{11} \rightarrow d_{111}$ (Voigt to tensor). $d_{111}$ 76 | transforms as: 77 | 78 | \\[ 79 | \begin{aligned} 80 | X_1'X_1'X_1' & = X_1 X_1 X_1\\ 81 | \implies d_{111}' & = d_{111} = d_{111} \mbox{ (Neumann's Principle)} 82 | \end{aligned} 83 | \\] 84 | 85 | Hence, there are no restrictions on $d_{11}$. 86 | 87 | For $d_{21}$, we have $d_{21} \rightarrow d_{211}$ (Voigt to tensor). $d_{211}$ 88 | transforms as: 89 | 90 | \\[ 91 | \begin{aligned} 92 | X_2'X_1'X_1' & = (-X_2) X_1 X_1\\ 93 | \implies d_{211}' & = -d_{211} = d_{211} \mbox{ (Neumann's Principle)}\\ 94 | \implies d_{211} & = 0 95 | \end{aligned} 96 | \\] 97 | 98 | Hence, $d_{21} = 0$. From this result, we can infer that all tensor elements 99 | that have an odd number of indices 2 and 3 will be constrained to be 0 by the 100 | 2-fold rotation (because of the negation of the $X_2$ and $X_3$). Hence, 101 | 102 | \\[ 103 | \begin{aligned} 104 | d_{113} = d_{131} = d_{112} = d_{121} = d_{211} = d_{222} = d_{233} = d_{223} = d_{232} = d_{311} = d_{322} = d_{333} = d_{323} = d_{332} = 0\\ 105 | \implies d_{15} = d_{16} = d_{21} = d_{22} = d_{23} = d_{24} = d_{31} = d_{32} = d_{33} = d_{34} = 0 \mbox{ (after conversion to Voigt form) } 106 | \end{aligned} 107 | \\] 108 | 109 | Hence, our piezoelectric matrix is now simplified to: 110 | 111 | \\[ 112 | \begin{pmatrix} 113 | d_{11} & d_{12} & d_{13} & d_{14} & 0 & 0\\ 114 | 0 & 0 & 0 & 0 & d_{25} & d_{26}\\ 115 | 0 & 0 & 0 & 0 & d_{35} & d_{36} 116 | \end{pmatrix} 117 | \\] 118 | 119 | # Symmetry constraints of the 3-fold rotation about $Z_3$ 120 | 121 | For the 3-fold rotation about $Z_3$, the relationship between the rotated axes and the original axes is given as: 122 | 123 | \\[ 124 | \begin{aligned} 125 | \begin{pmatrix} \mathbf{e_1'} \\ \mathbf{e_2'} \\ \mathbf{e_3'} \end{pmatrix} = \begin{pmatrix} \cos{120^\circ} & -\sin{120^\circ} & 0 \\ \sin{120^\circ} & \cos{120^\circ} & 0 \\ 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} \mathbf{e_1} \\ \mathbf{e_2} \\ \mathbf{e_3} \end{pmatrix} 126 | \end{aligned} 127 | \\] 128 | 129 | Hence, the mapping is given as: 130 | 131 | \\[ 132 | \begin{aligned} 133 | X_1' & = -\frac{1}{2} X_1 - \frac{\sqrt{3}}{2} X_2\\ 134 | X_2' & = \frac{\sqrt{3}}{2} X_1 - \frac{1}{2} X_2\\ 135 | X_3' & = X_3 136 | \end{aligned} 137 | \\] 138 | 139 | ## Constraints on $d_{13}$ 140 | 141 | Let us start with some of the simpler relationships first. 142 | 143 | For $d_{13}$, we have $d_{13} \rightarrow d_{133}$ (Voigt to tensor). 144 | $d_{133}$ transforms as: 145 | 146 | \\[ 147 | \begin{aligned} 148 | X_1'X_3'X_3' & = (-\frac{1}{2} X_1 - \frac{\sqrt{3}}{2} X_2)X_3X_3\\ 149 | & = -\frac{1}{2} X_1 X_3 X_3 - \frac{\sqrt{3}}{2} X_2 X_3 X_3 \\ 150 | \implies d_{133}' & = -\frac{1}{2} d_{133} - \frac{\sqrt{3}}{2} d_{233}\\ 151 | \implies d_{133}' & = -\frac{1}{2} d_{133} \mbox{ ($d_{233}$ was shown to be zero earlier) }\\ 152 | \implies -\frac{1}{2} d_{133} & = d_{133} \mbox{ (Neumann's Principle) }\\ 153 | \implies d_{133} & = 0\\ 154 | \implies d_{13} & = 0 155 | \end{aligned} 156 | \\] 157 | 158 | ## Constraints on $d_{35}$ 159 | 160 | For $d_{35}$, we have $d_{35} \rightarrow d_{313} + d_{331}$ (Voigt to tensor). 161 | $d_{313}$ transforms as: 162 | 163 | \\[ 164 | \begin{aligned} 165 | X_3'X_1'X_3' & = X_3(-\frac{1}{2} X_1 - \frac{\sqrt{3}}{2} X_2)X_3\\ 166 | & = -\frac{1}{2} X_3 X_1 X_3 - \frac{\sqrt{3}}{2} X_3 X_2 X_3 \\ 167 | \implies d_{313}' & = -\frac{1}{2} d_{313} - \frac{\sqrt{3}}{2} d_{323}\\ 168 | \implies d_{313}' & = -\frac{1}{2} d_{313} \mbox{ ($d_{323}$ was shown to be zero earlier)} = d_{313}\\ 169 | \implies d_{313} & = 0\\ 170 | \mbox{Similarly, } d_{331} & = 0\\ 171 | \implies d_{35} & = 0 172 | \end{aligned} 173 | \\] 174 | 175 | ## Constraints on $d_{36}$ 176 | 177 | For $d_{36}$, we have $d_{36} \rightarrow d_{312} + d_{321}$ (Voigt to tensor). 178 | $d_{312}$ transforms as: 179 | 180 | \\[ 181 | \begin{aligned} 182 | X_3'X_1'X_2' & = X_3(-\frac{1}{2} X_1 - \frac{\sqrt{3}}{2} X_2)(\frac{\sqrt{3}}{2} X_1 - \frac{1}{2} X_2)\\ 183 | & = -\frac{\sqrt{3}}{4} X_3 X_1 X_1 + \frac{1}{4} X_3 X_1 X_2 - \frac{3}{4} X_3 X_2 X_1 + \frac{\sqrt{3}}{4} X_3 X_2 X_2 \\ 184 | \implies d_{312}' & = -\frac{\sqrt{3}}{4} d_{311} + \frac{1}{4} d_{312} - \frac{3}{4} d_{321} + \frac{\sqrt{3}}{4} d_{322} 185 | \end{aligned} 186 | \\] 187 | 188 | Zeroing out the elements we have determined earlier and applying Neumann's 189 | Principle, we have 190 | 191 | \\[ 192 | \begin{aligned} 193 | d_{312}' & = \frac{1}{4} d_{312} - \frac{3}{4} d_{321} = d_{312}\\ 194 | \implies d_{312} & = - d_{321} 195 | \end{aligned} 196 | \\] 197 | 198 | Hence, $d_{36} = d_{312} + d_{321} = 0$ 199 | 200 | ## Constraints on $d_{14}$ and $d_{25}$ 201 | 202 | For $d_{25}$, we have $d_{25} \rightarrow d_{213} + d_{231}$ (Voigt to tensor). 203 | $d_{213}$ transforms as: 204 | 205 | \\[ 206 | \begin{aligned} 207 | X_2'X_1'X_3' & = (\frac{\sqrt{3}}{2} X_1 - \frac{1}{2} X_2)(-\frac{1}{2} X_1 - \frac{\sqrt{3}}{2} X_2)X_3\\ 208 | & = -\frac{\sqrt{3}}{4} X_1 X_1 X_3 - \frac{3}{4} X_1 X_2 X_3 + \frac{1}{4} X_2 X_1 X_3 + \frac{\sqrt{3}}{4} X_2 X_2 X_3 \\ 209 | \implies d_{213}' & = -\frac{\sqrt{3}}{4} d_{113} - \frac{3}{4} d_{123} + \frac{1}{4} d_{213} + \frac{\sqrt{3}}{4} d_{223} \\ 210 | \implies d_{213}' & = -\frac{3}{4} d_{123} + \frac{1}{4} d_{213} = d_{213} \\ 211 | \implies -d_{123} & = d_{213} \\ 212 | \implies d_{25} & = - d_{14} 213 | \end{aligned} 214 | \\] 215 | 216 | ## Constraints on $d_{11}$, $d_{12}$ and $d_{26}$ 217 | 218 | For $d_{11}$, we have $d_{11} \rightarrow d_{111}$ (Voigt to tensor). 219 | $d_{111}$ transforms as: 220 | 221 | \\[ 222 | \begin{aligned} 223 | X_1'X_1'X_1' & = (-\frac{1}{2} X_1 - \frac{\sqrt{3}}{2} X_2)(-\frac{1}{2} X_1 - \frac{\sqrt{3}}{2} X_2)(-\frac{1}{2} X_1 - \frac{\sqrt{3}}{2} X_2)\\ 224 | & = -\frac{1}{8} X_1 X_1 X_1 - \frac{\sqrt{3}}{8} X_1 X_1 X_2 \\ 225 | & - \frac{\sqrt{3}}{8} X_1 X_2 X_1 - \frac{3}{8} X_1 X_2 X_2 \\ 226 | & - \frac{\sqrt{3}}{8} X_2 X_1 X_1 - \frac{3}{8} X_2 X_1 X_2 \\ 227 | & - \frac{3}{8} X_2 X_2 X_1 - \frac{3\sqrt{3}}{8} X_2 X_2 X_2\\ 228 | \implies d_{111}' & = -\frac{1}{8} d_{111} - \frac{\sqrt{3}}{8} d_{112} - \frac{\sqrt{3}}{8} d_{121} - \frac{3}{8} d_{122} - \frac{\sqrt{3}}{8} d_{211} - \frac{3}{8} d_{212} - \frac{3}{8} d_{221} - \frac{3\sqrt{3}}{8} d_{222}\\ 229 | & = -\frac{1}{8} d_{111} - \frac{3}{8} d_{122} - \frac{3}{8} d_{212} - \frac{3}{8} d_{221} \mbox{ (some of the tensor elements are already 0)} 230 | \end{aligned} 231 | \\] 232 | 233 | In matrix form, we have: 234 | 235 | \\[ 236 | \begin{aligned} 237 | d_{11}' = -\frac{1}{8} d_{11} - \frac{3}{8} d_{12} - \frac{3}{8} d_{26} = d_{11}\\ 238 | \implies 3d_{11} + d_{12} + d_{26} = 0 239 | \end{aligned} 240 | \\] 241 | 242 | For $d_{12}$, we have $d_{12} \rightarrow d_{122}$ (Voigt to tensor). 243 | $d_{122}$ transforms as: 244 | 245 | \\[ 246 | \begin{aligned} 247 | X_1'X_2'X_2' & = (-\frac{1}{2} X_1 - \frac{\sqrt{3}}{2} X_2)(\frac{\sqrt{3}}{2} X_1 - \frac{1}{2} X_2)(\frac{\sqrt{3}}{2} X_1 - \frac{1}{2} X_2)\\ 248 | & = -\frac{3}{8} X_1 X_1 X_1 + \frac{\sqrt{3}}{8} X_1 X_1 X_2 \\ 249 | & + \frac{\sqrt{3}}{8} X_1 X_2 X_1 - \frac{1}{8} X_1 X_2 X_2 \\ 250 | & - \frac{3\sqrt{3}}{8} X_2 X_1 X_1 + \frac{3}{8} X_2 X_1 X_2 \\ 251 | & + \frac{3}{8} X_2 X_2 X_1 - \frac{\sqrt{3}}{8} X_2 X_2 X_2\\ 252 | \implies d_{122}' & = -\frac{3}{8} d_{111} + \frac{\sqrt{3}}{8} d_{112} + \frac{\sqrt{3}}{8} d_{121} - \frac{1}{8} d_{122} - \frac{3\sqrt{3}}{8} d_{211} + \frac{3}{8} d_{212} + \frac{3}{8} d_{221} - \frac{\sqrt{3}}{8} d_{222}\\ 253 | & = -\frac{3}{8} d_{111} - \frac{1}{8} d_{122} + \frac{3}{8} d_{212} + \frac{3}{8} d_{221} \mbox{ (some of the tensor elements are already 0)} 254 | \end{aligned} 255 | \\] 256 | 257 | In matrix form, we have: 258 | 259 | \\[ 260 | \begin{aligned} 261 | d_{12}' = -\frac{3}{8} d_{11} - \frac{1}{8} d_{12} + \frac{3}{8} d_{26} = d_{12}\\ 262 | \implies d_{11} + 3 d_{12} - d_{26} = 0 263 | \end{aligned} 264 | \\] 265 | 266 | Combining the relations derived for $d_{11}$ and $d_{12}$, we get: 267 | 268 | \\[ 269 | \begin{aligned} 270 | 4d_{11} + 4 d_{12} = 0\\ 271 | \implies d_{12} = -d_{11} \mbox{ and } d_{26} = -2d_{11} 272 | \end{aligned} 273 | \\] 274 | 275 | # Conclusion 276 | 277 | Incorporating all the symmetry restrictions, we finally get the simplified 278 | form of the piezoelectric matrix as follows: 279 | 280 | \\[ 281 | \begin{pmatrix} 282 | d_{11} & -d_{11} & 0 & d_{14} & 0 & 0\\ 283 | 0 & 0 & 0 & 0 & -d_{14} & -2d_{11}\\ 284 | 0 & 0 & 0 & 0 & 0 & 0 285 | \end{pmatrix} 286 | \\] 287 | 288 | In general, this is a more involved process than usual because the trigonal 289 | 3-fold rotation does not align with orthogonal axes. For 4-fold symmetry, the 290 | process is considerably simpler. But it is useful to go through this, which illustrates all the key steps of deriving symmetry restrictions. 291 | 292 | [The 32 point group]: 32.png "The 32 point group" width=150px 293 | -------------------------------------------------------------------------------- /lectures/handouts/Handout 11 - Piezoelectric coefficients for the 32 point group.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/Handout 11 - Piezoelectric coefficients for the 32 point group.pdf -------------------------------------------------------------------------------- /lectures/handouts/Handout 12 - Plane Groups.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/Handout 12 - Plane Groups.pdf -------------------------------------------------------------------------------- /lectures/handouts/Handout 12 - Plane Groups.tex: -------------------------------------------------------------------------------- 1 | \documentclass[12pt]{article} 2 | \usepackage[margin=0.5in]{geometry} 3 | \usepackage{multirow} 4 | \usepackage{graphicx} 5 | \usepackage{caption} 6 | \usepackage{subcaption} 7 | 8 | \begin{document} 9 | 10 | \section*{The 17 Plane Groups} 11 | 12 | \begin{figure}[htp] 13 | \centering 14 | \begin{subfigure}[b]{0.45\textwidth} 15 | \centering 16 | \includegraphics[width=\textwidth]{planegroups/1.png} 17 | \caption*{p1} 18 | \end{subfigure} 19 | ~ 20 | \begin{subfigure}[b]{0.45\textwidth} 21 | \centering 22 | \includegraphics[width=\textwidth]{planegroups/2.png} 23 | \caption*{p2} 24 | \end{subfigure} 25 | \begin{subfigure}[b]{0.45\textwidth} 26 | \centering 27 | \includegraphics[width=\textwidth]{planegroups/3.png} 28 | \caption*{pm} 29 | \end{subfigure} 30 | ~ 31 | \begin{subfigure}[b]{0.45\textwidth} 32 | \centering 33 | \includegraphics[width=\textwidth]{planegroups/4.png} 34 | \caption*{pg} 35 | \end{subfigure} 36 | \begin{subfigure}[b]{0.45\textwidth} 37 | \centering 38 | \includegraphics[width=\textwidth]{planegroups/5.png} 39 | \caption*{cm} 40 | \end{subfigure} 41 | ~ 42 | \begin{subfigure}[b]{0.45\textwidth} 43 | \centering 44 | \includegraphics[width=\textwidth]{planegroups/6.png} 45 | \caption*{p2mm} 46 | \end{subfigure} 47 | \begin{subfigure}[b]{0.45\textwidth} 48 | \centering 49 | \includegraphics[width=\textwidth]{planegroups/7.png} 50 | \caption*{p2mg} 51 | \end{subfigure} 52 | ~ 53 | \begin{subfigure}[b]{0.45\textwidth} 54 | \centering 55 | \includegraphics[width=\textwidth]{planegroups/8.png} 56 | \caption*{p2gg} 57 | \end{subfigure} 58 | \begin{subfigure}[b]{0.45\textwidth} 59 | \centering 60 | \includegraphics[width=\textwidth]{planegroups/9.png} 61 | \caption*{c2mm} 62 | \end{subfigure} 63 | ~ 64 | 65 | \end{figure} 66 | 67 | \begin{figure} 68 | \centering 69 | \begin{subfigure}[b]{0.45\textwidth} 70 | \centering 71 | \includegraphics[width=\textwidth]{planegroups/10.png} 72 | \caption*{p4} 73 | \end{subfigure} 74 | ~ 75 | \begin{subfigure}[b]{0.45\textwidth} 76 | \centering 77 | \includegraphics[width=\textwidth]{planegroups/11.png} 78 | \caption*{p4mm} 79 | \end{subfigure} 80 | \begin{subfigure}[b]{0.5\textwidth} 81 | \centering 82 | \includegraphics[width=\textwidth]{planegroups/12.png} 83 | \caption*{p4gm} 84 | \end{subfigure}\\ 85 | \begin{subfigure}[b]{0.45\textwidth} 86 | \centering 87 | \includegraphics[width=\textwidth]{planegroups/13.png} 88 | \caption*{p3} 89 | \end{subfigure} 90 | ~ 91 | \begin{subfigure}[b]{0.45\textwidth} 92 | \centering 93 | \includegraphics[width=\textwidth]{planegroups/14.png} 94 | \caption*{p3m1} 95 | \end{subfigure} 96 | \begin{subfigure}[b]{0.45\textwidth} 97 | \centering 98 | \includegraphics[width=\textwidth]{planegroups/15.png} 99 | \caption*{p31m} 100 | \end{subfigure}\\ 101 | \begin{subfigure}[b]{0.45\textwidth} 102 | \centering 103 | \includegraphics[width=\textwidth]{planegroups/16.png} 104 | \caption*{p6} 105 | \end{subfigure} 106 | \begin{subfigure}[b]{0.45\textwidth} 107 | \centering 108 | \includegraphics[width=\textwidth]{planegroups/17.png} 109 | \caption*{p6mm} 110 | \end{subfigure} 111 | \end{figure} 112 | 113 | \end{document} 114 | % 115 | % ****** End of file apstemplate.tex ****** 116 | -------------------------------------------------------------------------------- /lectures/handouts/Handout 2 - Summary of coordinate transformations.md: -------------------------------------------------------------------------------- 1 | LaTeX input: mmd-mavrldoc-header 2 | Title: NANO106 Handout 2 - Summary of Coordinate Transformations 3 | Author: Shyue Ping Ong 4 | Affiliation: University of California, San Diego 5 | Address: 9500 Gilman Drive, Mail Code 0448, La Jolla, CA 92093-0448 6 | Web: http://www.materialsvirtuallab.org 7 | Base Header Level: 2 8 | LaTeX Mode: mavrldoc 9 | LaTeX input: mmd-mavrldoc-begin-doc 10 | LaTeX footer: mmd-mavrldoc-footer 11 | xhtml header: 12 | 13 | # Introduction 14 | 15 | This document provides a summary of the various coordinate transformations relations and formulas. 16 | 17 | # Notation and definitions 18 | 19 | Let us define a series of consistent notations. Note that all vectors are written in *column* format for consistency. All vectors are **bolded**. 20 | 21 | | Quantity | Notation | 22 | | -------- | -------- | 23 | | Lattice basis vectors | $\mathbf{a_1}$, $\mathbf{a_2}$, $\mathbf{a_3}$ | 24 | | Cartesian coordinate vectors | $\mathbf{x}$ or $\mathbf{y}$ | 25 | | Crystal coordinate vectors | $\mathbf{p}$ or $\mathbf{q}$ | 26 | | Metric tensor | $g$ | 27 | 28 | \\[\textbf{x} = \begin{pmatrix}x_1\\x_2\\x_3\end{pmatrix}\\] 29 | \\[\textbf{p} = \begin{pmatrix}p_1\\p_2\\p_3\end{pmatrix}\\] 30 | 31 | Let us denote a basis transformation from basis vectors $\mathbf{a_i}$ to $\mathbf{a_i'}$ as: 32 | 33 | \\[ 34 | \begin{pmatrix}\mathbf{a_1'}\\\mathbf{a_2'}\\\mathbf{a_3'}\end{pmatrix} = \begin{pmatrix}c_{11}&c_{12}&c_{13}\\c_{21}&c_{22}&c_{23}\\c_{31}&c_{32}&c_{33}\end{pmatrix} \begin{pmatrix}\mathbf{a_1}\\\mathbf{a_2}\\\mathbf{a_3}\end{pmatrix} 35 | \\] 36 | 37 | or more compactly as: 38 | 39 | $$\mathbf{A'} = \mathbf{C} \mathbf{A}$$ 40 | 41 | In the new coordinate system, we add a $'$, e.g., $\mathbf{p'}$ denotes the crystal coordinates in the new basis. 42 | 43 | # Transformation relations 44 | 45 | The following table summarizes all the coordinate transformas. Be very careful to note whether we are using the transpose of the vector (i.e., writing it in terms of a row instead of a column), the order of the multiplication, and whether we are using the inverse or the direct transformation matrix $C$! 46 | 47 | | Transformation | Old basis-> New basis | New basis-> Old basis | 48 | | -------------- | --------------------- | --------------------- | 49 | |Postion/Vector -> Position/Vector|$\mathbf{p'}^T = \mathbf{p}^T\mathbf{C}^{-1}$|$\mathbf{p}^T = \mathbf{p'}^T\mathbf{C}$| 50 | |Postion/Vector -> Reciprocal Position/Vector|$\mathbf{p^*}^T = \mathbf{p}^Tg$|$\mathbf{p}^T = \mathbf{p^*}^Tg^{-1}$| 51 | |Reciprocal Postion/Vector -> Reciprocal Position/Vector|$\mathbf{p^*}' = \mathbf{C}\mathbf{p^*}$|$\mathbf{p^*} = \mathbf{C}^{-1}\mathbf{p^*}'$| 52 | |Metric Tensor -> Metric Tensor|$g' = \mathbf{C}g\mathbf{C}^T$|$g = \mathbf{C}^{-1}g'(\mathbf{C}^{-1})^T$| 53 | 54 | 55 | -------------------------------------------------------------------------------- /lectures/handouts/Handout 2 - Summary of coordinate transformations.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/Handout 2 - Summary of coordinate transformations.pdf -------------------------------------------------------------------------------- /lectures/handouts/Handout 3 - Graphical symbols for symmetry elements.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/Handout 3 - Graphical symbols for symmetry elements.pdf -------------------------------------------------------------------------------- /lectures/handouts/Handout 4 - Point Group Determination Flowchart.graffle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/Handout 4 - Point Group Determination Flowchart.graffle -------------------------------------------------------------------------------- /lectures/handouts/Handout 4 - Point Group Determination Flowchart.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/Handout 4 - Point Group Determination Flowchart.pdf -------------------------------------------------------------------------------- /lectures/handouts/Handout 5 - Summary of Point Groups.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/Handout 5 - Summary of Point Groups.pdf -------------------------------------------------------------------------------- /lectures/handouts/Handout 5 - Summary of Point Groups.tex: -------------------------------------------------------------------------------- 1 | \documentclass[12pt]{article} 2 | \usepackage{multirow} 3 | 4 | \begin{document} 5 | 6 | \begin{table}[h] 7 | \caption{The 32 Crystallographic Point Groups} 8 | \centering 9 | \small 10 | \begin{tabular}{lcccc} 11 | \hline 12 | \textbf{Crystal} & \textbf{Laue Class} & \multicolumn{2}{l}{\textbf{Hermann-Mauguin}} & \textbf{Schoenflies}\\ 13 | \textbf{System} & & \textbf{Full} & \textbf{Short } & \\ 14 | \hline 15 | \hline 16 | \multirow{2}{*}{Triclinic} & \multirow{2}{*}{$\overline{1}$} & $1$ & $1$ & $C_1$\\ 17 | & & $\overline{1}$ & $\overline{1}$ & $C_i = S_2$ \\ 18 | \hline 19 | \multirow{3}{*}{Monoclinic} & \multirow{3}{*}{$\displaystyle \frac{2}{m}$} & $2$ & $2$ & $C_2$\\ 20 | & & $m$ & $m$ & $C_s = C_{1h}$ \\ 21 | & & $\displaystyle \frac{2}{m}$ & $\displaystyle \frac{2}{m}$ & $C_{2h}$ \\[1.5ex] 22 | \hline 23 | \multirow{3}{*}{Orthorhombic} & \multirow{3}{*}{$mmm$} & $222$ & $222$ & $D_2$\\ 24 | & & $mm2$ & $mm2$ & $C_{2v}$ \\ 25 | & & $\displaystyle \frac{2}{m}\frac{2}{m}\frac{2}{m}$ & $mmm$ & $D_{2h}$ \\[1.5ex] 26 | \hline 27 | \multirow{7}{*}{Tetragonal} & \multirow{3}{*}{$\displaystyle \frac{4}{m}$} & $4$ & $4$ & $C_4$\\ 28 | & & $\overline{4}$ & $\overline{4}$ & $S_4$ \\ 29 | & & $\displaystyle \frac{4}{m}$ & $\displaystyle \frac{4}{m}$ & $C_{4h}$ \\[1.5ex] 30 | \cline{2-5} 31 | & \multirow{4}{*}{$\displaystyle \frac{4}{m}mm$} & $422$ & $422$ & $D_4$\\ 32 | & & $4mm$ & $4mm$ & $C_{4v}$ \\ 33 | & & $\overline{4}2m$ & $\overline{4}2m$ & $D_{2d}$ \\ 34 | & & $\displaystyle \frac{4}{m}\frac{2}{m}\frac{2}{m}$ & $\displaystyle \frac{4}{m}mm$ & $D_{4h}$ \\ [1.5ex] 35 | \hline 36 | \multirow{5}{*}{Trigonal } & \multirow{2}{*}{$\overline{3}$} & $3$ & $3$ & $C_3$\\ 37 | & & $\overline{3}$ & $\overline{3}$ & $C_{3i} = S_6$ \\ 38 | \cline{2-5} 39 | & \multirow{3}{*}{$\overline{3}m$} & $32$ & $32$ & $D_3$\\ 40 | & & $3m$ & $3m$ & $C_{3v}$ \\ 41 | & & $\overline{3}m$ & $\overline{3}m$ & $D_{3d}$ \\ 42 | \hline 43 | \multirow{7}{*}{Hexagonal} & \multirow{3}{*}{$\displaystyle \frac{6}{m}$} & $6$ & $6$ & $C_6$\\ 44 | & & $\overline{6}$ & $\overline{6}$ & $C_{3h}$ \\ 45 | & & $\displaystyle \frac{6}{m}$ & $\displaystyle \frac{6}{m}$ & $C_{6h}$ \\[1.5ex] 46 | \cline{2-5} 47 | & \multirow{4}{*}{$\displaystyle \frac{6}{m}mm$} & $622$ & $622$ & $D_6$\\ 48 | & & $6mm$ & $6mm$ & $C_{6v}$ \\ 49 | & & $\overline{6}m2$ & $\overline{6}m2$ & $D_{3h}$ \\ 50 | & & $\displaystyle \frac{6}{m}\frac{2}{m}\frac{2}{m}$ & $\displaystyle \frac{6}{m}mm$ & $D_{6h}$ \\ [1.5ex] 51 | \hline 52 | \multirow{5}{*}{Cubic} & \multirow{2}{*}{$m\overline{3}$} & $23$ & $23$ & $T$\\ 53 | & & $\displaystyle \frac{2}{m}\overline{3}$ & $m\overline{3}$ & $T_h$ \\ 54 | \cline{2-5} 55 | & \multirow{3}{*}{$m\overline{3}m$} & $432$ & $432$ & $O$\\ 56 | & & $\overline{4}3m$ & $\overline{4}3m$ & $T_d$ \\ 57 | & & $\displaystyle \frac{4}{m}\overline{3}\frac{2}{m}$ & $m\overline{3}m$ & $O_h$ \\ [1.5ex] 58 | \hline 59 | \end{tabular} 60 | \end{table} 61 | 62 | \end{document} 63 | % 64 | % ****** End of file apstemplate.tex ****** 65 | -------------------------------------------------------------------------------- /lectures/handouts/Handout 6 - Determining Symmetry Matrices.md: -------------------------------------------------------------------------------- 1 | LaTeX input: mmd-mavrldoc-header 2 | Title: NANO106 Handout 6 - Determining Symmetry Matrices 3 | Author: Shyue Ping Ong 4 | Affiliation: University of California, San Diego 5 | Address: 9500 Gilman Drive, Mail Code 0448, La Jolla, CA 92093-0448 6 | Web: http://www.materialsvirtuallab.org 7 | Base Header Level: 2 8 | LaTeX Mode: mavrldoc 9 | LaTeX input: mmd-mavrldoc-begin-doc 10 | LaTeX footer: mmd-mavrldoc-footer 11 | xhtml header: 12 | 13 | # Introduction 14 | 15 | This document outlines how you determine crystal summary matrices. Two fairly 16 | complicated examples are provided to demonstrate the procedure in addition to 17 | the lecture slides. 18 | 19 | # General Procedure 20 | 21 | Let us first outline the general procedure. 22 | 23 | 1. Find an appropriate crystal system for the symmetry operation. This is 24 | typically indicated. Otherwise, you should use the more convenient lattice 25 | compatible with that symmetry. E.g., for 4-fold or 6-fold rotations, you use 26 | a tetragonal or hexagonal cell. 27 | 2. Align the crystal to the appropriate symmetry positions. Sometimes this is 28 | also specifically spelled out. 29 | 3. "Inspect" how your crystal axes transform under the symmetry operation, i.e., 30 | just imagine performing the operation on the crystal axes. 31 | 4. Express the new lattice vectors in terms of your old lattice vectors. 32 | 5. Determine the transformation matrix C that relates your new lattice vectors 33 | to your old ones. 34 | 6. The transpose of the transformation matrix is your crystal symmetry matrix. 35 | 36 | ![Example of symmetry operations on crystal axes.](SymmetryOperationsOnCrystal.pdf) 37 | 38 | # Example 1: Six-fold rotation in hexagonal crystal 39 | 40 | Consider the symmetry operation as shown in Figure (i) above. Let us now follow 41 | the steps. Steps 1 and 2 are already done. 42 | 43 | Step 3: Figure (i) shows the effect of the symmetry operation on the lattice 44 | vectors. 45 | 46 | Step 4: The new lattice vectors can be expressed in terms of the old lattice 47 | vectors as: 48 | 49 | $$\mathbf{a'} = \mathbf{a} + \mathbf{b}$$ 50 | $$\mathbf{b'} = - \mathbf{a}$$ 51 | $$\mathbf{c'} = \mathbf{c}$$ 52 | 53 | Step 5: We may express the above relationships as the following matrix operation. 54 | 55 | \\[ 56 | \begin{pmatrix}\mathbf{a'}\\\mathbf{b'}\\\mathbf{c'}\end{pmatrix} = 57 | \begin{pmatrix}1 & 1 & 0\\-1 & 0 & 0\\0 & 0 & 1\end{pmatrix} 58 | \begin{pmatrix}\mathbf{a}\\\mathbf{b}\\\mathbf{c}\end{pmatrix} 59 | \\] 60 | 61 | Step 6: Taking the transpose of the transformation matrix, we have the rotation 62 | matrix as: 63 | 64 | \\[ 65 | D(6) = \begin{pmatrix}1 & -1 & 0\\1 & 0 & 0\\0 & 0 & 1\end{pmatrix} 66 | \\] 67 | 68 | # Example 2: Diagonal vertical mirror plane in tetragonal crystal 69 | 70 | Consider the symmetry operation as shown in Figure (ii) above. Let us now follow 71 | the steps. Steps 1 and 2 are already done. 72 | 73 | Step 3: Figure (ii) shows the effect of the symmetry operation on the lattice 74 | vectors. 75 | 76 | Step 4: The new lattice vectors can be expressed in terms of the old lattice 77 | vectors as: 78 | 79 | $$\mathbf{a'} = \mathbf{b}$$ 80 | $$\mathbf{b'} = \mathbf{a}$$ 81 | $$\mathbf{c'} = \mathbf{c}$$ 82 | 83 | Step 5: We may express the above relationships as the following matrix operation. 84 | 85 | \\[ 86 | \begin{pmatrix}\mathbf{a'}\\\mathbf{b'}\\\mathbf{c'}\end{pmatrix} = 87 | \begin{pmatrix}0 & 1 & 0\\1 & 0 & 0\\0 & 0 & 1\end{pmatrix} 88 | \begin{pmatrix}\mathbf{a}\\\mathbf{b}\\\mathbf{c}\end{pmatrix} 89 | \\] 90 | 91 | Step 6: Taking the transpose of the transformation matrix, we have the symmetry 92 | matrix as: 93 | 94 | \\[ 95 | D(m_d) = \begin{pmatrix}0 & 1 & 0\\1 & 0 & 0\\0 & 0 & 1\end{pmatrix} 96 | \\] -------------------------------------------------------------------------------- /lectures/handouts/Handout 6 - Determining Symmetry Matrices.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/Handout 6 - Determining Symmetry Matrices.pdf -------------------------------------------------------------------------------- /lectures/handouts/Handout 7 - International Tables for Crystallography 35 - Cmm2 Annotated.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/Handout 7 - International Tables for Crystallography 35 - Cmm2 Annotated.pdf -------------------------------------------------------------------------------- /lectures/handouts/Handout 8 - International Tables Explanation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/Handout 8 - International Tables Explanation.pdf -------------------------------------------------------------------------------- /lectures/handouts/Handout 9 - International Tables Symmetry Operations.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/Handout 9 - International Tables Symmetry Operations.pdf -------------------------------------------------------------------------------- /lectures/handouts/Orientation of 32.graffle/data.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/Orientation of 32.graffle/data.plist -------------------------------------------------------------------------------- /lectures/handouts/Orientation of 32.graffle/image1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/Orientation of 32.graffle/image1.pdf -------------------------------------------------------------------------------- /lectures/handouts/PGFlowChart.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/PGFlowChart.pdf -------------------------------------------------------------------------------- /lectures/handouts/SymmetryOperationsOnCrystal.graffle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/SymmetryOperationsOnCrystal.graffle -------------------------------------------------------------------------------- /lectures/handouts/SymmetryOperationsOnCrystal.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/SymmetryOperationsOnCrystal.pdf -------------------------------------------------------------------------------- /lectures/handouts/planegroups/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/planegroups/1.png -------------------------------------------------------------------------------- /lectures/handouts/planegroups/10.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/planegroups/10.gif -------------------------------------------------------------------------------- /lectures/handouts/planegroups/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/planegroups/10.png -------------------------------------------------------------------------------- /lectures/handouts/planegroups/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/planegroups/11.png -------------------------------------------------------------------------------- /lectures/handouts/planegroups/12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/planegroups/12.png -------------------------------------------------------------------------------- /lectures/handouts/planegroups/13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/planegroups/13.png -------------------------------------------------------------------------------- /lectures/handouts/planegroups/14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/planegroups/14.png -------------------------------------------------------------------------------- /lectures/handouts/planegroups/15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/planegroups/15.png -------------------------------------------------------------------------------- /lectures/handouts/planegroups/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/planegroups/16.png -------------------------------------------------------------------------------- /lectures/handouts/planegroups/17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/planegroups/17.png -------------------------------------------------------------------------------- /lectures/handouts/planegroups/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/planegroups/2.png -------------------------------------------------------------------------------- /lectures/handouts/planegroups/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/planegroups/3.png -------------------------------------------------------------------------------- /lectures/handouts/planegroups/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/planegroups/4.png -------------------------------------------------------------------------------- /lectures/handouts/planegroups/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/planegroups/5.png -------------------------------------------------------------------------------- /lectures/handouts/planegroups/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/planegroups/6.png -------------------------------------------------------------------------------- /lectures/handouts/planegroups/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/planegroups/7.png -------------------------------------------------------------------------------- /lectures/handouts/planegroups/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/planegroups/8.png -------------------------------------------------------------------------------- /lectures/handouts/planegroups/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/handouts/planegroups/9.png -------------------------------------------------------------------------------- /lectures/lecture_13_xrd/PDF - alpha CsCl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/lecture_13_xrd/PDF - alpha CsCl.png -------------------------------------------------------------------------------- /lectures/lecture_13_xrd/PDF - beta CsCl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/lecture_13_xrd/PDF - beta CsCl.png -------------------------------------------------------------------------------- /lectures/lecture_4_point_group_symmetry/Summary of Point groups.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/lectures/lecture_4_point_group_symmetry/Summary of Point groups.pdf -------------------------------------------------------------------------------- /lectures/lecture_4_point_group_symmetry/Summary of Point groups.tex: -------------------------------------------------------------------------------- 1 | \documentclass[12pt]{article} 2 | \usepackage{multirow} 3 | \usepackage[margin=1in]{geometry} 4 | \begin{document} 5 | \renewcommand{\arraystretch}{1.1} 6 | \begin{table}[h] 7 | \centering 8 | \caption{The 32 Crystallographic Point Groups} 9 | \small 10 | \begin{tabular}{lcccc} 11 | \hline 12 | \textbf{Crystal} & \textbf{Laue Class} & \multicolumn{2}{l}{\textbf{Hermann-Mauguin}} & \textbf{Schoenflies}\\ 13 | \textbf{System} & & \textbf{Full} & \textbf{Short } & \\ 14 | \hline 15 | \hline 16 | \multirow{2}{*}{Triclinic} & \multirow{2}{*}{$\overline{1}$} & $1$ & $1$ & $C_1$\\ 17 | & & $\overline{1}$ & $\overline{1}$ & $C_i = S_2$ \\ 18 | \hline 19 | \multirow{3}{*}{Monoclinic} & \multirow{3}{*}{$\displaystyle \frac{2}{m}$} & $2$ & $2$ & $C_2$\\ 20 | & & $m$ & $m$ & $C_s = C_{1h}$ \\ 21 | & & $\displaystyle \frac{2}{m}$ & $\displaystyle \frac{2}{m}$ & $C_{2h}$ \\[1.5ex] 22 | \hline 23 | \multirow{3}{*}{Orthorhombic} & \multirow{3}{*}{$mmm$} & $222$ & $222$ & $D_2$\\ 24 | & & $mm2$ & $mm2$ & $C_{2v}$ \\ 25 | & & $\displaystyle \frac{2}{m}\frac{2}{m}\frac{2}{m}$ & $mmm$ & $D_{2h}$ \\[1.5ex] 26 | \hline 27 | \multirow{7}{*}{Tetragonal} & \multirow{3}{*}{$\displaystyle \frac{4}{m}$} & $4$ & $4$ & $C_4$\\ 28 | & & $\overline{4}$ & $\overline{4}$ & $S_4$ \\ 29 | & & $\displaystyle \frac{4}{m}$ & $\displaystyle \frac{4}{m}$ & $C_{4h}$ \\[1.5ex] 30 | \cline{2-5} 31 | & \multirow{4}{*}{$\displaystyle \frac{4}{m}mm$} & $422$ & $422$ & $D_4$\\ 32 | & & $4mm$ & $4mm$ & $C_{4v}$ \\ 33 | & & $\overline{4}2m$ & $\overline{4}2m$ & $D_{2h}$ \\ 34 | & & $\displaystyle \frac{4}{m}\frac{2}{m}\frac{2}{m}$ & $\displaystyle \frac{4}{m}mm$ & $D_{4h}$ \\ [1.5ex] 35 | \hline 36 | \multirow{5}{*}{Trigonal } & \multirow{2}{*}{$\overline{4}$} & $3$ & $3$ & $C_3$\\ 37 | & & $\overline{3}$ & $\overline{3}$ & $C_{3i}$ \\ 38 | \cline{2-5} 39 | & \multirow{3}{*}{$\overline{3}m$} & $32$ & $32$ & $D_3$\\ 40 | & & $3m$ & $3m$ & $C_{3v}$ \\ 41 | & & $\overline{3}m$ & $\overline{3}m$ & $D_{3d}$ \\ 42 | \hline 43 | \multirow{7}{*}{Hexagonal} & \multirow{3}{*}{$\displaystyle \frac{6}{m}$} & $6$ & $6$ & $C_6$\\ 44 | & & $\overline{6}$ & $\overline{6}$ & $C_{3h}$ \\ 45 | & & $\displaystyle \frac{6}{m}$ & $\displaystyle \frac{6}{m}$ & $C_{6h}$ \\[1.5ex] 46 | \cline{2-5} 47 | & \multirow{4}{*}{$\displaystyle \frac{6}{m}mm$} & $622$ & $622$ & $D_6$\\ 48 | & & $6mm$ & $6mm$ & $C_{6v}$ \\ 49 | & & $\overline{6}m2$ & $\overline{6}m2$ & $D_{3h}$ \\ 50 | & & $\displaystyle \frac{6}{m}\frac{2}{m}\frac{2}{m}$ & $\displaystyle \frac{6}{m}mm$ & $D_{6h}$ \\ [1.5ex] 51 | \hline 52 | \multirow{5}{*}{Cubic} & \multirow{2}{*}{$m\overline{3}$} & $23$ & $23$ & $T$\\ 53 | & & $m\overline{3}$ & $\displaystyle \frac{2}{m}\overline{3}$ & $T_h$ \\ 54 | \cline{2-5} 55 | & \multirow{3}{*}{$m\overline{3}m$} & $432$ & $432$ & $O$\\ 56 | & & $\overline{4}3m$ & $\overline{4}3m$ & $T_d$ \\ 57 | & & $\displaystyle \frac{4}{m}\overline{3}\frac{2}{m}$ & $m\overline{3}m$ & $O_h$ \\ [1.5ex] 58 | \hline 59 | \end{tabular} 60 | \end{table} 61 | 62 | \end{document} 63 | % 64 | % ****** End of file apstemplate.tex ****** 65 | -------------------------------------------------------------------------------- /lectures/lecture_4_point_group_symmetry/Symmetry Computations on m-3m (O_h) Point Group.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# NANO106 - Symmetry Computations on $m\\overline{3}m$ ($O_h$) Point Group\n", 8 | "*by Shyue Ping Ong*\n", 9 | "\n", 10 | "This notebook demonstrates the computation of orbits in the $m\\overline{3}m$ ($O_h$) point group (more complex than the simple mmm example). It is part of course material for UCSD's NANO106 - Crystallography of Materials." 11 | ] 12 | }, 13 | { 14 | "cell_type": "markdown", 15 | "metadata": {}, 16 | "source": [ 17 | "# Initializing the $m\\overline{3}m$ point group.\n", 18 | "\n", 19 | "Let's start by importing the numpy, sympy and other packages we need. Instead of going through all the steps one by one, we will use the symmetry.point_groups written by Prof Ong, which basically consolidates the information for all point groups in a single module." 20 | ] 21 | }, 22 | { 23 | "cell_type": "code", 24 | "execution_count": 1, 25 | "metadata": { 26 | "collapsed": false 27 | }, 28 | "outputs": [ 29 | { 30 | "name": "stdout", 31 | "output_type": "stream", 32 | "text": [ 33 | "The generators for this point group are:\n", 34 | "[[0, 0, 1], [1, 0, 0], [0, 1, 0]]\n", 35 | "[[0, -1, 0], [1, 0, 0], [0, 0, 1]]\n", 36 | "[[-1, 0, 0], [0, -1, 0], [0, 0, -1]]\n", 37 | "[[0, 1, 0], [1, 0, 0], [0, 0, 1]]\n", 38 | "The order of the point group is 48.\n" 39 | ] 40 | } 41 | ], 42 | "source": [ 43 | "import numpy as np\n", 44 | "from sympy import symbols, Mod\n", 45 | "from symmetry.groups import PointGroup\n", 46 | "\n", 47 | "#Create the point group.\n", 48 | "oh = PointGroup(\"m-3m\")\n", 49 | "\n", 50 | "print \"The generators for this point group are:\"\n", 51 | "for m in oh.generators:\n", 52 | " print m\n", 53 | "print \"The order of the point group is %d.\" % len(oh.symmetry_ops)" 54 | ] 55 | }, 56 | { 57 | "cell_type": "markdown", 58 | "metadata": {}, 59 | "source": [ 60 | "# Computing Orbits\n", 61 | "\n", 62 | "Using sympy, we specify the symbolic symbols x, y, z to represent position coordinates. We also define a function to generate the orbit given a set of symmetry operations and a point p." 63 | ] 64 | }, 65 | { 66 | "cell_type": "code", 67 | "execution_count": 2, 68 | "metadata": { 69 | "collapsed": false 70 | }, 71 | "outputs": [], 72 | "source": [ 73 | "x, y, z = symbols(\"x y z\")\n", 74 | "\n", 75 | "def pt_2_str(pt):\n", 76 | " return str([i.args[0] if isinstance(i, Mod) else i for i in pt])" 77 | ] 78 | }, 79 | { 80 | "cell_type": "markdown", 81 | "metadata": {}, 82 | "source": [ 83 | "## Orbit for General Position" 84 | ] 85 | }, 86 | { 87 | "cell_type": "code", 88 | "execution_count": 3, 89 | "metadata": { 90 | "collapsed": false 91 | }, 92 | "outputs": [ 93 | { 94 | "name": "stdout", 95 | "output_type": "stream", 96 | "text": [ 97 | "For the general position [x y z] on the two-fold axis, the orbit comprise 48 points:\n", 98 | "[z, x, y] [-y, x, z] [-x, -y, -z] [y, x, z] [y, z, x] [z, -y, x] [-z, -x, -y] [z, y, x] [-x, z, y] [-x, -y, z] [y, -x, -z] [-x, y, z] [x, y, z] [-y, -x, -z] [x, z, y] [x, -y, z] [x, z, -y] [-y, -z, -x] [z, y, -x] [-y, z, -x] [-x, -z, y] [y, z, -x] [-x, -z, -y] [-y, z, x] [y, -x, z] [z, -x, -y] [-z, y, -x] [z, -x, y] [x, -z, y] [-y, x, -z] [y, -z, -x] [-z, x, y] [z, -y, -x] [-z, x, -y] [y, -z, x] [-z, -y, -x] [-z, -x, y] [z, x, -y] [-z, y, x] [x, -z, -y] [-x, z, -y] [x, y, -z] [-y, -x, z] [-y, -z, x] [-z, -y, x] [y, x, -z] [x, -y, -z] [-x, y, -z]\n" 99 | ] 100 | } 101 | ], 102 | "source": [ 103 | "p = np.array([x, y, z])\n", 104 | "orb = oh.get_orbit(p, tol=0)\n", 105 | "print \"For the general position %s on the two-fold axis, the orbit comprise %d points:\" % (str(p), len(orb))\n", 106 | "for o in orb:\n", 107 | " print pt_2_str(o)," 108 | ] 109 | }, 110 | { 111 | "cell_type": "markdown", 112 | "metadata": {}, 113 | "source": [ 114 | "## Orbit for Special Position on four-fold rotation axis" 115 | ] 116 | }, 117 | { 118 | "cell_type": "code", 119 | "execution_count": 4, 120 | "metadata": { 121 | "collapsed": false 122 | }, 123 | "outputs": [ 124 | { 125 | "name": "stdout", 126 | "output_type": "stream", 127 | "text": [ 128 | "For the special position [0 0 z] on the two-fold axis, the orbit comprise 6 points:\n", 129 | "[z, 0, 0] [0, 0, z] [0, 0, -z] [0, z, 0] [-z, 0, 0] [0, -z, 0]\n" 130 | ] 131 | } 132 | ], 133 | "source": [ 134 | "p = np.array([0, 0, z])\n", 135 | "orb = oh.get_orbit(p, tol=0)\n", 136 | "\n", 137 | "print \"For the special position %s on the two-fold axis, the orbit comprise %d points:\" % (str(p), len(orb))\n", 138 | "for o in orb:\n", 139 | " print pt_2_str(o)," 140 | ] 141 | }, 142 | { 143 | "cell_type": "markdown", 144 | "metadata": {}, 145 | "source": [ 146 | "The orbit is similar for the other two-fold axes on the a and b axes are similar." 147 | ] 148 | }, 149 | { 150 | "cell_type": "markdown", 151 | "metadata": {}, 152 | "source": [ 153 | "## Orbit for Special Position on three-fold rotation axis\n", 154 | "\n", 155 | "The three-fold rotation axis are given by (x, x, x)" 156 | ] 157 | }, 158 | { 159 | "cell_type": "code", 160 | "execution_count": 5, 161 | "metadata": { 162 | "collapsed": false 163 | }, 164 | "outputs": [ 165 | { 166 | "name": "stdout", 167 | "output_type": "stream", 168 | "text": [ 169 | "For the special position [x x x] on the two-fold axis, the orbit comprise 8 points:\n", 170 | "[x, x, x] [-x, x, x] [-x, -x, -x] [x, -x, x] [-x, -x, x] [x, -x, -x] [x, x, -x] [-x, x, -x]\n" 171 | ] 172 | } 173 | ], 174 | "source": [ 175 | "p = np.array([x, x, x])\n", 176 | "orb = oh.get_orbit(p, tol=0)\n", 177 | "print \"For the special position %s on the two-fold axis, the orbit comprise %d points:\" % (str(p), len(orb))\n", 178 | "for o in orb:\n", 179 | " print pt_2_str(o)," 180 | ] 181 | }, 182 | { 183 | "cell_type": "markdown", 184 | "metadata": {}, 185 | "source": [ 186 | "## Orbit for Special Position on two-fold rotation axis\n", 187 | "\n", 188 | "The two-fold rotation axis are given by (x, x, 0)." 189 | ] 190 | }, 191 | { 192 | "cell_type": "code", 193 | "execution_count": 6, 194 | "metadata": { 195 | "collapsed": false 196 | }, 197 | "outputs": [ 198 | { 199 | "name": "stdout", 200 | "output_type": "stream", 201 | "text": [ 202 | "For the special position [x x 0] on the two-fold axis, the orbit comprise 12 points:\n", 203 | "[0, x, x] [-x, x, 0] [-x, -x, 0] [x, x, 0] [x, 0, x] [0, -x, x] [0, -x, -x] [-x, 0, x] [x, -x, 0] [x, 0, -x] [-x, 0, -x] [0, x, -x]\n" 204 | ] 205 | } 206 | ], 207 | "source": [ 208 | "p = np.array([x, x, 0])\n", 209 | "orb = oh.get_orbit(p, tol=0)\n", 210 | "print \"For the special position %s on the two-fold axis, the orbit comprise %d points:\" % (str(p), len(orb))\n", 211 | "for o in orb:\n", 212 | " print pt_2_str(o)," 213 | ] 214 | }, 215 | { 216 | "cell_type": "markdown", 217 | "metadata": {}, 218 | "source": [ 219 | "## Orbit for Special Position on mirror planes\n", 220 | "\n", 221 | "Positions on the mirror on the a-b plane have coordinates (x, y, 0)." 222 | ] 223 | }, 224 | { 225 | "cell_type": "code", 226 | "execution_count": 7, 227 | "metadata": { 228 | "collapsed": false 229 | }, 230 | "outputs": [ 231 | { 232 | "name": "stdout", 233 | "output_type": "stream", 234 | "text": [ 235 | "For the special position [x y 0] on the two-fold axis, the orbit comprise 24 points:\n", 236 | "[0, x, y] [-y, x, 0] [-x, -y, 0] [y, x, 0] [y, 0, x] [0, -y, x] [0, -x, -y] [0, y, x] [-x, 0, y] [y, -x, 0] [-x, y, 0] [x, y, 0] [-y, -x, 0] [x, 0, y] [x, -y, 0] [x, 0, -y] [-y, 0, -x] [0, y, -x] [y, 0, -x] [-x, 0, -y] [-y, 0, x] [0, -x, y] [0, -y, -x] [0, x, -y]\n" 237 | ] 238 | } 239 | ], 240 | "source": [ 241 | "p = np.array([x, y, 0])\n", 242 | "orb = oh.get_orbit(p, tol=0)\n", 243 | "print \"For the special position %s on the two-fold axis, the orbit comprise %d points:\" % (str(p), len(orb))\n", 244 | "for o in orb:\n", 245 | " print pt_2_str(o)," 246 | ] 247 | }, 248 | { 249 | "cell_type": "markdown", 250 | "metadata": {}, 251 | "source": [ 252 | "The orbit is similar for the other mirror planes on the a-c and b-c planes are similar." 253 | ] 254 | } 255 | ], 256 | "metadata": { 257 | "kernelspec": { 258 | "display_name": "Python 2", 259 | "language": "python", 260 | "name": "python2" 261 | }, 262 | "language_info": { 263 | "codemirror_mode": { 264 | "name": "ipython", 265 | "version": 2 266 | }, 267 | "file_extension": ".py", 268 | "mimetype": "text/x-python", 269 | "name": "python", 270 | "nbconvert_exporter": "python", 271 | "pygments_lexer": "ipython2", 272 | "version": "2.7.9" 273 | } 274 | }, 275 | "nbformat": 4, 276 | "nbformat_minor": 0 277 | } 278 | -------------------------------------------------------------------------------- /lectures/lecture_4_point_group_symmetry/Symmetry Computations on mmm (D_2h) Point Group.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# NANO106 - Symmetry Computations on $mmm (D_{2h})$ Point Group\n", 8 | "*by Shyue Ping Ong*\n", 9 | "\n", 10 | "This notebook demonstrates the computation of orbits in the mmm point group. It is part of course material for UCSD's NANO106 - Crystallography of Materials. Unlike the $m\\overline{3}m (O_h)$ version, this duplicates relevant code from the symmetry package to explicitly demonstrate the priniciples of generating point group symmetry operations. " 11 | ] 12 | }, 13 | { 14 | "cell_type": "markdown", 15 | "metadata": {}, 16 | "source": [ 17 | "# Preliminaries\n", 18 | "\n", 19 | "Let's start by importing the numpy, sympy and other packages we need." 20 | ] 21 | }, 22 | { 23 | "cell_type": "code", 24 | "execution_count": 1, 25 | "metadata": { 26 | "collapsed": false 27 | }, 28 | "outputs": [], 29 | "source": [ 30 | "import numpy as np\n", 31 | "import itertools\n", 32 | "from sympy import symbols" 33 | ] 34 | }, 35 | { 36 | "cell_type": "markdown", 37 | "metadata": {}, 38 | "source": [ 39 | "We will now define a useful function for checking existence of np.arrays in a list of arrays. It is not the most efficient implementation, but would suffice for our purposes." 40 | ] 41 | }, 42 | { 43 | "cell_type": "code", 44 | "execution_count": 2, 45 | "metadata": { 46 | "collapsed": false 47 | }, 48 | "outputs": [], 49 | "source": [ 50 | "def in_array_list(array_list, a):\n", 51 | " for i in array_list:\n", 52 | " if np.all(np.equal(a, i)):\n", 53 | " return True\n", 54 | " return False" 55 | ] 56 | }, 57 | { 58 | "cell_type": "markdown", 59 | "metadata": {}, 60 | "source": [ 61 | "# Generating the Symmetry Operations\n", 62 | "\n", 63 | "Next, we specify the generators for mmm point group, which are the three mirror planes. Note that the existence of the three two-fold rotation axes is implied by the existence of the three mirror planes." 64 | ] 65 | }, 66 | { 67 | "cell_type": "code", 68 | "execution_count": 3, 69 | "metadata": { 70 | "collapsed": false 71 | }, 72 | "outputs": [], 73 | "source": [ 74 | "generators = []\n", 75 | "for i in xrange(3):\n", 76 | " g = np.eye(3).astype(np.int)\n", 77 | " g[i, i] = -1\n", 78 | " generators.append(g)" 79 | ] 80 | }, 81 | { 82 | "cell_type": "markdown", 83 | "metadata": {}, 84 | "source": [ 85 | "We will now generate all the group symmetry operation matrices from the generators." 86 | ] 87 | }, 88 | { 89 | "cell_type": "code", 90 | "execution_count": 4, 91 | "metadata": { 92 | "collapsed": false 93 | }, 94 | "outputs": [ 95 | { 96 | "name": "stdout", 97 | "output_type": "stream", 98 | "text": [ 99 | "The order of the group is 8. The group matrices are:\n", 100 | "[[-1 0 0]\n", 101 | " [ 0 1 0]\n", 102 | " [ 0 0 1]]\n", 103 | "[[ 1 0 0]\n", 104 | " [ 0 -1 0]\n", 105 | " [ 0 0 1]]\n", 106 | "[[ 1 0 0]\n", 107 | " [ 0 1 0]\n", 108 | " [ 0 0 -1]]\n", 109 | "[[1 0 0]\n", 110 | " [0 1 0]\n", 111 | " [0 0 1]]\n", 112 | "[[-1 0 0]\n", 113 | " [ 0 -1 0]\n", 114 | " [ 0 0 1]]\n", 115 | "[[-1 0 0]\n", 116 | " [ 0 1 0]\n", 117 | " [ 0 0 -1]]\n", 118 | "[[ 1 0 0]\n", 119 | " [ 0 -1 0]\n", 120 | " [ 0 0 -1]]\n", 121 | "[[-1 0 0]\n", 122 | " [ 0 -1 0]\n", 123 | " [ 0 0 -1]]\n" 124 | ] 125 | } 126 | ], 127 | "source": [ 128 | "symm_ops = []\n", 129 | "symm_ops.extend(generators)\n", 130 | "new_ops = generators\n", 131 | "\n", 132 | "while len(new_ops) > 0:\n", 133 | " gen_ops = []\n", 134 | " for g1, g2 in itertools.product(new_ops, symm_ops):\n", 135 | " #Note that we cast the op to int to improve presentation of the results.\n", 136 | " #This is fine in crystallographic reference frame.\n", 137 | " op = np.dot(g1, g2)\n", 138 | " if not in_array_list(symm_ops, op):\n", 139 | " gen_ops.append(op)\n", 140 | " symm_ops.append(op)\n", 141 | " op = np.dot(g2, g1)\n", 142 | " if not in_array_list(symm_ops, op):\n", 143 | " gen_ops.append(op)\n", 144 | " symm_ops.append(op)\n", 145 | " new_ops = gen_ops\n", 146 | "print \"The order of the group is %d. The group matrices are:\" % len(symm_ops)\n", 147 | "for op in symm_ops:\n", 148 | " print op" 149 | ] 150 | }, 151 | { 152 | "cell_type": "markdown", 153 | "metadata": {}, 154 | "source": [ 155 | "# Computing Orbits\n", 156 | "\n", 157 | "Using sympy, we specify the symbolic symbols x, y, z to represent position coordinates. We also define a function to generate the orbit given a set of symmetry operations and a point p." 158 | ] 159 | }, 160 | { 161 | "cell_type": "code", 162 | "execution_count": 5, 163 | "metadata": { 164 | "collapsed": false 165 | }, 166 | "outputs": [], 167 | "source": [ 168 | "x, y, z = symbols(\"x y z\")\n", 169 | "\n", 170 | "def get_orbit(symm_ops, p):\n", 171 | " \"\"\"Given a set of symmops and a point p, this function returns the orbit\"\"\"\n", 172 | " orbit = []\n", 173 | " for o in symm_ops:\n", 174 | " pp = np.dot(o, p)\n", 175 | " if not in_array_list(orbit, pp):\n", 176 | " orbit.append(pp)\n", 177 | " return orbit" 178 | ] 179 | }, 180 | { 181 | "cell_type": "markdown", 182 | "metadata": {}, 183 | "source": [ 184 | "## Orbit for General Position" 185 | ] 186 | }, 187 | { 188 | "cell_type": "code", 189 | "execution_count": 6, 190 | "metadata": { 191 | "collapsed": false 192 | }, 193 | "outputs": [ 194 | { 195 | "name": "stdout", 196 | "output_type": "stream", 197 | "text": [ 198 | "For the general position [x y z], the orbit is \n", 199 | "[-x y z] [x -y z] [x y -z] [x y z] [-x -y z] [-x y -z] [x -y -z] [-x -y -z]\n" 200 | ] 201 | } 202 | ], 203 | "source": [ 204 | "p = np.array([x, y, z])\n", 205 | "print \"For the general position %s, the orbit is \" % str(p)\n", 206 | "for o in get_orbit(symm_ops, p):\n", 207 | " print o," 208 | ] 209 | }, 210 | { 211 | "cell_type": "markdown", 212 | "metadata": {}, 213 | "source": [ 214 | "## Orbit for Special Position on two-fold rotation axes" 215 | ] 216 | }, 217 | { 218 | "cell_type": "code", 219 | "execution_count": 7, 220 | "metadata": { 221 | "collapsed": false 222 | }, 223 | "outputs": [ 224 | { 225 | "name": "stdout", 226 | "output_type": "stream", 227 | "text": [ 228 | "For the special position [0 0 z] on the two-fold axis, the orbit comprise 2 points:\n", 229 | "[0 0 z] [0 0 -z]\n" 230 | ] 231 | } 232 | ], 233 | "source": [ 234 | "p = np.array([0, 0, z])\n", 235 | "orb = get_orbit(symm_ops, p)\n", 236 | "print \"For the special position %s on the two-fold axis, the orbit comprise %d points:\" % (str(p), len(orb))\n", 237 | "for o in orb:\n", 238 | " print o," 239 | ] 240 | }, 241 | { 242 | "cell_type": "markdown", 243 | "metadata": {}, 244 | "source": [ 245 | "The orbit is similar for the other two-fold axes on the a and b axes are similar." 246 | ] 247 | }, 248 | { 249 | "cell_type": "markdown", 250 | "metadata": {}, 251 | "source": [ 252 | "## Orbit for Special Position on mirror planes\n", 253 | "\n", 254 | "Positions on the mirror on the a-b plane have coordinates (x, y, 0)." 255 | ] 256 | }, 257 | { 258 | "cell_type": "code", 259 | "execution_count": 8, 260 | "metadata": { 261 | "collapsed": false 262 | }, 263 | "outputs": [ 264 | { 265 | "name": "stdout", 266 | "output_type": "stream", 267 | "text": [ 268 | "For the special position [x y 0] on the two-fold axis, the orbit comprise 4 points:\n", 269 | "[-x y 0] [x -y 0] [x y 0] [-x -y 0]\n" 270 | ] 271 | } 272 | ], 273 | "source": [ 274 | "p = np.array([x, y, 0])\n", 275 | "orb = get_orbit(symm_ops, p)\n", 276 | "print \"For the special position %s on the two-fold axis, the orbit comprise %d points:\" % (str(p), len(orb))\n", 277 | "for o in orb:\n", 278 | " print o," 279 | ] 280 | }, 281 | { 282 | "cell_type": "markdown", 283 | "metadata": {}, 284 | "source": [ 285 | "The orbit is similar for the other two mirror planes on the a-c and b-c planes are similar." 286 | ] 287 | } 288 | ], 289 | "metadata": { 290 | "kernelspec": { 291 | "display_name": "Python 2", 292 | "language": "python", 293 | "name": "python2" 294 | }, 295 | "language_info": { 296 | "codemirror_mode": { 297 | "name": "ipython", 298 | "version": 2 299 | }, 300 | "file_extension": ".py", 301 | "mimetype": "text/x-python", 302 | "name": "python", 303 | "nbconvert_exporter": "python", 304 | "pygments_lexer": "ipython2", 305 | "version": "2.7.9" 306 | } 307 | }, 308 | "nbformat": 4, 309 | "nbformat_minor": 0 310 | } 311 | -------------------------------------------------------------------------------- /lectures/molecules/C1_H1C1Br1Cl1F1.xyz: -------------------------------------------------------------------------------- 1 | 5 2 | H1 C1 Br1 Cl1 F1 3 | C 0.000000 0.000000 0.000000 4 | H 0.000000 0.000000 1.080000 5 | F 1.026719 0.000000 -0.363000 6 | Br -0.513360 -0.889165 -0.363000 7 | Cl -0.513360 0.889165 -0.363000 -------------------------------------------------------------------------------- /lectures/molecules/C2_H2O2.xyz: -------------------------------------------------------------------------------- 1 | 4 2 | H2 O2 3 | O 0.000000 0.727403 -0.050147 4 | O 0.000000 -0.727403 -0.050147 5 | H 0.834590 0.897642 0.401175 6 | H -0.834590 -0.897642 0.401175 -------------------------------------------------------------------------------- /lectures/molecules/C2v_C1S2.xyz: -------------------------------------------------------------------------------- 1 | 3 2 | C1 S2 3 | S 0.000000 -0.056055 1.619772 4 | S 0.000000 -0.056055 -1.619772 5 | C 0.000000 0.299480 0.000000 -------------------------------------------------------------------------------- /lectures/molecules/C2v_H2O1.xyz: -------------------------------------------------------------------------------- 1 | 3 2 | H2 O1 3 | H 0.000000 0.780362 -0.456316 4 | O 0.000000 0.000000 0.114079 5 | H 0.000000 -0.780362 -0.456316 -------------------------------------------------------------------------------- /lectures/molecules/C3_Triphenylphosphine.xyz: -------------------------------------------------------------------------------- 1 | 34 2 | P1 H15 C18 3 | P -0.068500 -0.020100 1.281900 4 | C -1.704800 -0.204200 0.506200 5 | C 0.651300 1.482200 0.531400 6 | C 0.977000 -1.301500 0.504800 7 | C -1.842200 -0.946900 -0.666500 8 | C -0.071900 2.194200 -0.420500 9 | C 1.692600 -1.002800 -0.650500 10 | C -2.821500 0.399100 1.084500 11 | C 1.919900 1.904900 0.915800 12 | C 1.050000 -2.569400 1.072800 13 | C -3.096500 -1.086300 -1.261000 14 | C 0.479200 3.340200 -0.993900 15 | C 2.489400 -1.982200 -1.243700 16 | C -4.075700 0.259800 0.490100 17 | C 2.471000 3.051000 0.342600 18 | C 1.846700 -3.548700 0.479600 19 | C -4.213100 -0.482900 -0.682600 20 | C 1.750600 3.768600 -0.612300 21 | C 2.566400 -3.255000 -0.678700 22 | H -1.010200 -1.430200 -1.165700 23 | H -1.062200 1.911300 -0.758100 24 | H 1.647600 -0.049600 -1.164200 25 | H -2.737300 0.983000 1.997900 26 | H 2.498300 1.363000 1.660100 27 | H 0.496500 -2.819100 1.974600 28 | H -3.204000 -1.662600 -2.175300 29 | H -0.080900 3.899400 -1.737700 30 | H 3.042900 -1.757300 -2.150800 31 | H -4.945300 0.729900 0.940000 32 | H 3.460700 3.385000 0.639900 33 | H 1.906200 -4.540200 0.918800 34 | H -5.189500 -0.590700 -1.145700 35 | H 2.179600 4.660900 -1.058700 36 | H 3.184900 -4.018300 -1.141800 -------------------------------------------------------------------------------- /lectures/molecules/C3v_H3N1.xyz: -------------------------------------------------------------------------------- 1 | 4 2 | H3 N1 3 | N 0.000000 0.000000 0.000000 4 | H 0.000000 -0.937700 -0.381600 5 | H 0.812100 0.468900 -0.381600 6 | H -0.812100 0.468900 -0.381600 -------------------------------------------------------------------------------- /lectures/molecules/C4v_SF5Cl.xyz: -------------------------------------------------------------------------------- 1 | 7 2 | S1 Cl1 F5 3 | Cl 0.881182 -0.000919 -0.098919 4 | F 3.010273 0.558993 1.325104 5 | F 3.010273 -1.424942 0.460993 6 | F 4.935686 -0.000919 -0.098919 7 | F 3.010273 -0.560831 -1.522942 8 | F 3.010273 1.423104 -0.658831 9 | S 3.284493 -0.000919 -0.098919 -------------------------------------------------------------------------------- /lectures/molecules/Ci_H2C2Br2F2.xyz: -------------------------------------------------------------------------------- 1 | 8 2 | H2 C2 Br2 F2 3 | C -0.752000 0.001000 -0.141000 4 | C 0.752000 -0.001000 0.141000 5 | F -1.158000 0.991000 0.070000 6 | Br -1.240000 -0.737000 0.496000 7 | H -0.924000 -0.249000 -1.188000 8 | F 1.158000 -0.991000 -0.070000 9 | H 0.924000 0.249000 1.188000 10 | Br 1.240000 0.737000 -0.496000 -------------------------------------------------------------------------------- /lectures/molecules/Cs_CH2ClF.xyz: -------------------------------------------------------------------------------- 1 | 5 2 | H2 C1 Cl1 F1 3 | C 1.021111 0.010034 0.100312 4 | Cl 0.433598 -1.150097 1.293110 5 | F 2.377848 0.015358 0.094838 6 | H 0.665243 1.010285 0.357856 7 | H 0.665242 -0.275178 -0.892403 -------------------------------------------------------------------------------- /lectures/molecules/Cs_H1C1Br1Cl1F1.xyz: -------------------------------------------------------------------------------- 1 | 5 2 | H1 C1 Br1 Cl1 F1 3 | C 0.000000 0.000000 0.000000 4 | H 0.000000 0.000000 1.080000 5 | F 1.026719 0.000000 -0.363000 6 | Br -0.513360 -0.889165 -0.363000 7 | Cl -0.513360 0.889165 -0.363000 -------------------------------------------------------------------------------- /lectures/molecules/D*h_H2C1.xyz: -------------------------------------------------------------------------------- 1 | 3 2 | H2 C1 3 | C 0.000000 0.000000 0.000000 4 | H 0.000000 0.000000 1.080000 5 | H 0.000000 0.000000 -1.080000 -------------------------------------------------------------------------------- /lectures/molecules/D2h_H4C2.xyz: -------------------------------------------------------------------------------- 1 | 6 2 | H4 C2 3 | C 0.000000 0.000000 0.669500 4 | C 0.000000 0.000000 -0.669500 5 | H 0.000000 0.928900 1.232100 6 | H 0.000000 -0.928900 1.232100 7 | H 0.000000 0.928900 -1.232100 8 | H 0.000000 -0.928900 -1.232100 -------------------------------------------------------------------------------- /lectures/molecules/D3h_B1F3.xyz: -------------------------------------------------------------------------------- 1 | 4 2 | B1 F3 3 | B 0.000000 0.000000 0.000000 4 | F 0.000000 -0.937700 0.000000 5 | F 0.812100 0.468900 0.000000 6 | F -0.812100 0.468900 0.000000 -------------------------------------------------------------------------------- /lectures/molecules/D6h_Benzene.xyz: -------------------------------------------------------------------------------- 1 | 12 2 | benzene example 3 | C 0.00000 1.40272 0.00000 4 | H 0.00000 2.49029 0.00000 5 | C -1.21479 0.70136 0.00000 6 | H -2.15666 1.24515 0.00000 7 | C -1.21479 -0.70136 0.00000 8 | H -2.15666 -1.24515 0.00000 9 | C 0.00000 -1.40272 0.00000 10 | H 0.00000 -2.49029 0.00000 11 | C 1.21479 -0.70136 0.00000 12 | H 2.15666 -1.24515 0.00000 13 | C 1.21479 0.70136 0.00000 14 | H 2.15666 1.24515 0.00000 -------------------------------------------------------------------------------- /lectures/molecules/Oh_P1F6.xyz: -------------------------------------------------------------------------------- 1 | 7 2 | P1 F6 3 | P 0.000000 0.000000 0.000000 4 | F 0.000000 0.000000 1.000000 5 | F 0.000000 0.000000 -1.000000 6 | F 0.000000 1.000000 0.000000 7 | F 0.000000 -1.000000 0.000000 8 | F 1.000000 0.000000 0.000000 9 | F -1.000000 0.000000 0.000000 -------------------------------------------------------------------------------- /lectures/molecules/Td_H4C1.xyz: -------------------------------------------------------------------------------- 1 | 5 2 | H4 C1 3 | C 0.000000 0.000000 0.000000 4 | H 0.000000 0.000000 1.080000 5 | H 1.026719 0.000000 -0.363000 6 | H -0.513360 -0.889165 -0.363000 7 | H -0.513360 0.889165 -0.363000 -------------------------------------------------------------------------------- /problem_sets/PS1 - Qn 4.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "metadata": { 3 | "name": "", 4 | "signature": "sha256:89d7113d674f4cf35d64277a55750cc993061b11d2208170baef93de468d8236" 5 | }, 6 | "nbformat": 3, 7 | "nbformat_minor": 0, 8 | "worksheets": [ 9 | { 10 | "cells": [ 11 | { 12 | "cell_type": "heading", 13 | "level": 2, 14 | "metadata": {}, 15 | "source": [ 16 | "4. Someone has provided the following lattice vectors for Li2O2, which is of interest in state-of-the-art lithium-air batteries. " 17 | ] 18 | }, 19 | { 20 | "cell_type": "code", 21 | "collapsed": false, 22 | "input": [ 23 | "a = [1.5915, 2.756559, 0]\n", 24 | "b = [1.5915, -2.756559, 0]\n", 25 | "c = [0, 0, 7.7258]" 26 | ], 27 | "language": "python", 28 | "metadata": {}, 29 | "outputs": [], 30 | "prompt_number": 1 31 | }, 32 | { 33 | "cell_type": "heading", 34 | "level": 2, 35 | "metadata": {}, 36 | "source": [ 37 | "a. What are the lattice parameters for Li2O2?" 38 | ] 39 | }, 40 | { 41 | "cell_type": "markdown", 42 | "metadata": {}, 43 | "source": [ 44 | "Solution:\n", 45 | "\n", 46 | "a = $|\\mathbf{a}|$\n", 47 | "\n", 48 | "b = $|\\mathbf{b}|$\n", 49 | "\n", 50 | "c = $|\\mathbf{c}|$\n", 51 | "\n", 52 | "$\\alpha$ = $cos^{-1}(\\frac{\\mathbf{b}.\\mathbf{c}}{|\\mathbf{b}||\\mathbf{c}|})$\n", 53 | "\n", 54 | "$\\beta$ = $cos^{-1}(\\frac{\\mathbf{a}.\\mathbf{c}}{|\\mathbf{a}||\\mathbf{c}|})$\n", 55 | "\n", 56 | "$\\gamma$ = $cos^{-1}(\\frac{\\mathbf{a}.\\mathbf{b}}{|\\mathbf{a}||\\mathbf{b}|})$" 57 | ] 58 | }, 59 | { 60 | "cell_type": "code", 61 | "collapsed": false, 62 | "input": [ 63 | "import numpy as np\n", 64 | "from math import acos, degrees\n", 65 | "\n", 66 | "a_length = np.linalg.norm(a)\n", 67 | "b_length = np.linalg.norm(b)\n", 68 | "c_length = np.linalg.norm(c)\n", 69 | "alpha_angle = degrees(acos(np.dot(b, c) / (b_length * c_length)))\n", 70 | "beta_angle = degrees(acos(np.dot(a, c) / (a_length * c_length)))\n", 71 | "gamma_angle = degrees(acos(np.dot(a, b) / (a_length * b_length)))\n", 72 | "print \"The lattice parameters are {%.4f, %.4f, %.4f, %.4f, %.4f, %.4f}.\" % (a_length, b_length, c_length, alpha_angle, beta_angle, gamma_angle)" 73 | ], 74 | "language": "python", 75 | "metadata": {}, 76 | "outputs": [ 77 | { 78 | "output_type": "stream", 79 | "stream": "stdout", 80 | "text": [ 81 | "The lattice parameters are {3.1830, 3.1830, 7.7258, 90.0000, 90.0000, 120.0000}.\n" 82 | ] 83 | } 84 | ], 85 | "prompt_number": 2 86 | }, 87 | { 88 | "cell_type": "heading", 89 | "level": 2, 90 | "metadata": {}, 91 | "source": [ 92 | "b. What is the crystal system for Li2O2?" 93 | ] 94 | }, 95 | { 96 | "cell_type": "markdown", 97 | "metadata": {}, 98 | "source": [ 99 | "Solution: The cell system is hexagonal." 100 | ] 101 | } 102 | ], 103 | "metadata": {} 104 | } 105 | ] 106 | } -------------------------------------------------------------------------------- /problem_sets/PS1 - Qn 8.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "metadata": { 3 | "name": "", 4 | "signature": "sha256:17d65df3b0c57a8fd111ea8eab4ef3133d5cb21c08bd9fb7e72c33e3a99bce28" 5 | }, 6 | "nbformat": 3, 7 | "nbformat_minor": 0, 8 | "worksheets": [ 9 | { 10 | "cells": [ 11 | { 12 | "cell_type": "heading", 13 | "level": 2, 14 | "metadata": {}, 15 | "source": [ 16 | "8. Consider the point group 4mm. It can be generated from a 4-fold rotation axis about the c-axis and a coinciding mirror plane about the a-c plane." 17 | ] 18 | }, 19 | { 20 | "cell_type": "heading", 21 | "level": 2, 22 | "metadata": {}, 23 | "source": [ 24 | "a. Write down the 3D matrix representations for the two generators in the tetragonal basis." 25 | ] 26 | }, 27 | { 28 | "cell_type": "markdown", 29 | "metadata": {}, 30 | "source": [ 31 | "Solution:\n", 32 | " \n", 33 | "The 4-fold rotation axis maps the $\\mathbf{a}$ and $\\mathbf{b}$ lattice vectors to $\\mathbf{a}'$ and $\\mathbf{b}'$, where $\\mathbf{a}'$ = $\\mathbf{b}$ and $\\mathbf{b}'$ = -$\\mathbf{a}$. Hence, the matrix is" 34 | ] 35 | }, 36 | { 37 | "cell_type": "code", 38 | "collapsed": false, 39 | "input": [ 40 | "D_4 = [[0, -1, 0],\n", 41 | " [1, 0, 0],\n", 42 | " [0, 0, 1]]" 43 | ], 44 | "language": "python", 45 | "metadata": {}, 46 | "outputs": [], 47 | "prompt_number": 1 48 | }, 49 | { 50 | "cell_type": "markdown", 51 | "metadata": {}, 52 | "source": [ 53 | "The mirror plane maps $\\mathbf{b}$ lattice vector to $\\mathbf{b}'$, where $\\mathbf{b}'$ = -$\\mathbf{b}$. Hence, the matrix is" 54 | ] 55 | }, 56 | { 57 | "cell_type": "code", 58 | "collapsed": false, 59 | "input": [ 60 | "D_m = [[1, 0, 0],\n", 61 | " [0, -1, 0],\n", 62 | " [0, 0, 1]]" 63 | ], 64 | "language": "python", 65 | "metadata": {}, 66 | "outputs": [], 67 | "prompt_number": 2 68 | }, 69 | { 70 | "cell_type": "heading", 71 | "level": 2, 72 | "metadata": {}, 73 | "source": [ 74 | "b. Determine the matrix representations for all symmetry elements in the group, and construct a multiplication table for the 4mm point group. " 75 | ] 76 | }, 77 | { 78 | "cell_type": "markdown", 79 | "metadata": {}, 80 | "source": [ 81 | "Solution: All symmetry elements can be obtained by the multiplication of the generators." 82 | ] 83 | }, 84 | { 85 | "cell_type": "code", 86 | "collapsed": false, 87 | "input": [ 88 | "import numpy as np\n", 89 | "\n", 90 | "D = {}\n", 91 | "D[\"4\"] = np.array(D_4)\n", 92 | "D[\"m\"] = np.array(D_m)\n", 93 | "D[\"4_2\"] = np.dot(D[\"4\"], D[\"4\"])\n", 94 | "D[\"4_3\"] = np.dot(D[\"4\"], D[\"4_2\"])\n", 95 | "D[\"E\"] = np.dot(D[\"4\"], D[\"4_3\"])\n", 96 | "D[\"m_4\"] = np.dot(D[\"m\"], D[\"4\"])\n", 97 | "D[\"m_4_2\"] = np.dot(D[\"m\"], D[\"4_2\"])\n", 98 | "D[\"m_4_3\"] = np.dot(D[\"m\"], D[\"4_3\"])\n", 99 | "\n", 100 | "print \"The complete set of symmetry elements are given by the following matrices:\"\n", 101 | "for k, v in D.items():\n", 102 | " print \"%s = %s\" % (k, str(v))" 103 | ], 104 | "language": "python", 105 | "metadata": {}, 106 | "outputs": [ 107 | { 108 | "output_type": "stream", 109 | "stream": "stdout", 110 | "text": [ 111 | "The complete set of symmetry elements are given by the following matrices:\n", 112 | "E = [[1 0 0]\n", 113 | " [0 1 0]\n", 114 | " [0 0 1]]\n", 115 | "m = [[ 1 0 0]\n", 116 | " [ 0 -1 0]\n", 117 | " [ 0 0 1]]\n", 118 | "4 = [[ 0 -1 0]\n", 119 | " [ 1 0 0]\n", 120 | " [ 0 0 1]]\n", 121 | "m_4_2 = [[-1 0 0]\n", 122 | " [ 0 1 0]\n", 123 | " [ 0 0 1]]\n", 124 | "m_4_3 = [[0 1 0]\n", 125 | " [1 0 0]\n", 126 | " [0 0 1]]\n", 127 | "4_2 = [[-1 0 0]\n", 128 | " [ 0 -1 0]\n", 129 | " [ 0 0 1]]\n", 130 | "4_3 = [[ 0 1 0]\n", 131 | " [-1 0 0]\n", 132 | " [ 0 0 1]]\n", 133 | "m_4 = [[ 0 -1 0]\n", 134 | " [-1 0 0]\n", 135 | " [ 0 0 1]]\n" 136 | ] 137 | } 138 | ], 139 | "prompt_number": 3 140 | }, 141 | { 142 | "cell_type": "markdown", 143 | "metadata": {}, 144 | "source": [ 145 | "The multiplication table is given below:" 146 | ] 147 | }, 148 | { 149 | "cell_type": "code", 150 | "collapsed": false, 151 | "input": [ 152 | "import itertools\n", 153 | "keys = [\"E\", \"4\", \"4_2\", \"4_3\", \"m\", \"m_4\", \"m_4_2\", \"m_4_3\"]\n", 154 | "def find_key(m):\n", 155 | " for k, v in D.items():\n", 156 | " if np.all(v == m):\n", 157 | " return k\n", 158 | "from prettytable import PrettyTable\n", 159 | "\n", 160 | "t = PrettyTable([\"\"] + keys)\n", 161 | "headers = list(keys)\n", 162 | "for k1 in keys:\n", 163 | " row = [k1]\n", 164 | " for k2 in keys:\n", 165 | " prod = np.dot(D[k1], D[k2])\n", 166 | " row.append(find_key(prod))\n", 167 | " t.add_row(row)\n", 168 | "print t" 169 | ], 170 | "language": "python", 171 | "metadata": {}, 172 | "outputs": [ 173 | { 174 | "output_type": "stream", 175 | "stream": "stdout", 176 | "text": [ 177 | "+-------+-------+-------+-------+-------+-------+-------+-------+-------+\n", 178 | "| | E | 4 | 4_2 | 4_3 | m | m_4 | m_4_2 | m_4_3 |\n", 179 | "+-------+-------+-------+-------+-------+-------+-------+-------+-------+\n", 180 | "| E | E | 4 | 4_2 | 4_3 | m | m_4 | m_4_2 | m_4_3 |\n", 181 | "| 4 | 4 | 4_2 | 4_3 | E | m_4_3 | m | m_4 | m_4_2 |\n", 182 | "| 4_2 | 4_2 | 4_3 | E | 4 | m_4_2 | m_4_3 | m | m_4 |\n", 183 | "| 4_3 | 4_3 | E | 4 | 4_2 | m_4 | m_4_2 | m_4_3 | m |\n", 184 | "| m | m | m_4 | m_4_2 | m_4_3 | E | 4 | 4_2 | 4_3 |\n", 185 | "| m_4 | m_4 | m_4_2 | m_4_3 | m | 4_3 | E | 4 | 4_2 |\n", 186 | "| m_4_2 | m_4_2 | m_4_3 | m | m_4 | 4_2 | 4_3 | E | 4 |\n", 187 | "| m_4_3 | m_4_3 | m | m_4 | m_4_2 | 4 | 4_2 | 4_3 | E |\n", 188 | "+-------+-------+-------+-------+-------+-------+-------+-------+-------+\n" 189 | ] 190 | } 191 | ], 192 | "prompt_number": 4 193 | }, 194 | { 195 | "cell_type": "heading", 196 | "level": 2, 197 | "metadata": {}, 198 | "source": [ 199 | "c. What are the subgroups of the 4mm point group?" 200 | ] 201 | }, 202 | { 203 | "cell_type": "markdown", 204 | "metadata": {}, 205 | "source": [ 206 | "Solution:\n", 207 | "\n", 208 | "4, m, m_4, m_4_2 and m_4_3 are subgroups of 4mm. " 209 | ] 210 | }, 211 | { 212 | "cell_type": "heading", 213 | "level": 2, 214 | "metadata": {}, 215 | "source": [ 216 | "d. Draw a stereographic projection for the point group." 217 | ] 218 | }, 219 | { 220 | "cell_type": "markdown", 221 | "metadata": {}, 222 | "source": [ 223 | "Solutinon: \n", 224 | " \n", 225 | "Refer to Structure of Materials Chapter 9, Fig 9.7." 226 | ] 227 | }, 228 | { 229 | "cell_type": "heading", 230 | "level": 2, 231 | "metadata": {}, 232 | "source": [ 233 | "e. Determine the orbit for the general position (x, y, z)." 234 | ] 235 | }, 236 | { 237 | "cell_type": "markdown", 238 | "metadata": {}, 239 | "source": [ 240 | "Solution: \n", 241 | " \n", 242 | "The orbit of the generalposition is given by:" 243 | ] 244 | }, 245 | { 246 | "cell_type": "code", 247 | "collapsed": false, 248 | "input": [ 249 | "from sympy import symbols\n", 250 | "x, y, z = symbols(\"x y z\")\n", 251 | "p = [x, y, z]\n", 252 | "for k, v in D.items():\n", 253 | " print np.dot(v, p)" 254 | ], 255 | "language": "python", 256 | "metadata": {}, 257 | "outputs": [ 258 | { 259 | "output_type": "stream", 260 | "stream": "stdout", 261 | "text": [ 262 | "[x y z]\n", 263 | "[x -y z]\n", 264 | "[-y x z]\n", 265 | "[-x y z]\n", 266 | "[y x z]\n", 267 | "[-x -y z]\n", 268 | "[y -x z]\n", 269 | "[-y -x z]\n" 270 | ] 271 | } 272 | ], 273 | "prompt_number": 5 274 | }, 275 | { 276 | "cell_type": "heading", 277 | "level": 2, 278 | "metadata": {}, 279 | "source": [ 280 | "f. Identify possible special positions and determine the orbits of points lying on these special positions." 281 | ] 282 | }, 283 | { 284 | "cell_type": "markdown", 285 | "metadata": {}, 286 | "source": [ 287 | "Solution:\n", 288 | "\n", 289 | "There are special positions on the 4-fold axis (0, 0, z), the mirror plane (0, y, 0) and the diagonal mirror plane (x, x, z)." 290 | ] 291 | }, 292 | { 293 | "cell_type": "markdown", 294 | "metadata": {}, 295 | "source": [ 296 | "The orbit for the special position (0, 0, z) on the 4-fold axis is given by:" 297 | ] 298 | }, 299 | { 300 | "cell_type": "code", 301 | "collapsed": false, 302 | "input": [ 303 | "p = [0, 0, z]\n", 304 | "orbit = []\n", 305 | "for k, v in D.items():\n", 306 | " orbit.append(str(np.dot(v, p)))\n", 307 | "for o in set(orbit):\n", 308 | " print o" 309 | ], 310 | "language": "python", 311 | "metadata": {}, 312 | "outputs": [ 313 | { 314 | "output_type": "stream", 315 | "stream": "stdout", 316 | "text": [ 317 | "[0 0 z]\n" 318 | ] 319 | } 320 | ], 321 | "prompt_number": 6 322 | }, 323 | { 324 | "cell_type": "markdown", 325 | "metadata": {}, 326 | "source": [ 327 | "The orbit for the special position (0, y, 0) on the mirror plane on the a-c plane is given by:" 328 | ] 329 | }, 330 | { 331 | "cell_type": "code", 332 | "collapsed": false, 333 | "input": [ 334 | "p = [0, y, 0]\n", 335 | "orbit = []\n", 336 | "for k, v in D.items():\n", 337 | " orbit.append(str(np.dot(v, p)))\n", 338 | "for o in set(orbit):\n", 339 | " print o" 340 | ], 341 | "language": "python", 342 | "metadata": {}, 343 | "outputs": [ 344 | { 345 | "output_type": "stream", 346 | "stream": "stdout", 347 | "text": [ 348 | "[0 y 0]\n", 349 | "[0 -y 0]\n", 350 | "[-y 0 0]\n", 351 | "[y 0 0]\n" 352 | ] 353 | } 354 | ], 355 | "prompt_number": 7 356 | }, 357 | { 358 | "cell_type": "markdown", 359 | "metadata": {}, 360 | "source": [ 361 | "The orbit for the special position (x, x, z) on the diagonal mirror plane is given by:" 362 | ] 363 | }, 364 | { 365 | "cell_type": "code", 366 | "collapsed": false, 367 | "input": [ 368 | "p = [x, x, z]\n", 369 | "orbit = []\n", 370 | "for k, v in D.items():\n", 371 | " orbit.append(str(np.dot(v, p)))\n", 372 | "for o in set(orbit):\n", 373 | " print o" 374 | ], 375 | "language": "python", 376 | "metadata": {}, 377 | "outputs": [ 378 | { 379 | "output_type": "stream", 380 | "stream": "stdout", 381 | "text": [ 382 | "[-x x z]\n", 383 | "[x x z]\n", 384 | "[-x -x z]\n", 385 | "[x -x z]\n" 386 | ] 387 | } 388 | ], 389 | "prompt_number": 8 390 | }, 391 | { 392 | "cell_type": "markdown", 393 | "metadata": {}, 394 | "source": [ 395 | "**Note that all special positions have orbits that have < 8 elements.**" 396 | ] 397 | } 398 | ], 399 | "metadata": {} 400 | } 401 | ] 402 | } -------------------------------------------------------------------------------- /problem_sets/PS1 - Qn 9.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "metadata": { 3 | "name": "", 4 | "signature": "sha256:008449515032517dd00b2b71fb47cf986e8bc633bfad3e80b6569fc3a22ba5c9" 5 | }, 6 | "nbformat": 3, 7 | "nbformat_minor": 0, 8 | "worksheets": [ 9 | { 10 | "cells": [ 11 | { 12 | "cell_type": "heading", 13 | "level": 2, 14 | "metadata": {}, 15 | "source": [ 16 | "9. Show mathematically that the combination of a mirror plane and a translation vector $\\mathbf{t}$ perpendicular to the mirror plane implies the existence of a mirror plane at $\\mathbf{t}$/2." 17 | ] 18 | }, 19 | { 20 | "cell_type": "markdown", 21 | "metadata": {}, 22 | "source": [ 23 | "Solution:\n", 24 | " \n", 25 | "Without loss of generality, let's define the translation vector be to the c-basis vector (note that we can always redefine basis vectors to make this the case).\n", 26 | "\n", 27 | "The mirror operation is therefore given by:" 28 | ] 29 | }, 30 | { 31 | "cell_type": "code", 32 | "collapsed": false, 33 | "input": [ 34 | "import numpy as np\n", 35 | "M = np.eye(4).astype(np.int)\n", 36 | "M[2, 2] = -1\n", 37 | "print M" 38 | ], 39 | "language": "python", 40 | "metadata": {}, 41 | "outputs": [ 42 | { 43 | "output_type": "stream", 44 | "stream": "stdout", 45 | "text": [ 46 | "[[ 1 0 0 0]\n", 47 | " [ 0 1 0 0]\n", 48 | " [ 0 0 -1 0]\n", 49 | " [ 0 0 0 1]]\n" 50 | ] 51 | } 52 | ], 53 | "prompt_number": 1 54 | }, 55 | { 56 | "cell_type": "markdown", 57 | "metadata": {}, 58 | "source": [ 59 | "The translation operation is given by:" 60 | ] 61 | }, 62 | { 63 | "cell_type": "code", 64 | "collapsed": false, 65 | "input": [ 66 | "from sympy import symbols\n", 67 | "t = symbols(\"t\")\n", 68 | "T = [[1, 0, 0, 0],\n", 69 | " [0, 1, 0, 0],\n", 70 | " [0, 0, 1, t],\n", 71 | " [0, 0, 0, 1]]" 72 | ], 73 | "language": "python", 74 | "metadata": {}, 75 | "outputs": [], 76 | "prompt_number": 2 77 | }, 78 | { 79 | "cell_type": "markdown", 80 | "metadata": {}, 81 | "source": [ 82 | "Consider the relationship between a reflected point and a translated point. The operation that maps the reflected point to the translated point is given by:\n", 83 | "\n", 84 | "$Op_m = p_t$\n", 85 | "\n", 86 | "$OMp = Tp$\n", 87 | "\n", 88 | "$OM = T$\n", 89 | "\n", 90 | "=> $O = TM^{-1}$" 91 | ] 92 | }, 93 | { 94 | "cell_type": "code", 95 | "collapsed": false, 96 | "input": [ 97 | "O = np.dot(T, np.linalg.inv(M))\n", 98 | "print \"O = %s\" % str(O)" 99 | ], 100 | "language": "python", 101 | "metadata": {}, 102 | "outputs": [ 103 | { 104 | "output_type": "stream", 105 | "stream": "stdout", 106 | "text": [ 107 | "O = [[1.0 0.0 0.0 0.0]\n", 108 | " [0.0 1.0 0.0 0.0]\n", 109 | " [0 0 -1.00000000000000 1.0*t]\n", 110 | " [0.0 0.0 0.0 1.0]]\n" 111 | ] 112 | } 113 | ], 114 | "prompt_number": 3 115 | }, 116 | { 117 | "cell_type": "markdown", 118 | "metadata": {}, 119 | "source": [ 120 | "Now consider a mirror plane at t/2. The symmetry operation is given by:\n", 121 | "\n", 122 | "$O' = T_{t/2}MT_{-t/2}$ " 123 | ] 124 | }, 125 | { 126 | "cell_type": "code", 127 | "collapsed": false, 128 | "input": [ 129 | " T__t2 = [[1, 0, 0, 0],\n", 130 | " [0, 1, 0, 0],\n", 131 | " [0, 0, 1, -t/2],\n", 132 | " [0, 0, 0, 1]]\n", 133 | "T_t2 = [[1, 0, 0, 0],\n", 134 | " [0, 1, 0, 0],\n", 135 | " [0, 0, 1, t/2],\n", 136 | " [0, 0, 0, 1]]\n", 137 | "O = np.dot(T_t2, np.dot(M, T__t2))\n", 138 | "print \"O' = %s\" % str(O)" 139 | ], 140 | "language": "python", 141 | "metadata": {}, 142 | "outputs": [ 143 | { 144 | "output_type": "stream", 145 | "stream": "stdout", 146 | "text": [ 147 | "O' = [[1 0 0 0]\n", 148 | " [0 1 0 0]\n", 149 | " [0 0 -1 t]\n", 150 | " [0 0 0 1]]\n" 151 | ] 152 | } 153 | ], 154 | "prompt_number": 4 155 | }, 156 | { 157 | "cell_type": "markdown", 158 | "metadata": {}, 159 | "source": [ 160 | "We may observe that $O' = O$, i.e., a reflection with a perpendicular translation **t** implies the existence of a mirror plane at **t/2**." 161 | ] 162 | }, 163 | { 164 | "cell_type": "code", 165 | "collapsed": false, 166 | "input": [], 167 | "language": "python", 168 | "metadata": {}, 169 | "outputs": [], 170 | "prompt_number": 4 171 | } 172 | ], 173 | "metadata": {} 174 | } 175 | ] 176 | } -------------------------------------------------------------------------------- /problem_sets/PbTiO3.cif: -------------------------------------------------------------------------------- 1 | 2 | #(C) 2014 by Fachinformationszentrum Karlsruhe. All rights reserved. 3 | data_90693-ICSD 4 | _database_code_ICSD 90693 5 | _audit_creation_date 2002-04-01 6 | _audit_update_record 2006-04-01 7 | _chemical_name_systematic 'Lead titanate' 8 | _chemical_formula_structural 'Pb (Ti O3)' 9 | _chemical_formula_sum 'O3 Pb1 Ti1' 10 | _chemical_name_structure_type PbTiO3 11 | _chemical_name_mineral Macedonite 12 | _exptl_crystal_density_diffrn 7.99 13 | _publ_section_title 14 | 15 | ; 16 | Structural investigations on Pb (Zrx Ti1-x) O3 solid solutions using the X-ray 17 | Rietveld method 18 | ; 19 | loop_ 20 | _citation_id 21 | _citation_journal_full 22 | _citation_year 23 | _citation_journal_volume 24 | _citation_page_first 25 | _citation_page_last 26 | _citation_journal_id_ASTM 27 | primary 'Journal of Materials Science' 2000 35 1571 1575 JMTSAS 28 | loop_ 29 | _publ_author_name 30 | 'Joseph, J.' 31 | 'Vimala, T.M.' 32 | 'Sivasubramanian, V.' 33 | 'Murthy, V.R.K.' 34 | _cell_length_a 3.9039(2) 35 | _cell_length_b 3.9039(2) 36 | _cell_length_c 4.1348(3) 37 | _cell_angle_alpha 90. 38 | _cell_angle_beta 90. 39 | _cell_angle_gamma 90. 40 | _cell_volume 63.02 41 | _cell_formula_units_Z 1 42 | _symmetry_space_group_name_H-M 'P 4 m m' 43 | _symmetry_Int_Tables_number 99 44 | _refine_ls_R_factor_all 0.042 45 | loop_ 46 | _symmetry_equiv_pos_site_id 47 | _symmetry_equiv_pos_as_xyz 48 | 1 'y, -x, z' 49 | 2 '-y, x, z' 50 | 3 '-y, -x, z' 51 | 4 'y, x, z' 52 | 5 'x, -y, z' 53 | 6 '-x, y, z' 54 | 7 '-x, -y, z' 55 | 8 'x, y, z' 56 | loop_ 57 | _atom_type_symbol 58 | _atom_type_oxidation_number 59 | Pb2+ 2 60 | Ti4+ 4 61 | O2- -2 62 | loop_ 63 | _atom_site_label 64 | _atom_site_type_symbol 65 | _atom_site_symmetry_multiplicity 66 | _atom_site_Wyckoff_symbol 67 | _atom_site_fract_x 68 | _atom_site_fract_y 69 | _atom_site_fract_z 70 | _atom_site_B_iso_or_equiv 71 | _atom_site_occupancy 72 | _atom_site_attached_hydrogens 73 | Pb1 Pb2+ 1 a 0 0 0 0.53(2) 1. 0 74 | Ti1 Ti4+ 1 b 0.5 0.5 0.5281(28) 0.29(11) 1. 0 75 | O1 O2- 2 c 0.5 0 0.6130(29) 1.42(31) 1. 0 76 | O2 O2- 1 b 0.5 0.5 0.1339(40) 1.42(31) 1. 0 77 | #End of TTdata_90693-ICSD -------------------------------------------------------------------------------- /problem_sets/PbTiO3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/materialsvirtuallab/nano106/222f2c6142f43fc4395d9f9ee833ec88c5106e8d/problem_sets/PbTiO3.png -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | numpy==1.16.4 -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [aliases] 2 | upload_doc = upload_docs --upload-dir=docs/_build/html 3 | release = register sdist bdist_egg upload upload_doc 4 | 5 | [build] 6 | force = 1 7 | 8 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup, find_packages 2 | 3 | 4 | setup( 5 | name="symmetry", 6 | packages=find_packages(), 7 | version="0.1", 8 | install_requires=["numpy"], 9 | author="Shyue Ping Ong", 10 | author_email="ongsp@ucsd.edu", 11 | maintainer="Shyue Ping Ong", 12 | license="BSD", 13 | description="Symmetry is a library for materials symmetry analysis.", 14 | long_description="Symmetry is a library for materials symmetry analysis. " 15 | "Please visit the doc and Github repo for more " 16 | "information and examples.", 17 | keywords=["crystallography", "materials", "symmetry", "crystals"], 18 | classifiers=[ 19 | "Programming Language :: Python :: 2.7", 20 | "Development Status :: 4 - Beta", 21 | "Intended Audience :: Science/Research", 22 | "License :: OSI Approved :: BSD License", 23 | "Operating System :: OS Independent", 24 | "Topic :: Scientific/Engineering :: Physics", 25 | "Topic :: Scientific/Engineering :: Chemistry", 26 | ], 27 | ) 28 | -------------------------------------------------------------------------------- /symmetry/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """ 4 | Library for materials symmetry analysis 5 | """ 6 | 7 | from __future__ import division 8 | 9 | __author__ = "Shyue Ping Ong" 10 | __copyright__ = "Copyright 2013, The Materials Virtual Lab" 11 | __version__ = "0.1" 12 | __maintainer__ = "Shyue Ping Ong" 13 | __email__ = "ongsp@ucsd.edu" 14 | __date__ = "4/4/14" 15 | 16 | -------------------------------------------------------------------------------- /symmetry/groups.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """ 4 | Defines SymmetryGroup parent class and PointGroup and SpaceGroup classes. 5 | Shyue Ping Ong thanks Marc De Graef for his generous sharing of his 6 | SpaceGroup data as published in his textbook "Structure of Materials". 7 | """ 8 | 9 | from __future__ import division 10 | 11 | __author__ = "Shyue Ping Ong" 12 | __copyright__ = "Copyright 2013, The Materials Virtual Lab" 13 | __version__ = "0.1" 14 | __maintainer__ = "Shyue Ping Ong" 15 | __email__ = "ongsp@ucsd.edu" 16 | __date__ = "4/4/14" 17 | 18 | import os 19 | from itertools import product 20 | from fractions import Fraction 21 | 22 | import numpy as np 23 | 24 | import json 25 | 26 | 27 | with open(os.path.join(os.path.dirname(__file__), "symm_data.json")) as f: 28 | SYMM_DATA = json.load(f) 29 | 30 | GENERATOR_MATRICES = SYMM_DATA["generator_matrices"] 31 | POINT_GROUP_ENC = SYMM_DATA["point_group_encoding"] 32 | SPACE_GROUP_ENC = SYMM_DATA["space_group_encoding"] 33 | TRANSLATIONS = {k: Fraction(v) for k, v in SYMM_DATA["translations"].items()} 34 | 35 | 36 | class SymmetryGroup(object): 37 | 38 | def get_orbit(self, p, tol=1e-5): 39 | """ 40 | Returns the orbit for a point. 41 | 42 | Args: 43 | p: Point as a 3x1 array. 44 | tol: Tolerance for determining if sites are the same. 1e-5 should 45 | be sufficient for most purposes. Set to 0 for exact matching 46 | (and also needed for symbolic orbits). 47 | 48 | Returns: 49 | ([array]) Orbit for point. 50 | """ 51 | orbit = [] 52 | for o in self.symmetry_ops: 53 | pp = np.dot(o, p) 54 | pp = np.mod(pp, 1) 55 | if not in_array_list(orbit, pp, tol=tol): 56 | orbit.append(pp) 57 | return orbit 58 | 59 | 60 | class PointGroup(SymmetryGroup): 61 | """ 62 | Class representing a Point Group, with generators and symmetry operations. 63 | 64 | .. attribute:: symbol 65 | 66 | Full International or Hermann-Mauguin Symbol. 67 | 68 | .. attribute:: generators 69 | 70 | List of generator matrices. Note that 3x3 matrices are used for Point 71 | Groups. 72 | 73 | .. attribute:: symmetry_ops 74 | 75 | Full set of symmetry operations as matrices. 76 | """ 77 | 78 | def __init__(self, int_symbol): 79 | """ 80 | Initializes a Point Group from its international symbol. 81 | 82 | Args: 83 | int_symbol (str): International or Hermann-Mauguin Symbol. 84 | """ 85 | self.symbol = int_symbol 86 | self.generators = [GENERATOR_MATRICES[c] 87 | for c in POINT_GROUP_ENC[int_symbol]] 88 | self.symmetry_ops = self._generate_full_symmetry_ops() 89 | self.order = len(self.symmetry_ops) 90 | 91 | def _generate_full_symmetry_ops(self): 92 | symm_ops = list(self.generators) 93 | new_ops = self.generators 94 | while len(new_ops) > 0: 95 | gen_ops = [] 96 | for g1, g2 in product(new_ops, symm_ops): 97 | op = np.dot(g1, g2) 98 | if not in_array_list(symm_ops, op): 99 | gen_ops.append(op) 100 | symm_ops.append(op) 101 | new_ops = gen_ops 102 | return symm_ops 103 | 104 | 105 | class SpaceGroup(SymmetryGroup): 106 | """ 107 | Class representing a SpaceGroup. 108 | 109 | .. attribute:: symbol 110 | 111 | Full International or Hermann-Mauguin Symbol. 112 | 113 | .. attribute:: int_number 114 | 115 | International number 116 | 117 | .. attribute:: generators 118 | 119 | List of generator matrices. Note that 4x4 matrices are used for Space 120 | Groups. 121 | 122 | .. attribute:: order 123 | 124 | Order of Space Group 125 | """ 126 | 127 | #Contains the entire list of supported Space Group symbols. 128 | SG_SYMBOLS = tuple(SPACE_GROUP_ENC.keys()) 129 | 130 | def __init__(self, int_symbol): 131 | """ 132 | Initializes a Space Group from its *full* international symbol. 133 | 134 | Args: 135 | int_symbol (str): Full International or Hermann-Mauguin Symbol. 136 | The notation is a LaTeX-like string, with screw axes being 137 | represented by an underscore. For example, "P6_3/mmc". Note 138 | that for rhomohedral cells, the hexagonal setting can be 139 | accessed by adding a "H", e.g., "R-3mH". 140 | """ 141 | self.symbol = int_symbol 142 | # TODO: Support different origin choices. 143 | enc = list(SPACE_GROUP_ENC[int_symbol]["enc"]) 144 | inversion = int(enc.pop(0)) 145 | ngen = int(enc.pop(0)) 146 | symm_ops = [np.eye(4)] 147 | if inversion: 148 | symm_ops.append(np.array( 149 | [[-1, 0, 0, 0], [0, -1, 0, 0], [0, 0, -1, 0], 150 | [0, 0, 0, 1]])) 151 | for i in range(ngen): 152 | m = np.eye(4) 153 | m[:3, :3] = GENERATOR_MATRICES[enc.pop(0)] 154 | m[0, 3] = TRANSLATIONS[enc.pop(0)] 155 | m[1, 3] = TRANSLATIONS[enc.pop(0)] 156 | m[2, 3] = TRANSLATIONS[enc.pop(0)] 157 | symm_ops.append(m) 158 | self.generators = symm_ops 159 | self.int_number = SPACE_GROUP_ENC[int_symbol]["int_number"] 160 | self.order = SPACE_GROUP_ENC[int_symbol]["order"] 161 | self._symmetry_ops = None 162 | 163 | def _generate_full_symmetry_ops(self): 164 | symm_ops = np.array(self.generators) 165 | for op in symm_ops: 166 | op[0:3, 3] = np.mod(op[0:3, 3], 1) 167 | new_ops = symm_ops 168 | while len(new_ops) > 0 and len(symm_ops) < self.order: 169 | gen_ops = [] 170 | for g in new_ops: 171 | temp_ops = np.einsum('ijk,kl', symm_ops, g) 172 | for op in temp_ops: 173 | op[0:3, 3] = np.mod(op[0:3, 3], 1) 174 | ind = np.where(np.abs(1 - op[0:3, 3]) < 1e-5) 175 | op[ind, 3] = 0 176 | if not in_array_list(symm_ops, op): 177 | gen_ops.append(op) 178 | symm_ops = np.append(symm_ops, [op], axis=0) 179 | new_ops = gen_ops 180 | assert len(symm_ops) == self.order 181 | return symm_ops 182 | 183 | @property 184 | def symmetry_ops(self): 185 | """ 186 | Full set of symmetry operations as matrices. Lazily initialized as 187 | generation sometimes takes a bit of time. 188 | """ 189 | if self._symmetry_ops is None: 190 | self._symmetry_ops = self._generate_full_symmetry_ops() 191 | return self._symmetry_ops 192 | 193 | @property 194 | def crystal_system(self): 195 | i = self.int_number 196 | if i <= 2: 197 | return "Triclinic" 198 | elif i <= 15: 199 | return "Monoclinic" 200 | elif i <= 74: 201 | return "Orthorhombic" 202 | elif i <= 142: 203 | return "Tetragonal" 204 | elif i <= 167: 205 | return "Trigonal" 206 | elif i <= 194: 207 | return "Hexagonal" 208 | else: 209 | return "Cubic" 210 | 211 | def get_orbit(self, p): 212 | """ 213 | Returns the orbit for a point. 214 | 215 | Args: 216 | p: Point as a 3x1 array. 217 | 218 | Returns: 219 | ([array]) Orbit for point. 220 | """ 221 | p = np.append(p, [1]) 222 | orbit = super(SpaceGroup, self).get_orbit(p) 223 | return np.delete(orbit, np.s_[-1:], 1) 224 | 225 | @classmethod 226 | def from_int_number(cls, int_number, hexagonal=True): 227 | """ 228 | Obtains a SpaceGroup from its international number. 229 | 230 | Args: 231 | int_number (int): International number. 232 | hexagonal (bool): For rhombohedral groups, whether to return the 233 | hexagonal setting (default) or rhombohedral setting. 234 | 235 | Returns: 236 | (SpaceGroup) 237 | """ 238 | return SpaceGroup(sg_symbol_from_int_number(int_number, 239 | hexagonal=hexagonal)) 240 | 241 | def __str__(self): 242 | return "Spacegroup %s with international number %d and order %d" % ( 243 | self.symbol, self.int_number, len(self.symmetry_ops)) 244 | 245 | 246 | def sg_symbol_from_int_number(int_number, hexagonal=True): 247 | """ 248 | Obtains a SpaceGroup name from its international number. 249 | 250 | Args: 251 | int_number (int): International number. 252 | hexagonal (bool): For rhombohedral groups, whether to return the 253 | hexagonal setting (default) or rhombohedral setting. 254 | 255 | Returns: 256 | (str) Spacegroup symbol 257 | """ 258 | syms = [] 259 | for n, v in SPACE_GROUP_ENC.items(): 260 | if v["int_number"] == int_number: 261 | syms.append(n) 262 | if len(syms) == 0: 263 | raise ValueError("Invalid international number!") 264 | if len(syms) == 2: 265 | if hexagonal: 266 | syms = list(filter(lambda s: s.endswith("H"), syms)) 267 | else: 268 | syms = list(filter(lambda s: not s.endswith("H"), syms)) 269 | return syms.pop() 270 | 271 | 272 | def in_array_list(array_list, a, tol=1e-5): 273 | """ 274 | Extremely efficient nd-array comparison using numpy's broadcasting. This 275 | function checks if a particular array a, is present in a list of arrays. 276 | It works for arrays of any size, e.g., even matrix searches. 277 | 278 | Args: 279 | array_list ([array]): A list of arrays to compare to. 280 | a (array): The test array for comparison. 281 | tol (float): The tolerance. Defaults to 1e-5. If 0, an exact match is 282 | done. 283 | 284 | Returns: 285 | (bool) 286 | """ 287 | if len(array_list) == 0: 288 | return False 289 | axes = tuple(range(1, a.ndim + 1)) 290 | if not tol: 291 | return np.any(np.all(np.equal(array_list, a[None, :]), axes)) 292 | else: 293 | return np.any(np.sum(np.abs(array_list - a[None, :]), axes) < tol) 294 | -------------------------------------------------------------------------------- /symmetry/symm_data.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator_matrices": { 3 | "a": [ 4 | [ 5 | 1, 6 | 0, 7 | 0 8 | ], 9 | [ 10 | 0, 11 | 1, 12 | 0 13 | ], 14 | [ 15 | 0, 16 | 0, 17 | 1 18 | ] 19 | ], 20 | "c": [ 21 | [ 22 | -1, 23 | 0, 24 | 0 25 | ], 26 | [ 27 | 0, 28 | 1, 29 | 0 30 | ], 31 | [ 32 | 0, 33 | 0, 34 | -1 35 | ] 36 | ], 37 | "b": [ 38 | [ 39 | -1, 40 | 0, 41 | 0 42 | ], 43 | [ 44 | 0, 45 | -1, 46 | 0 47 | ], 48 | [ 49 | 0, 50 | 0, 51 | 1 52 | ] 53 | ], 54 | "e": [ 55 | [ 56 | 0, 57 | 1, 58 | 0 59 | ], 60 | [ 61 | 1, 62 | 0, 63 | 0 64 | ], 65 | [ 66 | 0, 67 | 0, 68 | -1 69 | ] 70 | ], 71 | "d": [ 72 | [ 73 | 0, 74 | 0, 75 | 1 76 | ], 77 | [ 78 | 1, 79 | 0, 80 | 0 81 | ], 82 | [ 83 | 0, 84 | 1, 85 | 0 86 | ] 87 | ], 88 | "g": [ 89 | [ 90 | 0, 91 | -1, 92 | 0 93 | ], 94 | [ 95 | 1, 96 | 0, 97 | 0 98 | ], 99 | [ 100 | 0, 101 | 0, 102 | 1 103 | ] 104 | ], 105 | "f": [ 106 | [ 107 | 0, 108 | -1, 109 | 0 110 | ], 111 | [ 112 | -1, 113 | 0, 114 | 0 115 | ], 116 | [ 117 | 0, 118 | 0, 119 | -1 120 | ] 121 | ], 122 | "i": [ 123 | [ 124 | 1, 125 | 0, 126 | 0 127 | ], 128 | [ 129 | 0, 130 | 1, 131 | 0 132 | ], 133 | [ 134 | 0, 135 | 0, 136 | -1 137 | ] 138 | ], 139 | "h": [ 140 | [ 141 | -1, 142 | 0, 143 | 0 144 | ], 145 | [ 146 | 0, 147 | -1, 148 | 0 149 | ], 150 | [ 151 | 0, 152 | 0, 153 | -1 154 | ] 155 | ], 156 | "k": [ 157 | [ 158 | 0, 159 | -1, 160 | 0 161 | ], 162 | [ 163 | -1, 164 | 0, 165 | 0 166 | ], 167 | [ 168 | 0, 169 | 0, 170 | 1 171 | ] 172 | ], 173 | "j": [ 174 | [ 175 | 1, 176 | 0, 177 | 0 178 | ], 179 | [ 180 | 0, 181 | -1, 182 | 0 183 | ], 184 | [ 185 | 0, 186 | 0, 187 | 1 188 | ] 189 | ], 190 | "m": [ 191 | [ 192 | 0, 193 | 1, 194 | 0 195 | ], 196 | [ 197 | -1, 198 | 0, 199 | 0 200 | ], 201 | [ 202 | 0, 203 | 0, 204 | -1 205 | ] 206 | ], 207 | "l": [ 208 | [ 209 | 0, 210 | 1, 211 | 0 212 | ], 213 | [ 214 | 1, 215 | 0, 216 | 0 217 | ], 218 | [ 219 | 0, 220 | 0, 221 | 1 222 | ] 223 | ], 224 | "n": [ 225 | [ 226 | 0, 227 | -1, 228 | 0 229 | ], 230 | [ 231 | 1, 232 | -1, 233 | 0 234 | ], 235 | [ 236 | 0, 237 | 0, 238 | 1 239 | ] 240 | ] 241 | }, 242 | "translations": { 243 | "A": "1/6", 244 | "C": "1/3", 245 | "B": "1/4", 246 | "E": "2/3", 247 | "D": "1/2", 248 | "G": "5/6", 249 | "F": "3/4", 250 | "O": "0", 251 | "Y": "-1/4", 252 | "X": "-3/8", 253 | "Z": "-1/8" 254 | }, 255 | "space_group_encoding": { 256 | "I4_1": { 257 | "enc": "03aDDDbDDDgODB0", 258 | "order": 8, 259 | "int_number": 80 260 | }, 261 | "R3cH": { 262 | "enc": "03aECCnOOOkOOD0", 263 | "order": 18, 264 | "int_number": 161 265 | }, 266 | "I4_1/a": { 267 | "enc": "04aDDDbDDDgODBhODB1OYZ", 268 | "order": 16, 269 | "int_number": 88 270 | }, 271 | "I2_12_121": { 272 | "enc": "03aDDDbDODcODD0", 273 | "order": 8, 274 | "int_number": 24 275 | }, 276 | "F23": { 277 | "enc": "05aODDaDODbOOOcOOOdOOO0", 278 | "order": 48, 279 | "int_number": 196 280 | }, 281 | "Pn-3": { 282 | "enc": "04bOOOcOOOdOOOhDDD1YYY", 283 | "order": 24, 284 | "int_number": 201 285 | }, 286 | "P4_2/mmc": { 287 | "enc": "13bOOOgOODcOOO0", 288 | "order": 16, 289 | "int_number": 131 290 | }, 291 | "C1c1": { 292 | "enc": "02aDDOjOOD0", 293 | "order": 4, 294 | "int_number": 9 295 | }, 296 | "P6_3mc": { 297 | "enc": "03nOOObOODkOOO0", 298 | "order": 12, 299 | "int_number": 186 300 | }, 301 | "P6_3/mmc": { 302 | "enc": "13nOOObOODeOOO0", 303 | "order": 24, 304 | "int_number": 194 305 | }, 306 | "P-3c1": { 307 | "enc": "12nOOOeOOD0", 308 | "order": 12, 309 | "int_number": 165 310 | }, 311 | "Abm2": { 312 | "enc": "03aODDbOOOjODO0", 313 | "order": 8, 314 | "int_number": 39 315 | }, 316 | "P-6m2": { 317 | "enc": "03nOOOiOOOkOOO0", 318 | "order": 12, 319 | "int_number": 187 320 | }, 321 | "P4/mbm": { 322 | "enc": "13bOOOgOOOcDDO0", 323 | "order": 16, 324 | "int_number": 127 325 | }, 326 | "Fmm2": { 327 | "enc": "04aODDaDODbOOOjOOO0", 328 | "order": 16, 329 | "int_number": 42 330 | }, 331 | "P4_2/ncm": { 332 | "enc": "04bOOOgDDDcDDOhDDD1YBY", 333 | "order": 16, 334 | "int_number": 138 335 | }, 336 | "I-42d": { 337 | "enc": "04aDDDbOOOmOOOcDOF0", 338 | "order": 16, 339 | "int_number": 122 340 | }, 341 | "Im-3m": { 342 | "enc": "15aDDDbOOOcOOOdOOOeOOO0", 343 | "order": 96, 344 | "int_number": 229 345 | }, 346 | "P12/c1": { 347 | "enc": "11cOOD0", 348 | "order": 4, 349 | "int_number": 13 350 | }, 351 | "Cmm2": { 352 | "enc": "03aDDObOOOjOOO0", 353 | "order": 8, 354 | "int_number": 35 355 | }, 356 | "C12/c1": { 357 | "enc": "12aDDOcOOD0", 358 | "order": 8, 359 | "int_number": 15 360 | }, 361 | "I-42m": { 362 | "enc": "04aDDDbOOOmOOOcOOO0", 363 | "order": 16, 364 | "int_number": 121 365 | }, 366 | "P-31m": { 367 | "enc": "12nOOOfOOO0", 368 | "order": 12, 369 | "int_number": 162 370 | }, 371 | "R32": { 372 | "enc": "02dOOOfOOO0", 373 | "order": 6, 374 | "int_number": 155 375 | }, 376 | "P12_1/c1": { 377 | "enc": "11cODD0", 378 | "order": 4, 379 | "int_number": 14 380 | }, 381 | "R-3c": { 382 | "enc": "12dOOOfDDD0", 383 | "order": 12, 384 | "int_number": 167 385 | }, 386 | "R-3cH": { 387 | "enc": "13aECCnOOOeOOD0", 388 | "order": 36, 389 | "int_number": 167 390 | }, 391 | "P432": { 392 | "enc": "04bOOOcOOOdOOOeOOO0", 393 | "order": 24, 394 | "int_number": 207 395 | }, 396 | "P321": { 397 | "enc": "02nOOOeOOO0", 398 | "order": 6, 399 | "int_number": 150 400 | }, 401 | "I4_1/acd": { 402 | "enc": "05aDDDbDDDgODBcDOBhODB1OBZ", 403 | "order": 32, 404 | "int_number": 142 405 | }, 406 | "P4_2/nbc": { 407 | "enc": "04bOOOgDDDcOODhDDD1YBY", 408 | "order": 16, 409 | "int_number": 133 410 | }, 411 | "P12_11": { 412 | "enc": "01cODO0", 413 | "order": 2, 414 | "int_number": 4 415 | }, 416 | "P2_12_12": { 417 | "enc": "02bOOOcDDO0", 418 | "order": 4, 419 | "int_number": 18 420 | }, 421 | "P-6c2": { 422 | "enc": "03nOOOiOODkOOD0", 423 | "order": 12, 424 | "int_number": 188 425 | }, 426 | "I432": { 427 | "enc": "05aDDDbOOOcOOOdOOOeOOO0", 428 | "order": 48, 429 | "int_number": 211 430 | }, 431 | "P4_2/mbc": { 432 | "enc": "13bOOOgOODcDDO0", 433 | "order": 16, 434 | "int_number": 135 435 | }, 436 | "R-3m": { 437 | "enc": "12dOOOfOOO0", 438 | "order": 12, 439 | "int_number": 166 440 | }, 441 | "Pbcn": { 442 | "enc": "12bDDDcOOD0", 443 | "order": 8, 444 | "int_number": 60 445 | }, 446 | "Pbcm": { 447 | "enc": "12bOODcODD0", 448 | "order": 8, 449 | "int_number": 57 450 | }, 451 | "Fdd2": { 452 | "enc": "04aODDaDODbOOOjBBB0", 453 | "order": 16, 454 | "int_number": 43 455 | }, 456 | "Pbca": { 457 | "enc": "12bDODcODD0", 458 | "order": 8, 459 | "int_number": 61 460 | }, 461 | "P6_322": { 462 | "enc": "03nOOObOODeOOO0", 463 | "order": 12, 464 | "int_number": 182 465 | }, 466 | "P6_1": { 467 | "enc": "02nOOCbOOD0", 468 | "order": 6, 469 | "int_number": 169 470 | }, 471 | "R3m": { 472 | "enc": "02dOOOlOOO0", 473 | "order": 6, 474 | "int_number": 160 475 | }, 476 | "P6/mcc": { 477 | "enc": "13nOOObOOOeOOD0", 478 | "order": 24, 479 | "int_number": 192 480 | }, 481 | "Cmma": { 482 | "enc": "13aDDObODOcODO0", 483 | "order": 16, 484 | "int_number": 67 485 | }, 486 | "P121": { 487 | "enc": "01cOOO0", 488 | "order": 2, 489 | "int_number": 3 490 | }, 491 | "Cmmm": { 492 | "enc": "13aDDObOOOcOOO0", 493 | "order": 16, 494 | "int_number": 65 495 | }, 496 | "Fm-3c": { 497 | "enc": "16aODDaDODbOOOcOOOdOOOeDDD0", 498 | "order": 192, 499 | "int_number": 226 500 | }, 501 | "Ia-3d": { 502 | "enc": "15aDDDbDODcODDdOOOeFBB0", 503 | "order": 96, 504 | "int_number": 230 505 | }, 506 | "Fd-3m": { 507 | "enc": "07aODDaDODbODDcDDOdOOOeFBFhBBB1ZZZ", 508 | "order": 192, 509 | "int_number": 227 510 | }, 511 | "Ia-3": { 512 | "enc": "14aDDDbDODcODDdOOO0", 513 | "order": 48, 514 | "int_number": 206 515 | }, 516 | "P6_3cm": { 517 | "enc": "03nOOObOODkOOD0", 518 | "order": 12, 519 | "int_number": 185 520 | }, 521 | "Ama2": { 522 | "enc": "03aODDbOOOjDOO0", 523 | "order": 8, 524 | "int_number": 40 525 | }, 526 | "P6_3/mcm": { 527 | "enc": "13nOOObOODeOOD0", 528 | "order": 24, 529 | "int_number": 193 530 | }, 531 | "P4/nnc": { 532 | "enc": "04bOOOgOOOcOOOhDDD1YYY", 533 | "order": 16, 534 | "int_number": 126 535 | }, 536 | "C222": { 537 | "enc": "03aDDObOOOcOOO0", 538 | "order": 8, 539 | "int_number": 21 540 | }, 541 | "Fd-3c": { 542 | "enc": "07aODDaDODbODDcDDOdOOOeFBFhFFF1XXX", 543 | "order": 192, 544 | "int_number": 228 545 | }, 546 | "R-3H": { 547 | "enc": "12aECCnOOO0", 548 | "order": 18, 549 | "int_number": 148 550 | }, 551 | "P1m1": { 552 | "enc": "01jOOO0", 553 | "order": 2, 554 | "int_number": 6 555 | }, 556 | "F222": { 557 | "enc": "04aODDaDODbOOOcOOO0", 558 | "order": 16, 559 | "int_number": 22 560 | }, 561 | "P4_232": { 562 | "enc": "04bOOOcOOOdOOOeDDD0", 563 | "order": 24, 564 | "int_number": 208 565 | }, 566 | "P4/n": { 567 | "enc": "03bOOOgDDOhDDO1YBO", 568 | "order": 8, 569 | "int_number": 85 570 | }, 571 | "Immm": { 572 | "enc": "13aDDDbOOOcOOO0", 573 | "order": 16, 574 | "int_number": 71 575 | }, 576 | "Pmmm": { 577 | "enc": "12bOOOcOOO0", 578 | "order": 8, 579 | "int_number": 47 580 | }, 581 | "Imma": { 582 | "enc": "13aDDDbODOcODO0", 583 | "order": 16, 584 | "int_number": 74 585 | }, 586 | "P4_122": { 587 | "enc": "03bOODgOOBcOOO0", 588 | "order": 8, 589 | "int_number": 91 590 | }, 591 | "I422": { 592 | "enc": "04aDDDbOOOgOOOcOOO0", 593 | "order": 16, 594 | "int_number": 97 595 | }, 596 | "P6mm": { 597 | "enc": "03nOOObOOOkOOO0", 598 | "order": 12, 599 | "int_number": 183 600 | }, 601 | "P1c1": { 602 | "enc": "01jOOD0", 603 | "order": 2, 604 | "int_number": 7 605 | }, 606 | "Pm-3": { 607 | "enc": "13bOOOcOOOdOOO0", 608 | "order": 24, 609 | "int_number": 200 610 | }, 611 | "R3c": { 612 | "enc": "02dOOOlDDD0", 613 | "order": 6, 614 | "int_number": 161 615 | }, 616 | "I2_13": { 617 | "enc": "04aDDDbDODcODDdOOO0", 618 | "order": 24, 619 | "int_number": 199 620 | }, 621 | "Pccn": { 622 | "enc": "12bDDOcODD0", 623 | "order": 8, 624 | "int_number": 56 625 | }, 626 | "P4": { 627 | "enc": "02bOOOgOOO0", 628 | "order": 4, 629 | "int_number": 75 630 | }, 631 | "Pccm": { 632 | "enc": "12bOOOcOOD0", 633 | "order": 8, 634 | "int_number": 49 635 | }, 636 | "P-4c2": { 637 | "enc": "03bOOOmOOOjOOD0", 638 | "order": 8, 639 | "int_number": 116 640 | }, 641 | "Pnn2": { 642 | "enc": "02bOOOjDDD0", 643 | "order": 4, 644 | "int_number": 34 645 | }, 646 | "Pcca": { 647 | "enc": "12bDOOcOOD0", 648 | "order": 8, 649 | "int_number": 54 650 | }, 651 | "Pbam": { 652 | "enc": "12bOOOcDDO0", 653 | "order": 8, 654 | "int_number": 55 655 | }, 656 | "I4/mcm": { 657 | "enc": "14aDDDbOOOgOOOcOOD0", 658 | "order": 32, 659 | "int_number": 140 660 | }, 661 | "Pban": { 662 | "enc": "03bOOOcOOOhDDO1BBO", 663 | "order": 8, 664 | "int_number": 50 665 | }, 666 | "Cmca": { 667 | "enc": "13aDDObODDcODD0", 668 | "order": 16, 669 | "int_number": 64 670 | }, 671 | "P4_22_12": { 672 | "enc": "03bOOOgDDDcDDD0", 673 | "order": 8, 674 | "int_number": 94 675 | }, 676 | "P3_121": { 677 | "enc": "02nOOCeOOO0", 678 | "order": 6, 679 | "int_number": 152 680 | }, 681 | "P-3m1": { 682 | "enc": "12nOOOeOOO0", 683 | "order": 12, 684 | "int_number": 164 685 | }, 686 | "C1m1": { 687 | "enc": "02aDDOjOOO0", 688 | "order": 4, 689 | "int_number": 8 690 | }, 691 | "P12/m1": { 692 | "enc": "11cOOO0", 693 | "order": 4, 694 | "int_number": 10 695 | }, 696 | "Ibca": { 697 | "enc": "13aDDDbDODcODD0", 698 | "order": 16, 699 | "int_number": 73 700 | }, 701 | "I4_1cd": { 702 | "enc": "04aDDDbDDDgODBjOOD0", 703 | "order": 16, 704 | "int_number": 110 705 | }, 706 | "P3": { 707 | "enc": "01nOOO0", 708 | "order": 3, 709 | "int_number": 143 710 | }, 711 | "P1": { 712 | "enc": "000", 713 | "order": 1, 714 | "int_number": 1 715 | }, 716 | "P6": { 717 | "enc": "02nOOObOOO0", 718 | "order": 6, 719 | "int_number": 168 720 | }, 721 | "P4_2nm": { 722 | "enc": "03bOOOgDDDjDDD0", 723 | "order": 8, 724 | "int_number": 102 725 | }, 726 | "P4_2/nmc": { 727 | "enc": "04bOOOgDDDcDDDhDDD1YBY", 728 | "order": 16, 729 | "int_number": 137 730 | }, 731 | "P422": { 732 | "enc": "03bOOOgOOOcOOO0", 733 | "order": 8, 734 | "int_number": 89 735 | }, 736 | "P4_12_12": { 737 | "enc": "03bOODgDDBcDDB0", 738 | "order": 8, 739 | "int_number": 92 740 | }, 741 | "P4_222": { 742 | "enc": "03bOOOgOODcOOO0", 743 | "order": 8, 744 | "int_number": 93 745 | }, 746 | "Pmna": { 747 | "enc": "12bDODcDOD0", 748 | "order": 8, 749 | "int_number": 53 750 | }, 751 | "P6_522": { 752 | "enc": "03nOOEbOODeOOE0", 753 | "order": 12, 754 | "int_number": 179 755 | }, 756 | "P6_222": { 757 | "enc": "03nOOEbOOOeOOE0", 758 | "order": 12, 759 | "int_number": 180 760 | }, 761 | "P6_422": { 762 | "enc": "03nOOCbOOOeOOC0", 763 | "order": 12, 764 | "int_number": 181 765 | }, 766 | "P-4b2": { 767 | "enc": "03bOOOmOOOjDDO0", 768 | "order": 8, 769 | "int_number": 117 770 | }, 771 | "Pmm2": { 772 | "enc": "02bOOOjOOO0", 773 | "order": 4, 774 | "int_number": 25 775 | }, 776 | "Fd-3": { 777 | "enc": "06aODDaDODbOOOcOOOdOOOhBBB1ZZZ", 778 | "order": 96, 779 | "int_number": 203 780 | }, 781 | "Imm2": { 782 | "enc": "03aDDDbOOOjOOO0", 783 | "order": 8, 784 | "int_number": 44 785 | }, 786 | "P-42_1m": { 787 | "enc": "03bOOOmOOOcDDO0", 788 | "order": 8, 789 | "int_number": 113 790 | }, 791 | "P3_221": { 792 | "enc": "02nOOEeOOO0", 793 | "order": 6, 794 | "int_number": 154 795 | }, 796 | "P4/mcc": { 797 | "enc": "13bOOOgOOOcOOD0", 798 | "order": 16, 799 | "int_number": 124 800 | }, 801 | "I4_1/amd": { 802 | "enc": "05aDDDbDDDgODBcDOFhODB1OBZ", 803 | "order": 32, 804 | "int_number": 141 805 | }, 806 | "P31m": { 807 | "enc": "02nOOOlOOO0", 808 | "order": 6, 809 | "int_number": 157 810 | }, 811 | "P4_322": { 812 | "enc": "03bOODgOOFcOOO0", 813 | "order": 8, 814 | "int_number": 95 815 | }, 816 | "Cmc2_1": { 817 | "enc": "03aDDObOODjOOD0", 818 | "order": 8, 819 | "int_number": 36 820 | }, 821 | "I-43d": { 822 | "enc": "05aDDDbDODcODDdOOOlBBB0", 823 | "order": 48, 824 | "int_number": 220 825 | }, 826 | "Pba2": { 827 | "enc": "02bOOOjDDO0", 828 | "order": 4, 829 | "int_number": 32 830 | }, 831 | "F432": { 832 | "enc": "06aODDaDODbOOOcOOOdOOOeOOO0", 833 | "order": 96, 834 | "int_number": 209 835 | }, 836 | "P23": { 837 | "enc": "03bOOOcOOOdOOO0", 838 | "order": 12, 839 | "int_number": 195 840 | }, 841 | "Pcc2": { 842 | "enc": "02bOOOjOOD0", 843 | "order": 4, 844 | "int_number": 27 845 | }, 846 | "Pnna": { 847 | "enc": "12bDOOcDDD0", 848 | "order": 8, 849 | "int_number": 52 850 | }, 851 | "I-43m": { 852 | "enc": "05aDDDbOOOcOOOdOOOlOOO0", 853 | "order": 48, 854 | "int_number": 217 855 | }, 856 | "Pnma": { 857 | "enc": "12bDODcODO0", 858 | "order": 8, 859 | "int_number": 62 860 | }, 861 | "P4/m": { 862 | "enc": "12bOOOgOOO0", 863 | "order": 8, 864 | "int_number": 83 865 | }, 866 | "P6/mmm": { 867 | "enc": "13nOOObOOOeOOO0", 868 | "order": 24, 869 | "int_number": 191 870 | }, 871 | "Amm2": { 872 | "enc": "03aODDbOOOjOOO0", 873 | "order": 8, 874 | "int_number": 38 875 | }, 876 | "I4_132": { 877 | "enc": "05aDDDbDODcODDdOOOeFBB0", 878 | "order": 48, 879 | "int_number": 214 880 | }, 881 | "P4_2mc": { 882 | "enc": "03bOOOgOODjOOO0", 883 | "order": 8, 884 | "int_number": 105 885 | }, 886 | "I23": { 887 | "enc": "04aDDDbOOOcOOOdOOO0", 888 | "order": 24, 889 | "int_number": 197 890 | }, 891 | "P4/nbm": { 892 | "enc": "04bOOOgOOOcOOOhDDO1YYO", 893 | "order": 16, 894 | "int_number": 125 895 | }, 896 | "I4/mmm": { 897 | "enc": "14aDDDbOOOgOOOcOOO0", 898 | "order": 32, 899 | "int_number": 139 900 | }, 901 | "P4_2/nnm": { 902 | "enc": "04bOOOgDDDcOOOhDDD1YBY", 903 | "order": 16, 904 | "int_number": 134 905 | }, 906 | "Fm-3m": { 907 | "enc": "16aODDaDODbOOOcOOOdOOOeOOO0", 908 | "order": 192, 909 | "int_number": 225 910 | }, 911 | "P2_13": { 912 | "enc": "03bDODcODDdOOO0", 913 | "order": 12, 914 | "int_number": 198 915 | }, 916 | "P3m1": { 917 | "enc": "02nOOOkOOO0", 918 | "order": 6, 919 | "int_number": 156 920 | }, 921 | "P4cc": { 922 | "enc": "03bOOOgOOOjOOD0", 923 | "order": 8, 924 | "int_number": 103 925 | }, 926 | "P4_2cm": { 927 | "enc": "03bOOOgOODjOOD0", 928 | "order": 8, 929 | "int_number": 101 930 | }, 931 | "P12_1/m1": { 932 | "enc": "11cODO0", 933 | "order": 4, 934 | "int_number": 11 935 | }, 936 | "Aba2": { 937 | "enc": "03aODDbOOOjDDO0", 938 | "order": 8, 939 | "int_number": 41 940 | }, 941 | "P4/mmm": { 942 | "enc": "13bOOOgOOOcOOO0", 943 | "order": 16, 944 | "int_number": 123 945 | }, 946 | "Fddd": { 947 | "enc": "05aODDaDODbOOOcOOOhBBB1ZZZ", 948 | "order": 32, 949 | "int_number": 70 950 | }, 951 | "P4_332": { 952 | "enc": "04bDODcODDdOOOeBFF0", 953 | "order": 24, 954 | "int_number": 212 955 | }, 956 | "P6cc": { 957 | "enc": "03nOOObOOOkOOD0", 958 | "order": 12, 959 | "int_number": 184 960 | }, 961 | "P4_132": { 962 | "enc": "04bDODcODDdOOOeFBB0", 963 | "order": 24, 964 | "int_number": 213 965 | }, 966 | "Ibam": { 967 | "enc": "13aDDDbOOOcDDO0", 968 | "order": 16, 969 | "int_number": 72 970 | }, 971 | "P-4m2": { 972 | "enc": "03bOOOmOOOjOOO0", 973 | "order": 8, 974 | "int_number": 115 975 | }, 976 | "Pna2_1": { 977 | "enc": "02bOODjDDO0", 978 | "order": 4, 979 | "int_number": 33 980 | }, 981 | "I4_122": { 982 | "enc": "04aDDDbDDDgODBcDOF0", 983 | "order": 16, 984 | "int_number": 98 985 | }, 986 | "Pmmn": { 987 | "enc": "03bOOOcDDOhDDO1BBO", 988 | "order": 8, 989 | "int_number": 59 990 | }, 991 | "P3c1": { 992 | "enc": "02nOOOkOOD0", 993 | "order": 6, 994 | "int_number": 158 995 | }, 996 | "P4/ncc": { 997 | "enc": "04bOOOgDDOcDDDhDDO1YBO", 998 | "order": 16, 999 | "int_number": 130 1000 | }, 1001 | "I4_1md": { 1002 | "enc": "04aDDDbDDDgODBjOOO0", 1003 | "order": 16, 1004 | "int_number": 109 1005 | }, 1006 | "P-4n2": { 1007 | "enc": "03bOOOmOOOjDDD0", 1008 | "order": 8, 1009 | "int_number": 118 1010 | }, 1011 | "I4/m": { 1012 | "enc": "13aDDDbOOOgOOO0", 1013 | "order": 16, 1014 | "int_number": 87 1015 | }, 1016 | "F-43m": { 1017 | "enc": "06aODDaDODbOOOcOOOdOOOlOOO0", 1018 | "order": 96, 1019 | "int_number": 216 1020 | }, 1021 | "P4_2/mnm": { 1022 | "enc": "13bOOOgDDDcDDD0", 1023 | "order": 16, 1024 | "int_number": 136 1025 | }, 1026 | "Fmmm": { 1027 | "enc": "14aODDaDODbOOOcOOO0", 1028 | "order": 32, 1029 | "int_number": 69 1030 | }, 1031 | "F-43c": { 1032 | "enc": "06aODDaDODbOOOcOOOdOOOlDDD0", 1033 | "order": 96, 1034 | "int_number": 219 1035 | }, 1036 | "P6/m": { 1037 | "enc": "12nOOObOOO0", 1038 | "order": 12, 1039 | "int_number": 175 1040 | }, 1041 | "P-1": { 1042 | "enc": "100", 1043 | "order": 2, 1044 | "int_number": 2 1045 | }, 1046 | "C222_1": { 1047 | "enc": "03aDDObOODcOOD0", 1048 | "order": 8, 1049 | "int_number": 20 1050 | }, 1051 | "P4bm": { 1052 | "enc": "03bOOOgOOOjDDO0", 1053 | "order": 8, 1054 | "int_number": 100 1055 | }, 1056 | "Pca2_1": { 1057 | "enc": "02bOODjDOO0", 1058 | "order": 4, 1059 | "int_number": 29 1060 | }, 1061 | "Iba2": { 1062 | "enc": "03aDDDbOOOjDDO0", 1063 | "order": 8, 1064 | "int_number": 45 1065 | }, 1066 | "I222": { 1067 | "enc": "03aDDDbOOOcOOO0", 1068 | "order": 8, 1069 | "int_number": 23 1070 | }, 1071 | "P-31c": { 1072 | "enc": "12nOOOfOOD0", 1073 | "order": 12, 1074 | "int_number": 163 1075 | }, 1076 | "Pmma": { 1077 | "enc": "12bDOOcOOO0", 1078 | "order": 8, 1079 | "int_number": 51 1080 | }, 1081 | "P-42_1c": { 1082 | "enc": "03bOOOmOOOcDDD0", 1083 | "order": 8, 1084 | "int_number": 114 1085 | }, 1086 | "P31c": { 1087 | "enc": "02nOOOlOOD0", 1088 | "order": 6, 1089 | "int_number": 159 1090 | }, 1091 | "I-4m2": { 1092 | "enc": "04aDDDbOOOmOOOjOOO0", 1093 | "order": 16, 1094 | "int_number": 119 1095 | }, 1096 | "C121": { 1097 | "enc": "02aDDOcOOO0", 1098 | "order": 4, 1099 | "int_number": 5 1100 | }, 1101 | "P222": { 1102 | "enc": "02bOOOcOOO0", 1103 | "order": 4, 1104 | "int_number": 16 1105 | }, 1106 | "P2_12_121": { 1107 | "enc": "02bDODcODD0", 1108 | "order": 4, 1109 | "int_number": 19 1110 | }, 1111 | "I-4": { 1112 | "enc": "03aDDDbOOOmOOO0", 1113 | "order": 8, 1114 | "int_number": 82 1115 | }, 1116 | "P4nc": { 1117 | "enc": "03bOOOgOOOjDDD0", 1118 | "order": 8, 1119 | "int_number": 104 1120 | }, 1121 | "Pa-3": { 1122 | "enc": "13bDODcODDdOOO0", 1123 | "order": 24, 1124 | "int_number": 205 1125 | }, 1126 | "P4_2/mcm": { 1127 | "enc": "13bOOOgOODcOOD0", 1128 | "order": 16, 1129 | "int_number": 132 1130 | }, 1131 | "I4mm": { 1132 | "enc": "04aDDDbOOOgOOOjOOO0", 1133 | "order": 16, 1134 | "int_number": 107 1135 | }, 1136 | "P3_112": { 1137 | "enc": "02nOOCfOOE0", 1138 | "order": 6, 1139 | "int_number": 151 1140 | }, 1141 | "R3": { 1142 | "enc": "01dOOO0", 1143 | "order": 3, 1144 | "int_number": 146 1145 | }, 1146 | "P4/mnc": { 1147 | "enc": "13bOOOgOOOcDDD0", 1148 | "order": 16, 1149 | "int_number": 128 1150 | }, 1151 | "I-4c2": { 1152 | "enc": "04aDDDbOOOmOOOjOOD0", 1153 | "order": 16, 1154 | "int_number": 120 1155 | }, 1156 | "P622": { 1157 | "enc": "03nOOObOOOeOOO0", 1158 | "order": 12, 1159 | "int_number": 177 1160 | }, 1161 | "P3_212": { 1162 | "enc": "02nOOEfOOC0", 1163 | "order": 6, 1164 | "int_number": 153 1165 | }, 1166 | "R3H": { 1167 | "enc": "02aECCnOOO0", 1168 | "order": 9, 1169 | "int_number": 146 1170 | }, 1171 | "Im-3": { 1172 | "enc": "14aDDDbOOOcOOOdOOO0", 1173 | "order": 48, 1174 | "int_number": 204 1175 | }, 1176 | "C12/m1": { 1177 | "enc": "12aDDOcOOO0", 1178 | "order": 8, 1179 | "int_number": 12 1180 | }, 1181 | "P312": { 1182 | "enc": "02nOOOfOOO0", 1183 | "order": 6, 1184 | "int_number": 149 1185 | }, 1186 | "P6_122": { 1187 | "enc": "03nOOCbOODeOOC0", 1188 | "order": 12, 1189 | "int_number": 178 1190 | }, 1191 | "Pn-3n": { 1192 | "enc": "05bOOOcOOOdOOOeOOOhDDD1YYY", 1193 | "order": 48, 1194 | "int_number": 222 1195 | }, 1196 | "Pn-3m": { 1197 | "enc": "05bOOOcOOOdOOOeDDDhDDD1YYY", 1198 | "order": 48, 1199 | "int_number": 224 1200 | }, 1201 | "F4_132": { 1202 | "enc": "06aODDaDODbODDcDDOdOOOeFBF0", 1203 | "order": 96, 1204 | "int_number": 210 1205 | }, 1206 | "I4": { 1207 | "enc": "03aDDDbOOOgOOO0", 1208 | "order": 8, 1209 | "int_number": 79 1210 | }, 1211 | "P222_1": { 1212 | "enc": "02bOODcOOD0", 1213 | "order": 4, 1214 | "int_number": 17 1215 | }, 1216 | "Ccca": { 1217 | "enc": "04aDDObDDOcOOOhODD1OBB", 1218 | "order": 16, 1219 | "int_number": 68 1220 | }, 1221 | "P3_2": { 1222 | "enc": "01nOOE0", 1223 | "order": 3, 1224 | "int_number": 145 1225 | }, 1226 | "P3_1": { 1227 | "enc": "01nOOC0", 1228 | "order": 3, 1229 | "int_number": 144 1230 | }, 1231 | "P-42m": { 1232 | "enc": "03bOOOmOOOcOOO0", 1233 | "order": 8, 1234 | "int_number": 111 1235 | }, 1236 | "R32H": { 1237 | "enc": "03aECCnOOOeOOO0", 1238 | "order": 18, 1239 | "int_number": 155 1240 | }, 1241 | "Cccm": { 1242 | "enc": "13aDDObOOOcOOD0", 1243 | "order": 16, 1244 | "int_number": 66 1245 | }, 1246 | "Pnnm": { 1247 | "enc": "12bOOOcDDD0", 1248 | "order": 8, 1249 | "int_number": 58 1250 | }, 1251 | "P4_2/m": { 1252 | "enc": "12bOOOgOOD0", 1253 | "order": 8, 1254 | "int_number": 84 1255 | }, 1256 | "P4_2/n": { 1257 | "enc": "03bOOOgDDDhDDD1YYY", 1258 | "order": 8, 1259 | "int_number": 86 1260 | }, 1261 | "P4/nmm": { 1262 | "enc": "04bOOOgDDOcDDOhDDO1YBO", 1263 | "order": 16, 1264 | "int_number": 129 1265 | }, 1266 | "Cmcm": { 1267 | "enc": "13aDDObOODcOOD0", 1268 | "order": 16, 1269 | "int_number": 63 1270 | }, 1271 | "Pnnn": { 1272 | "enc": "03bOOOcOOOhDDD1BBB", 1273 | "order": 8, 1274 | "int_number": 48 1275 | }, 1276 | "Fm-3": { 1277 | "enc": "15aODDaDODbOOOcOOOdOOO0", 1278 | "order": 96, 1279 | "int_number": 202 1280 | }, 1281 | "Pmc2_1": { 1282 | "enc": "02bOODjOOD0", 1283 | "order": 4, 1284 | "int_number": 26 1285 | }, 1286 | "P4mm": { 1287 | "enc": "03bOOOgOOOjOOO0", 1288 | "order": 8, 1289 | "int_number": 99 1290 | }, 1291 | "Pmn2_1": { 1292 | "enc": "02bDODjDOD0", 1293 | "order": 4, 1294 | "int_number": 31 1295 | }, 1296 | "P4_1": { 1297 | "enc": "02bOODgOOB0", 1298 | "order": 4, 1299 | "int_number": 76 1300 | }, 1301 | "P4_3": { 1302 | "enc": "02bOODgOOF0", 1303 | "order": 4, 1304 | "int_number": 78 1305 | }, 1306 | "P4_2": { 1307 | "enc": "02bOOOgOOD0", 1308 | "order": 4, 1309 | "int_number": 77 1310 | }, 1311 | "P6_3": { 1312 | "enc": "02nOOObOOD0", 1313 | "order": 6, 1314 | "int_number": 173 1315 | }, 1316 | "P6_2": { 1317 | "enc": "02nOOEbOOO0", 1318 | "order": 6, 1319 | "int_number": 171 1320 | }, 1321 | "P6_3/m": { 1322 | "enc": "12nOOObOOD0", 1323 | "order": 12, 1324 | "int_number": 176 1325 | }, 1326 | "Ccc2": { 1327 | "enc": "03aDDObOOOjOOD0", 1328 | "order": 8, 1329 | "int_number": 37 1330 | }, 1331 | "Pma2": { 1332 | "enc": "02bOOOjDOO0", 1333 | "order": 4, 1334 | "int_number": 28 1335 | }, 1336 | "P-62c": { 1337 | "enc": "03nOOOiOODeOOO0", 1338 | "order": 12, 1339 | "int_number": 190 1340 | }, 1341 | "P6_5": { 1342 | "enc": "02nOOEbOOD0", 1343 | "order": 6, 1344 | "int_number": 170 1345 | }, 1346 | "P6_4": { 1347 | "enc": "02nOOCbOOO0", 1348 | "order": 6, 1349 | "int_number": 172 1350 | }, 1351 | "P4_32_12": { 1352 | "enc": "03bOODgDDFcDDF0", 1353 | "order": 8, 1354 | "int_number": 96 1355 | }, 1356 | "P-62m": { 1357 | "enc": "03nOOOiOOOeOOO0", 1358 | "order": 12, 1359 | "int_number": 189 1360 | }, 1361 | "Pnc2": { 1362 | "enc": "02bOOOjODD0", 1363 | "order": 4, 1364 | "int_number": 30 1365 | }, 1366 | "P-4": { 1367 | "enc": "02bOOOmOOO0", 1368 | "order": 4, 1369 | "int_number": 81 1370 | }, 1371 | "R-3": { 1372 | "enc": "11dOOO0", 1373 | "order": 6, 1374 | "int_number": 148 1375 | }, 1376 | "P-6": { 1377 | "enc": "02nOOOiOOO0", 1378 | "order": 6, 1379 | "int_number": 174 1380 | }, 1381 | "I4cm": { 1382 | "enc": "04aDDDbOOOgOOOjOOD0", 1383 | "order": 16, 1384 | "int_number": 108 1385 | }, 1386 | "P-43n": { 1387 | "enc": "04bOOOcOOOdOOOlDDD0", 1388 | "order": 24, 1389 | "int_number": 218 1390 | }, 1391 | "P-43m": { 1392 | "enc": "04bOOOcOOOdOOOlOOO0", 1393 | "order": 24, 1394 | "int_number": 215 1395 | }, 1396 | "P-3": { 1397 | "enc": "11nOOO0", 1398 | "order": 6, 1399 | "int_number": 147 1400 | }, 1401 | "R3mH": { 1402 | "enc": "03aECCnOOOkOOO0", 1403 | "order": 18, 1404 | "int_number": 160 1405 | }, 1406 | "P4_2bc": { 1407 | "enc": "03bOOOgOODjDDO0", 1408 | "order": 8, 1409 | "int_number": 106 1410 | }, 1411 | "P42_12": { 1412 | "enc": "03bOOOgDDOcDDO0", 1413 | "order": 8, 1414 | "int_number": 90 1415 | }, 1416 | "P-42c": { 1417 | "enc": "03bOOOmOOOcOOD0", 1418 | "order": 8, 1419 | "int_number": 112 1420 | }, 1421 | "Ima2": { 1422 | "enc": "03aDDDbOOOjDOO0", 1423 | "order": 8, 1424 | "int_number": 46 1425 | }, 1426 | "Pm-3n": { 1427 | "enc": "14bOOOcOOOdOOOeDDD0", 1428 | "order": 48, 1429 | "int_number": 223 1430 | }, 1431 | "R-3mH": { 1432 | "enc": "13aECCnOOOeOOO0", 1433 | "order": 36, 1434 | "int_number": 166 1435 | }, 1436 | "Pm-3m": { 1437 | "enc": "14bOOOcOOOdOOOeOOO0", 1438 | "order": 48, 1439 | "int_number": 221 1440 | } 1441 | }, 1442 | "point_group_encoding": { 1443 | "622": "ben", 1444 | "2/m": "ch", 1445 | "6/m": "bhn", 1446 | "mm2": "bj", 1447 | "-43m": "dml", 1448 | "6/mmm": "benh", 1449 | "23": "cd", 1450 | "-42m": "cm", 1451 | "3": "n", 1452 | "1": "a", 1453 | "-3m": "fhn", 1454 | "2": "c", 1455 | "4": "g", 1456 | "3m": "kn", 1457 | "6": "bn", 1458 | "422": "cg", 1459 | "6mm": "bkn", 1460 | "4/m": "gh", 1461 | "-6m2": "ikn", 1462 | "m-3m": "dghl", 1463 | "mmm": "bch", 1464 | "m-3": "cdh", 1465 | "222": "bc", 1466 | "32": "en", 1467 | "m": "j", 1468 | "-4": "m", 1469 | "-6": "in", 1470 | "-1": "h", 1471 | "-3": "hn", 1472 | "4/mmm": "cgh", 1473 | "432": "dg", 1474 | "4mm": "gj" 1475 | } 1476 | } -------------------------------------------------------------------------------- /symmetry/tests/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """ 4 | TODO: Modify module doc. 5 | """ 6 | 7 | from __future__ import division 8 | 9 | __author__ = "Shyue Ping Ong" 10 | __copyright__ = "Copyright 2012, The Materials Project" 11 | __version__ = "0.1" 12 | __maintainer__ = "Shyue Ping Ong" 13 | __email__ = "shyuep@gmail.com" 14 | __date__ = "4/10/14" 15 | 16 | -------------------------------------------------------------------------------- /symmetry/tests/test_groups.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """ 4 | TODO: Modify unittest doc. 5 | """ 6 | 7 | from __future__ import division 8 | 9 | __author__ = "Shyue Ping Ong" 10 | __copyright__ = "Copyright 2012, The Materials Virtual Lab" 11 | __version__ = "0.1" 12 | __maintainer__ = "Shyue Ping Ong" 13 | __email__ = "ongsp@ucsd.edu" 14 | __date__ = "4/10/14" 15 | 16 | import unittest 17 | import numpy as np 18 | 19 | from symmetry.groups import PointGroup, SpaceGroup 20 | 21 | 22 | class PointGroupTest(unittest.TestCase): 23 | 24 | def test_order(self): 25 | order = {"mmm": 8, "432": 24, "-6m2": 12} 26 | for k, v in order.items(): 27 | pg = PointGroup(k) 28 | self.assertEqual(order[k], len(pg.symmetry_ops)) 29 | 30 | 31 | class SpaceGroupTest(unittest.TestCase): 32 | 33 | def test_order_symm_ops(self): 34 | for name in SpaceGroup.SG_SYMBOLS: 35 | sg = SpaceGroup(name) 36 | self.assertEqual(len(sg.symmetry_ops), sg.order) 37 | 38 | def test_crystal_system(self): 39 | sg = SpaceGroup("R-3c") 40 | self.assertEqual(sg.crystal_system, "Trigonal") 41 | sg = SpaceGroup("R-3cH") 42 | self.assertEqual(sg.crystal_system, "Trigonal") 43 | 44 | def test_get_orbit(self): 45 | sg = SpaceGroup("Fm-3m") 46 | p = np.random.randint(0, 100 + 1, size=(3,)) / 100 47 | self.assertLessEqual(len(sg.get_orbit(p)), sg.order) 48 | 49 | if __name__ == '__main__': 50 | unittest.main() 51 | -------------------------------------------------------------------------------- /symmetry/vis.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """ 4 | TODO: Modify module doc. 5 | """ 6 | 7 | from __future__ import division 8 | 9 | __author__ = "Shyue Ping Ong" 10 | __copyright__ = "Copyright 2013, The Materials Virtual Lab" 11 | __version__ = "0.1" 12 | __maintainer__ = "Shyue Ping Ong" 13 | __email__ = "ongsp@ucsd.edu" 14 | __date__ = "4/12/14" 15 | 16 | 17 | import inspect 18 | import itertools 19 | import numpy as np 20 | from pymatgen import Lattice 21 | import matplotlib.pyplot as plt 22 | from mpl_toolkits.mplot3d import Axes3D 23 | from pymatgen.util.plotting_utils import get_publication_quality_plot 24 | 25 | 26 | class SpaceGroupVisualizer(object): 27 | 28 | def __init__(self): 29 | pass 30 | 31 | def plot(self, sg): 32 | cs = sg.crystal_system 33 | params = { 34 | "a": 10, 35 | "b": 12, 36 | "c": 14, 37 | "alpha": 20, 38 | "beta": 30, 39 | "gamma": 40 40 | } 41 | cs = "rhombohedral" if cs == "Trigonal" else cs 42 | func = getattr(Lattice, cs.lower()) 43 | kw = {k: params[k] for k in inspect.getargspec(func).args} 44 | lattice = func(**kw) 45 | global plt 46 | fig = plt.figure(figsize=(10, 10)) 47 | #ax = fig.add_subplot(111, projection='3d') 48 | for i in range(2): 49 | plt.plot([0, lattice.matrix[i][0]], [0, lattice.matrix[i][1]], 50 | 'k-') 51 | plt.plot([lattice.matrix[0][0], lattice.matrix[0][0]], 52 | [0, lattice.matrix[1][1]], 53 | 'k-') 54 | plt.plot([0, lattice.matrix[0][0]], 55 | [lattice.matrix[1][1], lattice.matrix[1][1]], 56 | 'k-') 57 | 58 | l = np.arange(0, 0.02, 0.02 / 100) 59 | theta = np.arange(0, 4 * np.pi, 4 * np.pi / 100) - np.pi / 2 60 | 61 | x = l * np.cos(theta) + 0.025 62 | y = l * np.sin(theta) + 0.025 63 | z = 0.001 * theta + 0.02 64 | d = np.array(zip(x, y, z, [1] * len(x))) 65 | 66 | for op in sg.symmetry_ops: 67 | dd = np.dot(op, d.T).T 68 | for tx, ty in itertools.product((-1, 0, 1), (-1, 0, 1)): 69 | ddd = dd[:, 0:3] + np.array([tx, ty, 0])[None, :] 70 | color = "r" if 0.5 < ddd[0, 2] > 1 else "b" 71 | coords = lattice.get_cartesian_coords(ddd[:, 0:3]) 72 | plt.plot(coords[:, 0], coords[:, 1], color + "-") 73 | 74 | #plt.plot(x, y, 'k-') 75 | max_l = max(params['a'], params['b']) 76 | #plt = get_publication_quality_plot(8, 8, plt) 77 | #plt.savefig('test2png.png',dpi=100) 78 | lim = [-max_l * 0.1, max_l * 1.1] 79 | plt.xlim(lim) 80 | plt.ylim(lim) 81 | plt.tight_layout() 82 | plt.show() 83 | 84 | if __name__ == "__main__": 85 | from symmetry.groups import SpaceGroup 86 | sg = SpaceGroup("Pnma") 87 | SpaceGroupVisualizer().plot(sg) 88 | --------------------------------------------------------------------------------