Skip to content

the setting of ocp_set for multi-k-points system in tddft. #5891

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

Closed
1 of 10 tasks
Jweijian opened this issue Feb 10, 2025 · 6 comments · Fixed by #5896
Closed
1 of 10 tasks

the setting of ocp_set for multi-k-points system in tddft. #5891

Jweijian opened this issue Feb 10, 2025 · 6 comments · Fixed by #5896
Assignees
Labels
Questions Raise your quesiton! We will answer it.

Comments

@Jweijian
Copy link

Details

I am trying to use abacus to do tddft calculation. According to the tutorials, i must set ocp for different kpoint and band, such as for 70 bands and 132 electrons system which KPT sets 2 2 1 0 0 0, i set ocp_set 652 21 30 652 21 30 652 21 30 652 21 30. But, when i set ocp_set for multi_kpoints, a warning always raises.
Below is the INPUT and warning information:

Image

Image

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.
@Jweijian Jweijian added the Questions Raise your quesiton! We will answer it. label Feb 10, 2025
@AsTonyshment
Copy link
Collaborator

Do you have complete INPUT, KPT, and STRU files for us to debug? @Jweijian

@AsTonyshment AsTonyshment self-assigned this Feb 11, 2025
@Jweijian
Copy link
Author

Jweijian commented Feb 11, 2025

Do you have complete INPUT, KPT, and STRU files for us to debug? @Jweijian

I have uploaded the input file in this address
https://github.com/Jweijian/Abacus_debug.git

@AsTonyshment
Copy link
Collaborator

AsTonyshment commented Feb 11, 2025

I noticed that you have closed this issue. Could you confirm if the problem has been resolved?😂 @Jweijian
If not, you can reopen this issue.

@Jweijian Jweijian reopened this Feb 11, 2025
@Jweijian
Copy link
Author

I noticed that you have closed this issue. Could you confirm if the problem has been resolved?😂 @Jweijian If not, you can reopen this issue.

Sorry, my bad. I have reopened this issue.

@AsTonyshment
Copy link
Collaborator

@Jweijian In your example of CsPbI₃, since you have multiple $\boldsymbol{k}$-points (4 in this case), the average occupation should be 0.5 for each $\boldsymbol{k}$-point. Given that there are a total of 592 electrons, they occupy 296 bands (with nspin=1), with an occupation of 0.5 per $\boldsymbol{k}$-point.

If you want to excite a single electron from HOMO to LUMO, you might set ocp_set as follows:
295*0.5 2*0.25 3*0 295*0.5 2*0.25 3*0 295*0.5 2*0.25 3*0 295*0.5 2*0.25 3*0 (instead of 295*2 2*1 3*0 295*2 2*1 3*0 295*2 2*1 3*0 295*2 2*1 3*0). Otherwise, the total occupation number will exceed the total number of electrons in the system when checking the electron count, resulting in an error.

Useful information: The sequence of $\boldsymbol{k}$-points corresponds to those listed in the output file kpoints. The source code responsible for setting occupations is shown below. Here, the vector ocp_kb is parsed from the string ocp_set, and wg(ik, ib) represents the actual weight for $\boldsymbol{k}$-point ik (a total of wg.nr=4 in this case) and band ib (a total of wg.nc=300 in this case) used in the code for calculations:

for (int ik = 0; ik < this->wg.nr; ++ik)
{
for (int ib = 0; ib < this->wg.nc; ++ib)
{
this->wg(ik, ib) = ocp_kb[ik * this->wg.nc + ib];
}
}

If you have further questions, feel free to ask! This issue might be due to an unclear description in the user manual. I will create a Pull Request to update the description of ocp_set.

@Jweijian
Copy link
Author

@Jweijian In your example of CsPbI₃, since you have multiple k -points (4 in this case), the average occupation should be 0.5 for each k -point. Given that there are a total of 592 electrons, they occupy 296 bands (with nspin=1), with an occupation of 0.5 per k -point.

If you want to excite a single electron from HOMO to LUMO, you might set ocp_set as follows: 295*0.5 2*0.25 3*0 295*0.5 2*0.25 3*0 295*0.5 2*0.25 3*0 295*0.5 2*0.25 3*0 (instead of 295*2 2*1 3*0 295*2 2*1 3*0 295*2 2*1 3*0 295*2 2*1 3*0). Otherwise, the total occupation number will exceed the total number of electrons in the system when checking the electron count, resulting in an error.

Useful information: The sequence of k -points corresponds to those listed in the output file kpoints. The source code responsible for setting occupations is shown below. Here, the vector ocp_kb is parsed from the string ocp_set, and wg(ik, ib) represents the actual weight for k -point ik (a total of wg.nr=4 in this case) and band ib (a total of wg.nc=300 in this case) used in the code for calculations:

abacus-develop/source/module_elecstate/elecstate.cpp

Lines 44 to 50 in 105fd19

for (int ik = 0; ik < this->wg.nr; ++ik)
{
for (int ib = 0; ib < this->wg.nc; ++ib)
{
this->wg(ik, ib) = ocp_kb[ik * this->wg.nc + ib];
}
}
If you have further questions, feel free to ask! This issue might be due to an unclear description in the user manual. I will create a Pull Request to update the description of ocp_set.

Thank you for your kind answers, your suggestions are valid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Questions Raise your quesiton! We will answer it.
Projects
None yet
2 participants