Skip to content

interface for deepmd with the centroids atoms #1093

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

Merged

Conversation

DavideTisi
Copy link
Contributor

@DavideTisi DavideTisi commented Sep 3, 2021

The following request is aimed to allow the deepmd code to pass to lammps the full non symmetric atomic_virial matrix (dvatom) using the cvatom matrix defined for centroid/atom/stress. This will allow to take full advantage of the use of the computed "atomic_virial" that is non-symmetric, beeing deepmd potential inherently many-body. This allows to compute correctly the heat current with LAMMPS. It has been shown in the literature that the usual formula implemented in compute_hat_flux in LAMMPS for the heat current is not correct for many body potential where the atomic virial (called vatom in the deepmd interface) is not symmetric (see Fan et al, Phys. Rev. B 92, 094301 or Phys Rev E, 99, 051301(R) (2019) or even the LAMMPS manual page on compute heat/flux ).

Now lammps has an option called compute centroid/atom/stress to have a non symmetric atomic viral, and to compute the thermal conductivity from that. With this request I have included in deepmd interface for lammps the use of these 3*3 atomic stress matrix called cvatom.



To have a better inside on the equations the heat flux formula is:

J= sum_i e_i v_i + sum_{n,m} (r_m-r_n) de_m/dr_n v_n

Being r_n position of atom, v_n velocity of atom and e_n local atomic energy.
deepmd computes and stores in dvatom the matrix sum_m(r_n-r_m) de_m/dr_n .
Thus I passed this 9 component non-symmetric array to cvatom that can be used with the compute heat/flux.

amcadmus and others added 30 commits December 21, 2020 20:25
Merge recent development on devel to master
bug fixing: not displaying input doc on github
add doc for short-range tabulated interaction
Bug fixings and add notice for the consistency of TF versions.
When the number of sel is smaller than the lammps nbors, the program may have a gpu sorting error.
update compiler support for Ampere architecture devices
The assertions will be bypassed in release building mode
Restarting the pair_style `deepmd` from restart file is not supported
fix bug of illegal device memory access
@amcadmus amcadmus self-requested a review September 3, 2021 16:08
@njzjz
Copy link
Member

njzjz commented Sep 3, 2021

Please submit commits to devel branch

@codecov-commenter
Copy link

codecov-commenter commented Sep 3, 2021

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.72%. Comparing base (e2fc5e3) to head (2f190ae).
Report is 1459 commits behind head on devel.

Additional details and impacted files
@@           Coverage Diff           @@
##            devel    #1093   +/-   ##
=======================================
  Coverage   75.72%   75.72%           
=======================================
  Files          88       88           
  Lines        6998     6998           
=======================================
  Hits         5299     5299           
  Misses       1699     1699           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@DavideTisi DavideTisi changed the base branch from master to devel September 3, 2021 21:37
@DavideTisi
Copy link
Contributor Author

Please submit commits to devel branch

I changed the target to devel now.

DavideTisi and others added 2 commits September 4, 2021 07:25
@amcadmus amcadmus merged commit a5bdd14 into deepmodeling:devel Sep 4, 2021
@mayankaditya
Copy link

Thanks for the details. I am just wondering if I could use the option "compute centroid/atom/stress" in current deepmd-2.0.3 lammps. It would be great if an example input for the same is provided.

Thanks,
Mayank

@mayankaditya
Copy link

Dear Developers,

It would be great if you could provide an input script for thermal conductivity calculation. I am facing an issue to compute the 'cvatom' and use it in compute heat/flux as mentioned above.

Thanks,
Mayank

@mayankaditya
Copy link

Hello everyone,

I am getting the following error while calculating the stress matrix with "compute myStress all centroid/stress/atom NULL virial"

ERROR: Pair style does not support compute centroid/stress/atom (src/compute_centroid_stress_atom.cpp:131)

Please see the attached input file.
Screenshot from 2022-01-27 23-26-21

Thanks,
Mayank

Screenshot from 2022-01-27 23-26-21

@DavideTisi
Copy link
Contributor Author

Dear Mayank,

In the documentation at the end of the page at this link
Doc/lammps-command.md there are the combinations of commands to add to the lammps script in order to use compute heat/flux.
They are working for me, and I am using deepmd-2.0.3 and lammps version 29Oct2020

Best,
Davide

@DavideTisi
Copy link
Contributor Author

Dear Mayank,

Sorry, I saw your last post after I send mine.
The input seems ok which version of lammps and deepmd are you using ?
Davide

@mayankaditya
Copy link

Dear Davide,

Thanks for the prompt response. I am also using deepmd-2.0.3 and default lammps executable (installed with deepmd).

Mayank

@DavideTisi
Copy link
Contributor Author

Dear Mayank,

for what I see deepmd2.0.3 use as default now lammps stable_29Sep2021, I can try to do some test to see if there are problems with the interface and that version of lammps.
Can you try to see which version of lammps are you using, and in the case can you use lammps version 29Oct2020?
if the lammp version is the problem, changing it might solve it and you can continue in your research.

Davide

@mayankaditya
Copy link

mayankaditya commented Jan 27, 2022 via email

@neojie
Copy link

neojie commented Jun 18, 2022

The link does not work now. What are the combinations of commands to add?

@neojie
Copy link

neojie commented Jun 18, 2022

Dear David, Thank you for the help, I will try with lammps version 29Oct2020. Best regards, Mayank

On Thu, Jan 27, 2022 at 11:58 PM Davide Tisi @.> wrote: Dear Mayank, for what I see deepmd2.0.3 use as default now lammps stable_29Sep2021, I can try to do some test to see if there are problems with the interface and that version of lammps. Can you try to see which version of lammps are you using, and in the case can you use lammps version 29Oct2020? if the lammp version is the problem, changing it might solve it and you can continue in your research. Davide — Reply to this email directly, view it on GitHub <#1093 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADC5MSVLE64C5URKBZBYLVTUYGFEJANCNFSM5DLPRBXQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you commented.Message ID: @.>

Hi Mayank,
Do you make it work using different version of lammps? I tried
compute myStress all centroid/stress/atom NULL virial
and get the same problem as you reported.
I am using the latest stable version of lammps and deepmd-kit
Thank you.
Jie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants