Relax a Material with MACE¶
1. Introduction¶
Relax the atomic positions of a material with the Atomic Simulation Environment (ASE) and a MACE machine-learned force field (MLFF) foundation model. The relaxation runs in the notebook itself and submits no job; the notebook logs in to load the material from the account and to save the relaxed structure to it.
2. Open the notebook¶
In JupyterLite, the notebook is made/workflows/local/relaxation_mlff_mace.ipynb, entry 3.2.1 "Pre-relaxation with MLFF (MACE)" of made/workflows/Introduction.ipynb.
3. Set the parameters¶
Cell 1.2 holds the account and material parameters:
1 2 3 4 5 6 7 | |
FOLDER is ../../uploads, since the notebook is in the local subfolder. MATERIAL_NAME is looked up in FOLDER, then among the account's materials by its exact name. RELAXED_MATERIAL_NAME is the name of the relaxed material. ORGANIZATION_NAME selects the account.
Cell 1.3 holds the relaxation and model parameters:
1 2 3 4 5 6 7 8 9 | |
FMAX is the maximum force on any atom, in eV/Å, at which the relaxation stops. MACE_MODEL_FAMILY is "MACE-MP-0" for crystals and surfaces or "MACE-OFF23" for molecules, and MACE_MODEL its size. MACE_DISPERSION adds the D3 dispersion correction, and MACE_DEFAULT_DTYPE sets the floating-point precision. The overview explains the model parameters.
4. Run and read the result¶
Run the notebook with Run > Run All and log in when it asks, as in Authentication in JupyterLite.
Section 4 relaxes the structure with the BFGS optimizer of ASE, plots the energy at each step and prints the final energy. Section 5 shows the structure before and after the relaxation, and section 6 writes the relaxed material to FOLDER with set_materials and saves it to the account.
5. Interactive JupyterLite notebook¶
The interactive JupyterLite notebook for relaxing a structure with MACE can be accessed below.
6. Related¶
Perform Structural Relaxation runs a Density Functional Theory relaxation from the web interface.