Skip to content

Commit d999af7

Browse files
authored
Fix: correct the unit conversion between Plumed and ASE in example (#6993)
1 parent 8a2b8be commit d999af7

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

interfaces/ASE_interface/examples/metadynamics.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,12 @@
4747
from ase.io import read
4848
from ase.md import Bussi
4949
from ase.md.velocitydistribution import MaxwellBoltzmannDistribution
50-
from ase.units import fs
50+
from ase.units import (
51+
fs,
52+
kJ as _kJ,
53+
mol as _mol,
54+
)
55+
_ps = 1000 * fs
5156
from ase.constraints import FixCartesian
5257
from ase.calculators.plumed import Plumed
5358
from abacuslite import AbacusProfile, Abacus
@@ -109,7 +114,7 @@
109114
MaxwellBoltzmannDistribution(atoms, temperature_K=300)
110115

111116
setup = [# define the unit within the PLUMED runtime
112-
'UNITS LENGTH=A TIME=fs ENERGY=eV',
117+
f'UNITS LENGTH=A TIME={1/_ps} ENERGY={_mol/_kJ}',
113118
# define the two bond lengths
114119
'd1: DISTANCE ATOMS=1,5',
115120
'd2: DISTANCE ATOMS=1,6',

0 commit comments

Comments
 (0)