Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rare events simulations (PLUMED) #450

Open
ElliottKasoar opened this issue Feb 26, 2025 · 1 comment
Open

Add rare events simulations (PLUMED) #450

ElliottKasoar opened this issue Feb 26, 2025 · 1 comment
Labels
enhancement New/improved feature or request

Comments

@ElliottKasoar
Copy link
Member

https://wiki.fysik.dtu.dk/ase//ase/calculators/plumed.html

@ElliottKasoar ElliottKasoar added the enhancement New/improved feature or request label Feb 26, 2025
@alinelena
Copy link
Member

a simple poc is something like this

# -*- coding: utf-8 -*-
# Author; alin m elena, [email protected]
# Contribs;
# Date: 25-02-2025
# ©alin m elena, GPL v3 https://www.gnu.org/licenses/gpl-3.0.en.html
from ase import units
from ase.io import read

from janus_core.helpers.mlip_calculators import choose_calculator
from janus_core.calculations.md import NVT

from ase.calculators.plumed import Plumed


timestep = 0.001
steps = 1000
T = 300.0

arch = "mace_mp"
model = "small-0b2"
device = "cpu"

calc = choose_calculator(arch=arch,device=device,model_path=model)
with open("umbrella.dat") as f:
    plumed_config = [ x.strip("\n") for x in f.readlines() ]

butane = read('butane.extxyz')
plumed_config = [f"UNITS LENGTH=A TIME={1/(1000 * units.fs)} ENERGY={units.mol/units.kJ}"]  + plumed_config
plumed_calc = Plumed(calc=calc,
                    input=plumed_config,
                    timestep=timestep,
                    atoms=butane,
                    kT=units.kB*T)
md = NVT(struct=butane,
         temp=T,
         device=device,
         arch=arch,
         calc_kwargs={"model_paths": model},
         stats_every=1,
         steps=steps,
         timestep=1.0,
         friction=0.005,
         minimize=False)

md.struct.calc = plumed_calc

md.run()

units may need checked and seems to expose also a bug...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New/improved feature or request
Projects
None yet
Development

No branches or pull requests

2 participants