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

Fix cell and virial transpose bug in dp_ipi #1353

Merged
merged 3 commits into from
Dec 15, 2021

Conversation

njzjz
Copy link
Member

@njzjz njzjz commented Dec 13, 2021

i-Pi assumes column-major storage to store cell and virial.

Fix #1351.
See i-Pi manual: https://ipi-code.org/i-pi/_static/manual.pdf (page 33 and page 78)
See also i-pi/i-pi#48 and i-pi/i-pi#196.

i-Pi assumes column-major storage to store cell and virial.

Fix deepmodeling#1351.
See i-Pi manual: https://ipi-code.org/i-pi/_static/manual.pdf
See also i-pi/i-pi#48 and i-pi/i-pi#196.
@njzjz njzjz requested review from amcadmus and wanghan-iapcm and removed request for amcadmus December 13, 2021 21:12
@njzjz njzjz marked this pull request as ready for review December 13, 2021 21:13
@njzjz
Copy link
Member Author

njzjz commented Dec 13, 2021

I am not sure I am correct - @wanghan-iapcm and @Yi-FanLi can you take a look?

@njzjz
Copy link
Member Author

njzjz commented Dec 13, 2021

Besides, is #1123 related?

@codecov-commenter
Copy link

codecov-commenter commented Dec 13, 2021

Codecov Report

Merging #1353 (2ec3574) into devel (0393766) will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##            devel    #1353      +/-   ##
==========================================
- Coverage   75.56%   75.53%   -0.03%     
==========================================
  Files          91       91              
  Lines        7500     7506       +6     
==========================================
+ Hits         5667     5670       +3     
- Misses       1833     1836       +3     
Impacted Files Coverage Δ
deepmd/descriptor/se_t.py 97.34% <0.00%> (-0.43%) ⬇️
deepmd/descriptor/se_r.py 91.50% <0.00%> (-0.42%) ⬇️
deepmd/descriptor/se_a.py 93.87% <0.00%> (-0.29%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0393766...2ec3574. Read the comment docs.

@@ -158,7 +158,7 @@ int main(int argc, char * argv[])
readbuffer_ (&socket, (char *)(cell_h), 9*sizeof(double));
readbuffer_ (&socket, (char *)(cell_ih), 9*sizeof(double));
for (int dd = 0; dd < 9; ++dd){
dbox[dd] = cell_h[dd] * cvt_len;
dbox[dd] = cell_ih[dd] * cvt_len;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you checked what is cell_ih? does it the transpose of cell_h or the inverse of cell_h?

Copy link
Member Author

@njzjz njzjz Dec 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh the manual said it is the inverse matrix... I didn't realize the difference between them.

The serversocket will then send a string “POSDATA”, then nine floats for the cell vectormatrix, then another nine floats for the inverse matrix.

(page 33)

@njzjz njzjz marked this pull request as draft December 14, 2021 00:31
@njzjz njzjz marked this pull request as ready for review December 14, 2021 07:58
@njzjz
Copy link
Member Author

njzjz commented Dec 14, 2021

For the system in #1351, the energy error before this PR is 0.02, and the error after this PR is 6e-6.

@njzjz
Copy link
Member Author

njzjz commented Dec 14, 2021

The rest error should come from the unit conversion, I think.

@wanghan-iapcm wanghan-iapcm merged commit 2223ff3 into deepmodeling:devel Dec 15, 2021
@njzjz njzjz deleted the njzjz-patch-4 branch December 16, 2021 23:28
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.

None yet

3 participants