Skip to content
Snippets Groups Projects
validation_NiAl.ipynb 675 KiB
Newer Older
{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "25d5b0d5-f330-4dcb-9b7c-f57c4bea9596",
   "metadata": {},
   "source": [
    "# **Workshop: From electrons to phase diagrams**\n",
    "\n",
    "# Day 2: Validation of the potentials (draft)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4756d4c9-304a-4ccc-b772-ba67d008c5a4",
   "metadata": {},
   "source": [
    "## Import the fitted potentials for Li-Al ( from prevoius excercise)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "83f7a2c9-d45a-4987-9e35-59badd754d4f",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pylab as plt\n",
    "import seaborn as sns\n",
    "import pandas as pd\n",
    "import time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "73bedeef-3e9b-4ca4-99c1-1be729222df8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2.426196225"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time_start =  time.process_time()\n",
    "\n",
    "time_start"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c702e2da-52b2-419d-8031-483bba3b44d9",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "da96c965-24f8-401d-911e-72818c90e731",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pyiron_atomistics import Project\n",
    "import pyiron_gpl\n",
    "from ase.lattice.compounds import B2\n",
    "from pyiron_atomistics import ase_to_pyiron"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "abf1afd7-a6a1-46b5-99f1-6d74f5986cb1",
   "metadata": {},
   "outputs": [],
   "source": [
    "# from structdbrest import StructDBLightRester\n",
    "# rest = StructDBLightRester(token=\"workshop2021\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "5bb172cc-4881-4928-baa0-18ccef0e544c",
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pylab as plt\n",
    "import matplotlib as mpl\n",
    "from matplotlib.patches import Rectangle\n",
    "from matplotlib.colors import LogNorm, PowerNorm\n",
    "\n",
    "linewidth = 3\n",
    "axis_width = linewidth - 1\n",
    "\n",
    "# Figure parameters\n",
    "mpl.rcParams[\"figure.titlesize\"] = 38\n",
    "mpl.rcParams[\"figure.figsize\"] = 10, 8\n",
    "mpl.rcParams[\"figure.subplot.wspace\"] = 0.6\n",
    "mpl.rcParams[\"figure.subplot.hspace\"] = 0.6\n",
    "\n",
    "# Line parameters\n",
    "mpl.rcParams['lines.linewidth'] = linewidth\n",
    "mpl.rcParams['lines.markeredgewidth'] = linewidth\n",
    "mpl.rcParams['lines.markersize'] = linewidth\n",
    "\n",
    "# Font parameters\n",
    "#mpl.rcParams['font.family'] = 'Times New Roman'\n",
    "\n",
    "mpl.rcParams['font.family'] = 'Times New Roman'\n",
    "mpl.rcParams['font.size'] = 20\n",
    "\n",
    "# Latex params\n",
    "#mpl.rcParams['text.usetex'] = True\n",
    "\n",
    "# Axes parameters\n",
    "mpl.rcParams['axes.linewidth'] = axis_width\n",
    "mpl.rcParams['axes.titlesize'] = 20\n",
    "mpl.rcParams['axes.labelsize'] = 20\n",
    "\n",
    "# Tick parameters\n",
    "mpl.rcParams[\"xtick.top\"] = True\n",
    "mpl.rcParams[\"xtick.major.size\"] = 2 * linewidth + 1\n",
    "mpl.rcParams[\"xtick.minor.size\"] = linewidth\n",
    "mpl.rcParams[\"xtick.major.width\"] = axis_width\n",
    "mpl.rcParams[\"xtick.labelsize\"] = 20\n",
    "mpl.rcParams[\"xtick.direction\"] = \"in\"\n",
    "mpl.rcParams[\"ytick.right\"] = True\n",
    "mpl.rcParams[\"ytick.major.size\"] = 2 * linewidth + 1\n",
    "mpl.rcParams[\"ytick.minor.size\"] = linewidth\n",
    "mpl.rcParams[\"ytick.major.width\"] = axis_width\n",
    "mpl.rcParams[\"ytick.labelsize\"] = 20\n",
    "mpl.rcParams[\"ytick.direction\"] = \"in\"\n",
    "\n",
    "# Grid parameters\n",
    "mpl.rcParams[\"grid.linewidth\"] = axis_width       ## in points\n",
    "\n",
    "# Legend parameters\n",
    "mpl.rcParams[\"legend.framealpha\"] = 1\n",
    "mpl.rcParams[\"legend.edgecolor\"] = \"k\"\n",
    "mpl.rcParams[\"legend.fancybox\"] = False\n",
    "mpl.rcParams[\"legend.fontsize\"] = 20\n",
    "\n",
    "# Mathtext parameters parameters\n",
    "mpl.rcParams[\"mathtext.fontset\"] = \"stix\"\n",
    "\n",
    "#del mpl.font_manager.weight_dict['roman']\n",
    "#mpl.font_manager._rebuild()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "706be2a9-5f94-4eb5-8e4f-6c349fe216b3",
   "metadata": {},
   "outputs": [],
   "source": [
    "pr = Project(\"validation_test\")\n",
    "####pr.remove_jobs(silently=True, recursive=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "9bd63883-25b3-441f-9b4b-b3c960a179aa",
   "metadata": {},
   "outputs": [],
   "source": [
    "##########! rm -rf validation_test"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fed285ea-9c22-4bf9-a6a6-c4687b140563",
   "metadata": {},
   "source": [
    "## Generate list of potentials (after fitting)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "d7626bae-f843-42be-b34d-9b304074857c",
   "metadata": {},
   "outputs": [],
   "source": [
    "dummy = pr.create.job.Lammps(\"dummy\")\n",
    "dummy.structure = pr.create_ase_bulk(\"Al\", cubic=True)\n",
    "dummy.structure[0] = \"Ni\"\n",
    "potential_list = dummy.list_potentials()[:3]"
   ]
Loading
Loading full blame...