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

Calculation of bandgap using SCAN functional #5901

Open
16 tasks
yycx1111 opened this issue Feb 17, 2025 · 9 comments
Open
16 tasks

Calculation of bandgap using SCAN functional #5901

yycx1111 opened this issue Feb 17, 2025 · 9 comments
Assignees
Labels
Questions Raise your quesiton! We will answer it.

Comments

@yycx1111
Copy link

Describe the bug

  1. I want to test the use of the meta-GGA functional to calculate the bandgap of GaN. I used SCAN functional to calculate the bandgap of GaN, but the bandgap value was 0.0101181566.
  2. Can SCAN be used in ABACUS to calculate the bandgap? Or what do I need to pay attention to in the calculation to get the correct bandgap value?
    The following are input files
    STRU.txt
    INPUT_scf.txt
    INPUT_nscf.txt
    KPT_nscf.txt
    KPT_scf.txt

Expected behavior

No response

To Reproduce

No response

Environment

No response

Additional Context

No response

Task list for Issue attackers (only for developers)

  • Verify the issue is not a duplicate.
  • Describe the bug.
  • Steps to reproduce.
  • Expected behavior.
  • Error message.
  • Environment details.
  • Additional context.
  • Assign a priority level (low, medium, high, urgent).
  • Assign the issue to a team member.
  • Label the issue with relevant tags.
  • Identify possible related issues.
  • Create a unit test or automated test to reproduce the bug (if applicable).
  • Fix the bug.
  • Test the fix.
  • Update documentation (if necessary).
  • Close the issue and inform the reporter (if applicable).
@mohanchen mohanchen added the Questions Raise your quesiton! We will answer it. label Feb 18, 2025
@QuantumMisaka
Copy link
Collaborator

QuantumMisaka commented Feb 18, 2025

Hello @yycx1111
As shown in https://kirk0830.github.io/ABACUS-Pseudopot-Nao-Square/pseudopotential/results/2024-04-30/Ga.html, the ecutwfc value for Ga in PBE calculation should be 200 Ry in PBE-PW calculation using SG15-v1.0 potential. In PBE-LCAO calculation, the ecutwfc values could be lower, but meta-GGA like SCAN does need denser grid for lattice integral in eletronic kinetic energy evaluation, so it is recommended to set ecutwfc in a higher value like 200 Ry. Also, you can have some tests with the LCAO orbitals, while the completeness of them can also make the result different.

Besides, the original SCAN have numerical stability problem in SCF convergence, you can try R2SCAN with LibXC installed by setting dft_functional MGGA_X_R2SCAN+MGGA_C_R2SCAN

@yycx1111
Copy link
Author

Hello @yycx1111 As shown in https://kirk0830.github.io/ABACUS-Pseudopot-Nao-Square/pseudopotential/results/2024-04-30/Ga.html, the ecutwfc value for Ga in PBE calculation should be 200 Ry in PBE-PW calculation using SG15-v1.0 potential. In PBE-LCAO calculation, the ecutwfc values could be lower, but meta-GGA like SCAN does need denser grid for lattice integral in eletronic kinetic energy evaluation, so it is recommended to set ecutwfc in a higher value like 200 Ry. Also, you can have some tests with the LCAO orbitals, while the completeness of them can also make the result different.

Besides, the original SCAN have numerical stability problem in SCF convergence, you can try R2SCAN with LibXC installed by setting dft_functional MGGA_X_R2SCAN+MGGA_C_R2SCAN

Thank you for your reply. After setting ecutwfc to be 200 Ry or dft_functional MGGA_X_R2SCAN+MGGA_C_R2SCAN, the bandgap was still not correct which is 0.0075459863 eV or 0.0101181566eV.
Does "have some tests with the LCAO orbitals" mean modifying the ’NUMERICAL_ORBITAL‘ in STRU?

@kirk0830
Copy link
Collaborator

@yycx1111 Hi, could you try with these orbitals? if these does not work, I guess it would be something wrong with the pseudopotential:

package 20250219164406.zip

@yycx1111
Copy link
Author

@yycx1111 Hi, could you try with these orbitals? if these does not work, I guess it would be something wrong with the pseudopotential:

package 20250219164406.zip

I have tried with these orbitals. The results are still not correct which is 0.0294054700eV, 0.0094091646eV, 0.0128309509eV. The pseudopotential I used is
Ga 69.723 Ga_ONCV_PBE-1.0.upf
N 14.007 N_ONCV_PBE-1.0.upf
Do you have any advice on pseudopotential?

@kirk0830
Copy link
Collaborator

@yycx1111 after a quick check, I want to make sure the following:

  1. have you relax your structure properly? I mean with proper ecutwfc, kspacing, ...etc
  2. are you sure there is no significant discrepancy in force evolution between SCAN and PBE?
  3. can PBE give a more reasonable value?

@yycx1111
Copy link
Author

@yycx1111 after a quick check, I want to make sure the following:

  1. have you relax your structure properly? I mean with proper ecutwfc, kspacing, ...etc
  2. are you sure there is no significant discrepancy in force evolution between SCAN and PBE?
  3. can PBE give a more reasonable value?

For questions 1 and 3, the answer is yes. I did the convergence test and the structure is fine. The PBE generalisation gives me the correct bandgap value.
Here is the convergence process when scf is calculated.
Image
Image

@kirk0830
Copy link
Collaborator

@yycx1111 I will share pseudopotential for specifically the SCAN functional tomorrow :)

@kirk0830
Copy link
Collaborator

Useful information: how to generate ABACUS numerical atomic orbital from custom pseudopotential

Knowing the pseudopotential behavior

The first thing is to test its convergence behaviors (of energy, stress, band structure, etc.), then the quality of wavefunction can be guaranteed for most cases. Here I use the ABACUS-Pseudopot-Nao-Square (APNS) backend high-throughput workflow to perform convergence/efficiency tests on the following pseudopotentials that SCAN functional-specific:
PROJECT-Ga-q3.UPF-1.zip
. To build APNS locally, see README.md of its repo: https://github.com/kirk0830/ABACUS-Pseudopot-Nao-Square
. After a local pseudopotential archiving/configuration

{
    "rules": [
        {
            "re.folder": "scan-functional-upf",
            "re.file": "PROJECT-([A-Z][a-z]?).*\\.upf",
            "tags": ["norm-conserving", "NC", 
                     "SCAN", "scan", 
                     "GTH", "Goedecker-Teter-Hutter", 
                     "sr"]
        }
    ]
}

(see https://github.com/kirk0830/ABACUS-Pseudopot-Nao-Square/tree/main/download/upf), scan the ecutwfc with values 20, 30, 40, 50, 60, 70, 80, 90, 100, 150, 200, 300, 400 Rydberg:

{
    "global": {
        "mode": "test",
        "pseudo_dir": "~/documents/simulation/cp2k/scan-functional-upf/",
        "cache_dir": "~/deepmodeling/ABACUS-Pseudopot-Nao-Square/apns_cache",
        "out_dir": "~/documents/simulation/abacus/scan-functional-upf-test/jobs/"
    },
    "credentials": {
        "materials_project": {
            "api_key": "***"
        }
    },
    "abacus": [
        {
            "ecutwfc": [20, 30, 40, 50, 60, 70, 80, 90, 100, 150, 200, 300, 400],
            "calculation": "scf",
            "basis_type": "pw",
            "cal_force": 1,
            "cal_stress": 1,
            "nspin": 1,
            "symmetry": 1,
            "ks_solver": "dav",
            "out_chg": -1
        }
    ],
    "atomsets": [
        {
            "Ga": [["NC"], null]
        }
    ],
    "strusets": [
        {
            "calculator": "abacus", "calcset": 0,
            "atomset": 0,
            "database": "materials_project",
            "desc": [["search", "Ga", [1.00], [0.15]]]
        }
    ]
}

Then use abacustest developed by @pxlxingliang one can submit all folders generated in directory /home/whoami/documents/simulation/abacus/scan-functional-upf-test/jobs/ to the Bohrium platform (https://bohrium.dp.tech/). An easy-to-use script that can run abacustest automatically can be found here: https://github.com/kirk0830/ABACUS-Pseudopot-Nao-Square/blob/main/apns/abacustest/standalone.py
PS. each folder have a uniformed structure like:

whoami@legion:~/documents/simulation/abacus/scan-functional-upf-test/jobs# ll 38fbf984-f8b3-4e59-ad6a-2a3a575ea556/
total 164
drwxr-xr-x  2 whoami whoami 4096 Feb 20 10:03 ./
drwxr-xr-x 28 whoami whoami   4096 Feb 20 10:03 ../
-rw-r--r--  1 whoami whoami    231 Feb 20 10:03 INPUT
-rw-r--r--  1 whoami whoami     31 Feb 20 10:03 KPT
-rw-r--r--  1 whoami whoami 137752 Feb 20 10:03 PROJECT-Ga-q3.UPF-1.upf
-rw-r--r--  1 whoami whoami    614 Feb 20 10:03 STRU
-rw-r--r--  1 whoami whoami   4605 Feb 20 10:03 description.json

. In description.json you can find most of simulation information, therefore sorting all information from folders named with uuid will be easy. There is a script https://github.com/kirk0830/ABACUS-Pseudopot-Nao-Square/blob/main/apns/analysis/apns2_ecut_abacus.py can do this.
Here I give you the result:

POTENTIAL_UZH.json

, in which you can find the pseudopotential that semicore-included is very hard, it cannot reach the convergence even when ecutwfc is set to 400 Ry. This is a typical behavior of pseudopotential that published by CP2K.

warning: these pseudopotentials are not tested for precision, use with care

Generate orbitals

Following tutorials, you can generate orbitals you like. A brief theoretical background can be found at:
https://mcresearch.github.io/abacus-user-guide/abacus-nac1.html
Remember: set the ecutwfc to the value that meet your demand of convergence. For example in APNS project, the convergence thresholds are, 1 meV/atom for energy, 0.1 kbar for pressure, 10 meV for band structure.
please see the hands-on for technical details:

  1. SimulatedAnnealing: https://mcresearch.github.io/abacus-user-guide/abacus-nac2.html
  2. PTG-DPSI: https://mcresearch.github.io/abacus-user-guide/abacus-nac3.html

Here I provide orbitals rcut from 6 to 10, zeta configuration from SZ to TZDP, the orbital of N and Ga (q3):

issue-5901-scan-functional-pporb.zip

cc. @yycx1111

@ErjieWu
Copy link
Collaborator

ErjieWu commented Feb 21, 2025

@yycx1111
I've tried to calculate the bandgap for GaAs before and it has the similar problem for bandgap. The PBE result shows 0.057284 eV and HSE shows 1.022783 eV. Both lower than the experimental result 1.52eV. To solve the problem, I tried to use Ga_ONCV_PBE-1.1.upf instead of Ga_ONCV_PBE-1.0.upf and set the lattice by hand, it gave the result close to the experimental result. It seems the error is caused by pseudo-potential file for Ga.
Maybe you can try SG15-v1.1 potential for Ga to see whether it works better.

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
Development

No branches or pull requests

5 participants