Skip to content

Wrong result for TwoCenterIntegrator module in pyabacus. #6376

@ErjieWu

Description

@ErjieWu

Describe the bug

When using ModuleNAO.TwoCenterIntegrator() module in pyabacus and calculate the overlap of two orbitals, the result mismatch the output in ABACUS. Take "Si_gga_7au_100Ry_2s2p1d.orb" for example, when I calculate the overlap of s orbital with all orbitals as follows:

from pyabacus import ModuleBase as base
from pyabacus import ModuleNAO as nao
orb = nao.RadialCollection()
orb.build(1, ["Si_gga_7au_100Ry_2s2p1d.orb"])
orb.set_uniform_grid(True, nr, cutoff, 'i', True) # nr =701, cutoff = 14.0 here
integrator = nao.TwoCenterIntegrator()
integrator.tabulate(orb, orb, 'S', nr, cutoff)
test = integrator.snap(0, 0, 0, 0, 0, dist, False) # here dist = 0 for overlap with itself
print(test[0])

The result shows

[1.111111111111111, -2.636779683484747e-16, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]

However, it should be 1 at first value (itself) and 0 at other values (overlap with other s,p,d orbitals)
In ABACUS, the result is reasonable (shown below).

[1, -3.12882700630797e-16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

So there must be something wrong with this module in pyabacus.

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).

Metadata

Metadata

Assignees

Labels

BugsBugs that only solvable with sufficient knowledge of DFTpyabacusABACUS used with Python

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions