{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Tutorial 1: Atomic crystal module in PyXtal\n", "\n", "Source code: https://github.com/qzhu2017/PyXtal\n", "\n", "Created by Qiang Zhu (2020/11/23)\n", "\n", "Last updated: 2022/08/11\n", "\n", "More details can be found at the following [link](https://pyxtal.readthedocs.io/en/latest/)\n", "\n", "# 1.1 Generate a random atomic crystal" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from pyxtal import pyxtal" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "------Crystal from random------\n", "Dimension: 3\n", "Composition: C8\n", "Group: F d -3 m:2 (227)\n", " 4.5200, 4.5200, 4.5200, 90.0000, 90.0000, 90.0000, cubic\n", "Wyckoff sites:\n", "\t C @ [ 0.1250 0.1250 0.1250], WP [8a] Site [-433mm]\n" ] } ], "source": [ "C1 = pyxtal()\n", "C1.from_random(3, 227, ['C'], [8])\n", "# Alternative, you can also generate the structure with pre-assigned sites\n", "# C1.from_random(3, 225, [\"C\"], [12], sites=[[\"4a\", \"8c\"]])\n", "\n", "print(C1)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Wyckoff position 8a in space group 227 with site symmetry -4 33 mm\n", "1/8, 1/8, 1/8\n", "7/8, 3/8, 3/8\n", "1/8, 5/8, 5/8\n", "7/8, 7/8, 7/8\n", "5/8, 1/8, 5/8\n", "11/8, 3/8, 7/8\n", "5/8, 5/8, 1/8\n", "11/8, 7/8, 3/8" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "C1.atom_sites[0].wp" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "application/3dmoljs_load.v0": "
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
\n jupyter labextension install jupyterlab_3dmol
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
\n",
" jupyter labextension install jupyterlab_3dmol