Skip to content

Commit

Permalink
add mlip diatomic curves
Browse files Browse the repository at this point in the history
chiang-yuan committed Jul 5, 2024
1 parent f6fdc0c commit d9ed521
Showing 11 changed files with 342 additions and 83 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ title: MLIP Arena
emoji:
sdk: streamlit
sdk_version: 1.36.0 # The latest supported version
app_file: app.py
app_file: serve/app.py
---

# mlip-arena
11 changes: 10 additions & 1 deletion mlip_arena/models/registry.yaml
Original file line number Diff line number Diff line change
@@ -10,4 +10,13 @@ MACE_MP_Medium:
- alexandria
- qmof
gpu-tasks:

- diatomics

CHGNet:
module: chgnet
username: cyrusyc
datetime: 2024-03-25T14:30:00
datasets:
- atomind/mptrj
cpu-tasks:
- diatomics

Large diffs are not rendered by default.

44 changes: 44 additions & 0 deletions mlip_arena/tasks/diatomics/gpaw/ClCl_AFM/traj.extxyz
Original file line number Diff line number Diff line change
@@ -42,3 +42,47 @@ Cl 7.51628571 5.64200000 5.64200000 -5.00000000 -0.4
Lattice="11.284 0.0 0.0 0.0 11.285 0.0 0.0 0.0 11.286000000000001" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1 energy=-0.6362307456758872 free_energy=-0.6362307456758872 dipole="-6.23444412816076e-13 4.224599845528633e-08 9.766026461949354e-08" magmom=-7.0067028017747165e-15 pbc="T T T"
Cl 3.87290476 5.64200000 5.64200000 5.00000000 0.41212465
Cl 7.41109524 5.64200000 5.64200000 -5.00000000 -0.41212465
2
Lattice="11.284 0.0 0.0 0.0 11.285 0.0 0.0 0.0 11.286000000000001" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1:forces:R:3 energy=-0.8214194441479813 free_energy=-0.8214194441479813 dipole="3.031008398392218e-15 3.62639251524717e-08 4.853343314726535e-08" magmom=-9.59680372038913e-16 pbc="T T T"
Cl 3.97809524 5.64200000 5.64200000 5.00000000 0.36824720 0.50594916 0.00000009 0.00000032
Cl 7.30590476 5.64200000 5.64200000 -5.00000000 -0.36824720 -0.50594916 0.00000009 0.00000032
2
Lattice="11.284 0.0 0.0 0.0 11.285 0.0 0.0 0.0 11.286000000000001" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1:forces:R:3 energy=-0.9744416063810685 free_energy=-0.9744416063810685 dipole="-1.0811936539188394e-15 4.02433059462361e-08 3.6996328393298045e-08" magmom=1.902850737514897e-15 pbc="T T T"
Cl 4.08328571 5.64200000 5.64200000 5.00000000 0.32032644 0.98640219 0.00000000 0.00000117
Cl 7.20071429 5.64200000 5.64200000 -5.00000000 -0.32032644 -0.98640219 0.00000000 0.00000117
2
Lattice="11.284 0.0 0.0 0.0 11.285 0.0 0.0 0.0 11.286000000000001" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1:forces:R:3 energy=-1.2775831370374562 free_energy=-1.2775831370374562 dipole="1.0675304429229721e-12 2.893539756435728e-08 6.278255714709154e-09" magmom=-4.415183980536728e-15 pbc="T T T"
Cl 4.18847619 5.64200000 5.64200000 5.00000000 0.18936843 2.02970072 0.00000061 0.00000048
Cl 7.09552381 5.64200000 5.64200000 -5.00000000 -0.18936843 -2.02970072 0.00000057 -0.00000119
2
Lattice="11.284 0.0 0.0 0.0 11.285 0.0 0.0 0.0 11.286000000000001" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1:forces:R:3 energy=-1.8057105218266352 free_energy=-1.8057105218266352 dipole="-3.4608418034857716e-11 1.152462814085366e-08 2.0075345434954526e-08" magmom=-5.3189152213278416e-15 pbc="T T T"
Cl 4.29366667 5.64200000 5.64200000 5.00000000 -0.00050656 2.81726869 -0.00000016 0.00000008
Cl 6.99033333 5.64200000 5.64200000 -5.00000000 0.00050656 -2.81726869 -0.00000017 -0.00000051
2
Lattice="11.284 0.0 0.0 0.0 11.285 0.0 0.0 0.0 11.286000000000001" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1:forces:R:3 energy=-2.427495082323482 free_energy=-2.427495082323482 dipole="-1.0495821921180604e-11 2.578891299581512e-08 4.920262866209571e-08" magmom=6.148806719500548e-16 pbc="T T T"
Cl 4.39885714 5.64200000 5.64200000 5.00000000 -0.00000078 3.08800480 0.00000020 0.00000033
Cl 6.88514286 5.64200000 5.64200000 -5.00000000 0.00000078 -3.08800480 0.00000020 0.00000040
2
Lattice="11.284 0.0 0.0 0.0 11.285 0.0 0.0 0.0 11.286000000000001" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1:forces:R:3 energy=-3.052013389867105 free_energy=-3.052013389867105 dipole="-3.428500183860969e-14 2.0336666886586886e-08 4.418968059606245e-08" magmom=1.0258199308851289e-14 pbc="T T T"
Cl 4.50404762 5.64200000 5.64200000 5.00000000 0.00000003 2.73735610 -0.00000002 -0.00000016
Cl 6.77995238 5.64200000 5.64200000 -5.00000000 -0.00000003 -2.73735610 -0.00000002 -0.00000016
2
Lattice="11.284 0.0 0.0 0.0 11.285 0.0 0.0 0.0 11.286000000000001" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1:forces:R:3 energy=-3.4764220153807246 free_energy=-3.4764220153807246 dipole="1.508837559325854e-15 1.3225649213312095e-08 2.885772677479711e-08" magmom=7.844884745995615e-15 pbc="T T T"
Cl 4.60923810 5.64200000 5.64200000 5.00000000 0.00000000 0.95062936 0.00000003 0.00000012
Cl 6.67476190 5.64200000 5.64200000 -5.00000000 -0.00000000 -0.95062936 0.00000003 0.00000012
2
Lattice="11.284 0.0 0.0 0.0 11.285 0.0 0.0 0.0 11.286000000000001" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1:forces:R:3 energy=-3.223949531641405 free_energy=-3.223949531641405 dipole="-3.217189467511924e-15 1.7808263039149192e-08 3.43383904853661e-08" magmom=5.365221205814371e-16 pbc="T T T"
Cl 4.71442857 5.64200000 5.64200000 5.00000000 0.00000000 -4.16695098 0.00000021 0.00000044
Cl 6.56957143 5.64200000 5.64200000 -5.00000000 -0.00000000 4.16695098 0.00000021 0.00000044
2
Lattice="11.284 0.0 0.0 0.0 11.285 0.0 0.0 0.0 11.286000000000001" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1:forces:R:3 energy=-1.1700250836228716 free_energy=-1.1700250836228716 dipole="3.449011404357495e-15 2.0746956339343378e-08 4.084945998710388e-08" magmom=-5.1685190641446925e-15 pbc="T T T"
Cl 4.81961905 5.64200000 5.64200000 5.00000000 -0.00000000 -17.37941950 -0.00000003 -0.00000007
Cl 6.46438095 5.64200000 5.64200000 -5.00000000 0.00000000 17.37941950 -0.00000003 -0.00000007
2
Lattice="11.284 0.0 0.0 0.0 11.285 0.0 0.0 0.0 11.286000000000001" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1:forces:R:3 energy=5.45971214912991 free_energy=5.45971214912991 dipole="1.3722143897742859e-15 1.823162783844328e-08 3.776677923261878e-08" magmom=-3.1652456091193807e-15 pbc="T T T"
Cl 4.92480952 5.64200000 5.64200000 5.00000000 0.00000000 -50.81606443 -0.00000039 -0.00000065
Cl 6.35919048 5.64200000 5.64200000 -5.00000000 -0.00000000 50.81606443 -0.00000039 -0.00000065
2
Lattice="11.284 0.0 0.0 0.0 11.285 0.0 0.0 0.0 11.286000000000001" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1:forces:R:3 energy=23.83541143475322 free_energy=23.83541143475322 dipole="-1.6827525271393086e-14 2.511662752649596e-09 5.042134828448459e-09" magmom=6.230988124242401e-15 pbc="T T T"
Cl 5.03000000 5.64200000 5.64200000 5.00000000 -0.00000000 -137.43831052 -0.00000001 0.00000018
Cl 6.25400000 5.64200000 5.64200000 -5.00000000 0.00000000 137.43831052 -0.00000001 0.00000018
28 changes: 0 additions & 28 deletions mlip_arena/tasks/diatomics/gpaw/MgMg_AFM/traj.extxyz

This file was deleted.

40 changes: 40 additions & 0 deletions mlip_arena/tasks/diatomics/gpaw/SS_AFM/traj.extxyz
Original file line number Diff line number Diff line change
@@ -46,3 +46,43 @@ S 7.69350000 5.85900000 5.85900000 -4.00000000 -0.9
Lattice="11.718 0.0 0.0 0.0 11.719 0.0 0.0 0.0 11.72" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1 energy=-1.9524021673265366 free_energy=-1.9524021673265366 dipole="8.648728149746012e-08 3.7151671782460395e-06 1.1011625089236083e-05" magmom=-8.507052887892137e-15 pbc="T T T"
S 4.13400000 5.85900000 5.85900000 4.00000000 0.97588439
S 7.58400000 5.85900000 5.85900000 -4.00000000 -0.97588437
2
Lattice="11.718 0.0 0.0 0.0 11.719 0.0 0.0 0.0 11.72" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1:forces:R:3 energy=-2.4754979021056105 free_energy=-2.4754979021056105 dipole="-9.068529462346077e-11 -4.404073258102355e-09 -8.663119545562142e-09" magmom=2.7463903207804998e-15 pbc="T T T"
S 4.24350000 5.85900000 5.85900000 4.00000000 0.86739354 1.03324085 0.00000004 -0.00000002
S 7.47450000 5.85900000 5.85900000 -4.00000000 -0.86739354 -1.03324086 0.00000004 -0.00000002
2
Lattice="11.718 0.0 0.0 0.0 11.719 0.0 0.0 0.0 11.72" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1:forces:R:3 energy=-2.7767417251109054 free_energy=-2.7767417251109054 dipole="-5.867801409732914e-10 -1.3130890982217635e-09 6.827248541061529e-10" magmom=4.7371232682523474e-15 pbc="T T T"
S 4.35300000 5.85900000 5.85900000 4.00000000 0.76304927 1.75834541 -0.00000005 -0.00000004
S 7.36500000 5.85900000 5.85900000 -4.00000000 -0.76304927 -1.75834481 -0.00000005 -0.00000004
2
Lattice="11.718 0.0 0.0 0.0 11.719 0.0 0.0 0.0 11.72" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1:forces:R:3 energy=-3.258351890958282 free_energy=-3.258351890958282 dipole="-8.25529736066669e-07 2.9594622483356695e-09 2.178906719515088e-09" magmom=2.203723015310609e-12 pbc="T T T"
S 4.46250000 5.85900000 5.85900000 4.00000000 0.62060871 2.59017909 0.00000001 0.00000002
S 7.25550000 5.85900000 5.85900000 -4.00000000 -0.62060892 -2.59020032 0.00000001 0.00000002
2
Lattice="11.718 0.0 0.0 0.0 11.719 0.0 0.0 0.0 11.72" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1:forces:R:3 energy=-4.3988946520648735 free_energy=-4.3988946520648735 dipole="-0.001622641443223675 7.840535958111968e-11 3.171243313295675e-09" magmom=3.040904184817457e-14 pbc="T T T"
S 4.57200000 5.85900000 5.85900000 4.00000000 0.00615030 4.43907180 -0.00000008 -0.00000004
S 7.14600000 5.85900000 5.85900000 -4.00000000 -0.00622389 -4.41929551 -0.00000004 -0.00000003
2
Lattice="11.718 0.0 0.0 0.0 11.719 0.0 0.0 0.0 11.72" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1:forces:R:3 energy=-5.3996322156935985 free_energy=-5.3996322156935985 dipole="-0.0004705846630342035 2.6428249065571766e-09 2.0131954590530433e-09" magmom=-5.852425428574635e-09 pbc="T T T"
S 4.68150000 5.85900000 5.85900000 4.00000000 0.00028130 4.62371800 0.00000001 -0.00000001
S 7.03650000 5.85900000 5.85900000 -4.00000000 -0.00028276 -4.62707329 0.00000001 -0.00000001
2
Lattice="11.718 0.0 0.0 0.0 11.719 0.0 0.0 0.0 11.72" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1:forces:R:3 energy=-6.355011487963147 free_energy=-6.355011487963147 dipole="-0.0002565400339933681 1.701061399478038e-09 3.756612054832852e-09" magmom=5.5137122623194315e-12 pbc="T T T"
S 4.79100000 5.85900000 5.85900000 4.00000000 0.00000530 3.80003676 -0.00000000 0.00000003
S 6.92700000 5.85900000 5.85900000 -4.00000000 -0.00000525 -3.79437305 -0.00000000 0.00000003
2
Lattice="11.718 0.0 0.0 0.0 11.719 0.0 0.0 0.0 11.72" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1:forces:R:3 energy=-6.864989485271182 free_energy=-6.864989485271182 dipole="-2.4295054339974333e-07 4.829326582293934e-09 3.512739215409518e-09" magmom=1.396992497174256e-13 pbc="T T T"
S 4.90050000 5.85900000 5.85900000 4.00000000 0.00000001 0.14266223 -0.00000002 0.00000003
S 6.81750000 5.85900000 5.85900000 -4.00000000 -0.00000002 -0.14244610 -0.00000002 0.00000003
2
Lattice="11.718 0.0 0.0 0.0 11.719 0.0 0.0 0.0 11.72" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1:forces:R:3 energy=-5.910986335781827 free_energy=-5.910986335781827 dipole="-5.050899102418916e-08 1.3059356960041258e-09 1.0905790050203337e-09" magmom=-1.1747464789937136e-13 pbc="T T T"
S 5.01000000 5.85900000 5.85900000 4.00000000 -0.00000000 -10.63466386 0.00000001 0.00000002
S 6.70800000 5.85900000 5.85900000 -4.00000000 -0.00000000 10.63466681 0.00000001 0.00000002
2
Lattice="11.718 0.0 0.0 0.0 11.719 0.0 0.0 0.0 11.72" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1:forces:R:3 energy=-0.9079304777624212 free_energy=-0.9079304777624212 dipole="-5.034922852075231e-09 -8.112889099915873e-11 9.953151544433073e-10" magmom=-7.532204103831928e-14 pbc="T T T"
S 5.11950000 5.85900000 5.85900000 4.00000000 0.00000000 -39.61907637 -0.00000002 0.00000010
S 6.59850000 5.85900000 5.85900000 -4.00000000 0.00000000 39.61907637 -0.00000002 0.00000010
2
Lattice="11.718 0.0 0.0 0.0 11.719 0.0 0.0 0.0 11.72" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1:forces:R:3 energy=14.648212060240844 free_energy=14.648212060240844 dipole="8.991280081992044e-08 -3.1987904484984434e-09 -1.7801637360774048e-09" magmom=1.0225729821146675e-14 pbc="T T T"
S 5.22900000 5.85900000 5.85900000 4.00000000 0.00000000 -113.59576350 -0.00000000 0.00000001
S 6.48900000 5.85900000 5.85900000 -4.00000000 0.00000001 113.59575924 -0.00000000 0.00000001
44 changes: 44 additions & 0 deletions mlip_arena/tasks/diatomics/gpaw/SiSi_AFM/traj.extxyz
Original file line number Diff line number Diff line change
@@ -62,3 +62,47 @@ Si 8.71430769 6.78900000 6.78900000 -2.00000000 -0.4
Lattice="13.578 0.0 0.0 0.0 13.578999999999999 0.0 0.0 0.0 13.58" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1 energy=-2.29727654834893 free_energy=-2.29727654834893 dipole="-4.987523004589227e-07 -2.6959496732403502e-06 3.4038488756166403e-07" magmom=6.119018896352277e-10 pbc="T T T"
Si 4.96863462 6.78900000 6.78900000 2.00000000 0.40921037
Si 8.60936538 6.78900000 6.78900000 -2.00000000 -0.40920434
2
Lattice="13.578 0.0 0.0 0.0 13.578999999999999 0.0 0.0 0.0 13.58" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1:forces:R:3 energy=-2.5532493443448385 free_energy=-2.5532493443448385 dipole="7.352819717213404e-07 -7.062323292453009e-09 -6.301025008880651e-09" magmom=-4.9589881320518486e-15 pbc="T T T"
Si 5.07357692 6.78900000 6.78900000 2.00000000 0.35118372 1.35621663 0.00000004 0.00000004
Si 8.50442308 6.78900000 6.78900000 -2.00000000 -0.35118407 -1.35622652 0.00000004 0.00000004
2
Lattice="13.578 0.0 0.0 0.0 13.578999999999999 0.0 0.0 0.0 13.58" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1:forces:R:3 energy=-3.188423219416578 free_energy=-3.188423219416578 dipole="-0.00040787073584288067 1.1289027987331761e-06 -4.1191330374468776e-07" magmom=2.757386756668508e-14 pbc="T T T"
Si 5.17851923 6.78900000 6.78900000 2.00000000 0.02066497 2.26566770 -0.00001833 -0.00000254
Si 8.39948077 6.78900000 6.78900000 -2.00000000 -0.02072537 -2.26373507 0.00002194 -0.00001311
2
Lattice="13.578 0.0 0.0 0.0 13.578999999999999 0.0 0.0 0.0 13.58" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1:forces:R:3 energy=-3.683917327329515 free_energy=-3.683917327329515 dipole="-0.00010729599428164871 6.079730339053743e-08 -8.067142876407431e-08" magmom=-1.315858111579632e-08 pbc="T T T"
Si 5.28346154 6.78900000 6.78900000 2.00000000 -0.00160632 2.43573053 -0.00000436 0.00000021
Si 8.29453846 6.78900000 6.78900000 -2.00000000 0.00161219 -2.43752268 0.00000558 -0.00000180
2
Lattice="13.578 0.0 0.0 0.0 13.578999999999999 0.0 0.0 0.0 13.58" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1:forces:R:3 energy=-4.197843597964851 free_energy=-4.197843597964851 dipole="0.00017131138366368795 -1.0613950218331658e-08 -1.5175115513324666e-08" magmom=-1.5961398450537137e-09 pbc="T T T"
Si 5.38840385 6.78900000 6.78900000 2.00000000 0.00002089 2.41743018 -0.00000127 0.00000015
Si 8.18959615 6.78900000 6.78900000 -2.00000000 -0.00002123 -2.41783947 0.00000124 -0.00000018
2
Lattice="13.578 0.0 0.0 0.0 13.578999999999999 0.0 0.0 0.0 13.58" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1:forces:R:3 energy=-4.6740222596332295 free_energy=-4.6740222596332295 dipole="-2.6692989092788546e-05 1.2487156145607518e-09 -7.09709453081909e-09" magmom=1.117780919509961e-09 pbc="T T T"
Si 5.49334615 6.78900000 6.78900000 2.00000000 -0.00000087 2.02293019 -0.00000006 -0.00000001
Si 8.08465385 6.78900000 6.78900000 -2.00000000 0.00000092 -2.02297999 0.00000007 -0.00000002
2
Lattice="13.578 0.0 0.0 0.0 13.578999999999999 0.0 0.0 0.0 13.58" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1:forces:R:3 energy=-4.996413821947155 free_energy=-4.996413821947155 dipole="1.0936788322896686e-06 -4.867689005956423e-09 -2.7750338709558942e-09" magmom=4.576907028376879e-11 pbc="T T T"
Si 5.59828846 6.78900000 6.78900000 2.00000000 -0.00000000 0.86194442 -0.00000000 0.00000004
Si 7.97971154 6.78900000 6.78900000 -2.00000000 0.00000000 -0.86194491 0.00000001 0.00000003
2
Lattice="13.578 0.0 0.0 0.0 13.578999999999999 0.0 0.0 0.0 13.58" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1:forces:R:3 energy=-4.931602182881434 free_energy=-4.931602182881434 dipole="3.7174961826305685e-08 3.621057283674936e-08 3.5829876284998824e-08" magmom=-3.495473263730297e-13 pbc="T T T"
Si 5.70323077 6.78900000 6.78900000 2.00000000 0.00000003 -1.83409458 0.00000017 0.00000025
Si 7.87476923 6.78900000 6.78900000 -2.00000000 -0.00000002 1.83409467 0.00000017 0.00000025
2
Lattice="13.578 0.0 0.0 0.0 13.578999999999999 0.0 0.0 0.0 13.58" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1:forces:R:3 energy=-4.573854449836713 free_energy=-4.573854449836713 dipole="-1.2460613949634714e-07 -0.016267332341179754 -0.00848808973042689" magmom=-4.4104910695841326e-14 pbc="T T T"
Si 5.80817308 6.78900000 6.78900000 2.00000000 0.01405424 -4.29228874 0.00192538 0.00339464
Si 7.76982692 6.78900000 6.78900000 -2.00000000 0.01405424 4.29228861 0.00192528 0.00339462
2
Lattice="13.578 0.0 0.0 0.0 13.578999999999999 0.0 0.0 0.0 13.58" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1:forces:R:3 energy=-2.876166265900186 free_energy=-2.876166265900186 dipole="2.2797855185657538e-10 -0.0002978691035081787 -0.00014992392723568344" magmom=-4.6571019963537285e-06 pbc="T T T"
Si 5.91311538 6.78900000 6.78900000 2.00000000 -0.00012983 -12.93090397 -0.00020118 -0.00007331
Si 7.66488462 6.78900000 6.78900000 -2.00000000 -0.00012983 12.93090396 -0.00020118 -0.00007331
2
Lattice="13.578 0.0 0.0 0.0 13.578999999999999 0.0 0.0 0.0 13.58" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1:forces:R:3 energy=1.4624058641173112 free_energy=1.4624058641173112 dipole="-3.872246998051089e-11 4.580942933692496e-07 2.1507861904836858e-07" magmom=9.142577920530893e-09 pbc="T T T"
Si 6.01805769 6.78900000 6.78900000 2.00000000 -0.00000031 -30.96276185 -0.00000044 -0.00000011
Si 7.55994231 6.78900000 6.78900000 -2.00000000 -0.00000031 30.96276185 -0.00000044 -0.00000011
2
Lattice="13.578 0.0 0.0 0.0 13.578999999999999 0.0 0.0 0.0 13.58" Properties=species:S:1:pos:R:3:initial_magmoms:R:1:magmoms:R:1:forces:R:3 energy=11.41097421595209 free_energy=11.41097421595209 dipole="1.7453736480191038e-13 1.7129078057442776e-08 7.220828334726962e-09" magmom=-2.009967008321909e-11 pbc="T T T"
Si 6.12300000 6.78900000 6.78900000 2.00000000 -0.00000000 -67.35607511 -0.00000019 -0.00000008
Si 7.45500000 6.78900000 6.78900000 -2.00000000 -0.00000000 67.35607511 -0.00000019 -0.00000008

Large diffs are not rendered by default.

18 changes: 10 additions & 8 deletions app.py → serve/app.py
Original file line number Diff line number Diff line change
@@ -25,25 +25,27 @@
# logout_page = st.Page(logout, title="Log out", icon=":material/logout:")

dashboard = st.Page(
"serve/reports/dashboard.py", title="Dashboard", icon=":material/dashboard:", default=True
"reports/dashboard.py", title="Dashboard", icon=":material/dashboard:"
)
bugs = st.Page("serve/reports/bugs.py", title="Bug reports", icon=":material/bug_report:")
bugs = st.Page("reports/bugs.py", title="Bug reports", icon=":material/bug_report:")
alerts = st.Page(
"serve/reports/alerts.py", title="System alerts", icon=":material/notification_important:"
"reports/alerts.py", title="System alerts", icon=":material/notification_important:"
)

search = st.Page("serve/tools/search.py", title="Search", icon=":material/search:")
history = st.Page("serve/tools/history.py", title="History", icon=":material/history:")
search = st.Page("tools/search.py", title="Search", icon=":material/search:")
history = st.Page("tools/history.py", title="History", icon=":material/history:")
ptable = st.Page("tools/ptable.py", title="Periodic table", icon=":material/gradient:")

diatomics = st.Page("serve/tasks/homonuclear-diatomics.py", title="Homonuclear diatomics", icon="")
diatomics = st.Page("tasks/homonuclear-diatomics.py", title="Homonuclear diatomics", icon="", default=True)

# if st.session_state.logged_in:
pg = st.navigation(
{
# "Account": [logout_page],
"Reports": [dashboard, bugs, alerts],
"Tools": [search, history],
# "Reports": [dashboard, bugs, alerts],
# "Tools": [search, history, ptable],
"Tasks": [diatomics],
"Tools": [ptable],
}
)
# else:
144 changes: 99 additions & 45 deletions serve/tasks/homonuclear-diatomics.py
Original file line number Diff line number Diff line change
@@ -1,73 +1,127 @@
from pathlib import Path

import numpy as np
import numpy.linalg as LA
import plotly.express as px
import pandas as pd
import plotly.colors as pcolors
import plotly.graph_objects as go
import streamlit as st
from ase.data import chemical_symbols
from ase.io import read
from plotly.subplots import make_subplots
from scipy.interpolate import CubicSpline

st.markdown("# Homonuclear diatomics")
color_sequence = pcolors.qualitative.Plotly

DATA_DIR = Path("mlip_arena/tasks/diatomics")


for i, symbol in enumerate(chemical_symbols[1:10]):
st.markdown("# Homonuclear diatomics")

if i % 3 == 0:
cols = st.columns(3)
# button to toggle plots
container = st.container(border=True)
energy_plot = container.checkbox("Show energy curves", value=True)
force_plot = container.checkbox("Show force curves", value=False)

fpath = DATA_DIR / "gpaw" / f"{symbol+symbol}_AFM" / "traj.extxyz"
ncols = 2

if not fpath.exists():
continue

trj = read(fpath, index=":")
DATA_DIR = Path("mlip_arena/tasks/diatomics")
mlips = ["MACE-MP", "CHGNet"]

rs, es, s2s = [], [], []
dfs = [pd.read_json(DATA_DIR / mlip.lower() / "homonuclear-diatomics.json") for mlip in mlips]
df = pd.concat(dfs, ignore_index=True)

for atoms in trj:
rs.append(LA.norm(atoms.positions[1] - atoms.positions[0]))
es.append(atoms.get_potential_energy())
s2s.append(np.power(atoms.get_magnetic_moments(), 2).mean())

rs = np.array(rs)
ind = np.argsort(rs)
es = np.array(es)
s2s = np.array(s2s)

rs = rs[ind]
es = es[ind]
s2s = s2s[ind]
df.drop_duplicates(inplace=True, subset=["name", "method"])

es = es - es[-1]
for i, symbol in enumerate(chemical_symbols[1:]):

xs = np.linspace(rs.min()*0.99, rs.max()*1.01, int(5e2))
if i % ncols == 0:
cols = st.columns(ncols)

cs = CubicSpline(rs, es)
ys = cs(xs)

cs = CubicSpline(rs, s2s)
s2s = cs(xs)
rows = df[df["name"] == symbol + symbol]

ylo = min(ys.min()*1.5, -1)
if rows.empty:
continue

fig = px.scatter(
x=xs, y=ys,
render_mode="webgl",
color=s2s,
range_color=[0, s2s.max()],
width=500,
range_y=[ylo, 1.2*(abs(ylo))],
# title=f"{atoms.get_chemical_formula()}",
labels={"x": "Bond length (Å)", "y": "Energy", "color": "Magnetic moment"},
# fig = go.Figure()
fig = make_subplots(specs=[[{"secondary_y": True}]])

ylo = float("inf")

for j, method in enumerate(rows["method"].unique()):
row = rows[rows["method"] == method].iloc[0]

rs = np.array(row["R"])
es = np.array(row["E"])
fs = np.array(row["F"])

rs = np.array(rs)
ind = np.argsort(rs)
es = np.array(es)
fs = np.array(fs)

rs = rs[ind]
es = es[ind]
es = es - es[-1]
fs = fs[ind]

xs = np.linspace(rs.min()*0.99, rs.max()*1.01, int(5e2))

if energy_plot:
cs = CubicSpline(rs, es)
ys = cs(xs)

ylo = min(ylo, ys.min()*1.2, -1)

fig.add_trace(
go.Scatter(
x=xs, y=ys,
mode="lines",
line=dict(
color=color_sequence[j % len(color_sequence)],
width=2,
),
name=method,
),
secondary_y=False,
)

if force_plot:
cs = CubicSpline(rs, fs)
ys = cs(xs)

fig.add_trace(
go.Scatter(
x=xs, y=ys,
mode="lines",
line=dict(
color=color_sequence[j % len(color_sequence)],
width=1,
dash="dot",
),
name=method,
showlegend=False if energy_plot else True,
),
secondary_y=True,
)


fig.update_layout(
showlegend=True,
title_text=f"{symbol}-{symbol}",
title_x=0.5,
# yaxis_range=[ylo, 2*(abs(ylo))],
)

cols[i % 3].title(f"{symbol+symbol}")
cols[i % 3].plotly_chart(fig, use_container_width=False)
# Set x-axis title
fig.update_xaxes(title_text="Bond length (Å)")

# st.latex(r"\frac{d^2E}{dr^2} = \frac{d^2E}{dr^2}")
# Set y-axes titles
if energy_plot:
fig.update_yaxes(title_text="Energy [eV]", secondary_y=False)

# st.components.v1.html(fig.to_html(include_mathjax='cdn'),height=500)
if force_plot:
fig.update_yaxes(title_text="Force [eV/Å]", secondary_y=True)

# cols[i % ncols].title(f"{row['name']}")
cols[i % ncols].plotly_chart(fig, use_container_width=True, height=250)
92 changes: 92 additions & 0 deletions serve/tools/ptable.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
import streamlit as st
from ase.data import chemical_symbols
from pymatgen.core import Element

elements = [Element.from_Z(z) for z in range(1, 119)]

# Define the number of rows and columns in the periodic table
rows = 9 # There are 7 rows in the conventional periodic table
columns = 18

# Define a function to display the periodic table
def display_periodic_table():
# elements = [
# (element, element) for element in chemical_symbols[1:]
# ]

# cols = st.columns(18, gap='small', vertical_alignment='bottom') # Create 18 columns for the periodic table layout

row = 0
for element in elements:
symbol = element.symbol
atomic_number = element.Z
group = element.group

if element.row > row:
cols = st.columns(columns, gap='small', vertical_alignment='bottom')
row = element.row

if element.block == 'f':
continue

with cols[group - 1]:
if st.button(symbol, use_container_width=True):
st.session_state.selected_element = symbol
st.session_state.selected_name = symbol
st.rerun()
# st.experimental_rerun()

for element in elements:
symbol = element.symbol
atomic_number = element.Z
group = element.group

if element.row > row:
cols = st.columns(columns, gap='small', vertical_alignment='bottom')
row = element.row

if element.block == 'f':
noble = Element.from_row_and_group(row-1, 18)
row += 2
group += atomic_number - noble.Z - 2
else:
continue

with cols[group - 1]:
if st.button(symbol, use_container_width=True):
st.session_state.selected_element = symbol
st.session_state.selected_name = symbol
st.rerun()
# st.experimental_rerun()


# for idx, (symbol, name) in enumerate(elements):
# with cols[idx % 18]: # Place each element in the correct column
# if st.button(symbol, use_container_width=True):
# st.session_state.selected_element = symbol
# st.session_state.selected_name = name
# st.experimental_rerun()

# Define a function to display the details of an element
def display_element_details():
symbol = st.session_state.selected_element
name = st.session_state.selected_name
st.write(f"### {name} ({symbol})")
st.write(f"Details about {name} ({symbol}) will be displayed here.")
if st.button("Back to Periodic Table"):
st.session_state.selected_element = None
st.session_state.selected_name = None
st.experimental_rerun()


st.title("Periodic Table")

# st.balloons()
if 'selected_element' not in st.session_state:
st.session_state.selected_element = None

if st.session_state.selected_element:
display_element_details()
else:
display_periodic_table()

0 comments on commit d9ed521

Please sign in to comment.