{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "# Struct2XAS examples: from CIF/XYZ to XANES/EXAFS simulations with FDMNES and FEFF\n", "\n", "- Authors: Beatriz G. Foschiani and Mauro Rovezzi\n", "- Contact: mauro.rovezzi@esrf.fr\n", "- Last modified: September 2023\n", "\n", "Here we provide various examples on the usage of `larch.xrd.struct2xas` module." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import os\n", "import larch" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1: Zn K-edge XANES of wurtzite ZnO with FDMNES from a CIF file\n", "\n", "This example shows how to use the `Struct2XAS` class to convert a CIF file to a FDMNES XANES input. We will simulate Zn K-edge XAS of ZnO. \n", "\n", "- The input structure is taken from the Materials Project database: [mp-2133](https://legacy.materialsproject.org/materials/mp-2133/).\n", "- The experimental data are taken from the SSHADE/FAME database: [DOI:10.26302/SSHADE/EXPERIMENT_ST_20180418_001](https://www.sshade.eu/data/EXPERIMENT_ST_20180418_001)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "Import the main class and instantiate it with the CIF file and the name of the absorbing element" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[struct2xas] INFO : Frames: 1, Absorbing sites: 1. (Indexes for frames and abs_sites start at 0)\n" ] } ], "source": [ "from larch.xrd.struct2xas import Struct2XAS\n", "mat_obj = Struct2XAS(file = \"../structuredata/struct2xas/ZnO_mp-2133.cif\", abs_atom=\"Zn\")" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "to get the information about absorbing site" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
| idx_abs\n", " | specie\n", " | frac_coords\n", " | wyckoff_site\n", " | cart_coords\n", " | occupancy\n", " | idx_in_struct\n", " | 
|---|---|---|---|---|---|---|
| 0\n", " | Zn\n", " | [0.3333, 0.6667, 0.4995]\n", " | 2b\n", " | [-1.6446 0.9495 -2.6505]\n", " | 1\n", " | 0\n", " | 
| \n", " | Element\n", " | Distance\n", " | 
|---|---|---|
| 0\n", " | (O)\n", " | 2.00418\n", " | 
| 1\n", " | (O)\n", " | 2.00425\n", " | 
| 2\n", " | (O)\n", " | 2.00426\n", " | 
| 3\n", " | (O)\n", " | 2.01242\n", " | 
| 4\n", " | (O)\n", " | 3.29440\n", " | 
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
| idx_abs\n", " | specie\n", " | frac_coords\n", " | wyckoff_site\n", " | cart_coords\n", " | occupancy\n", " | idx_in_struct\n", " | 
|---|---|---|---|---|---|---|
| 0\n", " | Zn\n", " | [0.6667, 0.3333, 0.1651]\n", " | 4f\n", " | [-1.5277 -0.882 -5.0195]\n", " | 1\n", " | 0\n", " | 
| 1\n", " | Zn\n", " | [0.6667, 0.3333, 0.5825]\n", " | 4f\n", " | [ -1.5277 -0.882 -17.7146]\n", " | 1\n", " | 4\n", " | 
| 2\n", " | Zn\n", " | [0.0, 0.0, 0.75]\n", " | 2b\n", " | [ 0. 0. -22.8074]\n", " | 1\n", " | 8\n", " | 
| 3\n", " | Zn\n", " | [0.0, 0.0, 0.0]\n", " | 2a\n", " | [0. 0. 0.]\n", " | 1\n", " | 10\n", " | 
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
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
| \n", " | Element\n", " | Distance\n", " | 
|---|---|---|
| 0\n", " | (H)\n", " | 2.64949\n", " | 
| 1\n", " | (H)\n", " | 2.64949\n", " |