Repository navigation
Conversation
added 8 commits
December 5, 2026 17:28
Test PW DFT+U + DeltaSpin in NSCF band structure calculation, XY magnetization constraint, SCF+NSCF workflow. Add to both CASES_CPU.txt and CASES_GPU.txt.
Superseded by tests/01_PW/nscf_deltaspin4_dftu.
Test LCAO DFT+U + DeltaSpin in NSCF band structure calculation, XY magnetization constraint, SCF+NSCF workflow. Add to both CASES_CPU.txt and CASES_GPU.txt.
Superseded by tests/03_NAO_multik/nscf_deltaspin4_u.
Previously, when init_chg=file, the occupation matrix was implicitly read from occ_mat.txt even without init_occ_mat. This made the two code paths (init_occ_mat vs init_chg=file) overlapping and confusing. Now only init_occ_mat controls occupation-matrix initialization: - init_occ_mat != 0: read from dm_onsite_ini.txt / occ_mat.txt - init_occ_mat == 0: zero the matrix regardless of init_chg
added 14 commits
December 5, 2026 18:18
These cases duplicate coverage already provided by 01_PW/02_NAO_Gamma/ 03_NAO_multik: - plain spin (nspin=2/4) SCF: 01, 02, 06, 07 - DFT+U SCF: 03, 04, 05, 08, 09, 11 - DeltaSpin SCF (nspin=2/4): 12, 14, 15, 16, 24, 26, 27, 28 - DFT+U + DeltaSpin combos: 18, 19, 21, 30, 31, 32, 33 - sc_scf_thr parameter variants: 38-45 Remaining 8 cases (ReadLam, FeO atom-order, DirectionOnly) cover unique code paths and will be migrated to 01_PW/03_NAO_multik.
…n_state.h - test_read_atoms.cpp: add 3 tests covering lambda vector parsing, lambda scalar (z-only), and default zero when lambda is absent - deltaspin_state.h: fix stale comment - lambda unit in STRU is eV/uB, matching parser and print conventions (was meV/uB)
- read_atoms_helper.cpp: add input_lambda flag to detect repeated lambda keyword; emit WARNING when lambda is repeated for the same atom - read_atoms.cpp: pass input_lambda flag through to parse_atom_properties - read_atoms_helper.h: add input_lambda parameter to parse_atom_properties - deltaspin_state.cpp/h: remove dead ScData/ScAtomData code (never populated) - spin_constrain.h: remove dead wrapper functions set_sc_lambda(), set_target_mag(), set_constrain() (never called)
- read_atoms_helper.h/cpp: add input_sc flag to parse_atom_properties; WARNING_QUIT when sc is repeated for the same atom - read_atoms_helper.cpp: explicitly zero x/y components when single-value sc is parsed (consistent with lambda behavior) - read_atoms.cpp: pass input_sc flag to parse_atom_properties
- read_atoms_helper.h/cpp: add input_mag, input_angle1, input_angle2 flags; WARNING_QUIT when mag/angle1/angle2 is repeated for the same atom - read_atoms.cpp: pass new flags to parse_atom_properties - test_read_atoms.cpp: add 3 death tests for repeated mag/angle1/angle2
- read_atoms_helper.h/cpp: add input_m and input_v flags; WARNING_QUIT when m or v/vel/velocity is repeated for the same atom - read_atoms.cpp: pass new flags to parse_atom_properties - test_read_atoms.cpp: add ScVectorParsed and ScScalarParsedAsZ tests
These cases use nsc=1 (read lambda from file) but the required lambda files are absent, so they cannot run. Remove them along with the other duplicate cases in 17_DS_DFTU.
- Swap O/Fe species order in 03_NAO_multik/scf_u_spin2 so O is atom type 0 and Fe is type 1; apply U only to Fe (orbital_corr -1 2, hubbard_u 0.0 5.0) - Regenerate result.ref; energy/force/stress are numerically identical to the previous Fe-first order, confirming order independence - Remove duplicate PW atom-order cases 50/51 from 17_DS_DFTU
Keep only the plain DeltaSpin direction-only coverage in PW (56) and LCAO (58). Update CASES_CPU.txt to list the remaining cases; the old list still referenced deleted cases 01 and 03.
- Move 56_PW_DS_S4_DirectionOnly_XY from 17_DS_DFTU to 01_PW/scf_deltaspin4_dir and switch the element from Fe to Ni (Ni_ONCV_PBE-1.0.upf, Ni_gga_9au_100Ry_4s2p2d1f.orb) - Align INPUT formatting with other 01_PW cases - Disable the case in CASES_CPU.txt as a known bug: direction_only projects lambda parallel component to zero, triggering repeated [GRAD-DECAY] nu_change warnings and stalling convergence - Remove 56 from 17_DS_DFTU/CASES_CPU.txt
The remaining direction-only case (58) is no longer needed. DeltaSpin direction-only coverage is now the Ni case in 01_PW, currently disabled as a known bug. Drop the add_subdirectory entry as well.
CI rejects modifications to unit test sources under the legacy test/ directory. Migrate read_atoms_hlp_test.cpp to source_cell/unittests/test_read_atoms_hlp.cpp, drop the hand-written mocks and main() (the cell library and gtest_main now provide them), and register the target in unittests/CMakeLists.txt. Verified: target builds and all 33 tests pass.
This branch has not been deployed
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.
Fix #8529
Summary
Add two new integration test cases for DeltaSpin + DFT+U NSCF band structure calculations, and remove four legacy test cases from
17_DS_DFTU.New test cases
tests/01_PW/nscf_deltaspin4_dftu— PW basis, noncollinear nscf with DFT+U and DeltaSpin (XY constraint), reading charge density and occupation matrix from prior scf steptests/03_NAO_multik/nscf_deltaspin4_u— LCAO basis, same setupBoth cases use
init_occ_mat 1to explicitly read the occupation matrix,out_band 1for band structure output, and are registered inCASES_CPU.txtandCASES_GPU.txt.DFT+U code change
init_chg: previouslyinit_chg=fileimplicitly readocc_mat.txt; now onlyinit_occ_matcontrols whether the occupation matrix is loadedRemoved legacy cases (superseded by new ones)
tests/17_DS_DFTU/55_PW_DS_NSCF_S4_XYtests/17_DS_DFTU/60_PW_DFTU_DS_NSCF_Band_XYtests/17_DS_DFTU/61_LCAO_DS_NSCF_S4_XY+62_LCAO_DFTU_NSCF_Band_XYtests/17_DS_DFTU/63_LCAO_DFTU_DS_NSCF_Band_XY