Skip to content

Refactor LR_IO function and add test case 58_KP_LR_BSE - #7849

Open
Fisherd99 wants to merge 3 commits into
deepmodeling:developfrom
Fisherd99:develop
Open

Refactor LR_IO function and add test case 58_KP_LR_BSE#7849
Fisherd99 wants to merge 3 commits into
deepmodeling:developfrom
Fisherd99:develop

Conversation

@Fisherd99

@Fisherd99 Fisherd99 commented Aug 23, 2026

Copy link
Copy Markdown
  • Add test case 58_KP_LR_BSE, the test system is FCC H 2x2x2 solid case.
  • refactor LR_IO function, separate lr_io_krlist file.
  • fix out_struc in rpa_lri.hpp, correctly handle the case when lat0 ≠ 1/BOHR_TO_A

@Fisherd99
Fisherd99 force-pushed the develop branch 3 times, most recently from 98c743f to 4c7c941 Compare August 23, 2026 13:09
fix `out_struc` to handle `lat0` correctly

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

沟通格式,我就用中文了。3.11版本的规范是:所有文本文件都按照.txt后缀输出,所有二进制文件都按照.dat文件输出,所以这里band_out,建议可以改成band_out.txt,但我觉得这个out的单词似乎有点多余,建议改成band.txt。我们现在程序里out_band参数设成1的时候,输出是bands1.txt和bands2.txt这样,代表不同自旋channel的能级,你这里怎么处理自旋?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

在LibRPA程序包中,文件名的规范略有不同,我认为这需要一定的兼容而不是一刀切。band_out文件会包含所有的自旋channel,输出循环有外层到内层依次是:k-point, spin, band,具体说明见https://srlive1201.github.io/LibRPA/develop/dataset_format.html#band-out

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

3.11版本的输出规范是所有下标不从0开始,从1开始,

@@ -0,0 +1,73 @@
8

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

3.11版本输出规范要求尽可能每个参数加个注释,让使用者打开文件之后就可以大致理解内容,比如 8 # number of bands,类似这样

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

我认为这样做的收益并不高。也许有些参数可以在文件注释中做简要解释,但大部分参数很难用几行文字解释清楚,这时候引导用户阅读更具体的说明文档是更好的选择。
关于coulomb_mat_*.txt文件的格式说明,可参阅文档https://srlive1201.github.io/LibRPA/develop/dataset_format.html#coulomb-mat

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

3.11版本输出文件的字符都要求是小写,混杂着大小写的文件名用户不好记

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

data这个字符感觉多余了

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

建议加.txt文件,让使用者知道这是一个文本文件

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Nice idea,我统一一下文件后缀名

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

建议同上,另外eigenvector是波函数吗?如果是建议按照波函数的统一输出名,例如wfs1_nao.txt代表wave function,自旋为1,以NAO为基组的波函数(因为程序还会输出pw基组的波函数,因此加以区分)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

是的,eigenvector是波函数。这些都是LibRPA读取接口所采用的文件名。

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

这个像是矩阵元,名字太长了,iR是布拉维格式? mu nu我建议可以去掉,比如Wc_Mu_0_Nu_0是否可以简写成wc00?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

是的,iR是布拉维格矢,ifreq是频率点,Mu和Nu代表辅助基所处的原子。关于这个文件,我可以处理成不按原子指标分开的形式,这样确实更清爽些。

@mohanchen mohanchen added Feature Discussed The features will be discussed first but will not be implemented soon Input&Output Suitable for coders without knowing too many DFT details Tests/Examples Issues/PR related to unit tests and integrate tests labels Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature Discussed The features will be discussed first but will not be implemented soon Input&Output Suitable for coders without knowing too many DFT details Tests/Examples Issues/PR related to unit tests and integrate tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants