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

Number of electrons can be large than number of orbitals (or equal) #1169

Open
foxtran opened this issue Feb 1, 2025 · 1 comment
Open
Labels
unconfirmed This report has not yet been confirmed by the developers

Comments

@foxtran
Copy link
Contributor

foxtran commented Feb 1, 2025

Describe the bug
For systems with an extra electrons, the condition that # electrons equals # orbitals that may lead to out-of-bounds access, for example, here:

e_fermi = 0.5*(eig(nel)+eig(nel+1))

And therefore, there is a out-of-bounds memory access.

To Reproduce
Steps to reproduce the behaviour:

  1. Use the latest version (from git repo)
  2. Add manual check near src/scc_core.f90#L974
  3. xtb h2.xyz --chrg 1
  4. See your message :-)

Expected behaviour
Properly catching cases when number of electrons achieves number of orbitals.

Additional context
Add any other context about the problem here.

H2.xyz:

2

H 0.7 0.0 0.0
H 0.0 0.0 0.0
@foxtran foxtran added the unconfirmed This report has not yet been confirmed by the developers label Feb 1, 2025
@marvinfriede
Copy link
Member

Thanks for reporting. You also see the issue by just looking at the Fermi level.

xtb h2.xyz --ceasefiles --chrg 1 | grep "Fermi-level"

This shows:

Fermi-level NaN Eh NaN eV

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unconfirmed This report has not yet been confirmed by the developers
Projects
None yet
Development

No branches or pull requests

2 participants