From 54cc6c0e45890981b00be5d5981f43cbffa4e1cd Mon Sep 17 00:00:00 2001 From: Critsium Date: Thu, 2 Jul 2026 14:34:12 +0800 Subject: [PATCH 1/7] fix(tools): correct syntax error in RT-TDDFT projection tool Line 9 contained the invalid expression `fdir suffix + s_dir`, which made projection.py unparseable. Use `fdir + s_dir` to match the working example copy. Closes #7541 Co-Authored-By: Claude Opus 4.8 --- tools/02_postprocessing/rt-tddft-tools/projection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/02_postprocessing/rt-tddft-tools/projection.py b/tools/02_postprocessing/rt-tddft-tools/projection.py index 80d54504b1b..34553f7118f 100644 --- a/tools/02_postprocessing/rt-tddft-tools/projection.py +++ b/tools/02_postprocessing/rt-tddft-tools/projection.py @@ -6,7 +6,7 @@ def __init__(self, stepref, klist, steps, fdir='./OUT.ABACUS', wfc_dir='', s_dir self.klist = klist self.steps = steps self.wfc_dir = fdir + wfc_dir - self.s_dir = fdir suffix + s_dir + self.s_dir = fdir + s_dir wfc_ref, Ocp_ref = self.read_wfc(klist[0]+1, stepref+1, dir=self.wfc_dir) self.nband = len(Ocp_ref) self.nlocal = len(wfc_ref[0]) From 64edf18bdc244cd4bc7170a5163bdedf0f31d99a Mon Sep 17 00:00:00 2001 From: Critsium Date: Thu, 2 Jul 2026 14:34:12 +0800 Subject: [PATCH 2/7] fix(tools): repair empty else branch in generate_orbital_mixstru.sh `bash -n` failed on the empty `else` branch before `fi`. Add a `:` no-op so the example script is syntactically valid. Closes #7542 Co-Authored-By: Claude Opus 4.8 --- .../example_opt_lcao_bash/generate_orbital_mixstru.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/01_NAO_generation/examples/example_opt_lcao_bash/generate_orbital_mixstru.sh b/tools/01_NAO_generation/examples/example_opt_lcao_bash/generate_orbital_mixstru.sh index a810997e5ed..50b7e779ce4 100755 --- a/tools/01_NAO_generation/examples/example_opt_lcao_bash/generate_orbital_mixstru.sh +++ b/tools/01_NAO_generation/examples/example_opt_lcao_bash/generate_orbital_mixstru.sh @@ -651,8 +651,8 @@ if [ "${EXE_orbital:0-3:3}" != ".py" ]; then echo ok ; -else - +else + : fi From 2cf31669ced35d02ca9a1a871272936a80d835be Mon Sep 17 00:00:00 2001 From: Critsium Date: Thu, 2 Jul 2026 14:34:12 +0800 Subject: [PATCH 3/7] fix(nao): reject one-past angular momentum index in TwoCenterTable index_map_ is allocated with final dimension length bra.lmax()+ket.lmax()+1, so valid indices are 0..dim_size(6)-1. The bounds check used `l <= dim_size(6)`, allowing a one-past read. Use `l < dim_size(6)` to match the neighboring dimension checks. Closes #7552 Co-Authored-By: Claude Opus 4.8 --- source/source_basis/module_nao/two_center_table.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/source_basis/module_nao/two_center_table.cpp b/source/source_basis/module_nao/two_center_table.cpp index 821e881a458..d2ef6fb6257 100644 --- a/source/source_basis/module_nao/two_center_table.cpp +++ b/source/source_basis/module_nao/two_center_table.cpp @@ -135,7 +135,7 @@ bool TwoCenterTable::is_present(const int itype1, return itype1 >= 0 && itype1 < index_map_.shape().dim_size(0) && l1 >= 0 && l1 < index_map_.shape().dim_size(1) && izeta1 >= 0 && izeta1 < index_map_.shape().dim_size(2) && itype2 >= 0 && itype2 < index_map_.shape().dim_size(3) && l2 >= 0 && l2 < index_map_.shape().dim_size(4) && izeta2 >= 0 - && izeta2 < index_map_.shape().dim_size(5) && l >= 0 && l <= index_map_.shape().dim_size(6) + && izeta2 < index_map_.shape().dim_size(5) && l >= 0 && l < index_map_.shape().dim_size(6) && index_map_.get_value(itype1, l1, izeta1, itype2, l2, izeta2, l) >= 0; } From 4d6d6f3efa6505fdecad166d198e1c3c79aea59e Mon Sep 17 00:00:00 2001 From: Critsium Date: Thu, 2 Jul 2026 14:34:12 +0800 Subject: [PATCH 4/7] fix(container): copy innermost dimension when slicing 3D tensors Each 3D row is placed at offset_out advancing by size[2], so the contiguous copy length must also be size[2]. The copy used size[1], corrupting non-cubic slices where size[1] != size[2]. Closes #7551 Co-Authored-By: Claude Opus 4.8 --- source/source_base/module_container/ATen/core/tensor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/source_base/module_container/ATen/core/tensor.cpp b/source/source_base/module_container/ATen/core/tensor.cpp index 92babb361c9..0affb9d995f 100644 --- a/source/source_base/module_container/ATen/core/tensor.cpp +++ b/source/source_base/module_container/ATen/core/tensor.cpp @@ -196,7 +196,7 @@ Tensor Tensor::slice(const std::vector &start, const std::vector &size int offset_out = i * size[1] * size[2] + j * size[2]; TEMPLATE_ALL_2(this->data_type_, this->device_, kernels::synchronize_memory()( - output.data() + offset_out, this->data() + offset, size[1])) + output.data() + offset_out, this->data() + offset, size[2])) } } } From 9e770366801c2cf34470265bfbe78a893f014c5b Mon Sep 17 00:00:00 2001 From: Critsium Date: Thu, 2 Jul 2026 14:34:36 +0800 Subject: [PATCH 5/7] fix(esolver): delete OFDFT KEDF_Manager with scalar delete kedf_manager_ is allocated with scalar `new KEDF_Manager()`, but the reinitialization path in before_all_runners() freed it with `delete[]`, which is undefined behavior. Use scalar `delete` to match the allocation. Closes #7548 Co-Authored-By: Claude Opus 4.8 --- source/source_esolver/esolver_of.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/source_esolver/esolver_of.cpp b/source/source_esolver/esolver_of.cpp index b346df60fb8..435e292e98c 100644 --- a/source/source_esolver/esolver_of.cpp +++ b/source/source_esolver/esolver_of.cpp @@ -119,7 +119,7 @@ void ESolver_OF::before_all_runners(UnitCell& ucell, const Input_para& inp) this->nelec_[0] = this->pelec->nelec_spin[0]; this->nelec_[1] = this->pelec->nelec_spin[1]; } - delete[] this->kedf_manager_; + delete this->kedf_manager_; this->kedf_manager_ = new KEDF_Manager(); this->kedf_manager_->init(inp, this->pw_rho, this->dV_, this->nelec_[0]); ModuleBase::GlobalFunc::DONE(GlobalV::ofs_running, "INIT KEDF"); From 12f66ac32a5aae5c1d673405883e2d433508a9a7 Mon Sep 17 00:00:00 2001 From: Critsium Date: Thu, 2 Jul 2026 14:34:37 +0800 Subject: [PATCH 6/7] fix(ci): use consistent SuperLU_DIST32_ROOT variable in path exports LD_LIBRARY_PATH, PKG_CONFIG_PATH and CPATH referenced the misspelled SUPERLU32_DIST_ROOT while CMAKE_PREFIX_PATH used SUPERLU_DIST32_ROOT (the name defined in Dockerfile.intel). Align the path exports to SUPERLU_DIST32_ROOT so SuperLU_DIST is not silently omitted. Closes #7572 Co-Authored-By: Claude Opus 4.8 --- .github/workflows/ase_plugin_test.yml | 6 +++--- .github/workflows/build_test_cmake.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ase_plugin_test.yml b/.github/workflows/ase_plugin_test.yml index bce0a379012..3b5dd93a697 100644 --- a/.github/workflows/ase_plugin_test.yml +++ b/.github/workflows/ase_plugin_test.yml @@ -48,9 +48,9 @@ jobs: - name: Configure & Build ABACUS (GNU) run: | git config --global --add safe.directory `pwd` - export LD_LIBRARY_PATH=${GKLIB_ROOT}/lib:${METIS32_ROOT}/lib:${PARMETIS32_ROOT}/lib:${SUPERLU32_DIST_ROOT}/lib:${PEXSI32_ROOT}/lib:${LD_LIBRARY_PATH} - export PKG_CONFIG_PATH=${GKLIB_ROOT}/lib/pkgconfig:${METIS32_ROOT}/lib/pkgconfig:${PARMETIS32_ROOT}/lib/pkgconfig:${SUPERLU32_DIST_ROOT}/lib/pkgconfig:${PEXSI32_ROOT}/lib/pkgconfig:${PKG_CONFIG_PATH} - export CPATH=${GKLIB_ROOT}/include:${METIS32_ROOT}/include:${PARMETIS32_ROOT}/include:${SUPERLU32_DIST_ROOT}/include:${PEXSI32_ROOT}/include:${CPATH} + export LD_LIBRARY_PATH=${GKLIB_ROOT}/lib:${METIS32_ROOT}/lib:${PARMETIS32_ROOT}/lib:${SUPERLU_DIST32_ROOT}/lib:${PEXSI32_ROOT}/lib:${LD_LIBRARY_PATH} + export PKG_CONFIG_PATH=${GKLIB_ROOT}/lib/pkgconfig:${METIS32_ROOT}/lib/pkgconfig:${PARMETIS32_ROOT}/lib/pkgconfig:${SUPERLU_DIST32_ROOT}/lib/pkgconfig:${PEXSI32_ROOT}/lib/pkgconfig:${PKG_CONFIG_PATH} + export CPATH=${GKLIB_ROOT}/include:${METIS32_ROOT}/include:${PARMETIS32_ROOT}/include:${SUPERLU_DIST32_ROOT}/include:${PEXSI32_ROOT}/include:${CPATH} export CMAKE_PREFIX_PATH=${PEXSI32_ROOT}:${SUPERLU_DIST32_ROOT}:${PARMETIS32_ROOT}:${METIS32_ROOT}:${GKLIB_ROOT}:${CMAKE_PREFIX_PATH} source toolchain/install/setup rm -rf build diff --git a/.github/workflows/build_test_cmake.yml b/.github/workflows/build_test_cmake.yml index 5da22cb3de4..ea4ce366fd0 100644 --- a/.github/workflows/build_test_cmake.yml +++ b/.github/workflows/build_test_cmake.yml @@ -70,9 +70,9 @@ jobs: - name: Build run: | git config --global --add safe.directory `pwd` - export LD_LIBRARY_PATH=${GKLIB_ROOT}/lib:${METIS32_ROOT}/lib:${PARMETIS32_ROOT}/lib:${SUPERLU32_DIST_ROOT}/lib:${PEXSI32_ROOT}/lib:${LD_LIBRARY_PATH} - export PKG_CONFIG_PATH=${GKLIB_ROOT}/lib/pkgconfig:${METIS32_ROOT}/lib/pkgconfig:${PARMETIS32_ROOT}/lib/pkgconfig:${SUPERLU32_DIST_ROOT}/lib/pkgconfig:${PEXSI32_ROOT}/lib/pkgconfig:${PKG_CONFIG_PATH} - export CPATH=${GKLIB_ROOT}/include:${METIS32_ROOT}/include:${PARMETIS32_ROOT}/include:${SUPERLU32_DIST_ROOT}/include:${PEXSI32_ROOT}/include:${CPATH} + export LD_LIBRARY_PATH=${GKLIB_ROOT}/lib:${METIS32_ROOT}/lib:${PARMETIS32_ROOT}/lib:${SUPERLU_DIST32_ROOT}/lib:${PEXSI32_ROOT}/lib:${LD_LIBRARY_PATH} + export PKG_CONFIG_PATH=${GKLIB_ROOT}/lib/pkgconfig:${METIS32_ROOT}/lib/pkgconfig:${PARMETIS32_ROOT}/lib/pkgconfig:${SUPERLU_DIST32_ROOT}/lib/pkgconfig:${PEXSI32_ROOT}/lib/pkgconfig:${PKG_CONFIG_PATH} + export CPATH=${GKLIB_ROOT}/include:${METIS32_ROOT}/include:${PARMETIS32_ROOT}/include:${SUPERLU_DIST32_ROOT}/include:${PEXSI32_ROOT}/include:${CPATH} export CMAKE_PREFIX_PATH=${PEXSI32_ROOT}:${SUPERLU_DIST32_ROOT}:${PARMETIS32_ROOT}:${METIS32_ROOT}:${GKLIB_ROOT}:${CMAKE_PREFIX_PATH} source toolchain/install/setup rm -rf build From db5774d45d2642319e67475f9041dc6f6e79250a Mon Sep 17 00:00:00 2001 From: Critsium Date: Thu, 2 Jul 2026 14:34:37 +0800 Subject: [PATCH 7/7] fix(io): read LATTICE_PARAMETER blocks consistently in STRU parsers The Multiwfn and pyabacus STRU parsers checked for a LATTICE_PARAMETER block but then read blocks['LATTICE_PARAMETERS'] with an extra S, and treated the list of lines as a string. Read blocks['LATTICE_PARAMETER'][0].split() to match the neighboring LATTICE_CONSTANT idiom, so STRU files using LATTICE_PARAMETER parse instead of raising KeyError. The identical fix for the ASE AbacusLite parser is intentionally left out of this PR and will be handled separately. Refs #7555 Co-Authored-By: Claude Opus 4.8 --- interfaces/Multiwfn_interface/molden.py | 2 +- python/pyabacus/src/pyabacus/io/stru.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/interfaces/Multiwfn_interface/molden.py b/interfaces/Multiwfn_interface/molden.py index 471767089f6..1935267a2c9 100644 --- a/interfaces/Multiwfn_interface/molden.py +++ b/interfaces/Multiwfn_interface/molden.py @@ -841,7 +841,7 @@ def read_stru(fpath): if 'LATTICE_VECTORS' in blocks: stru['lat']['vec'] = [[float(x) for x in line.split()] for line in blocks['LATTICE_VECTORS']] elif 'LATTICE_PARAMETER' in blocks: - stru['lat']['param'] = [float(x) for x in blocks['LATTICE_PARAMETERS'].split()] + stru['lat']['param'] = [float(x) for x in blocks['LATTICE_PARAMETER'][0].split()] #============ ATOMIC_SPECIES ============ stru['species'] = [ dict(zip(['symbol', 'mass', 'pp_file', 'pp_type'], line.split())) for line in blocks['ATOMIC_SPECIES'] ] diff --git a/python/pyabacus/src/pyabacus/io/stru.py b/python/pyabacus/src/pyabacus/io/stru.py index 0327898fc45..429f9dd09fb 100644 --- a/python/pyabacus/src/pyabacus/io/stru.py +++ b/python/pyabacus/src/pyabacus/io/stru.py @@ -134,7 +134,7 @@ def _trim(line): for line in blocks['LATTICE_VECTORS']] elif 'LATTICE_PARAMETER' in blocks: stru['lat']['param'] = [float(x) - for x in blocks['LATTICE_PARAMETERS'].split()] + for x in blocks['LATTICE_PARAMETER'][0].split()] #============ ATOMIC_SPECIES ============ stru['species'] = [_atomic_species_from_file(line)