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

关于傅里叶变换网格的疑问 #307

Open
1 of 10 tasks
WN90 opened this issue Apr 5, 2024 · 0 comments
Open
1 of 10 tasks

关于傅里叶变换网格的疑问 #307

WN90 opened this issue Apr 5, 2024 · 0 comments

Comments

@WN90
Copy link

WN90 commented Apr 5, 2024

Details

文档

关于傅里叶变换网格的确定,https://mcresearch.github.io/abacus-user-guide/develop-path4.html 中写道:

  1. INPUT 中 ecutrho 确定以动量𝐤=(0,0,0)为球心的球半径
  2. 在倒空间确定所有在“球”中的格点(均为整数坐标,因现在最小可分辨距离为倒格子矢量长度,见下 Fig.1),其中每个点都对应一个平面波
  3. 以倒空间内 x/y/z 最大/小值为边界组成正方形盒子,进行(2, 3, 5)质数分解,得到可能更大的盒子尺度(nx, ny 和 nz)

从2,3可以看出,程序中是要找到球中所有点的最大最小坐标,忽略非整数的误差,也就是范围对应的区域是球的外切平行六面体。

代码

阅读代码initgrids函数,发现是这样做的:

  1. 先找到球在坐标轴上的交点,nx,ny,nz,向上取整。
  2. 然后再在[-nx,nx], [-ny,ny], [-nz, nz] 内寻找所有在球中的点,从这些点中找到绝对值最大的 x,y,z坐标,并取绝对值,这里的最大值应该和nx, ny, nz相等或者差一个整数。
  3. 取网格点个数为 2*n_i+1,如果不等于2^a * 3^b * 5^c ,扩充,使等于2^a * 3^b * 5^c 。

疑问

  1. 代码和文档似乎不匹配。 如果倒空间中的基矢不互相垂直,代码中第一步,所求得的范围可能不是外切平行六面体,而是舍弃了“球”中的一部分点,如图

IMG20240405112531
上面图中是二维情况,假设xy方向基矢大小相等,夹角为钝角或锐角。ABCD是坐标轴交点确定的范围(代码中的做法),MNPQ是外切平行四边形对应的范围(文档中描述的做法),如果xy方向基矢夹角120°,都是单位矢量,圆半径为a, 那么在x轴正半轴,忽略浮点数取整,偏差为 2a/sqrt(3) - a,坐标轴夹角越大,偏差越大,夹角越小偏差越小,锐角的情况从图中看和钝角是对称的。
2. 按照代码中的做法,第2步似乎有一点冗余,如果没有第一步限定的范围,第二步中每个坐标方向都从0到正无穷和0到负无穷搜索,直到超出球范围,似乎就真正的起到了筛选的作用。是否这样做更好一点呢? 当然在代码的第三步,很大概率会扩充范围,第一步中的偏差也很可能会被掩盖。

Have you read FAQ on the online manual http://abacus.deepmodeling.com/en/latest/community/faq.html

  • Yes, I have read the FAQ part on online manual.

Task list for Issue attackers (only for developers)

  • Understand the problem or question described by the user.
  • Check if the issue is a known problem or has been addressed in the documentation.
  • Test the issue or problem on a similar system or environment, if possible.
  • Identify the root cause or provide clarification on the user's question.
  • Provide a step-by-step guide, including any necessary resources, to resolve the issue or answer the question.
  • If the issue is related to documentation, update the documentation to prevent future confusion (optional).
  • If the issue is related to code, consider implementing a fix or improvement (optional).
  • Review and incorporate any relevant feedback from users or developers.
  • Ensure the user's issue is resolved or their question is answered and close the ticket.
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

No branches or pull requests

1 participant