Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
{
"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...