Fix(pw): suppress spurious warning when no plane waves exist for a k-point#7282
Merged
Merged
Conversation
mohanchen
approved these changes
Apr 28, 2026
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.
Linked Issue
Refs #7201
Description
This PR fixes the spurious
no plane waveswarning that occur during SCF calculations when certain k-points have zero plane waves due to insufficient wavefunction cutoff energy (ecutwfc).When performing calculations with small simulation cells and low energy cutoffs,
k-points located far from reciprocal lattice points (requiring large |k+G| vectors)
may fall outside the kinetic energy cutoff sphere,
resulting in zero plane waves for those k-points. In such regimes:
ecutwfc(50–60 Ry), the code immediately aborted with"no plane waves".ecutwfc(70–130 Ry), plane waves existed butnpwx < nbands,leading to rank deficiency and
psi_norm <= 0during CG diagonalization indiago_cg.cpp.These k-points with zero plane waves are valid edge cases. This PR adds the
necessary zero-count guards so the code reports energy/k-points issue instead of reducing the cores.
What's Changed
PW_Basis_K::setuptransform()when no plane waves are available for a k-point.Prompts the user to increase
ecutwfcor check KPT settings.Prompts the user to reduce the number of cores.
Unit Tests and/or Case Tests for my changes
test_no_plane_wave_message_global_empty_ktest_no_plane_wave_message_parallel_local_empty