@@ -42,7 +42,7 @@ atoms.set_velocities( # it is generally a good idea to remove any net velocity
4242
4343# Load models
4444device= " cuda" if torch.cuda.is_available() else " cpu"
45- energy_model, flashmd_model = get_pretrained(" pet-omatpes" , time_step)
45+ energy_model, flashmd_model = get_pretrained(" pet-omatpes-v2 " , time_step)
4646
4747# Set the energy model (see below for more precise usage)
4848calculator = MetatomicCalculator(energy_model, device = device)
@@ -70,6 +70,11 @@ Other available integrators:
7070 from flashmd.ase.bussi import Bussi
7171```
7272
73+ Along with all FlashMD models, we also provide the potential energy model whose
74+ dynamics they are trained to reproduce. See this short [ guide] ( docs/energy.md ) on how to
75+ best use the energy models if you want to enforce exact energy conservation during
76+ FlashMD runs, run traditional MD with the energy model, and more.
77+
7378Common pitfalls
7479---------------
7580
@@ -78,52 +83,6 @@ above is good for metals. However,
7883- for most materials: try 32 fs (aggressive) or 16 fs (conservative)
7984- for aqueous and/or organic systems: try 16 fs (aggressive) or 8 fs (conservative)
8085
81-
82- Companion energy models and exact energy conservation
83- -----------------------------------------------------
84-
85- You might have noticed that `` get_pretrained() `` does not only return a FlashMD model,
86- but also an energy model, which is itself just a machine-learned interatomic potential.
87- This is the energy model that the FlashMD model was trained on. You might want to use it
88- if...
89-
90- ** Case 1** : you want to run FlashMD with exact energy conservation, available through the
91- integrator's (`` dyn `` above) parameter `` rescale_energy=True `` (this is enabled by
92- default only when targeting the NVE ensemble with `` VelocityVerlet `` ). In that case,
93- besides setting this flag, you should attach the energy calculator to the atoms before
94- running FlashMD, exactly as shown above (and below with the more precise
95- `` do_gradients_with_energy=False `` which will save you memory and computation):
96-
97- ```
98- from metatomic.torch.ase_calculator import MetatomicCalculator
99-
100- ... # setting up atoms
101- calculator = MetatomicCalculator(energy_model, device=device, do_gradients_with_energy=False)
102- atoms.calc = calculator
103- ... # running FlashMD
104- ```
105-
106- ** Case 2** : you want to compute energies after running FlashMD for your own analysis. In
107- this case, you can create the calculator just like in case 1, but possibly after running
108- FlashMD and/or in a different script.
109-
110- ** Case 3** : you found something interesting during a FlashMD run and you want to confirm it
111- with traditional MD. Then, you can just use ASE's MD modules as usual after attaching
112- the energy calculator:
113-
114- ```
115- from metatomic.torch.ase_calculator import MetatomicCalculator
116-
117- ... # setting up atoms
118- calculator = MetatomicCalculator(energy_model, device=device)
119- atoms.calc = calculator
120- ... # running MD
121- ```
122-
123- In general, the energy models are slower and have a larger memory footprint compared to
124- the FlashMD models. As summarized above, you should use ` do_gradients_with_energy=False `
125- to save computation and memory when you do not need forces.
126-
12786Using FlashMD in LAMMPS
12887-----------------------
12988
@@ -140,6 +99,12 @@ You can see
14099for usage examples. i-PI is our most mature interface, and the one that was used to
141100generate all our published results.
142101
102+ Models
103+ ------
104+
105+ See [ here] ( docs/models.md ) for the complete list of the models we provide. If you are
106+ new to FlashMD, we recommend starting with the `` pet-omatpes-v2 `` models.
107+
143108Disclaimer
144109----------
145110
0 commit comments