Fix OT unoccupied eigenvalue bandgaps - #230
Open
cpignedoli wants to merge 9 commits into
Open
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
cpignedoli
marked this pull request as ready for review
June 23, 2026 08:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This fixes OT HOMO-LUMO bandgap parsing for CP2K outputs where occupied and unoccupied eigenvalues are printed in separate blocks.
The parser now:
eigen_spin*_aukeys;unoccupied_eigen_spin*_aukeys;HOMO - LUMO gap [eV]values intoprinted_bandgap_spin*_ev;bandgap_spin*_aufrom CP2K's printed gap when available;eigenvalue_homo_spin*_au,eigenvalue_lumo_spin*_au, andeigenvalue_bandgap_spin*_auwhen both frontier eigenvalues are available;bandgap_spin*_auonly if CP2K did not print a gap;bandgap_spin*_auabsent if no real LUMO is available;Root Cause
After #184,
eigen_spin*_auintentionally excluded theLowest eigenvalues of the unoccupied subspaceblock. However,Cp2kAdvancedParserstill assumed the LUMO was present ineigen_spin*_au, so for OT outputs it could silently report an occupied-occupied spacing asbandgap_spin*_au.CI Maintenance Included
Small CI/doc maintenance changes are included because the existing checks were failing before reaching the relevant parser tests:
.github/workflows/ci.ymlfromactions/cache@v2toactions/cache@v4, since GitHub now hard-fails workflows using cache v2;docs/source/conf.py::nitpick_ignore, because the docs job runs Sphinx with-nWand was failing on unresolved external AiiDA references unrelated to this parser change;pyupgradepre-commit hook runtime to avoid a pre-commit.ci crash under Python 3.14. The hook still uses--py37-plus, so this does not change the package compatibility target.Tests
Added regression coverage using:
OT_v9.1.outfixture;Local validation performed in this environment:
OT_v9.1.out: stored printed gap0.009679 eV;OT_UKS_with_warnings.out: stored printed gaps2.811670 eVand2.798202 eV;2.811670 eVand2.798202 eV;python -m compileall /home/jovyan/opt/aiida-cp2k/aiida_cp2k;pre-commit run --all-files.Full pytest could not be run in this container because the repository
conftest.pyloads AiiDA PostgreSQL test fixtures and the environment is missing thelocatecommand required bypgtest.