Examples¶
Before running these examples, you need to install the appropriate backends.
See also the Python example for M3GNet.
AIMNet2¶
#!/bin/sh
export NSCM=1
"$AMSBIN/ams" --delete-old-results << eor
Task SinglePoint
Properties
Gradients Yes
DipoleMoment Yes
Charges Yes
End
System
Atoms
C -3.1168071304396 -3.303815558265976 0.0
C -1.981697818585937 -4.344278296437102 -0.02375164458614451
H -2.786224865835057 -2.422406202569603 0.5293702995256127
H -3.978089852534168 -3.72201295092763 0.4997029251388921
H -3.382157359184612 -3.037352354271593 -1.012416227162533
H -1.120415096491369 -3.926080903775447 -0.5234545697250367
H -2.312280083190481 -5.225687652133474 -0.5531219441117571
H -1.716347589840925 -4.610741500431485 0.9886645825763885
End
Charge 0
End
Engine MLPotential
Model AIMNet2-B973c
EndEngine
eor
M3GNet-UP-2022¶
#!/bin/sh
export NSCM=1
"$AMSBIN/ams" <<EOF
Task SinglePoint
Properties
Gradients True
StressTensor Yes
End
System
Atoms
C 1.1705 0.2287 -0.3792
C 0.0000 -0.6414 0.0001
C -1.1706 0.2288 0.3792
O -2.2331 0.0875 -0.1770
O 2.2330 0.0876 0.1771
H 1.0604 0.9753 -1.1517
H -0.2743 -1.2708 -0.8464
H 0.2743 -1.2705 0.8469
H -1.0592 0.9787 1.1484
End
Lattice
7.0000 0.0000 0.0000
0.0000 7.0000 0.0000
0.0000 0.0000 7.0000
End
End
Engine MLPotential
Model M3GNET-UP-2022
EndEngine
EOF
MACE¶
#!/bin/sh
export NSCM=1
$AMSBIN/ams --delete-old-results << eor
Task GeometryOptimization
GeometryOptimization
OptimizeLattice Yes
End
System
Atoms
Ti 0.0 0.0 0.0
Ti 2.295 2.295 1.48
O 3.672 0.918 1.48
O 0.918 3.672 1.48
O 1.377 1.377 0.0
O -1.377 -1.377 0.0
End
Lattice
4.59 0.0 0.0
0.0 4.59 0.0
0.0 0.0 2.96
End
End
Engine MLPotential
Backend MACE
Model MACE-MPA-0
EndEngine
eor
#!/bin/sh
export NSCM=1
$AMSBIN/ams --delete-old-results <<EOF
Task SinglePoint
System
Atoms
Fe 1.668114040730352 0.1262520819109224 -0.2724347551151446
C 2.874773495523232 0.1245428246154846 1.415559348633178
C 2.864258443334903 0.1209340150334762 -1.968408033283078
C 2.045488061455903 -1.017035067242245 1.417327562237913
C 2.045319712526689 1.266012877626015 1.420696387814215
C 2.034996210818667 1.262513524978156 -1.970493441468708
C 2.03481947582235 -1.020501448939123 -1.962197066617627
C 0.7035387107772729 -0.5811263243586964 1.423538567180201
C 0.7034224460425285 0.8298589950221958 1.425623912376544
C 0.6930135800564622 0.8266219565708358 -1.965565890130913
C 0.6929106632695451 -0.5843873011438833 -1.960428837552032
H 3.953018521369533 0.1247117414887672 1.357511955640776
H 3.942916839876545 0.1210957019063513 -1.918153717773214
H 2.378591921119416 -2.042633565448724 1.360726469795222
H 2.378211455132701 2.291885187385673 1.368152852262757
H 2.368487649252263 2.288431948587419 -1.922729549563146
H 2.368164382464549 -2.046021823720774 -1.905595942151872
H -0.1692093008491947 -1.215015035830631 1.373284230500532
H -0.1693975768578689 1.463823066120819 1.377860052750967
H -0.1792940809531387 1.460901281003479 -1.913022353631542
H -0.1795070909127082 -1.218027215565519 -1.902381441905027
End
End
Engine MLPotential
Backend MACE
Model Custom
ParameterFile $AMSHOME/examples/MLPotential/MACE-Custom-MH-1/mace-mh-1.model
MACE
DataType float64
ModelHead OMOL
End
EndEngine
EOF
Note
The MACE-MH-1 model is licensed under ASL.
This means it can only be used free-of-charge in an academic (non-commercial) setting.
NequIP¶
#!/bin/sh
export NSCM=1
$AMSBIN/ams --delete-old-results <<EOF
Task SinglePoint
Properties
Gradients Yes
End
System
Atoms
O -1.239192986364078 0.7447630849670073 0.2053776714668624
C -0.4264399234121155 -0.3765076809707508 -0.005559613642175442
C 1.015520464999812 -0.00839542074865508 0.1578564463228227
O 1.445056954461275 0.3261487267553756 1.250054826420532
H -1.187895927300546 1.292145824840463 -0.6216000200358711
H -0.6908065725149979 -1.158618889736239 0.7362545961529634
H -0.5963066387066123 -0.7970408421468641 -1.022241368854639
H 1.680064628837262 -0.02249480296033578 -0.7001425378304952
End
End
Engine MLPotential
Backend NequIP
Model Custom
ParameterFile $AMSHOME/examples/MLPotential/NequIP-Custom/model.pth
MLEnergyUnit eV
MLDistanceUnit angstrom
EndEngine
EOF
UMA¶
#!/bin/sh
export NSCM=1
"$AMSBIN/ams" --delete-old-results << eor
Task GeometryOptimization
System
Atoms
O 0. 0. -0.6
H 0. 0. 0.6
End
Charge -1
End
Engine MLPotential
Model UMA-S-1.2-OMol
EndEngine
eor
#!/bin/sh
export NSCM=1
for unpaired_e in 0 2; do
AMS_JOBNAME=o2_unpaired_e_${unpaired_e} $AMSBIN/ams --delete-old-results -n 1 <<eor
Task GeometryOptimization
System
Atoms
O 0. 0. -0.6
O 0. 0. 0.6
End
End
Engine MLPotential
Model UMA-S-1.2-OMol
Unrestricted Yes
UnpairedElectrons ${unpaired_e}
EndEngine
eor
done