Error while running fitting file

Hello Prof Gale,

I have a 2d Ag slab with Co2 on it. I am using the Co2 shell model, however, I am not fitting the same here. I am fitting Ag/C where C is carbon core. I am testing with 3 configs but getting an error when I run it. I do not understand why. I am attaching the file.

Ag_CO2_1.txt (14.5 KB)


I have resolved the issue but I made 2 observations in running a core-shell model.

  1. I am not fitting the core-shell. I am fitting Ag with carbon cores. I took coords of shell and core of co2 from lammps. However, when I tried to run a simple fit of Ag/C with fbfgs, I got errors. Only when I set the coods of both coord and shell same, did it run. However, on observing the examples I noticed, that say eg 2 of GULP, that c/s coords are not same but eg1 of GULP has same coords and they both run. So why did I get an error?
  2. I observed that in some example files, charge neutrality for c/s model holds (eg 4) and others it doesn’t (eg 2). Yet the files run in both cases. But when I made a mistake of not maintaing charge neutrality in my system, the run stops with an error. Why is this?

Thanks a lot,

Hi Nandana,
There are a lot of points here, but importantly I’d encourage you to read the Phil. Mag. B paper about GULP fitting (and fitting in general) since this covers many issues. Looking at your original input there are several concerns:

  1. You are fitting energies of 3 configurations that all have energies of zero! Note that 10^-23 kcal is zero as values below about 3 decimal places would be small compared with thermal energy and well below the accuracy of most QM methods, etc.
  2. By using weights of 10^-7 it means your contribution to the sum of squares would be negligible and so not useful.
  3. By using standard fitting (see simultaneous and relax fitting in the paper/manual) it means you are basically just fitting the forces to be zero at the structures you have given, but if they are 3 structures for the same system then this doesn’t make sense.
  4. I wouldn’t use “fbfgs” since this will take longer and you don’t necessarily need off diagonal numerical Hessian matrix elements.
    The bottom line is that you don’t have enough data for your fit and it generally doesn’t make sense.
    Now to charge neutrality - you need to read up on the Ewald (or in this case Parry for 2-D) sum and this will explain why things not being charge neutral is a problem. Think about the fact that you are working in periodic boundary conditions and so you have an infinite system and what would happen if you have an infinite charge (think along the lines of explosion!).

Thanks, Prof Gale. I had a few doubts regarding the core-shell model in Gulp.

  1. I want the coulombic interaction screened such that 1-2, 1-3, and 1-4 interactions are 0.0,0.0,0.5. The 1−2 pair interactions must be totally scaled down by a factor of 0.0, otherwise, the cores and individual Drude particles will interact.
  2. I also want the dipole-dipole interaction to be screened by Thole functions (
    Can these be implemented in Gulp?

ps- I do not fit the core-shell model, but I am using core/shell coords (taken from lammps) in the structure so that when E_ff is calculated by Gulp, we include those interactions as well.

The core-shell model in GULP has been successfully applied for 30 years, so I don’t think you need have any doubts. The model is usually used for ionic materials & so the question of molecular mechanics Coulomb subtraction rules would normally not arise since you don’t need a description of highly polarisable anions in something that is strongly covalently bonded. So it’s important to think about the physics and whether it really makes sense. To your points:

  1. You’ll need to probably set up the Coulomb subtractions manually and test carefully for shell models since usually shells shouldn’t be part of molecules. There are explicit Coulomb subtraction potentials in GULP and so you can set these up as you need them.
  2. Thole damping is usually used for dipoles with point polarisability, rather than the shell model. If you set up your potentials correctly the shell model is already intrinsically damped by the short-range interactions and so shouldn’t need further modification for damping. You can also damp by adding a k4 term if needed.
    If you want to implement Thole damping in some form with shells you’ll need to modify the Coulomb interactions between cores and shells on different centres. You can either edit the code or implement as a set of potentials that capture the difference between the full Coulomb interaction and the screened one.

Thank you so much, Prof Gale. I think my sentence construction was wrong in that ‘doubts’ line. Sorry.

What I meant was that I had doubts regarding the Drude model implemented in GULP because I didn’t find any information in the paper or help manual.

Will get back to you.