mir-group / flare

An open-source Python package for creating fast and accurate interatomic potentials.
https://mir-group.github.io/flare
MIT License
295 stars 71 forks source link

Mapped Model in LAMMPS inaccurate compared to ASE SGP Model #393

Closed usamaS97 closed 9 months ago

usamaS97 commented 9 months ago

Hi MIR team,

I have trained and validated a SGP model (<0.1 50eV/A/atom) using ASE and VASP.

I map the model using the following commands as outlined in tutorial:

calc, _ = calculator.SGP_Calculator.from_file('otf_flare.json') calc.build_map('lmp.flare', 'saleem')

The script gives me three files: lmp.flare, L_inv_lmp.flare, sparse_desc_lmp.flare

Upon running the Lammps script, my TiO2 system melts even after energy minimizing and at low temperatures. This does not occur with the ASE model.

Is there a mistake I am making in mapping the model or deploying it in lammps. The following is my lammps in. script:

Initialize simulation

units metal dimension 3 boundary p p p atom_style atomic

Read Data

read_data frame.data mass 1 15.999 mass 2 195.084 mass 3 47.90

Potential

newton on pair_style flare pair_coeff lmp.flare

min_style cg

minimize 0.0001 0.05 500 500

Set up NVT ensemble (if needed)

velocity all create 10 87287 loop geom fix 1 all nvt temp 10 500.0 $(100.0*dt) timestep 0.0005

Run the simulation

thermo_style custom step temp pe ke etotal thermo 1 dump 1 all custom 100 dump_unit.xyz id type x y z vx vy vz run 100000

Thank you in advance!

cjowen1 commented 9 months ago

Hi Usama, can you please provide more information about your lammps and flare versions? Also please provide the header of your coefficient file (first 6 lines) for debugging. Thanks.

usamaS97 commented 9 months ago

Hello Cameron,

The versions of the softwares are as following:

LAMMPS (2 Aug 2023) FLARE (1.4.1)

The following are the first six lines of the lmp.flare file I generated:

DATE: Thu Feb 1 10:08:21 2024 CONTRIBUTOR: saleem 2 NormalizedDotProduct chebyshev 3 9 4 1786995 quadratic 6.00 6.00 6.00 6.00 6.00 6.00 6.00 6.00 6.00

anjohan commented 9 months ago

Hi Usama

This error is a bit mysterious. One thing to check is the mapping from element (Ti O etc.) to FLARE species (0 1 etc.) to LAMMPS type (1 2 etc.).

From your LAMMPS script, it looks like O is type 1, Pt is type 2 and Ti is type 3. Make sure that this is the order both in FLARE and in the data file (most ASE functions accept an argument along the lines of specorder="O Pt Ti".split() or Z_of_type=[0,8,78,22]).

usamaS97 commented 9 months ago

Hi Usama

This error is a bit mysterious. One thing to check is the mapping from element (Ti O etc.) to FLARE species (0 1 etc.) to LAMMPS type (1 2 etc.).

From your LAMMPS script, it looks like O is type 1, Pt is type 2 and Ti is type 3. Make sure that this is the order both in FLARE and in the data file (most ASE functions accept an argument along the lines of specorder="O Pt Ti".split() or Z_of_type=[0,8,78,22]).

Hi Anders

Thank you for pointing that out. I was able to fix it. The order in which I specified the index of elements while creating the force field was not matching the index of elements in .data file for LAMMPS.