Unverified Commit a290b1ba authored by Sudarsan Surendralal's avatar Sudarsan Surendralal Committed by GitHub
Browse files

Merge pull request #69 from pyiron/day3-validation-surface-energy

Query Cu-fcc surface energies from atomsitictools.org
parents 5b047da9 8b0e9435
......@@ -2,7 +2,6 @@
"cells": [
{
"cell_type": "markdown",
"id": "removable-insert",
"metadata": {},
"source": [
"# [**Workflows for atomistic simulations**](http://potentials.rub.de/) "
......@@ -10,7 +9,6 @@
},
{
"cell_type": "markdown",
"id": "median-patch",
"metadata": {},
"source": [
"## **Day 3 - Validation of various potentials**\n",
......@@ -30,7 +28,6 @@
},
{
"cell_type": "markdown",
"id": "worth-monitoring",
"metadata": {},
"source": [
"## **Importing the modules and creating the project**"
......@@ -39,7 +36,6 @@
{
"cell_type": "code",
"execution_count": 1,
"id": "welsh-lafayette",
"metadata": {},
"outputs": [],
"source": [
......@@ -52,7 +48,6 @@
{
"cell_type": "code",
"execution_count": 2,
"id": "western-waterproof",
"metadata": {},
"outputs": [],
"source": [
......@@ -62,7 +57,6 @@
{
"cell_type": "code",
"execution_count": 3,
"id": "historic-murray",
"metadata": {},
"outputs": [],
"source": [
......@@ -72,7 +66,6 @@
{
"cell_type": "code",
"execution_count": 4,
"id": "numerous-engagement",
"metadata": {},
"outputs": [],
"source": [
......@@ -87,7 +80,6 @@
{
"cell_type": "code",
"execution_count": 5,
"id": "educational-fourth",
"metadata": {},
"outputs": [],
"source": [
......@@ -109,7 +101,6 @@
},
{
"cell_type": "markdown",
"id": "hidden-lodging",
"metadata": {},
"source": [
"## **Step 1: Get the equilibrium Cu lattice constant determined by the potentials**\n",
......@@ -120,7 +111,6 @@
{
"cell_type": "code",
"execution_count": 6,
"id": "rational-operations",
"metadata": {},
"outputs": [],
"source": [
......@@ -132,7 +122,6 @@
{
"cell_type": "code",
"execution_count": 7,
"id": "local-austin",
"metadata": {},
"outputs": [
{
......@@ -363,7 +352,6 @@
{
"cell_type": "code",
"execution_count": 8,
"id": "independent-tennis",
"metadata": {},
"outputs": [
{
......@@ -384,7 +372,6 @@
{
"cell_type": "code",
"execution_count": 9,
"id": "occupational-cross",
"metadata": {},
"outputs": [],
"source": [
......@@ -416,7 +403,6 @@
{
"cell_type": "code",
"execution_count": 10,
"id": "collective-parameter",
"metadata": {},
"outputs": [
{
......@@ -564,7 +550,6 @@
},
{
"cell_type": "markdown",
"id": "valid-apollo",
"metadata": {},
"source": [
"## **Compute elastic constants**\n",
......@@ -575,7 +560,6 @@
{
"cell_type": "code",
"execution_count": 11,
"id": "industrial-antique",
"metadata": {},
"outputs": [
{
......@@ -678,7 +662,6 @@
{
"cell_type": "code",
"execution_count": 12,
"id": "under-knight",
"metadata": {},
"outputs": [
{
......@@ -702,7 +685,6 @@
{
"cell_type": "code",
"execution_count": 13,
"id": "removable-clinic",
"metadata": {},
"outputs": [],
"source": [
......@@ -726,7 +708,6 @@
{
"cell_type": "code",
"execution_count": 14,
"id": "ongoing-chocolate",
"metadata": {},
"outputs": [
{
......@@ -860,7 +841,6 @@
},
{
"cell_type": "markdown",
"id": "considerable-latex",
"metadata": {},
"source": [
"## **Compare computed elastic constants with that from DFT calculations**\n",
......@@ -870,8 +850,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"id": "governmental-watershed",
"execution_count": 6,
"metadata": {},
"outputs": [
{
......@@ -879,13 +858,13 @@
"output_type": "stream",
"text": [
"Querying...done\n",
"Response successful, size = 7.20 kB, time = 0.04 s\n",
"Response successful, size = 7.20 kB, time = 0.07 s\n",
"1 entries received\n",
"Querying...done\n",
"Response successful, size = 37.78 kB, time = 0.36 s\n",
"Response successful, size = 37.78 kB, time = 0.27 s\n",
"1 entries received\n",
"Querying...done\n",
"Response successful, size = 22.50 kB, time = 1.13 s\n",
"Response successful, size = 22.50 kB, time = 0.13 s\n",
"1 entries received\n"
]
}
......@@ -910,8 +889,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"id": "soviet-restaurant",
"execution_count": 7,
"metadata": {},
"outputs": [
{
......@@ -933,7 +911,6 @@
},
{
"cell_type": "markdown",
"id": "cardiovascular-annex",
"metadata": {},
"source": [
"## **Calculation of surface energies**\n",
......@@ -944,7 +921,6 @@
{
"cell_type": "code",
"execution_count": 17,
"id": "individual-samuel",
"metadata": {},
"outputs": [
{
......@@ -989,7 +965,6 @@
{
"cell_type": "code",
"execution_count": 18,
"id": "applicable-tunnel",
"metadata": {},
"outputs": [],
"source": [
......@@ -1013,7 +988,6 @@
{
"cell_type": "code",
"execution_count": 19,
"id": "false-jacob",
"metadata": {},
"outputs": [
{
......@@ -1264,16 +1238,23 @@
},
{
"cell_type": "markdown",
"id": "polished-catalog",
"metadata": {},
"source": [
"Compute surface energies using data from the bulk fcc crystal"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [],
"source": [
"eV_A2_to_mJ_m2_factor = 16.0219 * 1e3"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "devoted-lover",
"metadata": {},
"outputs": [
{
......@@ -1441,13 +1422,177 @@
"source": [
"data_merged = pd.merge(data_surf, data_murn, on=\"potential\")\n",
"data_merged[\"surface_energy\"] = data_merged.energy_tot - (data_merged.eq_energy * data_merged.Number_of_atoms)\n",
"data_merged[\"surface_energy_in_mJ_per_sq_m\"] = data_merged.surface_energy / data_merged.surface_area / 2 * 16.0219 * 1e3\n",
"data_merged[\"surface_energy_in_mJ_per_sq_m\"] = data_merged.surface_energy / data_merged.surface_area / 2 * eV_A2_to_mJ_m2_factor\n",
"data_merged[[\"potential\", \"surface_type\", \"surface_energy_in_mJ_per_sq_m\"]]"
]
},
{
"cell_type": "markdown",
"id": "accredited-excuse",
"metadata": {},
"source": [
"## Compare to DFT reference data queried from atomistictools.org"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Querying...done\n",
"Response successful, size = 56.26 kB, time = 0.36 s\n",
"9 entries received\n"
]
}
],
"source": [
"surface_props = rest.query_properties(rest.PropertyTypes.SURFACE_ENERGY, \n",
" composition=\"Cu-%\", \n",
" strukturbericht=\"A1\",\n",
" calculator_name=fhi_calc.NAME\n",
" )"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"surf_dft_data=[]\n",
"for surf_prop in surface_props:\n",
" surf_dft_data.append([surf_prop.VALUE[\"surface_orientation\"], surf_prop.VALUE[\"number_of_atoms\"], surf_prop.VALUE[\"surface_energy\"]])"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [],
"source": [
"surf_dft_df=pd.DataFrame(surf_dft_data, columns=[\"surface_type\",\"number_of_atoms\",\"surface_energy(eV/A^2)\"])"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {},
"outputs": [],
"source": [
"surf_dft_df.sort_values([\"surface_type\", \"number_of_atoms\"], ascending=[False, False], inplace=True)"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {},
"outputs": [],
"source": [
"surf_dft_df.drop_duplicates([\"surface_type\"], keep=\"first\", inplace=True)"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {},
"outputs": [],
"source": [
"surf_dft_df[\"surface_type\"] = \"fcc\" + surf_dft_df[\"surface_type\"]"
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {},
"outputs": [],
"source": [
"surf_dft_df[\"surface_energy_in_mJ_per_sq_m\"] = surf_dft_df[\"surface_energy(eV/A^2)\"]*eV_A2_to_mJ_m2_factor"
]
},
{
"cell_type": "code",
"execution_count": 32,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>surface_type</th>\n",
" <th>number_of_atoms</th>\n",
" <th>surface_energy(eV/A^2)</th>\n",
" <th>surface_energy_in_mJ_per_sq_m</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>fcc111</td>\n",
" <td>14</td>\n",
" <td>0.085074</td>\n",
" <td>1363.054065</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>fcc110</td>\n",
" <td>9</td>\n",
" <td>0.098272</td>\n",
" <td>1574.504220</td>\n",
" </tr>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>fcc100</td>\n",
" <td>10</td>\n",
" <td>0.092586</td>\n",
" <td>1483.399754</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" surface_type number_of_atoms surface_energy(eV/A^2) \\\n",
"7 fcc111 14 0.085074 \n",
"5 fcc110 9 0.098272 \n",
"0 fcc100 10 0.092586 \n",
"\n",
" surface_energy_in_mJ_per_sq_m \n",
"7 1363.054065 \n",
"5 1574.504220 \n",
"0 1483.399754 "
]
},
"execution_count": 32,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"surf_dft_df"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## **Finite temperature thermodynamics (Harmonic approximation)**\n",
......@@ -1458,7 +1603,6 @@
{
"cell_type": "code",
"execution_count": 21,
"id": "seasonal-helmet",
"metadata": {},
"outputs": [
{
......@@ -1493,7 +1637,6 @@
},
{
"cell_type": "markdown",
"id": "clean-kruger",
"metadata": {},
"source": [
"Plotting the thermodynamic properties using phonopy"
......@@ -1502,7 +1645,6 @@
{
"cell_type": "code",
"execution_count": 22,
"id": "mathematical-monitor",
"metadata": {},
"outputs": [
{
......@@ -1553,7 +1695,6 @@
},
{
"cell_type": "markdown",
"id": "eastern-dayton",
"metadata": {},
"source": [
"We can also compute the phonon density of states and compare with that from benchmarked DFT calculations"
......@@ -1562,7 +1703,6 @@
{
"cell_type": "code",
"execution_count": 23,
"id": "general-eating",
"metadata": {},
"outputs": [
{
......@@ -1592,7 +1732,6 @@
},
{
"cell_type": "markdown",
"id": "flush-cleaning",
"metadata": {},
"source": [
"## **Validating against original dataset**\n",
......@@ -1603,7 +1742,6 @@
{
"cell_type": "code",
"execution_count": 24,
"id": "weekly-austria",
"metadata": {},
"outputs": [],
"source": [
......@@ -1615,7 +1753,6 @@
{
"cell_type": "code",
"execution_count": 25,
"id": "whole-syracuse",
"metadata": {},
"outputs": [
{
......@@ -1771,7 +1908,6 @@
{
"cell_type": "code",
"execution_count": 26,
"id": "alert-adjustment",
"metadata": {},
"outputs": [],
"source": [
......@@ -1781,7 +1917,6 @@
{
"cell_type": "code",
"execution_count": 27,
"id": "center-contributor",
"metadata": {},
"outputs": [
{
......@@ -1986,7 +2121,6 @@
},
{
"cell_type": "markdown",
"id": "empirical-ceiling",
"metadata": {},
"source": [
"Now we iterate over the structures in the dataset and compute the energies and forces for comparison"
......@@ -1995,7 +2129,6 @@
{
"cell_type": "code",
"execution_count": 28,
"id": "compliant-crazy",
"metadata": {},
"outputs": [],
"source": [
......@@ -2007,7 +2140,6 @@
{
"cell_type": "code",
"execution_count": 29,
"id": "negative-system",
"metadata": {},
"outputs": [
{
......@@ -2115,7 +2247,6 @@
{
"cell_type": "code",
"execution_count": 30,
"id": "danish-nerve",
"metadata": {},
"outputs": [
{
......@@ -2161,7 +2292,6 @@
{
"cell_type": "code",
"execution_count": null,
"id": "median-syndication",
"metadata": {},
"outputs": [],
"source": []
......@@ -2183,7 +2313,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.6"
"version": "3.7.6"
}
},
"nbformat": 4,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment