process_dedr for systems with padding atoms

Hi Ryan,

After looking into what you mentioned about setting up padding particles, I am not sure if I can do the following:

I have an expression which involves derivatives of a single particle energy with respect to distances in the system. I am taking a single particle, say i, as “contributing”. For the purpose of this discussion let us consider a full list. Then all the “surrounding” particles of i are in its neighborhood while the neighborhoods of all the surrounding particles are empty. This setup allows me to only calculate certain derivatives of the energy of particle i, which are of the form dV_i/dr_{ij} or d2V_i/ dr_{ij} dr_{il}. These are the “only” derivatives of the particle energy if the potential is of EAM or pair form, where energy of particle i depends on the distances of the form r_{ij}.

On the other hand, I am not sure if having a single contributing particle can give me derivatives of the form dV_i/dr_{pq} where p \ne i and q \ne i. This happens for multi-body potentials which are not pair functionals, for example the Stillinger-Weber potential. I am making this observation by noting that the neighbor list of p and q are empty.

Thanks!

Thanks.

Nikhil

Hi Nikhil,

If there is a contribution to be made to the derivative arising from r_{pq}—which is an awkward way to say that dV_i/dr_{pq} is not identically zero—then the model is responsible for calling process_dEdr with indices p and q. Unless I misunderstand your system, there should be no issues here.

Steve Whalen

Thanks Steve. I was under the impression that in order for the model to call process_dedr with indices p and q to report back dV_i/dr_{pq}, p and q (padding atoms) should in the the neighbor list of each other (full list). I now see that there is no such restriction.

I will check if the above is true for the Stillinger Weber potential driver in the kim repository, and then report back here.

Nikhil

Hi All,

Just to add my confirmation; I agree with Steve's comments. I would expect the model to provide the dV_i/dr_{pq} terms...

Thanks!

Ryan

Hi Ryan,

Could you please answer the following question, again related to process_dedr. I am currently using the EAM driver, and I have a question regarding process_dedr when using padding particles. I am comparing the results of the following scenarios:

  1. Construct the half neighbor list as is, and in the test give the number of contributing particles, and the model takes care of the computation from this point.
  2. In the test give the number of contributing particles, and at the same time construct only the half list of the first numberContributionParticles particles. I don’t see why you will need to construct the half list of padding particles.
  3. For a full list, construct the full list neighbors of the first numberContributingParticles particles, and the neighbor lists of the padding atoms are empty.

All the above three give me different results. I initially thought 1 and 3 are the way to go, and they should give me same results. But I am not sure why in the case of 1, process_dedr in the test receives the derivatives of the energy w.r.t distances between padding particles very far away from the domain of interest. So I tried 2, but the results of 2 and 3 also don’t match.

I think I am going to document my whole experience with process_dedr because I feel it is non-trivial. I also think that while writing models, there is a paradigm you are following, which is think about “particle contributions” and not about “bond contributions” because this is how you are building up the derivatives. This logic flows smoothly when extending to padding particles. I think if this is not clear, then there exists a pitfall of writing a model which works correctly in the absence of padding particles, but not so in their presence.

Nikhil

Hi Nikhil,

Thanks for the message. I know the process_dedr scheme is complicated and confusing. Your notes on the process would be a great addition to the available documentation.

More below.

Hi Ryan,

Could you please answer the following question, again related to
process_dedr. I am currently using the EAM driver, and I have a question
regarding process_dedr when using padding particles. I am comparing the
results of the following scenarios:

1. Construct the half neighbor list as is, and in the test give the number
of contributing particles, and the model takes care of the computation from
this point.
2. In the test give the number of contributing particles, and at the same
time construct only the half list of the first numberContributionParticles
particles. I don't see why you will need to construct the half list of
padding particles.

I agree, you shouldn't need to list any neighbors in a half list for particles numbered greater than the numberContributingParticles value.

I'm not completely clear in what you say here. Just to clarify, in the half-lists for the first numberContributingParticles, do you include entries for particles numbered with value greater than numberContributingParticles? (i.e., are padding particles included in the half list for contributing particles?)

3. For a full list, construct the full list neighbors of the first
numberContributingParticles particles, and the neighbor lists of the
padding atoms are empty.

All the above three give me different results. I initially thought 1 and 3
are the way to go, and they should give me same results. But I am not sure
why in the case of 1, process_dedr in the test receives the derivatives of
the energy w.r.t distances between padding particles very far away from the
domain of interest. So I tried 2, but the results of 2 and 3 also don't
match.

I agree 1 and 3 should work and give the same answer.

I'm not sure what is going on.

Maybe the best way to make quick progress is if you send me a set of examples that I could test, compare, and debug...

I think I am going to document my whole experience with process_dedr
because I feel it is non-trivial. I also think that while writing models,
there is a paradigm you are following, which is think about "particle
contributions" and not about "bond contributions" because this is how you
are building up the derivatives. This logic flows smoothly when extending
to padding particles. I think if this is not clear, then there exists a
pitfall of writing a model which works correctly in the absence of padding
particles, but not so in their presence.

That's right, the KIM API starts with a basic assumption of a individual particle-energy function E_i and builds up total energies from there. This is most important for the process_dE* mechanism, as it if a fundamental requirement of that approach. (Elsewhere, the existence of a particle-energy function is not so critical.)

As I said, any notes you want to provide would be great. I'll also be happy to have any submissions that contribute to improvements in the official documentation...

Thanks,

Ryan

Hi Ryan,

Thanks for the answer. Please see my answer below for one of your questions. I will send you my test after stripping it down to a very basic level.

Nikhil

Hi Nikhil,

Thanks for the message. I know the process_dedr scheme is complicated and
confusing. Your notes on the process would be a great addition to the
available documentation.

More below.

Hi Ryan,

Could you please answer the following question, again related to
process_dedr. I am currently using the EAM driver, and I have a question
regarding process_dedr when using padding particles. I am comparing the
results of the following scenarios:

  1. Construct the half neighbor list as is, and in the test give the number
    of contributing particles, and the model takes care of the computation from
    this point.
  2. In the test give the number of contributing particles, and at the same
    time construct only the half list of the first numberContributionParticles
    particles. I don’t see why you will need to construct the half list of
    padding particles.

I agree, you shouldn’t need to list any neighbors in a half list for particles
numbered greater than the numberContributingParticles value.

I’m not completely clear in what you say here. Just to clarify, in the
half-lists for the first numberContributingParticles, do you include entries
for particles numbered with value greater than numberContributingParticles?
(i.e., are padding particles included in the half list for contributing
particles?)

My numberContributingParticles=1. So yes, I prepare the half list of 1 (which is same as it’s full list), so it contains all non-contributing particles.

Hi Ryan,

This email is related to the Three body Stillinger Weber model driver Three_Body_Stillinger_Weber_Hauch_Brittle_Si__MO_119167353542_001.

You mentioned in one of your emails that the process_d2edr2 essentially fills up a matrix of values, where the matrix is of size equal to the number of bonds in the system. So, the quantities such as d2V/dr_{ij}^2, which fill up the diagonal of the matrix, are reported to the test by the model only once. It is possibly sent in pieces, but when put together by the test you get the net value for d2V/dr_{ij}^2 only once. On the other hand, quantititeis such as d2V/dr_{ij} dr_{kl} where r_{ij} \ne r_{kl} are reported twice in the form of d2V/dr_{ij} dr_{kl} and d2V/dr_{kl} dr_{ij}.

On the contrary, in the the above model driver, I see that all the double derivatives are reported only once. I checked this in a round about way by calculating the elastic constants analytically (for which I need process_d2edr2) and comparing it to numerically evaluating it using the energies. By adjusting the test to obtaining all the second derivatives only once, the analytical and numerical results coincide. Obviously, this is not intended.

Note that this system also has just 1 contributing particle, and all the other other particles are non-contributing.

Nikhil

Hi Nikhil,

Thanks for the report. We'll contact the model author and have them take a look at this issue.

Cheers,

Ryan