From ff62dd1cf85bcd59b93121d19b447f99835adf25 Mon Sep 17 00:00:00 2001 From: Fabian Zills Date: Thu, 5 Dec 2024 13:20:30 +0100 Subject: [PATCH] run `mattersim` --- examples/diatomics/README.md | 2 +- examples/diatomics/dvc.lock | 34 ++++++ examples/diatomics/dvc.yaml | 12 ++ examples/diatomics/main.py | 2 +- examples/diatomics/models.py | 8 ++ .../mattersim/HomonuclearDiatomics/.gitignore | 2 + .../HomonuclearDiatomics/node-meta.json | 1 + examples/diatomics/params.yaml | 12 ++ examples/diatomics/zntrack.json | 30 +++++ examples/energy-volume/README.md | 2 +- examples/energy-volume/models.py | 1 + examples/invariances/README.md | 2 +- examples/invariances/dvc.lock | 105 ++++++++++++++++++ examples/invariances/dvc.yaml | 42 +++++++ examples/invariances/models.py | 8 ++ .../0/PermutationInvariance/.gitignore | 2 + .../0/PermutationInvariance/metrics.json | 1 + .../0/PermutationInvariance/node-meta.json | 1 + .../0/RotationalInvariance/.gitignore | 2 + .../0/RotationalInvariance/metrics.json | 1 + .../0/RotationalInvariance/node-meta.json | 1 + .../0/TranslationalInvariance/.gitignore | 2 + .../0/TranslationalInvariance/metrics.json | 1 + .../0/TranslationalInvariance/node-meta.json | 1 + examples/invariances/params.yaml | 27 +++++ examples/invariances/zntrack.json | 102 +++++++++++++++++ examples/md/README.md | 2 +- examples/md/dvc.lock | 49 ++++++++ examples/md/dvc.yaml | 24 ++++ examples/md/models.py | 8 ++ .../mattersim/0/MolecularDynamics/.gitignore | 2 + .../0/MolecularDynamics/node-meta.json | 1 + .../0/MolecularDynamics/observer_metrics.json | 1 + examples/md/params.yaml | 23 ++++ examples/md/zntrack.json | 59 ++++++++++ examples/metrics/README.md | 2 +- examples/metrics/dvc.lock | 79 +++++++++++++ examples/metrics/dvc.yaml | 53 +++++++++ examples/metrics/models.py | 8 ++ .../mattersim/ApplyCalculator/.gitignore | 1 + .../mattersim/ApplyCalculator/node-meta.json | 1 + .../CompareCalculatorResults/.gitignore | 1 + .../CompareCalculatorResults/error.json | 1 + .../CompareCalculatorResults/node-meta.json | 1 + .../CompareCalculatorResults/rmse.json | 1 + .../EvaluateCalculatorResults/.gitignore | 1 + .../EvaluateCalculatorResults/node-meta.json | 1 + examples/metrics/params.yaml | 7 ++ examples/metrics/zntrack.json | 97 ++++++++++++++++ examples/neb/README.md | 2 +- examples/neb/dvc.lock | 37 ++++++ examples/neb/dvc.yaml | 18 +++ examples/neb/models.py | 8 ++ examples/neb/nodes/mattersim/NEBs/.gitignore | 3 + .../neb/nodes/mattersim/NEBs/node-meta.json | 1 + examples/neb/params.yaml | 11 ++ examples/neb/zntrack.json | 38 +++++++ examples/phase_diagram/README.md | 2 +- examples/phase_diagram/models.py | 1 + examples/pourbaix_diagram/README.md | 2 +- examples/pourbaix_diagram/dvc.lock | 39 +++++++ examples/pourbaix_diagram/dvc.yaml | 18 +++ examples/pourbaix_diagram/models.py | 8 ++ .../mattersim/0/PourbaixDiagram/.gitignore | 3 + .../0/PourbaixDiagram/node-meta.json | 1 + examples/pourbaix_diagram/params.yaml | 13 +++ examples/pourbaix_diagram/zntrack.json | 34 ++++++ examples/relax/README.md | 2 +- examples/relax/dvc.lock | 34 ++++++ examples/relax/dvc.yaml | 23 ++++ examples/relax/models.py | 8 ++ .../0/StructureOptimization/.gitignore | 2 + .../0/StructureOptimization/node-meta.json | 1 + examples/relax/params.yaml | 11 ++ examples/relax/zntrack.json | 34 ++++++ examples/vibrational_analysis/README.md | 2 +- examples/vibrational_analysis/dvc.lock | 62 +++++++++++ examples/vibrational_analysis/dvc.yaml | 23 ++++ examples/vibrational_analysis/models.py | 8 ++ .../mattersim/VibrationalAnalysis/.gitignore | 5 + .../VibrationalAnalysis/node-meta.json | 1 + examples/vibrational_analysis/params.yaml | 14 +++ examples/vibrational_analysis/zntrack.json | 105 ++++++++++++++++++ mlipx/nodes/invariances.py | 4 +- mlipx/recipes/models.py.jinja2 | 7 ++ 85 files changed, 1399 insertions(+), 13 deletions(-) create mode 100644 examples/diatomics/nodes/mattersim/HomonuclearDiatomics/.gitignore create mode 100644 examples/diatomics/nodes/mattersim/HomonuclearDiatomics/node-meta.json create mode 100644 examples/invariances/nodes/mattersim/0/PermutationInvariance/.gitignore create mode 100644 examples/invariances/nodes/mattersim/0/PermutationInvariance/metrics.json create mode 100644 examples/invariances/nodes/mattersim/0/PermutationInvariance/node-meta.json create mode 100644 examples/invariances/nodes/mattersim/0/RotationalInvariance/.gitignore create mode 100644 examples/invariances/nodes/mattersim/0/RotationalInvariance/metrics.json create mode 100644 examples/invariances/nodes/mattersim/0/RotationalInvariance/node-meta.json create mode 100644 examples/invariances/nodes/mattersim/0/TranslationalInvariance/.gitignore create mode 100644 examples/invariances/nodes/mattersim/0/TranslationalInvariance/metrics.json create mode 100644 examples/invariances/nodes/mattersim/0/TranslationalInvariance/node-meta.json create mode 100644 examples/md/nodes/mattersim/0/MolecularDynamics/.gitignore create mode 100644 examples/md/nodes/mattersim/0/MolecularDynamics/node-meta.json create mode 100644 examples/md/nodes/mattersim/0/MolecularDynamics/observer_metrics.json create mode 100644 examples/metrics/nodes/mattersim/ApplyCalculator/.gitignore create mode 100644 examples/metrics/nodes/mattersim/ApplyCalculator/node-meta.json create mode 100644 examples/metrics/nodes/mattersim/CompareCalculatorResults/.gitignore create mode 100644 examples/metrics/nodes/mattersim/CompareCalculatorResults/error.json create mode 100644 examples/metrics/nodes/mattersim/CompareCalculatorResults/node-meta.json create mode 100644 examples/metrics/nodes/mattersim/CompareCalculatorResults/rmse.json create mode 100644 examples/metrics/nodes/mattersim/EvaluateCalculatorResults/.gitignore create mode 100644 examples/metrics/nodes/mattersim/EvaluateCalculatorResults/node-meta.json create mode 100644 examples/neb/nodes/mattersim/NEBs/.gitignore create mode 100644 examples/neb/nodes/mattersim/NEBs/node-meta.json create mode 100644 examples/pourbaix_diagram/nodes/mattersim/0/PourbaixDiagram/.gitignore create mode 100644 examples/pourbaix_diagram/nodes/mattersim/0/PourbaixDiagram/node-meta.json create mode 100644 examples/relax/nodes/mattersim/0/StructureOptimization/.gitignore create mode 100644 examples/relax/nodes/mattersim/0/StructureOptimization/node-meta.json create mode 100644 examples/vibrational_analysis/nodes/mattersim/VibrationalAnalysis/.gitignore create mode 100644 examples/vibrational_analysis/nodes/mattersim/VibrationalAnalysis/node-meta.json diff --git a/examples/diatomics/README.md b/examples/diatomics/README.md index 205fb43..cdeef2d 100644 --- a/examples/diatomics/README.md +++ b/examples/diatomics/README.md @@ -1,4 +1,4 @@ ```bash -mlipx recipes homonuclear-diatomics --models mace_mp,sevennet,orb_v2 --smiles="[Li+].[Cl-]" --repro +mlipx recipes homonuclear-diatomics --models mace_mp,sevennet,orb_v2,mattersim --smiles="[Li+].[Cl-]" --repro mlipx compare --glob "*HomonuclearDiatomics" ``` diff --git a/examples/diatomics/dvc.lock b/examples/diatomics/dvc.lock index 4bedb49..9d76f4f 100644 --- a/examples/diatomics/dvc.lock +++ b/examples/diatomics/dvc.lock @@ -236,3 +236,37 @@ stages: hash: md5 md5: f05ba44025dbc070e740fedc0c6d2be2 size: 64 + mattersim_HomonuclearDiatomics: + cmd: zntrack run mlipx.nodes.diatomics.HomonuclearDiatomics --name mattersim_HomonuclearDiatomics + deps: + - path: nodes/initialize/Smiles2Conformers/frames.xyz + hash: md5 + md5: e5492061936ed82d534cc2d7c62937ea + size: 153 + params: + params.yaml: + mattersim_HomonuclearDiatomics: + elements: [] + eq_distance: covalent-radiuis + max_distance: 2.0 + min_distance: 0.5 + model: + _cls: mlipx.nodes.generic_ase.GenericASECalculator + class_name: MatterSimCalculator + device: auto + kwargs: + module: mattersim.forcefield + n_points: 100 + outs: + - path: nodes/mattersim/HomonuclearDiatomics/frames.json + hash: md5 + md5: f27250c6ea623b2a9a38b92717cd97af + size: 421800 + - path: nodes/mattersim/HomonuclearDiatomics/node-meta.json + hash: md5 + md5: bc45e1ec53bd983d26b89c74fc127b40 + size: 64 + - path: nodes/mattersim/HomonuclearDiatomics/results.csv + hash: md5 + md5: b70e500ccf4307772b390389fb6e5a1d + size: 5843 diff --git a/examples/diatomics/dvc.yaml b/examples/diatomics/dvc.yaml index 57d216d..c228df8 100644 --- a/examples/diatomics/dvc.yaml +++ b/examples/diatomics/dvc.yaml @@ -20,6 +20,18 @@ stages: - nodes/mace_mp/HomonuclearDiatomics/results.csv params: - mace_mp_HomonuclearDiatomics + mattersim_HomonuclearDiatomics: + cmd: zntrack run mlipx.nodes.diatomics.HomonuclearDiatomics --name mattersim_HomonuclearDiatomics + deps: + - nodes/initialize/Smiles2Conformers/frames.xyz + metrics: + - nodes/mattersim/HomonuclearDiatomics/node-meta.json: + cache: false + outs: + - nodes/mattersim/HomonuclearDiatomics/frames.json + - nodes/mattersim/HomonuclearDiatomics/results.csv + params: + - mattersim_HomonuclearDiatomics orb_v2_HomonuclearDiatomics: cmd: zntrack run mlipx.nodes.diatomics.HomonuclearDiatomics --name orb_v2_HomonuclearDiatomics deps: diff --git a/examples/diatomics/main.py b/examples/diatomics/main.py index 7cc134c..0d47ec6 100644 --- a/examples/diatomics/main.py +++ b/examples/diatomics/main.py @@ -16,7 +16,7 @@ with project.group(model_name): neb = mlipx.HomonuclearDiatomics( elements=[], - data=sum(frames, []), + data=sum(frames, []), # Use all elements from all frames model=model, n_points=100, min_distance=0.5, diff --git a/examples/diatomics/models.py b/examples/diatomics/models.py index ea6b419..5a9e697 100644 --- a/examples/diatomics/models.py +++ b/examples/diatomics/models.py @@ -50,6 +50,14 @@ def get_calculator(self, **kwargs): MODELS["orb_v2"] = OrbCalc(name="orb_v2", device="auto") +# https://github.com/CederGroupHub/chgnet +MODELS["mattersim"] = mlipx.GenericASECalculator( + module="mattersim.forcefield", + class_name="MatterSimCalculator", + device="auto", +) + + # OPTIONAL # ======== # If you have custom property names you can use the UpdatedFramesCalc diff --git a/examples/diatomics/nodes/mattersim/HomonuclearDiatomics/.gitignore b/examples/diatomics/nodes/mattersim/HomonuclearDiatomics/.gitignore new file mode 100644 index 0000000..ba666e0 --- /dev/null +++ b/examples/diatomics/nodes/mattersim/HomonuclearDiatomics/.gitignore @@ -0,0 +1,2 @@ +/frames.json +/results.csv diff --git a/examples/diatomics/nodes/mattersim/HomonuclearDiatomics/node-meta.json b/examples/diatomics/nodes/mattersim/HomonuclearDiatomics/node-meta.json new file mode 100644 index 0000000..716171e --- /dev/null +++ b/examples/diatomics/nodes/mattersim/HomonuclearDiatomics/node-meta.json @@ -0,0 +1 @@ +{"uuid": "c5addb02-3509-4d8c-a32a-b2908b12a680", "run_count": 1} \ No newline at end of file diff --git a/examples/diatomics/params.yaml b/examples/diatomics/params.yaml index 6dd1d99..5952339 100644 --- a/examples/diatomics/params.yaml +++ b/examples/diatomics/params.yaml @@ -16,6 +16,18 @@ mace_mp_HomonuclearDiatomics: model: medium module: mace.calculators n_points: 100 +mattersim_HomonuclearDiatomics: + elements: [] + eq_distance: covalent-radiuis + max_distance: 2.0 + min_distance: 0.5 + model: + _cls: mlipx.nodes.generic_ase.GenericASECalculator + class_name: MatterSimCalculator + device: auto + kwargs: null + module: mattersim.forcefield + n_points: 100 orb_v2_HomonuclearDiatomics: elements: [] eq_distance: covalent-radiuis diff --git a/examples/diatomics/zntrack.json b/examples/diatomics/zntrack.json index 459d40c..bf91d59 100644 --- a/examples/diatomics/zntrack.json +++ b/examples/diatomics/zntrack.json @@ -98,5 +98,35 @@ "item": null } } + }, + "mattersim_HomonuclearDiatomics": { + "nwd": { + "_type": "pathlib.Path", + "value": "nodes/mattersim/HomonuclearDiatomics" + }, + "model": { + "_type": "@dataclasses.dataclass", + "value": { + "module": "mlipx.nodes.generic_ase", + "cls": "GenericASECalculator" + } + }, + "data": { + "_type": "znflow.Connection", + "value": { + "instance": { + "_type": "zntrack.Node", + "value": { + "module": "mlipx.nodes.smiles", + "name": "initialize_Smiles2Conformers", + "cls": "Smiles2Conformers", + "remote": null, + "rev": null + } + }, + "attribute": "frames", + "item": null + } + } } } \ No newline at end of file diff --git a/examples/energy-volume/README.md b/examples/energy-volume/README.md index 876cbff..9709b57 100644 --- a/examples/energy-volume/README.md +++ b/examples/energy-volume/README.md @@ -1,4 +1,4 @@ ```bash -mlipx recipes ev --models mace_mp,sevennet,orb_v2,chgnet --material-ids=mp-1143 --repro +mlipx recipes ev --models mace_mp,sevennet,orb_v2,chgnet,mattersim --material-ids=mp-1143 --repro mlipx compare --glob "*EnergyVolumeCurve" ``` diff --git a/examples/energy-volume/models.py b/examples/energy-volume/models.py index 69edc78..b4af4f0 100644 --- a/examples/energy-volume/models.py +++ b/examples/energy-volume/models.py @@ -56,6 +56,7 @@ def get_calculator(self, **kwargs): class_name="CHGNetCalculator", ) + # https://github.com/CederGroupHub/chgnet MODELS["mattersim"] = mlipx.GenericASECalculator( module="mattersim.forcefield", diff --git a/examples/invariances/README.md b/examples/invariances/README.md index 25e5b3f..9f71c5f 100644 --- a/examples/invariances/README.md +++ b/examples/invariances/README.md @@ -1,5 +1,5 @@ ```bash -mlipx recipes invariances --models mace_mp,sevennet,orb_v2,chgnet --material-ids=mp-1143 --repro +mlipx recipes invariances --models mace_mp,sevennet,orb_v2,chgnet,mattersim --material-ids=mp-1143 --repro mlipx compare --glob "*RotationalInvariance" mlipx compare --glob "*TranslationalInvariance" mlipx compare --glob "*PermutationInvariance" diff --git a/examples/invariances/dvc.lock b/examples/invariances/dvc.lock index 0149dd3..70ca013 100644 --- a/examples/invariances/dvc.lock +++ b/examples/invariances/dvc.lock @@ -437,3 +437,108 @@ stages: hash: md5 md5: 9c6a8b5fe9083d3b630a1eeae994bb32 size: 2174 + mattersim_0_RotationalInvariance: + cmd: zntrack run mlipx.nodes.invariances.RotationalInvariance --name mattersim_0_RotationalInvariance + deps: + - path: nodes/initialize/MPRester/frames.xyz + hash: md5 + md5: b2aa0fb43e0b26ef88bedc082a0a2325 + size: 866 + params: + params.yaml: + mattersim_0_RotationalInvariance: + data_id: -1 + model: + _cls: mlipx.nodes.generic_ase.GenericASECalculator + class_name: MatterSimCalculator + device: auto + kwargs: + module: mattersim.forcefield + n_points: 100 + outs: + - path: nodes/mattersim/0/RotationalInvariance/frames.xyz + hash: md5 + md5: 707a6dc4eecc8a0a0b02fd95ca83e443 + size: 174713 + - path: nodes/mattersim/0/RotationalInvariance/metrics.json + hash: md5 + md5: 77ccde3a333100eb4349487f89f5b6bb + size: 59 + - path: nodes/mattersim/0/RotationalInvariance/node-meta.json + hash: md5 + md5: a85268bf8a3ecc93b11a7147b83ae77d + size: 64 + - path: nodes/mattersim/0/RotationalInvariance/plots.csv + hash: md5 + md5: 2bde6d882f64043daf58e44cf084e23e + size: 1333 + mattersim_0_PermutationInvariance: + cmd: zntrack run mlipx.nodes.invariances.PermutationInvariance --name mattersim_0_PermutationInvariance + deps: + - path: nodes/initialize/MPRester/frames.xyz + hash: md5 + md5: b2aa0fb43e0b26ef88bedc082a0a2325 + size: 866 + params: + params.yaml: + mattersim_0_PermutationInvariance: + data_id: -1 + model: + _cls: mlipx.nodes.generic_ase.GenericASECalculator + class_name: MatterSimCalculator + device: auto + kwargs: + module: mattersim.forcefield + n_points: 100 + outs: + - path: nodes/mattersim/0/PermutationInvariance/frames.xyz + hash: md5 + md5: 1b409395466af84044d0287f895045bf + size: 165300 + - path: nodes/mattersim/0/PermutationInvariance/metrics.json + hash: md5 + md5: 4e4427ee1edb555656e7147e83f02c3f + size: 40 + - path: nodes/mattersim/0/PermutationInvariance/node-meta.json + hash: md5 + md5: e781deaac25d66bceb3516f0d782411b + size: 64 + - path: nodes/mattersim/0/PermutationInvariance/plots.csv + hash: md5 + md5: 1c1c42ccb7cb6a2c7fa26e80401d4b2c + size: 1298 + mattersim_0_TranslationalInvariance: + cmd: zntrack run mlipx.nodes.invariances.TranslationalInvariance --name mattersim_0_TranslationalInvariance + deps: + - path: nodes/initialize/MPRester/frames.xyz + hash: md5 + md5: b2aa0fb43e0b26ef88bedc082a0a2325 + size: 866 + params: + params.yaml: + mattersim_0_TranslationalInvariance: + data_id: -1 + model: + _cls: mlipx.nodes.generic_ase.GenericASECalculator + class_name: MatterSimCalculator + device: auto + kwargs: + module: mattersim.forcefield + n_points: 100 + outs: + - path: nodes/mattersim/0/TranslationalInvariance/frames.xyz + hash: md5 + md5: 46b9c42ac7326387e45bd50371a4fb84 + size: 165318 + - path: nodes/mattersim/0/TranslationalInvariance/metrics.json + hash: md5 + md5: 7d4ad028825f3dc04b1f1dd31af3ad8a + size: 58 + - path: nodes/mattersim/0/TranslationalInvariance/node-meta.json + hash: md5 + md5: 5637f1d232f8039a0a364fd6daa150b4 + size: 64 + - path: nodes/mattersim/0/TranslationalInvariance/plots.csv + hash: md5 + md5: f1d21493378826913984aa19aa0dc61b + size: 1316 diff --git a/examples/invariances/dvc.yaml b/examples/invariances/dvc.yaml index 9ee4d7d..1c89fbb 100644 --- a/examples/invariances/dvc.yaml +++ b/examples/invariances/dvc.yaml @@ -92,6 +92,48 @@ stages: - nodes/mace_mp/0/TranslationalInvariance/plots.csv params: - mace_mp_0_TranslationalInvariance + mattersim_0_PermutationInvariance: + cmd: zntrack run mlipx.nodes.invariances.PermutationInvariance --name mattersim_0_PermutationInvariance + deps: + - nodes/initialize/MPRester/frames.xyz + metrics: + - nodes/mattersim/0/PermutationInvariance/metrics.json: + cache: false + - nodes/mattersim/0/PermutationInvariance/node-meta.json: + cache: false + outs: + - nodes/mattersim/0/PermutationInvariance/frames.xyz + - nodes/mattersim/0/PermutationInvariance/plots.csv + params: + - mattersim_0_PermutationInvariance + mattersim_0_RotationalInvariance: + cmd: zntrack run mlipx.nodes.invariances.RotationalInvariance --name mattersim_0_RotationalInvariance + deps: + - nodes/initialize/MPRester/frames.xyz + metrics: + - nodes/mattersim/0/RotationalInvariance/metrics.json: + cache: false + - nodes/mattersim/0/RotationalInvariance/node-meta.json: + cache: false + outs: + - nodes/mattersim/0/RotationalInvariance/frames.xyz + - nodes/mattersim/0/RotationalInvariance/plots.csv + params: + - mattersim_0_RotationalInvariance + mattersim_0_TranslationalInvariance: + cmd: zntrack run mlipx.nodes.invariances.TranslationalInvariance --name mattersim_0_TranslationalInvariance + deps: + - nodes/initialize/MPRester/frames.xyz + metrics: + - nodes/mattersim/0/TranslationalInvariance/metrics.json: + cache: false + - nodes/mattersim/0/TranslationalInvariance/node-meta.json: + cache: false + outs: + - nodes/mattersim/0/TranslationalInvariance/frames.xyz + - nodes/mattersim/0/TranslationalInvariance/plots.csv + params: + - mattersim_0_TranslationalInvariance orb_v2_0_PermutationInvariance: cmd: zntrack run mlipx.nodes.invariances.PermutationInvariance --name orb_v2_0_PermutationInvariance deps: diff --git a/examples/invariances/models.py b/examples/invariances/models.py index d9a0c0a..b4af4f0 100644 --- a/examples/invariances/models.py +++ b/examples/invariances/models.py @@ -57,6 +57,14 @@ def get_calculator(self, **kwargs): ) +# https://github.com/CederGroupHub/chgnet +MODELS["mattersim"] = mlipx.GenericASECalculator( + module="mattersim.forcefield", + class_name="MatterSimCalculator", + device="auto", +) + + # OPTIONAL # ======== # If you have custom property names you can use the UpdatedFramesCalc diff --git a/examples/invariances/nodes/mattersim/0/PermutationInvariance/.gitignore b/examples/invariances/nodes/mattersim/0/PermutationInvariance/.gitignore new file mode 100644 index 0000000..2807d56 --- /dev/null +++ b/examples/invariances/nodes/mattersim/0/PermutationInvariance/.gitignore @@ -0,0 +1,2 @@ +/frames.xyz +/plots.csv diff --git a/examples/invariances/nodes/mattersim/0/PermutationInvariance/metrics.json b/examples/invariances/nodes/mattersim/0/PermutationInvariance/metrics.json new file mode 100644 index 0000000..7eaaca0 --- /dev/null +++ b/examples/invariances/nodes/mattersim/0/PermutationInvariance/metrics.json @@ -0,0 +1 @@ +{"mean": -74.80252075195312, "std": 0.0} \ No newline at end of file diff --git a/examples/invariances/nodes/mattersim/0/PermutationInvariance/node-meta.json b/examples/invariances/nodes/mattersim/0/PermutationInvariance/node-meta.json new file mode 100644 index 0000000..925af83 --- /dev/null +++ b/examples/invariances/nodes/mattersim/0/PermutationInvariance/node-meta.json @@ -0,0 +1 @@ +{"uuid": "132511da-f3af-424e-b685-d340efe58b19", "run_count": 1} \ No newline at end of file diff --git a/examples/invariances/nodes/mattersim/0/RotationalInvariance/.gitignore b/examples/invariances/nodes/mattersim/0/RotationalInvariance/.gitignore new file mode 100644 index 0000000..2807d56 --- /dev/null +++ b/examples/invariances/nodes/mattersim/0/RotationalInvariance/.gitignore @@ -0,0 +1,2 @@ +/frames.xyz +/plots.csv diff --git a/examples/invariances/nodes/mattersim/0/RotationalInvariance/metrics.json b/examples/invariances/nodes/mattersim/0/RotationalInvariance/metrics.json new file mode 100644 index 0000000..70a8bd0 --- /dev/null +++ b/examples/invariances/nodes/mattersim/0/RotationalInvariance/metrics.json @@ -0,0 +1 @@ +{"mean": -74.80253601074219, "std": 1.0976787052641157e-05} \ No newline at end of file diff --git a/examples/invariances/nodes/mattersim/0/RotationalInvariance/node-meta.json b/examples/invariances/nodes/mattersim/0/RotationalInvariance/node-meta.json new file mode 100644 index 0000000..87ce52f --- /dev/null +++ b/examples/invariances/nodes/mattersim/0/RotationalInvariance/node-meta.json @@ -0,0 +1 @@ +{"uuid": "3a230a3a-6819-44ad-824f-4cf6be3b17be", "run_count": 1} \ No newline at end of file diff --git a/examples/invariances/nodes/mattersim/0/TranslationalInvariance/.gitignore b/examples/invariances/nodes/mattersim/0/TranslationalInvariance/.gitignore new file mode 100644 index 0000000..2807d56 --- /dev/null +++ b/examples/invariances/nodes/mattersim/0/TranslationalInvariance/.gitignore @@ -0,0 +1,2 @@ +/frames.xyz +/plots.csv diff --git a/examples/invariances/nodes/mattersim/0/TranslationalInvariance/metrics.json b/examples/invariances/nodes/mattersim/0/TranslationalInvariance/metrics.json new file mode 100644 index 0000000..60adb8d --- /dev/null +++ b/examples/invariances/nodes/mattersim/0/TranslationalInvariance/metrics.json @@ -0,0 +1 @@ +{"mean": -74.80253601074219, "std": 1.199053440359421e-05} \ No newline at end of file diff --git a/examples/invariances/nodes/mattersim/0/TranslationalInvariance/node-meta.json b/examples/invariances/nodes/mattersim/0/TranslationalInvariance/node-meta.json new file mode 100644 index 0000000..88b3140 --- /dev/null +++ b/examples/invariances/nodes/mattersim/0/TranslationalInvariance/node-meta.json @@ -0,0 +1 @@ +{"uuid": "62751729-608e-44d3-861a-75087b8b6053", "run_count": 1} \ No newline at end of file diff --git a/examples/invariances/params.yaml b/examples/invariances/params.yaml index afe3ffc..baef733 100644 --- a/examples/invariances/params.yaml +++ b/examples/invariances/params.yaml @@ -59,6 +59,33 @@ mace_mp_0_TranslationalInvariance: model: medium module: mace.calculators n_points: 100 +mattersim_0_PermutationInvariance: + data_id: -1 + model: + _cls: mlipx.nodes.generic_ase.GenericASECalculator + class_name: MatterSimCalculator + device: auto + kwargs: null + module: mattersim.forcefield + n_points: 100 +mattersim_0_RotationalInvariance: + data_id: -1 + model: + _cls: mlipx.nodes.generic_ase.GenericASECalculator + class_name: MatterSimCalculator + device: auto + kwargs: null + module: mattersim.forcefield + n_points: 100 +mattersim_0_TranslationalInvariance: + data_id: -1 + model: + _cls: mlipx.nodes.generic_ase.GenericASECalculator + class_name: MatterSimCalculator + device: auto + kwargs: null + module: mattersim.forcefield + n_points: 100 orb_v2_0_PermutationInvariance: data_id: -1 model: diff --git a/examples/invariances/zntrack.json b/examples/invariances/zntrack.json index d3bacb8..aee04cf 100644 --- a/examples/invariances/zntrack.json +++ b/examples/invariances/zntrack.json @@ -416,5 +416,107 @@ "_type": "pathlib.Path", "value": "$nwd$/frames.xyz" } + }, + "mattersim_0_RotationalInvariance": { + "nwd": { + "_type": "pathlib.Path", + "value": "nodes/mattersim/0/RotationalInvariance" + }, + "model": { + "_type": "@dataclasses.dataclass", + "value": { + "module": "mlipx.nodes.generic_ase", + "cls": "GenericASECalculator" + } + }, + "data": { + "_type": "znflow.Connection", + "value": { + "instance": { + "_type": "zntrack.Node", + "value": { + "module": "mlipx.nodes.mp_api", + "name": "initialize_MPRester", + "cls": "MPRester", + "remote": null, + "rev": null + } + }, + "attribute": "frames", + "item": null + } + }, + "frames_path": { + "_type": "pathlib.Path", + "value": "$nwd$/frames.xyz" + } + }, + "mattersim_0_TranslationalInvariance": { + "nwd": { + "_type": "pathlib.Path", + "value": "nodes/mattersim/0/TranslationalInvariance" + }, + "model": { + "_type": "@dataclasses.dataclass", + "value": { + "module": "mlipx.nodes.generic_ase", + "cls": "GenericASECalculator" + } + }, + "data": { + "_type": "znflow.Connection", + "value": { + "instance": { + "_type": "zntrack.Node", + "value": { + "module": "mlipx.nodes.mp_api", + "name": "initialize_MPRester", + "cls": "MPRester", + "remote": null, + "rev": null + } + }, + "attribute": "frames", + "item": null + } + }, + "frames_path": { + "_type": "pathlib.Path", + "value": "$nwd$/frames.xyz" + } + }, + "mattersim_0_PermutationInvariance": { + "nwd": { + "_type": "pathlib.Path", + "value": "nodes/mattersim/0/PermutationInvariance" + }, + "model": { + "_type": "@dataclasses.dataclass", + "value": { + "module": "mlipx.nodes.generic_ase", + "cls": "GenericASECalculator" + } + }, + "data": { + "_type": "znflow.Connection", + "value": { + "instance": { + "_type": "zntrack.Node", + "value": { + "module": "mlipx.nodes.mp_api", + "name": "initialize_MPRester", + "cls": "MPRester", + "remote": null, + "rev": null + } + }, + "attribute": "frames", + "item": null + } + }, + "frames_path": { + "_type": "pathlib.Path", + "value": "$nwd$/frames.xyz" + } } } \ No newline at end of file diff --git a/examples/md/README.md b/examples/md/README.md index 2c2cce7..36c145d 100644 --- a/examples/md/README.md +++ b/examples/md/README.md @@ -1,4 +1,4 @@ ```bash -mlipx recipes md --models mace_mp,sevennet,orb_v2,chgnet --material-ids=mp-1143 --repro +mlipx recipes md --models mace_mp,sevennet,orb_v2,chgnet,mattersim --material-ids=mp-1143 --repro mlipx compare --glob "*MolecularDynamics" ``` diff --git a/examples/md/dvc.lock b/examples/md/dvc.lock index dc4cf98..9ee6047 100644 --- a/examples/md/dvc.lock +++ b/examples/md/dvc.lock @@ -376,3 +376,52 @@ stages: hash: md5 md5: a0f37bbcc44187ff6e5ebe5387c0ec1d size: 42250 + mattersim_0_MolecularDynamics: + cmd: zntrack run mlipx.nodes.molecular_dynamics.MolecularDynamics --name mattersim_0_MolecularDynamics + deps: + - path: nodes/initialize/MPRester/frames.xyz + hash: md5 + md5: b2aa0fb43e0b26ef88bedc082a0a2325 + size: 866 + params: + params.yaml: + mattersim_0_MolecularDynamics: + data_id: -1 + model: + _cls: mlipx.nodes.generic_ase.GenericASECalculator + class_name: MatterSimCalculator + device: auto + kwargs: + module: mattersim.forcefield + modifiers: + - _cls: mlipx.nodes.modifier.TemperatureRampModifier + end_temperature: 400 + interval: 1 + start_temperature: + total_steps: 100 + observers: + - _cls: mlipx.nodes.observer.MaximumForceObserver + f_max: 100 + steps: 1000 + thermostat: + _cls: mlipx.nodes.molecular_dynamics.LangevinConfig + friction: 0.05 + temperature: 300 + timestep: 0.5 + outs: + - path: nodes/mattersim/0/MolecularDynamics/frames.xyz + hash: md5 + md5: 101a538597eb3d51b7522c4002a8bbcf + size: 2172217 + - path: nodes/mattersim/0/MolecularDynamics/node-meta.json + hash: md5 + md5: 1d3dfe61bf3855f88992a7f45bee38e1 + size: 64 + - path: nodes/mattersim/0/MolecularDynamics/observer_metrics.json + hash: md5 + md5: 99d1bc2c8fde362f1c1b8ccf64ceac4c + size: 28 + - path: nodes/mattersim/0/MolecularDynamics/plots.csv + hash: md5 + md5: ef19191286cff7a649de10d4c4b87f66 + size: 33565 diff --git a/examples/md/dvc.yaml b/examples/md/dvc.yaml index cc48d7d..b286da2 100644 --- a/examples/md/dvc.yaml +++ b/examples/md/dvc.yaml @@ -39,6 +39,16 @@ plots: nodes/chgnet/0/MolecularDynamics/plots.csv: step y: nodes/chgnet/0/MolecularDynamics/plots.csv: fmax +- mattersim_0_MolecularDynamics_plots_0: + x: + nodes/mattersim/0/MolecularDynamics/plots.csv: step + y: + nodes/mattersim/0/MolecularDynamics/plots.csv: energy +- mattersim_0_MolecularDynamics_plots_1: + x: + nodes/mattersim/0/MolecularDynamics/plots.csv: step + y: + nodes/mattersim/0/MolecularDynamics/plots.csv: fmax stages: chgnet_0_MolecularDynamics: cmd: zntrack run mlipx.nodes.molecular_dynamics.MolecularDynamics --name chgnet_0_MolecularDynamics @@ -77,6 +87,20 @@ stages: - nodes/mace_mp/0/MolecularDynamics/plots.csv params: - mace_mp_0_MolecularDynamics + mattersim_0_MolecularDynamics: + cmd: zntrack run mlipx.nodes.molecular_dynamics.MolecularDynamics --name mattersim_0_MolecularDynamics + deps: + - nodes/initialize/MPRester/frames.xyz + metrics: + - nodes/mattersim/0/MolecularDynamics/node-meta.json: + cache: false + - nodes/mattersim/0/MolecularDynamics/observer_metrics.json: + cache: false + outs: + - nodes/mattersim/0/MolecularDynamics/frames.xyz + - nodes/mattersim/0/MolecularDynamics/plots.csv + params: + - mattersim_0_MolecularDynamics orb_v2_0_MolecularDynamics: cmd: zntrack run mlipx.nodes.molecular_dynamics.MolecularDynamics --name orb_v2_0_MolecularDynamics deps: diff --git a/examples/md/models.py b/examples/md/models.py index d9a0c0a..b4af4f0 100644 --- a/examples/md/models.py +++ b/examples/md/models.py @@ -57,6 +57,14 @@ def get_calculator(self, **kwargs): ) +# https://github.com/CederGroupHub/chgnet +MODELS["mattersim"] = mlipx.GenericASECalculator( + module="mattersim.forcefield", + class_name="MatterSimCalculator", + device="auto", +) + + # OPTIONAL # ======== # If you have custom property names you can use the UpdatedFramesCalc diff --git a/examples/md/nodes/mattersim/0/MolecularDynamics/.gitignore b/examples/md/nodes/mattersim/0/MolecularDynamics/.gitignore new file mode 100644 index 0000000..2807d56 --- /dev/null +++ b/examples/md/nodes/mattersim/0/MolecularDynamics/.gitignore @@ -0,0 +1,2 @@ +/frames.xyz +/plots.csv diff --git a/examples/md/nodes/mattersim/0/MolecularDynamics/node-meta.json b/examples/md/nodes/mattersim/0/MolecularDynamics/node-meta.json new file mode 100644 index 0000000..3cbe65e --- /dev/null +++ b/examples/md/nodes/mattersim/0/MolecularDynamics/node-meta.json @@ -0,0 +1 @@ +{"uuid": "a92be779-e694-4911-b61d-92e79bdba8b4", "run_count": 1} \ No newline at end of file diff --git a/examples/md/nodes/mattersim/0/MolecularDynamics/observer_metrics.json b/examples/md/nodes/mattersim/0/MolecularDynamics/observer_metrics.json new file mode 100644 index 0000000..1c49c26 --- /dev/null +++ b/examples/md/nodes/mattersim/0/MolecularDynamics/observer_metrics.json @@ -0,0 +1 @@ +{"MaximumForceObserver": -1} \ No newline at end of file diff --git a/examples/md/params.yaml b/examples/md/params.yaml index 0ae7258..e21dc7b 100644 --- a/examples/md/params.yaml +++ b/examples/md/params.yaml @@ -49,6 +49,29 @@ mace_mp_0_MolecularDynamics: friction: 0.05 temperature: 300 timestep: 0.5 +mattersim_0_MolecularDynamics: + data_id: -1 + model: + _cls: mlipx.nodes.generic_ase.GenericASECalculator + class_name: MatterSimCalculator + device: auto + kwargs: null + module: mattersim.forcefield + modifiers: + - _cls: mlipx.nodes.modifier.TemperatureRampModifier + end_temperature: 400 + interval: 1 + start_temperature: null + total_steps: 100 + observers: + - _cls: mlipx.nodes.observer.MaximumForceObserver + f_max: 100 + steps: 1000 + thermostat: + _cls: mlipx.nodes.molecular_dynamics.LangevinConfig + friction: 0.05 + temperature: 300 + timestep: 0.5 orb_v2_0_MolecularDynamics: data_id: -1 model: diff --git a/examples/md/zntrack.json b/examples/md/zntrack.json index 0a19a5a..0560132 100644 --- a/examples/md/zntrack.json +++ b/examples/md/zntrack.json @@ -244,5 +244,64 @@ "_type": "pathlib.Path", "value": "$nwd$/frames.xyz" } + }, + "mattersim_0_MolecularDynamics": { + "nwd": { + "_type": "pathlib.Path", + "value": "nodes/mattersim/0/MolecularDynamics" + }, + "model": { + "_type": "@dataclasses.dataclass", + "value": { + "module": "mlipx.nodes.generic_ase", + "cls": "GenericASECalculator" + } + }, + "thermostat": { + "_type": "@dataclasses.dataclass", + "value": { + "module": "mlipx.nodes.molecular_dynamics", + "cls": "LangevinConfig" + } + }, + "data": { + "_type": "znflow.Connection", + "value": { + "instance": { + "_type": "zntrack.Node", + "value": { + "module": "mlipx.nodes.mp_api", + "name": "initialize_MPRester", + "cls": "MPRester", + "remote": null, + "rev": null + } + }, + "attribute": "frames", + "item": null + } + }, + "observers": [ + { + "_type": "@dataclasses.dataclass", + "value": { + "module": "mlipx.nodes.observer", + "cls": "MaximumForceObserver" + } + } + ], + "modifiers": [ + { + "_type": "@dataclasses.dataclass", + "value": { + "module": "mlipx.nodes.modifier", + "cls": "TemperatureRampModifier" + } + } + ], + "frames_path": { + "_type": "pathlib.Path", + "value": "$nwd$/frames.xyz" + } } } \ No newline at end of file diff --git a/examples/metrics/README.md b/examples/metrics/README.md index 2a27aab..a270e6c 100644 --- a/examples/metrics/README.md +++ b/examples/metrics/README.md @@ -1,4 +1,4 @@ ```bash -mlipx recipes metrics --models mace_mp,sevennet,orb_v2,chgnet --datapath ../data/DODH_adsorption_dft.xyz --repro +mlipx recipes metrics --models mace_mp,sevennet,orb_v2,chgnet,mattersim --datapath ../data/DODH_adsorption_dft.xyz --repro mlipx compare --glob "*CompareCalculatorResults" ``` diff --git a/examples/metrics/dvc.lock b/examples/metrics/dvc.lock index 703dd1a..1527e74 100644 --- a/examples/metrics/dvc.lock +++ b/examples/metrics/dvc.lock @@ -351,3 +351,82 @@ stages: hash: md5 md5: 12350a2e6e20341a2a1d40a89dfe9a27 size: 125 + mattersim_ApplyCalculator: + cmd: zntrack run mlipx.nodes.apply_calculator.ApplyCalculator --name mattersim_ApplyCalculator + deps: + - path: nodes/initialize/LoadDataFile/node-meta.json + hash: md5 + md5: d9b685b4f8110469c644ea0895f27fcb + size: 64 + params: + params.yaml: + mattersim_ApplyCalculator: + model: + _cls: mlipx.nodes.generic_ase.GenericASECalculator + class_name: MatterSimCalculator + device: auto + kwargs: + module: mattersim.forcefield + outs: + - path: nodes/mattersim/ApplyCalculator/frames.h5 + hash: md5 + md5: 12a77ea49a1c36ad5f250c29b8aa9c59 + size: 450504 + - path: nodes/mattersim/ApplyCalculator/node-meta.json + hash: md5 + md5: 236886f3d0f6c9fec498e735410d3241 + size: 64 + mattersim_EvaluateCalculatorResults: + cmd: zntrack run mlipx.nodes.evaluate_calculator.EvaluateCalculatorResults --name + mattersim_EvaluateCalculatorResults + deps: + - path: nodes/mattersim/ApplyCalculator/frames.h5 + hash: md5 + md5: 12a77ea49a1c36ad5f250c29b8aa9c59 + size: 450504 + outs: + - path: nodes/mattersim/EvaluateCalculatorResults/node-meta.json + hash: md5 + md5: c2f4b501267e0a0a759a9903b4d27099 + size: 64 + - path: nodes/mattersim/EvaluateCalculatorResults/plots.csv + hash: md5 + md5: b3094a70db87e2d900453b109e67562f + size: 6412 + mattersim_CompareCalculatorResults: + cmd: zntrack run mlipx.nodes.compare_calculator.CompareCalculatorResults --name + mattersim_CompareCalculatorResults + deps: + - path: nodes/mattersim/EvaluateCalculatorResults/node-meta.json + hash: md5 + md5: c2f4b501267e0a0a759a9903b4d27099 + size: 64 + - path: nodes/mattersim/EvaluateCalculatorResults/plots.csv + hash: md5 + md5: b3094a70db87e2d900453b109e67562f + size: 6412 + - path: nodes/reference/EvaluateCalculatorResults/node-meta.json + hash: md5 + md5: 71045eb1ce7912d8cb6123680a38ccfd + size: 64 + - path: nodes/reference/EvaluateCalculatorResults/plots.csv + hash: md5 + md5: bc55b5864767c6abeec9a3d0d19b2512 + size: 7210 + outs: + - path: nodes/mattersim/CompareCalculatorResults/error.json + hash: md5 + md5: e8d40ba7a7b52de14b219a971010e186 + size: 331 + - path: nodes/mattersim/CompareCalculatorResults/node-meta.json + hash: md5 + md5: 05437a36b1c11c9c60c89ebb81c6ba6b + size: 64 + - path: nodes/mattersim/CompareCalculatorResults/plots.csv + hash: md5 + md5: 69f8896a83c425cd72c849a2bfe51b16 + size: 9084 + - path: nodes/mattersim/CompareCalculatorResults/rmse.json + hash: md5 + md5: f5f5c89da0566447b53db00b31f01bd3 + size: 123 diff --git a/examples/metrics/dvc.yaml b/examples/metrics/dvc.yaml index 7ec8d32..2a3ab4e 100644 --- a/examples/metrics/dvc.yaml +++ b/examples/metrics/dvc.yaml @@ -74,6 +74,21 @@ plots: nodes/chgnet/EvaluateCalculatorResults/plots.csv: step y: nodes/chgnet/EvaluateCalculatorResults/plots.csv: energy +- mattersim_EvaluateCalculatorResults_plots_0: + x: + nodes/mattersim/EvaluateCalculatorResults/plots.csv: step + y: + nodes/mattersim/EvaluateCalculatorResults/plots.csv: fmax +- mattersim_EvaluateCalculatorResults_plots_1: + x: + nodes/mattersim/EvaluateCalculatorResults/plots.csv: step + y: + nodes/mattersim/EvaluateCalculatorResults/plots.csv: fnorm +- mattersim_EvaluateCalculatorResults_plots_2: + x: + nodes/mattersim/EvaluateCalculatorResults/plots.csv: step + y: + nodes/mattersim/EvaluateCalculatorResults/plots.csv: energy stages: chgnet_ApplyCalculator: cmd: zntrack run mlipx.nodes.apply_calculator.ApplyCalculator --name chgnet_ApplyCalculator @@ -160,6 +175,44 @@ stages: cache: false outs: - nodes/mace_mp/EvaluateCalculatorResults/plots.csv + mattersim_ApplyCalculator: + cmd: zntrack run mlipx.nodes.apply_calculator.ApplyCalculator --name mattersim_ApplyCalculator + deps: + - nodes/initialize/LoadDataFile/node-meta.json + metrics: + - nodes/mattersim/ApplyCalculator/node-meta.json: + cache: false + outs: + - nodes/mattersim/ApplyCalculator/frames.h5 + params: + - mattersim_ApplyCalculator + mattersim_CompareCalculatorResults: + cmd: zntrack run mlipx.nodes.compare_calculator.CompareCalculatorResults --name + mattersim_CompareCalculatorResults + deps: + - nodes/mattersim/EvaluateCalculatorResults/node-meta.json + - nodes/mattersim/EvaluateCalculatorResults/plots.csv + - nodes/reference/EvaluateCalculatorResults/node-meta.json + - nodes/reference/EvaluateCalculatorResults/plots.csv + metrics: + - nodes/mattersim/CompareCalculatorResults/error.json: + cache: false + - nodes/mattersim/CompareCalculatorResults/node-meta.json: + cache: false + - nodes/mattersim/CompareCalculatorResults/rmse.json: + cache: false + outs: + - nodes/mattersim/CompareCalculatorResults/plots.csv + mattersim_EvaluateCalculatorResults: + cmd: zntrack run mlipx.nodes.evaluate_calculator.EvaluateCalculatorResults --name + mattersim_EvaluateCalculatorResults + deps: + - nodes/mattersim/ApplyCalculator/frames.h5 + metrics: + - nodes/mattersim/EvaluateCalculatorResults/node-meta.json: + cache: false + outs: + - nodes/mattersim/EvaluateCalculatorResults/plots.csv orb_v2_ApplyCalculator: cmd: zntrack run mlipx.nodes.apply_calculator.ApplyCalculator --name orb_v2_ApplyCalculator deps: diff --git a/examples/metrics/models.py b/examples/metrics/models.py index d9a0c0a..b4af4f0 100644 --- a/examples/metrics/models.py +++ b/examples/metrics/models.py @@ -57,6 +57,14 @@ def get_calculator(self, **kwargs): ) +# https://github.com/CederGroupHub/chgnet +MODELS["mattersim"] = mlipx.GenericASECalculator( + module="mattersim.forcefield", + class_name="MatterSimCalculator", + device="auto", +) + + # OPTIONAL # ======== # If you have custom property names you can use the UpdatedFramesCalc diff --git a/examples/metrics/nodes/mattersim/ApplyCalculator/.gitignore b/examples/metrics/nodes/mattersim/ApplyCalculator/.gitignore new file mode 100644 index 0000000..7b49cc8 --- /dev/null +++ b/examples/metrics/nodes/mattersim/ApplyCalculator/.gitignore @@ -0,0 +1 @@ +/frames.h5 diff --git a/examples/metrics/nodes/mattersim/ApplyCalculator/node-meta.json b/examples/metrics/nodes/mattersim/ApplyCalculator/node-meta.json new file mode 100644 index 0000000..c4ea2a2 --- /dev/null +++ b/examples/metrics/nodes/mattersim/ApplyCalculator/node-meta.json @@ -0,0 +1 @@ +{"uuid": "686d0881-4da7-480f-b5f8-4992d2373aee", "run_count": 1} \ No newline at end of file diff --git a/examples/metrics/nodes/mattersim/CompareCalculatorResults/.gitignore b/examples/metrics/nodes/mattersim/CompareCalculatorResults/.gitignore new file mode 100644 index 0000000..231f5c6 --- /dev/null +++ b/examples/metrics/nodes/mattersim/CompareCalculatorResults/.gitignore @@ -0,0 +1 @@ +/plots.csv diff --git a/examples/metrics/nodes/mattersim/CompareCalculatorResults/error.json b/examples/metrics/nodes/mattersim/CompareCalculatorResults/error.json new file mode 100644 index 0000000..0fc2a80 --- /dev/null +++ b/examples/metrics/nodes/mattersim/CompareCalculatorResults/error.json @@ -0,0 +1 @@ +{"adjusted_energy_max": 0.20476542063988745, "adjusted_energy_min": -0.24152881721965969, "adjusted_energy_per_atom_max": 0.0026251977005113778, "adjusted_energy_per_atom_min": -0.0030965232976879445, "fmax_max": 0.8480556679449998, "fmax_min": 0.09269013724584269, "fnorm_max": 1.0944513488136476, "fnorm_min": 0.5817434254715295} \ No newline at end of file diff --git a/examples/metrics/nodes/mattersim/CompareCalculatorResults/node-meta.json b/examples/metrics/nodes/mattersim/CompareCalculatorResults/node-meta.json new file mode 100644 index 0000000..f81cc73 --- /dev/null +++ b/examples/metrics/nodes/mattersim/CompareCalculatorResults/node-meta.json @@ -0,0 +1 @@ +{"uuid": "cb8efe6b-12dd-463e-b705-6eb8170864ff", "run_count": 1} \ No newline at end of file diff --git a/examples/metrics/nodes/mattersim/CompareCalculatorResults/rmse.json b/examples/metrics/nodes/mattersim/CompareCalculatorResults/rmse.json new file mode 100644 index 0000000..bee3966 --- /dev/null +++ b/examples/metrics/nodes/mattersim/CompareCalculatorResults/rmse.json @@ -0,0 +1 @@ +{"energy": 320188.7667452371, "energy_per_atom": 3680.330652244105, "fmax": 0.4667540294088362, "fnorm": 0.781137196400227} \ No newline at end of file diff --git a/examples/metrics/nodes/mattersim/EvaluateCalculatorResults/.gitignore b/examples/metrics/nodes/mattersim/EvaluateCalculatorResults/.gitignore new file mode 100644 index 0000000..231f5c6 --- /dev/null +++ b/examples/metrics/nodes/mattersim/EvaluateCalculatorResults/.gitignore @@ -0,0 +1 @@ +/plots.csv diff --git a/examples/metrics/nodes/mattersim/EvaluateCalculatorResults/node-meta.json b/examples/metrics/nodes/mattersim/EvaluateCalculatorResults/node-meta.json new file mode 100644 index 0000000..983482c --- /dev/null +++ b/examples/metrics/nodes/mattersim/EvaluateCalculatorResults/node-meta.json @@ -0,0 +1 @@ +{"uuid": "983ad0af-1f2c-4c1d-aedf-f96a52720763", "run_count": 1} \ No newline at end of file diff --git a/examples/metrics/params.yaml b/examples/metrics/params.yaml index ad4770d..8c0014e 100644 --- a/examples/metrics/params.yaml +++ b/examples/metrics/params.yaml @@ -17,6 +17,13 @@ mace_mp_ApplyCalculator: kwargs: model: medium module: mace.calculators +mattersim_ApplyCalculator: + model: + _cls: mlipx.nodes.generic_ase.GenericASECalculator + class_name: MatterSimCalculator + device: auto + kwargs: null + module: mattersim.forcefield orb_v2_ApplyCalculator: model: _cls: models.OrbCalc diff --git a/examples/metrics/zntrack.json b/examples/metrics/zntrack.json index 7751028..4b758cc 100644 --- a/examples/metrics/zntrack.json +++ b/examples/metrics/zntrack.json @@ -416,5 +416,102 @@ "item": null } } + }, + "mattersim_ApplyCalculator": { + "nwd": { + "_type": "pathlib.Path", + "value": "nodes/mattersim/ApplyCalculator" + }, + "data": { + "_type": "znflow.Connection", + "value": { + "instance": { + "_type": "zntrack.Node", + "value": { + "module": "mlipx.nodes.io", + "name": "initialize_LoadDataFile", + "cls": "LoadDataFile", + "remote": null, + "rev": null + } + }, + "attribute": "frames", + "item": null + } + }, + "model": { + "_type": "@dataclasses.dataclass", + "value": { + "module": "mlipx.nodes.generic_ase", + "cls": "GenericASECalculator" + } + }, + "frames_path": { + "_type": "pathlib.Path", + "value": "$nwd$/frames.h5" + } + }, + "mattersim_EvaluateCalculatorResults": { + "nwd": { + "_type": "pathlib.Path", + "value": "nodes/mattersim/EvaluateCalculatorResults" + }, + "data": { + "_type": "znflow.Connection", + "value": { + "instance": { + "_type": "zntrack.Node", + "value": { + "module": "mlipx.nodes.apply_calculator", + "name": "mattersim_ApplyCalculator", + "cls": "ApplyCalculator", + "remote": null, + "rev": null + } + }, + "attribute": "frames", + "item": null + } + } + }, + "mattersim_CompareCalculatorResults": { + "nwd": { + "_type": "pathlib.Path", + "value": "nodes/mattersim/CompareCalculatorResults" + }, + "data": { + "_type": "znflow.Connection", + "value": { + "instance": { + "_type": "zntrack.Node", + "value": { + "module": "mlipx.nodes.evaluate_calculator", + "name": "mattersim_EvaluateCalculatorResults", + "cls": "EvaluateCalculatorResults", + "remote": null, + "rev": null + } + }, + "attribute": null, + "item": null + } + }, + "reference": { + "_type": "znflow.Connection", + "value": { + "instance": { + "_type": "zntrack.Node", + "value": { + "module": "mlipx.nodes.evaluate_calculator", + "name": "reference_EvaluateCalculatorResults", + "cls": "EvaluateCalculatorResults", + "remote": null, + "rev": null + } + }, + "attribute": null, + "item": null + } + } } } \ No newline at end of file diff --git a/examples/neb/README.md b/examples/neb/README.md index ee27849..792f208 100644 --- a/examples/neb/README.md +++ b/examples/neb/README.md @@ -1,4 +1,4 @@ ```bash -mlipx recipes neb --models mace_mp,sevennet,orb_v2,chgnet --datapath ../data/neb_end_p.xyz --repro +mlipx recipes neb --models mace_mp,sevennet,orb_v2,chgnet,mattersim --datapath ../data/neb_end_p.xyz --repro mlipx compare --glob "*NEBs" ``` diff --git a/examples/neb/dvc.lock b/examples/neb/dvc.lock index 6f2037e..285d91d 100644 --- a/examples/neb/dvc.lock +++ b/examples/neb/dvc.lock @@ -451,3 +451,40 @@ stages: hash: md5 md5: 876aa90353f568e270639083ecc8368d size: 241 + mattersim_NEBs: + cmd: zntrack run mlipx.nodes.nebs.NEBs --name mattersim_NEBs + deps: + - path: nodes/initialize/NEBinterpolate/initial_frames.xyz + hash: md5 + md5: 996f25f229bef36ad93f486d4e662126 + size: 46938 + params: + params.yaml: + mattersim_NEBs: + fmax: 0.05 + model: + _cls: mlipx.nodes.generic_ase.GenericASECalculator + class_name: MatterSimCalculator + device: auto + kwargs: + module: mattersim.forcefield + n_steps: 500 + optimizer: FIRE + relax: true + outs: + - path: nodes/mattersim/NEBs/frames.xyz + hash: md5 + md5: 55e2218c1cf0a4ce9f9034dd0b04e2e2 + size: 64171 + - path: nodes/mattersim/NEBs/neb_trajectory.traj + hash: md5 + md5: 55bef32e451b9524213e243c37153e63 + size: 10660040 + - path: nodes/mattersim/NEBs/node-meta.json + hash: md5 + md5: 68964251396e3068d2c51182c1027e2b + size: 64 + - path: nodes/mattersim/NEBs/results.csv + hash: md5 + md5: 15f9cfb1007a6f47e986f4a2c7c95ab1 + size: 163 diff --git a/examples/neb/dvc.yaml b/examples/neb/dvc.yaml index f4bfd64..6932e62 100644 --- a/examples/neb/dvc.yaml +++ b/examples/neb/dvc.yaml @@ -19,6 +19,11 @@ plots: nodes/chgnet/NEBs/results.csv: data_id y: nodes/chgnet/NEBs/results.csv: potential_energy +- mattersim_NEBs_results: + x: + nodes/mattersim/NEBs/results.csv: data_id + y: + nodes/mattersim/NEBs/results.csv: potential_energy stages: chgnet_NEBs: cmd: zntrack run mlipx.nodes.nebs.NEBs --name chgnet_NEBs @@ -66,6 +71,19 @@ stages: - nodes/mace_mp/NEBs/results.csv params: - mace_mp_NEBs + mattersim_NEBs: + cmd: zntrack run mlipx.nodes.nebs.NEBs --name mattersim_NEBs + deps: + - nodes/initialize/NEBinterpolate/initial_frames.xyz + metrics: + - nodes/mattersim/NEBs/node-meta.json: + cache: false + outs: + - nodes/mattersim/NEBs/frames.xyz + - nodes/mattersim/NEBs/neb_trajectory.traj + - nodes/mattersim/NEBs/results.csv + params: + - mattersim_NEBs orb_v2_NEBs: cmd: zntrack run mlipx.nodes.nebs.NEBs --name orb_v2_NEBs deps: diff --git a/examples/neb/models.py b/examples/neb/models.py index d9a0c0a..b4af4f0 100644 --- a/examples/neb/models.py +++ b/examples/neb/models.py @@ -57,6 +57,14 @@ def get_calculator(self, **kwargs): ) +# https://github.com/CederGroupHub/chgnet +MODELS["mattersim"] = mlipx.GenericASECalculator( + module="mattersim.forcefield", + class_name="MatterSimCalculator", + device="auto", +) + + # OPTIONAL # ======== # If you have custom property names you can use the UpdatedFramesCalc diff --git a/examples/neb/nodes/mattersim/NEBs/.gitignore b/examples/neb/nodes/mattersim/NEBs/.gitignore new file mode 100644 index 0000000..b9f85ef --- /dev/null +++ b/examples/neb/nodes/mattersim/NEBs/.gitignore @@ -0,0 +1,3 @@ +/frames.xyz +/neb_trajectory.traj +/results.csv diff --git a/examples/neb/nodes/mattersim/NEBs/node-meta.json b/examples/neb/nodes/mattersim/NEBs/node-meta.json new file mode 100644 index 0000000..60f1e64 --- /dev/null +++ b/examples/neb/nodes/mattersim/NEBs/node-meta.json @@ -0,0 +1 @@ +{"uuid": "29e683f1-8b71-404f-bd4a-7ebbba644f86", "run_count": 1} \ No newline at end of file diff --git a/examples/neb/params.yaml b/examples/neb/params.yaml index 772a719..c5ce873 100644 --- a/examples/neb/params.yaml +++ b/examples/neb/params.yaml @@ -29,6 +29,17 @@ mace_mp_NEBs: n_steps: 500 optimizer: FIRE relax: true +mattersim_NEBs: + fmax: 0.05 + model: + _cls: mlipx.nodes.generic_ase.GenericASECalculator + class_name: MatterSimCalculator + device: auto + kwargs: null + module: mattersim.forcefield + n_steps: 500 + optimizer: FIRE + relax: true orb_v2_NEBs: fmax: 0.05 model: diff --git a/examples/neb/zntrack.json b/examples/neb/zntrack.json index 79814ce..8d91111 100644 --- a/examples/neb/zntrack.json +++ b/examples/neb/zntrack.json @@ -184,5 +184,43 @@ "_type": "pathlib.Path", "value": "$nwd$/neb_trajectory.traj" } + }, + "mattersim_NEBs": { + "nwd": { + "_type": "pathlib.Path", + "value": "nodes/mattersim/NEBs" + }, + "data": { + "_type": "znflow.Connection", + "value": { + "instance": { + "_type": "zntrack.Node", + "value": { + "module": "mlipx.nodes.nebs", + "name": "initialize_NEBinterpolate", + "cls": "NEBinterpolate", + "remote": null, + "rev": null + } + }, + "attribute": "frames", + "item": null + } + }, + "model": { + "_type": "@dataclasses.dataclass", + "value": { + "module": "mlipx.nodes.generic_ase", + "cls": "GenericASECalculator" + } + }, + "frames_path": { + "_type": "pathlib.Path", + "value": "$nwd$/frames.xyz" + }, + "trajectory_path": { + "_type": "pathlib.Path", + "value": "$nwd$/neb_trajectory.traj" + } } } \ No newline at end of file diff --git a/examples/phase_diagram/README.md b/examples/phase_diagram/README.md index e1f9d97..71f7340 100644 --- a/examples/phase_diagram/README.md +++ b/examples/phase_diagram/README.md @@ -1,4 +1,4 @@ ```bash -mlipx recipes phase-diagram --models mace_mp,sevennet,orb_v2,chgnet --material-ids=mp-30084 --repro +mlipx recipes phase-diagram --models mace_mp,sevennet,orb_v2,chgnet,mattersim --material-ids=mp-30084 --repro mlipx compare --glob "*PhaseDiagram" ``` diff --git a/examples/phase_diagram/models.py b/examples/phase_diagram/models.py index 69edc78..b4af4f0 100644 --- a/examples/phase_diagram/models.py +++ b/examples/phase_diagram/models.py @@ -56,6 +56,7 @@ def get_calculator(self, **kwargs): class_name="CHGNetCalculator", ) + # https://github.com/CederGroupHub/chgnet MODELS["mattersim"] = mlipx.GenericASECalculator( module="mattersim.forcefield", diff --git a/examples/pourbaix_diagram/README.md b/examples/pourbaix_diagram/README.md index 09aef67..b33e574 100644 --- a/examples/pourbaix_diagram/README.md +++ b/examples/pourbaix_diagram/README.md @@ -1,4 +1,4 @@ ```bash -mlipx recipes pourbaix-diagram --models mace_mp,sevennet,orb_v2,chgnet --material-ids=mp-1143 --repro +mlipx recipes pourbaix-diagram --models mace_mp,sevennet,orb_v2,chgnet,mattersim --material-ids=mp-1143 --repro mlipx compare --glob "*PourbaixDiagram" ``` diff --git a/examples/pourbaix_diagram/dvc.lock b/examples/pourbaix_diagram/dvc.lock index 1d8610d..32a6c57 100644 --- a/examples/pourbaix_diagram/dvc.lock +++ b/examples/pourbaix_diagram/dvc.lock @@ -493,3 +493,42 @@ stages: hash: md5 md5: 6bf1cb423234b96f9c803f9eae8c0519 size: 99 + mattersim_0_PourbaixDiagram: + cmd: zntrack run mlipx.nodes.pourbaix_diagram.PourbaixDiagram --name mattersim_0_PourbaixDiagram + deps: + - path: nodes/initialize/MPRester/frames.xyz + hash: md5 + md5: b2aa0fb43e0b26ef88bedc082a0a2325 + size: 866 + params: + params.yaml: + mattersim_0_PourbaixDiagram: + V: 1.8 + data_ids: + fmax: 0.05 + geo_opt: false + model: + _cls: mlipx.nodes.generic_ase.GenericASECalculator + class_name: MatterSimCalculator + device: auto + kwargs: + module: mattersim.forcefield + pH: 1.0 + use_gibbs: false + outs: + - path: nodes/mattersim/0/PourbaixDiagram/frames.xyz + hash: md5 + md5: 1169a9cec040363a981068961f32a688 + size: 1655 + - path: nodes/mattersim/0/PourbaixDiagram/node-meta.json + hash: md5 + md5: 82895f3f096fc9390b33518f4c35f3cc + size: 64 + - path: nodes/mattersim/0/PourbaixDiagram/pourbaix_diagram.json + hash: md5 + md5: 5fdfeef6c52abee16982757c6d737ff5 + size: 49599 + - path: nodes/mattersim/0/PourbaixDiagram/results.csv + hash: md5 + md5: 5c090275907a414db3b8fc0a65301073 + size: 89 diff --git a/examples/pourbaix_diagram/dvc.yaml b/examples/pourbaix_diagram/dvc.yaml index 3ae02a1..6a880ac 100644 --- a/examples/pourbaix_diagram/dvc.yaml +++ b/examples/pourbaix_diagram/dvc.yaml @@ -19,6 +19,11 @@ plots: nodes/chgnet/0/PourbaixDiagram/results.csv: data_id y: nodes/chgnet/0/PourbaixDiagram/results.csv: pourbaix_decomposition_energy +- mattersim_0_PourbaixDiagram_results: + x: + nodes/mattersim/0/PourbaixDiagram/results.csv: data_id + y: + nodes/mattersim/0/PourbaixDiagram/results.csv: pourbaix_decomposition_energy stages: chgnet_0_PourbaixDiagram: cmd: zntrack run mlipx.nodes.pourbaix_diagram.PourbaixDiagram --name chgnet_0_PourbaixDiagram @@ -55,6 +60,19 @@ stages: - nodes/mace_mp/0/PourbaixDiagram/results.csv params: - mace_mp_0_PourbaixDiagram + mattersim_0_PourbaixDiagram: + cmd: zntrack run mlipx.nodes.pourbaix_diagram.PourbaixDiagram --name mattersim_0_PourbaixDiagram + deps: + - nodes/initialize/MPRester/frames.xyz + metrics: + - nodes/mattersim/0/PourbaixDiagram/node-meta.json: + cache: false + outs: + - nodes/mattersim/0/PourbaixDiagram/frames.xyz + - nodes/mattersim/0/PourbaixDiagram/pourbaix_diagram.json + - nodes/mattersim/0/PourbaixDiagram/results.csv + params: + - mattersim_0_PourbaixDiagram orb_v2_0_PourbaixDiagram: cmd: zntrack run mlipx.nodes.pourbaix_diagram.PourbaixDiagram --name orb_v2_0_PourbaixDiagram deps: diff --git a/examples/pourbaix_diagram/models.py b/examples/pourbaix_diagram/models.py index d9a0c0a..b4af4f0 100644 --- a/examples/pourbaix_diagram/models.py +++ b/examples/pourbaix_diagram/models.py @@ -57,6 +57,14 @@ def get_calculator(self, **kwargs): ) +# https://github.com/CederGroupHub/chgnet +MODELS["mattersim"] = mlipx.GenericASECalculator( + module="mattersim.forcefield", + class_name="MatterSimCalculator", + device="auto", +) + + # OPTIONAL # ======== # If you have custom property names you can use the UpdatedFramesCalc diff --git a/examples/pourbaix_diagram/nodes/mattersim/0/PourbaixDiagram/.gitignore b/examples/pourbaix_diagram/nodes/mattersim/0/PourbaixDiagram/.gitignore new file mode 100644 index 0000000..a94aceb --- /dev/null +++ b/examples/pourbaix_diagram/nodes/mattersim/0/PourbaixDiagram/.gitignore @@ -0,0 +1,3 @@ +/frames.xyz +/pourbaix_diagram.json +/results.csv diff --git a/examples/pourbaix_diagram/nodes/mattersim/0/PourbaixDiagram/node-meta.json b/examples/pourbaix_diagram/nodes/mattersim/0/PourbaixDiagram/node-meta.json new file mode 100644 index 0000000..0cbb085 --- /dev/null +++ b/examples/pourbaix_diagram/nodes/mattersim/0/PourbaixDiagram/node-meta.json @@ -0,0 +1 @@ +{"uuid": "ce00a11f-eda2-4fe2-8652-d1c88c5de338", "run_count": 1} \ No newline at end of file diff --git a/examples/pourbaix_diagram/params.yaml b/examples/pourbaix_diagram/params.yaml index 5c6cf7a..4c380d0 100644 --- a/examples/pourbaix_diagram/params.yaml +++ b/examples/pourbaix_diagram/params.yaml @@ -29,6 +29,19 @@ mace_mp_0_PourbaixDiagram: module: mace.calculators pH: 1.0 use_gibbs: false +mattersim_0_PourbaixDiagram: + V: 1.8 + data_ids: null + fmax: 0.05 + geo_opt: false + model: + _cls: mlipx.nodes.generic_ase.GenericASECalculator + class_name: MatterSimCalculator + device: auto + kwargs: null + module: mattersim.forcefield + pH: 1.0 + use_gibbs: false orb_v2_0_PourbaixDiagram: V: 1.8 data_ids: null diff --git a/examples/pourbaix_diagram/zntrack.json b/examples/pourbaix_diagram/zntrack.json index c74b6c4..1d05911 100644 --- a/examples/pourbaix_diagram/zntrack.json +++ b/examples/pourbaix_diagram/zntrack.json @@ -144,5 +144,39 @@ "_type": "pathlib.Path", "value": "$nwd$/frames.xyz" } + }, + "mattersim_0_PourbaixDiagram": { + "nwd": { + "_type": "pathlib.Path", + "value": "nodes/mattersim/0/PourbaixDiagram" + }, + "model": { + "_type": "@dataclasses.dataclass", + "value": { + "module": "mlipx.nodes.generic_ase", + "cls": "GenericASECalculator" + } + }, + "data": { + "_type": "znflow.Connection", + "value": { + "instance": { + "_type": "zntrack.Node", + "value": { + "module": "mlipx.nodes.mp_api", + "name": "initialize_MPRester", + "cls": "MPRester", + "remote": null, + "rev": null + } + }, + "attribute": "frames", + "item": null + } + }, + "frames_path": { + "_type": "pathlib.Path", + "value": "$nwd$/frames.xyz" + } } } \ No newline at end of file diff --git a/examples/relax/README.md b/examples/relax/README.md index dd822c9..c7e5c0f 100644 --- a/examples/relax/README.md +++ b/examples/relax/README.md @@ -1,4 +1,4 @@ ```bash -mlipx recipes relax --models mace_mp,sevennet,orb_v2,chgnet --material-ids=mp-1143 --repro +mlipx recipes relax --models mace_mp,sevennet,orb_v2,chgnet,mattersim --material-ids=mp-1143 --repro mlipx compare --glob "*StructureOptimization" ``` diff --git a/examples/relax/dvc.lock b/examples/relax/dvc.lock index 9e4363e..448ac0d 100644 --- a/examples/relax/dvc.lock +++ b/examples/relax/dvc.lock @@ -732,3 +732,37 @@ stages: hash: md5 md5: 976e34601d5dc7794c6ba62f59a7df1a size: 332 + mattersim_0_StructureOptimization: + cmd: zntrack run mlipx.nodes.structure_optimization.StructureOptimization --name + mattersim_0_StructureOptimization + deps: + - path: nodes/initialize/Rattle/frames.xyz + hash: md5 + md5: 873b4763989a868506e5178487bcfb75 + size: 866 + params: + params.yaml: + mattersim_0_StructureOptimization: + data_id: -1 + fmax: 0.1 + model: + _cls: mlipx.nodes.generic_ase.GenericASECalculator + class_name: MatterSimCalculator + device: auto + kwargs: + module: mattersim.forcefield + optimizer: LBFGS + steps: 100000000 + outs: + - path: nodes/mattersim/0/StructureOptimization/frames.traj + hash: md5 + md5: 9014e0fc0409ffbf453e8404000087bc + size: 9622 + - path: nodes/mattersim/0/StructureOptimization/node-meta.json + hash: md5 + md5: 0142fbddff71276fcbd365f7ab14b6e8 + size: 64 + - path: nodes/mattersim/0/StructureOptimization/plots.csv + hash: md5 + md5: caa3d79a9427c22355ced14ea04e1ba0 + size: 220 diff --git a/examples/relax/dvc.yaml b/examples/relax/dvc.yaml index e0a4a8d..29c231d 100644 --- a/examples/relax/dvc.yaml +++ b/examples/relax/dvc.yaml @@ -39,6 +39,16 @@ plots: nodes/chgnet/0/StructureOptimization/plots.csv: step y: nodes/chgnet/0/StructureOptimization/plots.csv: fmax +- mattersim_0_StructureOptimization_plots_0: + x: + nodes/mattersim/0/StructureOptimization/plots.csv: step + y: + nodes/mattersim/0/StructureOptimization/plots.csv: energy +- mattersim_0_StructureOptimization_plots_1: + x: + nodes/mattersim/0/StructureOptimization/plots.csv: step + y: + nodes/mattersim/0/StructureOptimization/plots.csv: fmax stages: chgnet_0_StructureOptimization: cmd: zntrack run mlipx.nodes.structure_optimization.StructureOptimization --name @@ -86,6 +96,19 @@ stages: - nodes/mace_mp/0/StructureOptimization/plots.csv params: - mace_mp_0_StructureOptimization + mattersim_0_StructureOptimization: + cmd: zntrack run mlipx.nodes.structure_optimization.StructureOptimization --name + mattersim_0_StructureOptimization + deps: + - nodes/initialize/Rattle/frames.xyz + metrics: + - nodes/mattersim/0/StructureOptimization/node-meta.json: + cache: false + outs: + - nodes/mattersim/0/StructureOptimization/frames.traj + - nodes/mattersim/0/StructureOptimization/plots.csv + params: + - mattersim_0_StructureOptimization orb_v2_0_StructureOptimization: cmd: zntrack run mlipx.nodes.structure_optimization.StructureOptimization --name orb_v2_0_StructureOptimization diff --git a/examples/relax/models.py b/examples/relax/models.py index d9a0c0a..b4af4f0 100644 --- a/examples/relax/models.py +++ b/examples/relax/models.py @@ -57,6 +57,14 @@ def get_calculator(self, **kwargs): ) +# https://github.com/CederGroupHub/chgnet +MODELS["mattersim"] = mlipx.GenericASECalculator( + module="mattersim.forcefield", + class_name="MatterSimCalculator", + device="auto", +) + + # OPTIONAL # ======== # If you have custom property names you can use the UpdatedFramesCalc diff --git a/examples/relax/nodes/mattersim/0/StructureOptimization/.gitignore b/examples/relax/nodes/mattersim/0/StructureOptimization/.gitignore new file mode 100644 index 0000000..f3228a0 --- /dev/null +++ b/examples/relax/nodes/mattersim/0/StructureOptimization/.gitignore @@ -0,0 +1,2 @@ +/frames.traj +/plots.csv diff --git a/examples/relax/nodes/mattersim/0/StructureOptimization/node-meta.json b/examples/relax/nodes/mattersim/0/StructureOptimization/node-meta.json new file mode 100644 index 0000000..fe74abf --- /dev/null +++ b/examples/relax/nodes/mattersim/0/StructureOptimization/node-meta.json @@ -0,0 +1 @@ +{"uuid": "a3e707fd-1ef1-499a-bea2-e32dfcc56777", "run_count": 1} \ No newline at end of file diff --git a/examples/relax/params.yaml b/examples/relax/params.yaml index 8fd3ffa..c5ba7a1 100644 --- a/examples/relax/params.yaml +++ b/examples/relax/params.yaml @@ -28,6 +28,17 @@ mace_mp_0_StructureOptimization: module: mace.calculators optimizer: LBFGS steps: 100000000 +mattersim_0_StructureOptimization: + data_id: -1 + fmax: 0.1 + model: + _cls: mlipx.nodes.generic_ase.GenericASECalculator + class_name: MatterSimCalculator + device: auto + kwargs: null + module: mattersim.forcefield + optimizer: LBFGS + steps: 100000000 orb_v2_0_StructureOptimization: data_id: -1 fmax: 0.1 diff --git a/examples/relax/zntrack.json b/examples/relax/zntrack.json index 910c485..309b4d6 100644 --- a/examples/relax/zntrack.json +++ b/examples/relax/zntrack.json @@ -171,5 +171,39 @@ "_type": "pathlib.Path", "value": "$nwd$/frames.traj" } + }, + "mattersim_0_StructureOptimization": { + "nwd": { + "_type": "pathlib.Path", + "value": "nodes/mattersim/0/StructureOptimization" + }, + "data": { + "_type": "znflow.Connection", + "value": { + "instance": { + "_type": "zntrack.Node", + "value": { + "module": "mlipx.nodes.rattle", + "name": "initialize_Rattle", + "cls": "Rattle", + "remote": null, + "rev": null + } + }, + "attribute": "frames", + "item": null + } + }, + "model": { + "_type": "@dataclasses.dataclass", + "value": { + "module": "mlipx.nodes.generic_ase", + "cls": "GenericASECalculator" + } + }, + "frames_path": { + "_type": "pathlib.Path", + "value": "$nwd$/frames.traj" + } } } \ No newline at end of file diff --git a/examples/vibrational_analysis/README.md b/examples/vibrational_analysis/README.md index ae3f69d..3fde786 100644 --- a/examples/vibrational_analysis/README.md +++ b/examples/vibrational_analysis/README.md @@ -1,5 +1,5 @@ ```bash -mlipx recipes vibrational-analysis --models mace_mp,sevennet,orb_v2 --smiles=CO,CCO,CCCO,CCCCO +mlipx recipes vibrational-analysis --models mace_mp,sevennet,orb_v2,mattersim --smiles=CO,CCO,CCCO,CCCCO vim main.py # set system="molecule" python main.py dvc repro diff --git a/examples/vibrational_analysis/dvc.lock b/examples/vibrational_analysis/dvc.lock index 090a7fc..c155221 100644 --- a/examples/vibrational_analysis/dvc.lock +++ b/examples/vibrational_analysis/dvc.lock @@ -526,3 +526,65 @@ stages: md5: 2efa19253eb1753873361eed731b4d08.dir size: 394307 nfiles: 508 + mattersim_VibrationalAnalysis: + cmd: zntrack run mlipx.nodes.vibrational_analysis.VibrationalAnalysis --name mattersim_VibrationalAnalysis + deps: + - path: nodes/initialize/Smiles2Conformers/frames.xyz + hash: md5 + md5: 8aaaf93d21613c36e976fb04fc5dbd58 + size: 369 + - path: nodes/initialize/Smiles2Conformers_1/frames.xyz + hash: md5 + md5: f2aa9aaa4c216155e3cbbf82fdbe2f53 + size: 531 + - path: nodes/initialize/Smiles2Conformers_2/frames.xyz + hash: md5 + md5: a76929bb06b25f306ced9d308a3aba20 + size: 694 + - path: nodes/initialize/Smiles2Conformers_3/frames.xyz + hash: md5 + md5: 915327424112f9b99cb5971c59b20842 + size: 856 + params: + params.yaml: + mattersim_VibrationalAnalysis: + calc_type: + displacement: 0.015 + free_indices: + lower_freq_threshold: 12 + model: + _cls: mlipx.nodes.generic_ase.GenericASECalculator + class_name: MatterSimCalculator + device: auto + kwargs: + module: mattersim.forcefield + nfree: 4 + system: molecule + temperature: 298.15 + outs: + - path: nodes/mattersim/VibrationalAnalysis/frames.xyz + hash: md5 + md5: e3ca9cce4a8de2713d486c1a8d03b4d5 + size: 7006 + - path: nodes/mattersim/VibrationalAnalysis/modes + hash: md5 + md5: c56a2a9985472f9205bab5d55f5dd889.dir + size: 2512062 + nfiles: 126 + - path: nodes/mattersim/VibrationalAnalysis/modes.xyz + hash: md5 + md5: be6dfebc62ddad00f63f17449c997705 + size: 2534490 + - path: nodes/mattersim/VibrationalAnalysis/node-meta.json + hash: md5 + md5: 517e70a191de68dff8abea9d546a1f1c + size: 64 + - path: nodes/mattersim/VibrationalAnalysis/results.csv + hash: md5 + md5: 07e28ac51d3e6b3e5ecced93af4af017 + size: 101 + - path: nodes/mattersim/VibrationalAnalysis/vib + hash: md5 + md5: 62fc9e777dbbb6e00462944d51fd84ec.dir + size: 394158 + nfiles: 508 diff --git a/examples/vibrational_analysis/dvc.yaml b/examples/vibrational_analysis/dvc.yaml index bb437d8..637d9b8 100644 --- a/examples/vibrational_analysis/dvc.yaml +++ b/examples/vibrational_analysis/dvc.yaml @@ -14,6 +14,11 @@ plots: nodes/orb_v2/VibrationalAnalysis/results.csv: Frame y: nodes/orb_v2/VibrationalAnalysis/results.csv: ddG +- mattersim_VibrationalAnalysis_results: + x: + nodes/mattersim/VibrationalAnalysis/results.csv: Frame + y: + nodes/mattersim/VibrationalAnalysis/results.csv: ddG stages: initialize_Smiles2Conformers: cmd: zntrack run mlipx.nodes.smiles.Smiles2Conformers --name initialize_Smiles2Conformers @@ -69,6 +74,24 @@ stages: - nodes/mace_mp/VibrationalAnalysis/vib params: - mace_mp_VibrationalAnalysis + mattersim_VibrationalAnalysis: + cmd: zntrack run mlipx.nodes.vibrational_analysis.VibrationalAnalysis --name mattersim_VibrationalAnalysis + deps: + - nodes/initialize/Smiles2Conformers/frames.xyz + - nodes/initialize/Smiles2Conformers_1/frames.xyz + - nodes/initialize/Smiles2Conformers_2/frames.xyz + - nodes/initialize/Smiles2Conformers_3/frames.xyz + metrics: + - nodes/mattersim/VibrationalAnalysis/node-meta.json: + cache: false + outs: + - nodes/mattersim/VibrationalAnalysis/frames.xyz + - nodes/mattersim/VibrationalAnalysis/modes + - nodes/mattersim/VibrationalAnalysis/modes.xyz + - nodes/mattersim/VibrationalAnalysis/results.csv + - nodes/mattersim/VibrationalAnalysis/vib + params: + - mattersim_VibrationalAnalysis orb_v2_VibrationalAnalysis: cmd: zntrack run mlipx.nodes.vibrational_analysis.VibrationalAnalysis --name orb_v2_VibrationalAnalysis deps: diff --git a/examples/vibrational_analysis/models.py b/examples/vibrational_analysis/models.py index ea6b419..5a9e697 100644 --- a/examples/vibrational_analysis/models.py +++ b/examples/vibrational_analysis/models.py @@ -50,6 +50,14 @@ def get_calculator(self, **kwargs): MODELS["orb_v2"] = OrbCalc(name="orb_v2", device="auto") +# https://github.com/CederGroupHub/chgnet +MODELS["mattersim"] = mlipx.GenericASECalculator( + module="mattersim.forcefield", + class_name="MatterSimCalculator", + device="auto", +) + + # OPTIONAL # ======== # If you have custom property names you can use the UpdatedFramesCalc diff --git a/examples/vibrational_analysis/nodes/mattersim/VibrationalAnalysis/.gitignore b/examples/vibrational_analysis/nodes/mattersim/VibrationalAnalysis/.gitignore new file mode 100644 index 0000000..42de97c --- /dev/null +++ b/examples/vibrational_analysis/nodes/mattersim/VibrationalAnalysis/.gitignore @@ -0,0 +1,5 @@ +/frames.xyz +/modes +/modes.xyz +/results.csv +/vib diff --git a/examples/vibrational_analysis/nodes/mattersim/VibrationalAnalysis/node-meta.json b/examples/vibrational_analysis/nodes/mattersim/VibrationalAnalysis/node-meta.json new file mode 100644 index 0000000..905d079 --- /dev/null +++ b/examples/vibrational_analysis/nodes/mattersim/VibrationalAnalysis/node-meta.json @@ -0,0 +1 @@ +{"uuid": "b4f979dd-5a64-46a1-88a1-2ea0ea1dca72", "run_count": 1} \ No newline at end of file diff --git a/examples/vibrational_analysis/params.yaml b/examples/vibrational_analysis/params.yaml index e15c10b..258fc9d 100644 --- a/examples/vibrational_analysis/params.yaml +++ b/examples/vibrational_analysis/params.yaml @@ -33,6 +33,20 @@ mace_mp_VibrationalAnalysis: nfree: 4 system: molecule temperature: 298.15 +mattersim_VibrationalAnalysis: + calc_type: null + displacement: 0.015 + free_indices: null + lower_freq_threshold: 12 + model: + _cls: mlipx.nodes.generic_ase.GenericASECalculator + class_name: MatterSimCalculator + device: auto + kwargs: null + module: mattersim.forcefield + nfree: 4 + system: molecule + temperature: 298.15 orb_v2_VibrationalAnalysis: calc_type: null displacement: 0.015 diff --git a/examples/vibrational_analysis/zntrack.json b/examples/vibrational_analysis/zntrack.json index 9fd9924..52c9fe9 100644 --- a/examples/vibrational_analysis/zntrack.json +++ b/examples/vibrational_analysis/zntrack.json @@ -353,5 +353,110 @@ "_type": "pathlib.Path", "value": "$nwd$/vib" } + }, + "mattersim_VibrationalAnalysis": { + "nwd": { + "_type": "pathlib.Path", + "value": "nodes/mattersim/VibrationalAnalysis" + }, + "data": { + "_type": "znflow.CombinedConnections", + "value": { + "connections": [ + { + "_type": "znflow.Connection", + "value": { + "instance": { + "_type": "zntrack.Node", + "value": { + "module": "mlipx.nodes.smiles", + "name": "initialize_Smiles2Conformers", + "cls": "Smiles2Conformers", + "remote": null, + "rev": null + } + }, + "attribute": "frames", + "item": null + } + }, + { + "_type": "znflow.Connection", + "value": { + "instance": { + "_type": "zntrack.Node", + "value": { + "module": "mlipx.nodes.smiles", + "name": "initialize_Smiles2Conformers_1", + "cls": "Smiles2Conformers", + "remote": null, + "rev": null + } + }, + "attribute": "frames", + "item": null + } + }, + { + "_type": "znflow.Connection", + "value": { + "instance": { + "_type": "zntrack.Node", + "value": { + "module": "mlipx.nodes.smiles", + "name": "initialize_Smiles2Conformers_2", + "cls": "Smiles2Conformers", + "remote": null, + "rev": null + } + }, + "attribute": "frames", + "item": null + } + }, + { + "_type": "znflow.Connection", + "value": { + "instance": { + "_type": "zntrack.Node", + "value": { + "module": "mlipx.nodes.smiles", + "name": "initialize_Smiles2Conformers_3", + "cls": "Smiles2Conformers", + "remote": null, + "rev": null + } + }, + "attribute": "frames", + "item": null + } + } + ], + "item": null + } + }, + "model": { + "_type": "@dataclasses.dataclass", + "value": { + "module": "mlipx.nodes.generic_ase", + "cls": "GenericASECalculator" + } + }, + "frames_path": { + "_type": "pathlib.Path", + "value": "$nwd$/frames.xyz" + }, + "modes_path": { + "_type": "pathlib.Path", + "value": "$nwd$/modes.xyz" + }, + "modes_cache": { + "_type": "pathlib.Path", + "value": "$nwd$/modes" + }, + "vib_cache": { + "_type": "pathlib.Path", + "value": "$nwd$/vib" + } } } \ No newline at end of file diff --git a/mlipx/nodes/invariances.py b/mlipx/nodes/invariances.py index bb6fbef..4337b42 100644 --- a/mlipx/nodes/invariances.py +++ b/mlipx/nodes/invariances.py @@ -40,8 +40,8 @@ def run(self): self.plots = pd.DataFrame(energies, columns=["energy"]) self.metrics = { - "mean": np.mean(energies), - "std": np.std(energies), + "mean": float(np.mean(energies)), + "std": float(np.std(energies)), } @property diff --git a/mlipx/recipes/models.py.jinja2 b/mlipx/recipes/models.py.jinja2 index 249f5a1..660d962 100644 --- a/mlipx/recipes/models.py.jinja2 +++ b/mlipx/recipes/models.py.jinja2 @@ -55,6 +55,13 @@ MODELS["chgnet"] = mlipx.GenericASECalculator( module="chgnet.model", class_name="CHGNetCalculator", ) +{% elif model == "mattersim" %} +# https://github.com/CederGroupHub/chgnet +MODELS["mattersim"] = mlipx.GenericASECalculator( + module="mattersim.forcefield", + class_name="MatterSimCalculator", + device="auto", +) {% endif %} {% endfor %}