Skip to content

Commit

Permalink
fix defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
shinkle-lanl committed Oct 22, 2024
1 parent d9fe091 commit 77c8cfb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
5 changes: 4 additions & 1 deletion examples/molecular_dynamics.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@
"coordinates": "position",
},
device=device,
updater=VelocityVerlet(force_db_name="force"),
updater=VelocityVerlet(
force_db_name="force",
time_units = 1, # this will use the ASE default time unit
),
)

# Define species and cell Variables
Expand Down
12 changes: 6 additions & 6 deletions hippynn/molecular_dynamics/md.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,12 @@ def __init__(
in the HIPNN model output dictionary
:param force_units: model force units output (in terms of ase.units), defaults to eV/Ang
:param position_units: model position units output (in terms of ase.units), defaults to Ang
:param time_units: model time units output (in terms of ase.units), defaults to Ang/((amu/eV)**(1/2))
:param time_units: model time units output (in terms of ase.units), defaults to fs
"""
self.force_key = force_db_name
self.force_units = (force_units or ase.units.eV/ase.Ang)
self.force_units = (force_units or ase.units.eV/ase.units.Ang)
self.position_units = (position_units or ase.units.Ang)
self.time_units = (time_units or ase.units.Ang/((1/ase.units.eV)**(1/2)))
self.time_units = (time_units or ase.units.fs)

def pre_step(self, dt: float):
"""Updates to variables performed during each step of MD simulation before HIPNN model evaluation
Expand Down Expand Up @@ -265,7 +265,7 @@ def __init__(
:param frix: friction coefficient for Langevin algorithm
:param force_units: model force units output (in terms of ase.units), defaults to eV/Ang
:param position_units: model position units output (in terms of ase.units), defaults to Ang
:param time_units: model time units output (in terms of ase.units), defaults to Ang/((amu/eV)**(1/2))
:param time_units: model time units output (in terms of ase.units), defaults to fs
:param seed: used to set seed for reproducibility, defaults to None
mass of attached Variable must be in amu
Expand All @@ -275,9 +275,9 @@ def __init__(
self.temperature = temperature
self.frix = frix
self.kB = ase.units.kB
self.force_units = (force_units or ase.units.eV/ase.Ang)
self.force_units = (force_units or ase.units.eV/ase.units.Ang)
self.position_units = (position_units or ase.units.Ang)
self.time_units = (time_units or ase.units.Ang/((1/ase.units.eV)**(1/2)))
self.time_units = (time_units or ase.units.fs)

if seed is not None:
torch.manual_seed(seed)
Expand Down

0 comments on commit 77c8cfb

Please sign in to comment.