-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Few tweaks to roy example and re-trigger RTD build (#27)
* Few tweaks to roy example and re-trigger RTD build * Modified environment to pick chemiscope from gh
- Loading branch information
Showing
2 changed files
with
82 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
name: lode_linear | ||
name: roy_gch | ||
dependencies: | ||
- python=3.11 | ||
- pip | ||
- pip: | ||
- ase | ||
- chemiscope | ||
- chemiscope @ git+https://github.com/lab-cosmo/chemiscope | ||
- skmatter | ||
- metatensor | ||
- equisolve @ git+https://github.com/lab-cosmo/equisolve.git@63c9c54046507b27f115efb1d9b9fa8a1573c4da | ||
- rascaline @ git+https://github.com/Luthaf/rascaline@581d0ca4dece424b4594c8c3cac40a7381e13ae5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,11 +8,12 @@ | |
conventional density-energy convex hull with a Generalized Convex Hull | ||
(GCH) analysis (see `Anelli et al., Phys. Rev. Materials | ||
(2018) <https://doi.org/10.1103/PhysRevMaterials.2.103804>`__). | ||
It uses features computed with `rascaline <https://github.com/lab-cosmo/rascaline>` | ||
It uses features computed with `rascaline <https://github.com/lab-cosmo/rascaline>`__ | ||
and uses the directional convex hull function from | ||
`scikit-matter <https://github.com/lab-cosmo/scikit-matter>` | ||
`scikit-matter <https://github.com/lab-cosmo/scikit-matter>`__ | ||
to make the figure. | ||
""" | ||
|
||
import chemiscope | ||
import matplotlib.tri | ||
import numpy as np | ||
|
@@ -92,27 +93,33 @@ | |
# requires having the ``chemiscope`` package installed. | ||
# | ||
|
||
if chemiscope.jupyter._is_running_in_notebook(): | ||
chemiscope.show( | ||
structures, | ||
dict( | ||
energy=energy, | ||
density=density, | ||
hull_energy=dch_dist, | ||
structure_type=structype, | ||
), | ||
settings={ | ||
"map": { | ||
"x": {"property": "density"}, | ||
"y": {"property": "energy"}, | ||
"color": {"property": "hull_energy"}, | ||
"symbol": "structure_type", | ||
"size": {"factor": 35}, | ||
}, | ||
"structure": [{"unitCell": True, "supercell": {"0": 2, "1": 2, "2": 2}}], | ||
cs = chemiscope.show( | ||
structures, | ||
dict( | ||
energy=energy, | ||
density=density, | ||
hull_energy=dch_dist, | ||
structure_type=structype, | ||
), | ||
settings={ | ||
"map": { | ||
"x": {"property": "density"}, | ||
"y": {"property": "energy"}, | ||
"color": {"property": "hull_energy"}, | ||
"symbol": "structure_type", | ||
"size": {"factor": 35}, | ||
}, | ||
) | ||
"structure": [{"unitCell": True, "supercell": {"0": 2, "1": 2, "2": 2}}], | ||
}, | ||
) | ||
|
||
|
||
if chemiscope.jupyter._is_running_in_notebook(): | ||
from IPython.display import display | ||
|
||
display(cs) | ||
else: | ||
cs.save("roy_ch.json.gz") | ||
|
||
# %% | ||
# Generalized Convex Hull | ||
|
@@ -229,30 +236,57 @@ | |
structure_properties.update({"per_atom_energy": energy, "hull_energy": dch_dist}) | ||
|
||
# shows chemiscope if not run in terminal | ||
if chemiscope.jupyter._is_running_in_notebook(): | ||
chemiscope.show( | ||
frames=structures, | ||
properties=structure_properties, | ||
settings={ | ||
"map": { | ||
"x": {"property": "pca_1"}, | ||
"y": {"property": "pca_2"}, | ||
"z": {"property": "energy"}, | ||
"symbol": "type", | ||
"color": {"property": "hull_energy"}, | ||
"size": { | ||
"factor": 35, | ||
"mode": "linear", | ||
"property": "", | ||
"reverse": True, | ||
}, | ||
|
||
cs = chemiscope.show( | ||
frames=structures, | ||
properties=structure_properties, | ||
meta={ | ||
"name": "GCH for ROY polymorphs", | ||
"description": """ | ||
Demonstration of the Generalized Convex Hull construction for | ||
polymorphs of the ROY molecule. Molecules that are closest to | ||
the hull built on PCA-based structural descriptors and having the | ||
internal energy predicted by electronic-structure calculations as | ||
the z axis are the most thermodynamically stable. Indeed most of the | ||
known polymorphs of ROY are on (or very close) to this hull. | ||
""", | ||
"authors": ["Michele Ceriotti <[email protected]>"], | ||
"references": [ | ||
'A. Anelli, E. A. Engel, C. J. Pickard, and M. Ceriotti, \ | ||
"Generalized convex hull construction for materials discovery," \ | ||
Physical Review Materials 2(10), 103804 (2018).', | ||
'G. J. O. Beran, I. J. Sugden, C. Greenwell, D. H. Bowskill, \ | ||
C. C. Pantelides, and C. S. Adjiman, "How many more polymorphs of \ | ||
ROY remain undiscovered," Chem. Sci. 13(5), 1288–1297 (2022).', | ||
], | ||
}, | ||
settings={ | ||
"map": { | ||
"x": {"property": "pca_1"}, | ||
"y": {"property": "pca_2"}, | ||
"z": {"property": "energy"}, | ||
"symbol": "type", | ||
"color": {"property": "hull_energy"}, | ||
"size": { | ||
"factor": 35, | ||
"mode": "linear", | ||
"property": "", | ||
"reverse": True, | ||
}, | ||
"structure": [ | ||
{ | ||
"bonds": True, | ||
"unitCell": True, | ||
"keepOrientation": True, | ||
} | ||
], | ||
}, | ||
) | ||
"structure": [ | ||
{ | ||
"bonds": True, | ||
"unitCell": True, | ||
"keepOrientation": True, | ||
} | ||
], | ||
}, | ||
) | ||
|
||
if chemiscope.jupyter._is_running_in_notebook(): | ||
from IPython.display import display | ||
|
||
display(cs) | ||
else: | ||
cs.save("roy_gch.json.gz") |