-
Angelo Ziletti authoredAngelo Ziletti authored
phasediagram.bkr 30.63 KiB
{
"beaker": "2",
"evaluators": [
{
"name": "HTML",
"plugin": "HTML",
"view": {
"cm": {
"mode": "htmlmixed"
}
}
},
{
"name": "TeX",
"plugin": "TeX",
"view": {
"cm": {
"mode": "stex"
}
}
},
{
"name": "IPython",
"plugin": "IPython",
"imports": "",
"supplementalClassPath": "",
"view": {
"cm": {
"mode": "python"
}
},
"setup": "%matplotlib inline\nimport numpy\nimport matplotlib\nfrom matplotlib import pylab, mlab, pyplot\nnp = numpy\nplt = pyplot\nfrom IPython.display import display\nfrom IPython.core.pylabtools import figsize, getfigs\nfrom pylab import *\nfrom numpy import *\n"
},
{
"name": "JavaScript",
"plugin": "JavaScript",
"jsSetting2": "",
"jsSetting1": "",
"view": {
"cm": {
"mode": "javascript",
"background": "#FFE0F0"
}
},
"languageVersion": "ES2015"
},
{
"name": "Python3",
"plugin": "Python3",
"setup": "%matplotlib inline\nimport numpy\nimport matplotlib\nfrom matplotlib import pylab, mlab, pyplot\nnp = numpy\nplt = pyplot\nfrom IPython.display import display\nfrom IPython.core.pylabtools import figsize, getfigs\nfrom pylab import *\nfrom numpy import *\n",
"view": {
"cm": {
"mode": "python"
}
}
}
],
"cells": [
{
"id": "codeFZtLMr",
"type": "code",
"evaluator": "HTML",
"input": {
"body": [
"<style type=\"text/css\">",
"/*!",
" * Nomad Beaker Notebook Template",
" *",
" * @copyright Copyright 2017 Fritz Haber Institute of the Max Planck Society,",
" * Benjamin Regler - Apache 2.0 License",
" * @license http://www.apache.org/licenses/LICENSE-2.0",
" * @author Benjamin Regler",
" * @version 1.0.0",
" *",
" * Licensed under the Apache License, Version 2.0 (the \"License\");",
" * you may not use this file except in compliance with the License.",
" * You may obtain a copy of the License at",
" * ",
" * http://www.apache.org/licenses/LICENSE-2.0",
" *",
" * Unless required by applicable law or agreed to in writing, software",
" * distributed under the License is distributed on an \"AS IS\" BASIS,",
" * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
" * See the License for the specific language governing permissions and",
" * limitations under the License.",
" */",
"p{margin-bottom:1.3em}h1,h2,h3,h4{margin:1.414em 0 .5em;font-weight:inherit;line-height:1.2}h1{margin-top:0;font-size:3.998em}h2{font-size:2.827em}h3{font-size:1.999em}h4{font-size:1.414em}.font_small,small{font-size:.707em}.notebook-container{font-size:16px}.notebook-container .bkr{font-size:100%;font-weight:400;line-height:1.45;color:#333}.nomad--header h2{color:#20335d;font-weight:700;margin:0 0 .2em}.nomad--header h3{color:#20335d;font-weight:700;margin-top:0;text-indent:-1em;padding-left:1em}.nomad--header h3:before{content:\"\\2014\";padding-right:.25em}.nomad--header .nomad--description{margin:-1em 0 0 2em}.atomic-data--block,.nomad--last-updated{display:inline-block;margin-top:1em}.nomad--last-updated{color:grey;float:right;position:relative;z-index:1}.nomad--last-updated::before{bottom:-75%;content:attr(data-version);font-size:4em;font-weight:700;opacity:.2;position:absolute;right:0}.atomic-data label{display:block;font-size:medium;font-weight:700}.atomic-data--select,.chosen-container{width:100%!important}.atomic-data--select:disabled{color:#d3d3d3}.atomic-data--reset-buton{display:inline-block;margin-top:1.6em;width:100%}.modal-dialog{max-width:1000px;width:80%}.modal-header h1{font-size:2em;line-height:1.2}.modal-dialog h2{font-size:1.414em}.modal-dialog h2:first-child{margin-top:0}.modal-dialog h3{font-size:1.2em}.modal-dialog dt{font-size:larger;margin-top:1.414em}.modal-dialog img{width:100%}.modal-dialog .authors{text-transform:uppercase}",
"</style>"
],
"hidden": true
},
"output": {
"state": {},
"result": {
"type": "BeakerDisplay",
"innertype": "Html",
"object": "<script>\nvar beaker = bkHelper.getBeakerObject().beakerObj;\n</script>\n<style type=\"text/css\">\n/*!\n * Nomad Beaker Notebook Template\n *\n * @copyright Copyright 2017 Fritz Haber Institute of the Max Planck Society,\n * Benjamin Regler - Apache 2.0 License\n * @license http://www.apache.org/licenses/LICENSE-2.0\n * @author Benjamin Regler\n * @version 1.0.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\np{margin-bottom:1.3em}h1,h2,h3,h4{margin:1.414em 0 .5em;font-weight:inherit;line-height:1.2}h1{margin-top:0;font-size:3.998em}h2{font-size:2.827em}h3{font-size:1.999em}h4{font-size:1.414em}.font_small,small{font-size:.707em}.notebook-container{font-size:16px}.notebook-container .bkr{font-size:100%;font-weight:400;line-height:1.45;color:#333}.nomad--header h2{color:#20335d;font-weight:700;margin:0 0 .2em}.nomad--header h3{color:#20335d;font-weight:700;margin-top:0;text-indent:-1em;padding-left:1em}.nomad--header h3:before{content:\"\\2014\";padding-right:.25em}.nomad--header .nomad--description{margin:-1em 0 0 2em}.atomic-data--block,.nomad--last-updated{display:inline-block;margin-top:1em}.nomad--last-updated{color:grey;float:right;position:relative;z-index:1}.nomad--last-updated::before{bottom:-75%;content:attr(data-version);font-size:4em;font-weight:700;opacity:.2;position:absolute;right:0}.atomic-data label{display:block;font-size:medium;font-weight:700}.atomic-data--select,.chosen-container{width:100%!important}.atomic-data--select:disabled{color:#d3d3d3}.atomic-data--reset-buton{display:inline-block;margin-top:1.6em;width:100%}.modal-dialog{max-width:1000px;width:80%}.modal-header h1{font-size:2em;line-height:1.2}.modal-dialog h2{font-size:1.414em}.modal-dialog h2:first-child{margin-top:0}.modal-dialog h3{font-size:1.2em}.modal-dialog dt{font-size:larger;margin-top:1.414em}.modal-dialog img{width:100%}.modal-dialog .authors{text-transform:uppercase}\n</style>"
},
"selectedType": "BeakerDisplay",
"elapsedTime": 0,
"height": 50
},
"evaluatorReader": true,
"lineCount": 24
},
{
"id": "codeRqsjzA",
"type": "code",
"evaluator": "HTML",
"input": {
"body": [
"<div id=\"teaser\" style='background-color: rgba(149,170,79, 1.0); background-position: right center; background-size: 200px; background-repeat: no-repeat; ",
" padding-top: 20px;",
" padding-right: 10px;",
" padding-bottom: 50px;",
" padding-left: 80px;' > ",
"",
" <div class=\"nomad--header\">",
" <div style=\"text-align:center\">",
" <h2> <img id=\"nomad\" src=\"https://nomad-coe.eu/uploads/nomad/images/NOMAD_Logo2.png\" height=\"100\" alt=\"NOMAD Logo\"> NOMAD Analytics Toolkit ",
" <img id=\"nomad\" src=\"https://www.nomad-coe.eu/uploads/nomad/backgrounds/head_big-data_analytics_2.png\" height=\"80\" alt=\"NOMAD Logo\"> </h2>",
" </div>",
" <h3> Tutorial example on the stability of materials: Visualizing phase diagrams with dependence on chemical potentials</h3>",
" <p class=\"nomad--description\">",
" created by:",
" M. Strange<sup> 1</sup>,",
" and K. S. Thygesen<sup>1</sup> <br><br>",
" ",
" <sup>1</sup> Nano-Science Center and Department of Chemistry, University of Copenhagen, DK-2100 Copenhagen Ø, Denmark <br>",
" <span class=\"nomad--last-updated\" data-version=\"v1.0.0\">[Last updated: May 15, 2017]</span>",
" </p>",
"</div>",
"",
"</div> ",
"",
"<div style='text-align: right;'>",
"<a href=\"https://analytics-toolkit.nomad-coe.eu/home/\" class=\"btn btn-primary\" style=\"font-size:larger;\">Back to Analytics Home</a> ",
"<a href=\"https://www.nomad-coe.eu/\" class=\"btn btn-primary\" style=\"font-size:larger;\">Back to NOMAD CoE Home</a> ",
"</div>"
],
"hidden": true
},
"output": {
"state": {},
"result": {
"type": "BeakerDisplay",
"innertype": "Html",
"object": "<script>\nvar beaker = bkHelper.getBeakerObject().beakerObj;\n</script>\n<div id=\"teaser\" style=\"background-color: rgba(149,170,79, 1.0); background-position: right center; background-size: 200px; background-repeat: no-repeat; \n padding-top: 20px;\n padding-right: 10px;\n padding-bottom: 50px;\n padding-left: 80px;\"> \n\n <div class=\"nomad--header\">\n <div style=\"text-align:center\">\n <h2> <img id=\"nomad\" src=\"https://nomad-coe.eu/uploads/nomad/images/NOMAD_Logo2.png\" alt=\"NOMAD Logo\" height=\"100\"> NOMAD Analytics Toolkit \n <img id=\"nomad\" src=\"https://www.nomad-coe.eu/uploads/nomad/backgrounds/head_big-data_analytics_2.png\" alt=\"NOMAD Logo\" height=\"80\"> </h2>\n </div>\n <h3> Tutorial example on the stability of materials: Visualizing phase diagrams with dependence on chemical potentials</h3>\n <p class=\"nomad--description\">\n created by:\n M. Strange<sup> 1</sup>,\n and K. S. Thygesen<sup>1</sup> <br><br>\n \n <sup>1</sup> Nano-Science Center and Department of Chemistry, University of Copenhagen, DK-2100 Copenhagen Ø, Denmark <br>\n <span class=\"nomad--last-updated\" data-version=\"v1.0.0\">[Last updated: May 15, 2017]</span>\n </p>\n</div>\n\n</div> \n\n<div style=\"text-align: right;\">\n<a href=\"https://analytics-toolkit.nomad-coe.eu/home/\" class=\"btn btn-primary\" style=\"font-size:larger;\">Back to Analytics Home</a> \n<a href=\"https://www.nomad-coe.eu/\" class=\"btn btn-primary\" style=\"font-size:larger;\">Back to NOMAD CoE Home</a> \n</div>"
},
"selectedType": "BeakerDisplay",
"elapsedTime": 0,
"height": 405
},
"evaluatorReader": true,
"lineCount": 28
},
{
"id": "code0iXrL3",
"type": "code",
"evaluator": "HTML",
"input": {
"body": [
"<a target=\"_blank\" href=\"https://nomad-forum.rz-berlin.mpg.de//\" class=\"btn btn-primary\"> Send your feedback to the analytics-toolkit forum</a> Your comments are invaluable in helping us provide a user friendly experience for all! "
],
"hidden": true
},
"output": {
"state": {},
"result": {
"type": "BeakerDisplay",
"innertype": "Html",
"object": "<script>\nvar beaker = bkHelper.getBeakerObject().beakerObj;\n</script>\n<a target=\"_blank\" href=\"https://nomad-forum.rz-berlin.mpg.de//\" class=\"btn btn-primary\"> Send your feedback to the analytics-toolkit forum</a> Your comments are invaluable in helping us provide a user friendly experience for all! "
},
"selectedType": "BeakerDisplay",
"elapsedTime": 0,
"height": 72
},
"evaluatorReader": true,
"lineCount": 1
},
{
"id": "codeGHSu9O",
"type": "code",
"evaluator": "JavaScript",
"input": {
"body": [
"beaker.process_form = function() {",
" beaker.query = $('#query').val(); ",
" beaker.evaluate(\"phase_diagram\"); // evaluate all cells with tag phase_diagram",
"}"
]
},
"output": {
"state": {},
"selectedType": "Text",
"pluginName": "JavaScript",
"height": 50,
"hidden": true,
"elapsedTime": 52
},
"evaluatorReader": true,
"lineCount": 4,
"initialization": true
},
{
"id": "codeIaOuj8",
"type": "code",
"evaluator": "Python3",
"input": {
"body": [
"#import ase.db",
"from phasediagram2 import PhaseDiagram",
"from refs import refs_ceder as refs",
"#con = ase.db.connect('/Users/strange/Nomad/nomad-lab-base/analysis-tools/phase-diagram/cubic_perovskites.db')",
"#references = [(row.formula, row.energy) for row in con.select(reference='standard')]",
"pd = PhaseDiagram(refs, verbose=True)"
]
},
"output": {
"state": {},
"selectedType": "BeakerDisplay",
"pluginName": "Python3",
"shellId": "F062481DA2B947488DB9E2E4647F22DF",
"height": 50,
"hidden": true,
"elapsedTime": 334
},
"evaluatorReader": true,
"lineCount": 6,
"initialization": true
},
{
"id": "codeubF2um",
"type": "code",
"evaluator": "HTML",
"input": {
"body": [
"<style type=\"text/css\">",
" .phasediagram_instructions{",
" font-size: 15px;",
" } ",
"</style>",
"<!-- Button trigger modal -->",
"<button type=\"button\" class=\"btn btn-default\" data-toggle=\"modal\" data-target=\"#phasediagram-motivation-modal\">",
" Introduction and motivation",
"</button>",
"",
"<!-- Modal -->",
"<div class=\"modal fade\" id=\"phasediagram-motivation-modal\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"phasediagram-motivation-modal-label\">",
" <div class=\"modal-dialog modal-lg\" role=\"document\">",
" <div class=\"modal-content\">",
" <div class=\"modal-header\">",
" <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button>",
" <h4 class=\"modal-title\" id=\"phasediagram-motivation-modal-label\">Introduction and motivation</h4>",
" </div>",
" <div class=\"modal-body phasediagram_instructions\">",
" <p> ",
" In this tutorial we present a tool that produces compotitional phase diagrams. As an example we consider",
" materials made of Li-Fe-P-O; the methology is similar to one in [1,2] and the ",
" analysis can be compared directly to the on in [1].",
" </p>",
" ",
" <p> Phase diagrams are generaly useful to determine if a given material is thermodynamic stable under certain conditions such as temperature, pressure etc. In this tutorial we consider only a compositional phasediagram at zero temperature and pressure. We visualize the phase diagram with the so-called convex hull which in general is a set of connected multidimensional \"surfaces\"; for a binary compound it is composed of connected lines and for ternary compound it is composed of connected planes. Since the phase diagram only consider the thermodynamic stability, there may still be materials which are metastable that are missed by the materials making up the convex hull. One way to explore a larger phase-space of materials is to allow for variations of the chemipotenial of some of the elements, i.e. of oxygen, which could be tuned during synthesis by varying the temperature etc.",
" </p>",
" <p>References</p>",
" <ol>",
" <li> S. P Ong, L. Wang, B. Kang, and G. Ceder, Chem. Mater. 20, 1798-1807 (2008).</li>",
" <li> A. R. Akbarzadeh, V. Olzolins, and C. Wolverton, Advanced Materials 19, 3233-3239 (2007) </li>",
" </ol>",
" </div>",
" <div class=\"modal-footer\">",
" <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Close</button>",
"<!-- <button type=\"button\" class=\"btn btn-primary\">Save changes</button> -->",
" </div>",
" </div>",
" </div>",
""
]
},
"output": {
"state": {},
"selectedType": "BeakerDisplay",
"height": 72,
"elapsedTime": 0
},
"evaluatorReader": true,
"lineCount": 40,
"initialization": true
},
{
"id": "codeZ2DSp3",
"type": "code",
"evaluator": "HTML",
"input": {
"body": [
"<style type=\"text/css\">",
" .phasediagram_instructions{",
" font-size: 15px;",
" } ",
"</style>",
"<!-- Button trigger modal -->",
"<button type=\"button\" class=\"btn btn-default\" data-toggle=\"modal\" data-target=\"#phasediagram-instructions-modal\">",
" Instructions",
"</button>",
"",
"<!-- Modal -->",
"<div class=\"modal fade\" id=\"phasediagram-instructions-modal\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"phasediagram-instructions-modal-label\">",
" <div class=\"modal-dialog\" role=\"document\">",
" <div class=\"modal-content\">",
" <div class=\"modal-header\">",
" <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button>",
" <h4 class=\"modal-title\" id=\"phasediagram-instructions-modal-label\">Instructions</h4>",
" </div>",
" <div class=\"modal-body phasediagram_instructions\">",
"<p> In this example, you can run the phase diagram code with varying chemical potentials for the elements as well as try to",
" predict if a material of given composition will decompose into other phases.",
" ou will work directly in Python, but need only to enter some very",
" simple commands like: </p>",
" <p><code> pd.decompose(...) </code> and <code> pd.plot(...) </code>.</p>",
" <!--<b>principal component analysis (<a href=\"https://en.wikipedia.org/wiki/Feature_scaling\" target=\"_blank\">PCA</a>)</b> and two selected non-linear methods, <b>multidimensional scaling (<a href=\"https://en.wikipedia.org/wiki/Multidimensional_scaling\" target=\"_blank\">MDS</a>) </b>",
" and <b>t-Distributed Stochastic Neighbor Embedding (<a href=\"https://en.wikipedia.org/wiki/T-distributed_stochastic_neighbor_embedding\" target=\"_blank\">t-SNE</a>) </b>. -->",
" ",
"<p> The Li-Fe-P-O materials considered in this example are taken from [1] and the database of the energies used by",
" the phase diagram module are formation energies with respect to the monomers Li(s), Fe(s), P(s) and a corrected value for O2.",
" <!--in the cubic perovskite structure and is take from Castelli et al. (Energy Environ. Sci. 5, 5814 (2011)).</p>-->",
"<p> Lets first condider that we are interested in a \"new\" material, ",
" say with the chemical formula <b>FeLiO</b> and the calculated formation energy <b>E(FeLiO)</b>>.",
" To test if it is (thermodynamically) stable or not compared to other the phases of Fe-Li-O in the database we can use the command:</p>",
" <p>",
" <code>pd.decompose('FeLiO')</code> ",
" </p>",
" <p> This shows what the material 'FeLiO' will decompose into using the materials in the database (FeLiO -> (1/5) Li5FeO4 + (1/5) FeO - (3/5) Fe) . If <b>E(FeLiO)</b> is below the total energy of the decomposed phases, in this case about -5.2 eV, the \"new\" material is prediceted as stable, i.e. the material is below the complex hull.",
" </p>",
" <p> FePO4 is an experimentally identified phase which <code>pd.decompose('FePO4')</code> supports (FePO4->FePO4).",
" </p>",
" ",
"<p> To visualize the complex hull of the ternary composition Li-Fe-O enter: <br><code> pd.plot('LiFeO') </code></p>",
" This can be compared with Figure 1b in [1]. To investigate the line binary \"line\" Li-O use <code>pd.plot('LiO')</code>.",
" <p>The chemical potentials can be adjusted, say of oxygen, by entering<br><code>pd.plot(O=-1.3)</code>.</p>",
" <p>References</p>",
" <ol>",
" <li> S. P Ong, L. Wang, B. Kang, and G. Ceder, Chem. Mater. 20, 1798-1807 (2008).</li>",
" <!--<li> A. R. Akbarzadeh, V. Olzolins, and C. Wolverton, Advanced Materials 19, 3233-3239 (2007) </li>-->",
" </ol> ",
" </div>",
" <div class=\"modal-footer\">",
" <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Close</button>",
"<!-- <button type=\"button\" class=\"btn btn-primary\">Save changes</button> -->",
" </div>",
" </div>",
" </div>",
""
]
},
"output": {
"state": {},
"selectedType": "BeakerDisplay",
"height": 72,
"elapsedTime": 0
},
"evaluatorReader": true,
"lineCount": 57,
"initialization": true
},
{
"id": "codeSnfSqe",
"type": "code",
"evaluator": "HTML",
"input": {
"body": [
"<p>Enter a command:</p>",
"",
"<p>",
" <input type='text' id='query' value='' size='79'",
" onkeydown=\"if (event.keyCode == 13) beaker.process_form()\">",
"</p>",
"<p>Examples:</p>",
"<p>",
" <fontsize=4>",
"<code>print(pd.symbols)</code> -- components in references<br>",
"<code>pd.decompose('FeLiO')</code> -- what will it be decomposed into<br>",
"<code>pd.decompose('FePO4')</code> -- what will it be decomposed (exp. found)<br>",
"<code>pd.plot()</code> -- plot the convex hull<br>",
"<code>pd.plot('FeLiO')</code> -- plot the convex hull of the ternary Fe-Li-O<br>",
"<code>pd.plot('FeLiO', dims=3)</code> -- plot the convex hull of the ternary Fe-Li-O in 3D<br>",
"<code>pd.plot('LiP')</code> -- plot the convex hull of the binary Li-P system<br>",
"<code>pd.plot(O=-1.3)</code> -- use a different chemical potential for Oxygen",
"</fontsize>",
"</p>",
"<button onclick='beaker.process_form()'> Run </button>"
]
},
"output": {
"state": {},
"selectedType": "BeakerDisplay",
"height": 314,
"elapsedTime": 0
},
"evaluatorReader": true,
"lineCount": 20,
"initialization": true
},
{
"id": "code1zERGQ",
"type": "code",
"evaluator": "Python3",
"input": {
"body": [
"# Here you can execute python commands",
"print('running the command:', beaker.query, '...')",
"exec(beaker.query)",
"print('done')"
]
},
"output": {
"state": {},
"selectedType": "Results",
"pluginName": "Python3",
"shellId": "6922F636D5D94D17B258B0903EFA87D4",
"height": 86,
"dataresult": [
-10.772113943373578,
[
55,
54,
53,
52,
51,
50,
49,
48,
47,
46,
45,
44,
43,
42,
41,
40,
39,
38,
37,
36,
35,
34,
33,
32,
31,
30,
29,
28,
27,
26,
25,
24,
23,
22,
21,
20,
19,
18,
17,
16,
15,
14,
13,
12,
11,
10,
9,
8,
7,
6,
5,
4,
3,
2,
0,
1
],
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0.25,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0
]
]
},
"evaluatorReader": true,
"lineCount": 4,
"tags": "phase_diagram"
}
],
"namespace": {
"selected_feature_list": [
"rs(A)",
"rs(B)",
"rp(A)",
"rp(B)",
"rd(A)",
"rd(B)"
],
"allowed_operations": [
"|-|",
"/",
"^2",
"exp"
],
"maxDim": null,
"max_dim": "2",
"max_dim2": 18,
"max_dim3": [
11
],
"runInfo": "running Lasso",
"viewer_result": "a07a590d6030cf73",
"embed_method": "pca",
"standardize": "True",
"query": "pd.plot(O=-0.5)",
"x": 2
},
"locked": true
}