Skip to content

[Refactor] Rename module_hsolver to source_hsolver #6305

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

Merged
merged 2 commits into from
Jun 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ For those who are interested in the source code, the following figure shows the
| |-- hamilt_pwdft The module for defining the Hamiltonian in PW-DFT calculations.
| | |-- operator_pw The module for defining the operators in PW-DFT calculations.
| `-- hamilt_stodft The module for defining the Hamiltonian in STODFT calculations.
|-- module_hsolver The module for solving the Hamiltonian with different diagonalization methods, including CG, Davidson in PW
|-- source_hsolver The module for solving the Hamiltonian with different diagonalization methods, including CG, Davidson in PW
| | calculations, and scalapack and genelpa in LCAO calculations.
|-- module_io The module for reading of INPUT files and output properties including band structure, density of states, charge density, etc.
|-- module_md The module for performing molecular dynamics.
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/acceleration/cuda.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ In ABACUS, we provide the option to use GPU devices to accelerate performance. T

- **Parallel strategy**: K point parallel.

Unlike PW basis, only the grid integration module (module_gint) and the diagonalization of the Hamiltonian matrix (module_hsolver) have been implemented with GPU acceleration under LCAO basis.
Unlike PW basis, only the grid integration module (module_gint) and the diagonalization of the Hamiltonian matrix (source_hsolver) have been implemented with GPU acceleration under LCAO basis.

## Required hardware/software

Expand Down
2 changes: 1 addition & 1 deletion python/pyabacus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ find_package(pybind11 CONFIG REQUIRED)
set(ABACUS_SOURCE_DIR "${PROJECT_SOURCE_DIR}/../../source")
set(BASE_PATH "${ABACUS_SOURCE_DIR}/module_base")
set(NAO_PATH "${ABACUS_SOURCE_DIR}/module_basis/module_nao")
set(HSOLVER_PATH "${ABACUS_SOURCE_DIR}/module_hsolver")
set(HSOLVER_PATH "${ABACUS_SOURCE_DIR}/source_hsolver")
set(PSI_PATH "${ABACUS_SOURCE_DIR}/module_psi")
set(ENABLE_LCAO ON)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/../../cmake")
Expand Down
2 changes: 1 addition & 1 deletion python/pyabacus/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ find_package(pybind11 CONFIG REQUIRED)
set(ABACUS_SOURCE_DIR "${PROJECT_SOURCE_DIR}/../../source")
set(BASE_PATH "${ABACUS_SOURCE_DIR}/module_base")
set(NAO_PATH "${ABACUS_SOURCE_DIR}/module_basis/module_nao")
set(HSOLVER_PATH "${ABACUS_SOURCE_DIR}/module_hsolver")
set(HSOLVER_PATH "${ABACUS_SOURCE_DIR}/source_hsolver")
set(PSI_PATH "${ABACUS_SOURCE_DIR}/module_psi")
set(ENABLE_LCAO ON)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/../../cmake")
Expand Down
2 changes: 1 addition & 1 deletion python/pyabacus/src/hsolver/py_diago_cg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <ATen/core/tensor_map.h>
#include <ATen/core/tensor_types.h>

#include "module_hsolver/diago_cg.h"
#include "source_hsolver/diago_cg.h"
#include "module_base/module_device/memory_op.h"

namespace py = pybind11;
Expand Down
2 changes: 1 addition & 1 deletion python/pyabacus/src/hsolver/py_diago_dav_subspace.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <pybind11/numpy.h>
#include <pybind11/stl.h>

#include "module_hsolver/diago_dav_subspace.h"
#include "source_hsolver/diago_dav_subspace.h"

namespace py = pybind11;

Expand Down
2 changes: 1 addition & 1 deletion python/pyabacus/src/hsolver/py_diago_david.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <pybind11/numpy.h>
#include <pybind11/stl.h>

#include "module_hsolver/diago_david.h"
#include "source_hsolver/diago_david.h"

namespace py = pybind11;

Expand Down
2 changes: 1 addition & 1 deletion python/pyabacus/src/hsolver/py_hsolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <pybind11/complex.h>
#include <pybind11/numpy.h>

#include "module_hsolver/diago_dav_subspace.h"
#include "source_hsolver/diago_dav_subspace.h"
#include "module_base/kernels/math_kernel_op.h"
#include "module_base/module_device/types.h"

Expand Down
14 changes: 7 additions & 7 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ add_subdirectory(module_elecstate)
add_subdirectory(module_hamilt_general)
add_subdirectory(module_hamilt_pw)
add_subdirectory(module_hamilt_lcao)
add_subdirectory(module_hsolver)
add_subdirectory(source_hsolver)
add_subdirectory(module_basis/module_ao)
add_subdirectory(module_basis/module_nao)
add_subdirectory(module_md)
Expand Down Expand Up @@ -35,8 +35,8 @@ list(APPEND device_srcs
module_hamilt_pw/hamilt_pwdft/kernels/meta_op.cpp
module_hamilt_pw/hamilt_stodft/kernels/hpsi_norm_op.cpp
module_basis/module_pw/kernels/pw_op.cpp
module_hsolver/kernels/dngvd_op.cpp
module_hsolver/kernels/bpcg_kernel_op.cpp
source_hsolver/kernels/dngvd_op.cpp
source_hsolver/kernels/bpcg_kernel_op.cpp
module_elecstate/kernels/elecstate_op.cpp

# module_psi/kernels/psi_memory_op.cpp
Expand Down Expand Up @@ -65,8 +65,8 @@ if(USE_CUDA)
module_hamilt_pw/hamilt_stodft/kernels/cuda/hpsi_norm_op.cu
module_hamilt_pw/hamilt_pwdft/kernels/cuda/onsite_op.cu
module_basis/module_pw/kernels/cuda/pw_op.cu
module_hsolver/kernels/cuda/dngvd_op.cu
module_hsolver/kernels/cuda/bpcg_kernel_op.cu
source_hsolver/kernels/cuda/dngvd_op.cu
source_hsolver/kernels/cuda/bpcg_kernel_op.cu
module_elecstate/kernels/cuda/elecstate_op.cu

# module_psi/kernels/cuda/memory_op.cu
Expand All @@ -92,8 +92,8 @@ if(USE_ROCM)
module_hamilt_pw/hamilt_pwdft/kernels/rocm/onsite_op.hip.cu
module_hamilt_pw/hamilt_stodft/kernels/rocm/hpsi_norm_op.hip.cu
module_basis/module_pw/kernels/rocm/pw_op.hip.cu
module_hsolver/kernels/rocm/dngvd_op.hip.cu
module_hsolver/kernels/rocm/bpcg_kernel_op.hip.cu
source_hsolver/kernels/rocm/dngvd_op.hip.cu
source_hsolver/kernels/rocm/bpcg_kernel_op.hip.cu
module_elecstate/kernels/rocm/elecstate_op.hip.cu

# module_psi/kernels/rocm/memory_op.hip.cu
Expand Down
8 changes: 4 additions & 4 deletions source/Makefile.Objects
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ VPATH=./src_global:\
./module_basis/module_pw:\
./module_basis/module_pw/module_fft:\
./source_esolver:\
./module_hsolver:\
./module_hsolver/kernels:\
./module_hsolver/genelpa:\
./module_hsolver/module_pexsi:\
./source_hsolver:\
./source_hsolver/kernels:\
./source_hsolver/genelpa:\
./source_hsolver/module_pexsi:\
./module_elecstate:\
./module_elecstate/kernels:\
./module_elecstate/module_pot:\
Expand Down
2 changes: 1 addition & 1 deletion source/module_base/kernels/dsp/dsp_connector.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "module_base/module_device/device.h"
#include "module_base/module_device/memory_op.h"
#include "module_hsolver/diag_comm_info.h"
#include "source_hsolver/diag_comm_info.h"

namespace mtfunc
{
Expand Down
4 changes: 2 additions & 2 deletions source/module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
#endif

#ifdef __ELPA
#include "module_hsolver/diago_elpa.h"
#include "source_hsolver/diago_elpa.h"
#endif

#include "module_elecstate/module_pot/H_TDDFT_pw.h"
#include "module_hamilt_general/module_xc/xc_functional.h"
#include "module_hamilt_lcao/module_deltaspin/spin_constrain.h"
#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h"
#include "module_hsolver/hsolver_lcao.h"
#include "source_hsolver/hsolver_lcao.h"
#include "operator_lcao/dftu_lcao.h"
#include "operator_lcao/dspin_lcao.h"
#include "operator_lcao/ekinetic_new.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
#include "module_base/timer.h"
#include "module_base/tool_title.h"
#include "module_hamilt_lcao/module_hcontainer/hcontainer_funcs.h"
#include "module_hsolver/hsolver_lcao.h"
#include "source_hsolver/hsolver_lcao.h"

#include "module_parameter/parameter.h"

#ifdef __ELPA
#include "module_hsolver/diago_elpa.h"
#include "module_hsolver/diago_elpa_native.h"
#include "source_hsolver/diago_elpa.h"
#include "source_hsolver/diago_elpa_native.h"
#endif

namespace hamilt {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#include "module_base/timer.h"
#include "module_base/tool_title.h"
#include "module_hsolver/diago_iter_assist.h"
#include "source_hsolver/diago_iter_assist.h"
#include "module_parameter/parameter.h"
#include "spin_constrain.h"
#include "module_hamilt_pw/hamilt_pwdft/onsite_projector.h"
#include "module_base/parallel_reduce.h"
#include "module_base/kernels/math_kernel_op.h"
#include "module_hsolver/hsolver_lcao.h"
#include "module_hsolver/hsolver_pw.h"
#include "source_hsolver/hsolver_lcao.h"
#include "source_hsolver/hsolver_pw.h"
#include "module_elecstate/elecstate_pw.h"
#include "module_elecstate/elecstate_tools.h"

Expand Down
2 changes: 1 addition & 1 deletion source/module_hamilt_lcao/module_gint/grid_technique.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "module_base/parallel_reduce.h"
#include "module_base/timer.h"
#include "module_hamilt_pw/hamilt_pwdft/global.h"
#include "module_hsolver/kernels/cuda/helper_cuda.h"
#include "source_hsolver/kernels/cuda/helper_cuda.h"

#include "module_hamilt_lcao/module_gint/temp_gint/gint_helper.h"

Expand Down
2 changes: 1 addition & 1 deletion source/module_hamilt_pw/hamilt_stodft/sto_elecond.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "module_hamilt_general/hamilt.h"
#include "module_hamilt_pw/hamilt_pwdft/elecond.h"
#include "module_hamilt_pw/hamilt_stodft/sto_wf.h"
#include "module_hsolver/hsolver_pw_sdft.h"
#include "source_hsolver/hsolver_pw_sdft.h"

template <typename FPTYPE, typename Device>
class Sto_EleCond : protected EleCond<FPTYPE, Device>
Expand Down
2 changes: 1 addition & 1 deletion source/module_hamilt_pw/hamilt_stodft/sto_iter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "module_elecstate/kernels/elecstate_op.h"
#include "module_elecstate/occupy.h"
#include "module_hamilt_pw/hamilt_pwdft/global.h"
#include "module_hsolver/para_linear_transform.h"
#include "source_hsolver/para_linear_transform.h"
#include "module_parameter/parameter.h"

template <typename T, typename Device>
Expand Down
10 changes: 5 additions & 5 deletions source/module_io/input_conv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@
#include "module_hamilt_lcao/module_tddft/td_velocity.h"
#endif
#ifdef __PEXSI
#include "module_hsolver/module_pexsi/pexsi_solver.h"
#include "source_hsolver/module_pexsi/pexsi_solver.h"
#endif
#ifdef __MPI
#include "module_hsolver/diago_elpa.h"
#include "module_hsolver/diago_elpa_native.h"
#include "source_hsolver/diago_elpa.h"
#include "source_hsolver/diago_elpa_native.h"
#endif

#include "module_base/module_device/device.h"
#include "module_base/timer.h"
#include "module_elecstate/elecstate_lcao.h"
#include "module_elecstate/module_pot/efield.h"
#include "module_elecstate/module_pot/gatefield.h"
#include "module_hsolver/hsolver_lcao.h"
#include "module_hsolver/hsolver_pw.h"
#include "source_hsolver/hsolver_lcao.h"
#include "source_hsolver/hsolver_pw.h"
#include "module_md/md_func.h"

#ifdef __LCAO
Expand Down
4 changes: 2 additions & 2 deletions source/module_io/test/for_testing_input_conv.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "module_hamilt_lcao/module_tddft/td_velocity.h"
#include "module_hamilt_pw/hamilt_pwdft/VNL_in_pw.h"
#include "module_hamilt_pw/hamilt_pwdft/structure_factor.h"
#include "module_hsolver/hsolver_lcao.h"
#include "source_hsolver/hsolver_lcao.h"
#include "module_io/berryphase.h"
#include "module_io/restart.h"
#include "module_md/md_func.h"
Expand All @@ -25,7 +25,7 @@
#include "module_relax/relax_old/ions_move_cg.h"
#include "module_relax/relax_old/lattice_change_basic.h"
#ifdef __PEXSI
#include "module_hsolver/module_pexsi/pexsi_solver.h"
#include "source_hsolver/module_pexsi/pexsi_solver.h"
#endif
#undef private
bool berryphase::berry_phase_flag = false;
Expand Down
10 changes: 5 additions & 5 deletions source/module_lr/hsolver_lrtd.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#pragma once
#include "module_parameter/parameter.h"
#include "module_hsolver/diago_david.h"
#include "module_hsolver/diago_dav_subspace.h"
#include "module_hsolver/diago_cg.h"
#include "module_hsolver/diago_iter_assist.h"
#include "module_hsolver/diago_cg.h"
#include "source_hsolver/diago_david.h"
#include "source_hsolver/diago_dav_subspace.h"
#include "source_hsolver/diago_cg.h"
#include "source_hsolver/diago_iter_assist.h"
#include "source_hsolver/diago_cg.h"
#include "module_lr/utils/lr_util.h"
#include "module_lr/utils/lr_util_print.h"
#include "module_base/module_container/ATen/core/tensor_map.h"
Expand Down
2 changes: 1 addition & 1 deletion source/module_psi/psi_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "module_base/parallel_device.h"
#include "module_base/timer.h"
#include "module_base/tool_quit.h"
#include "module_hsolver/diago_iter_assist.h"
#include "source_hsolver/diago_iter_assist.h"
#include "module_parameter/parameter.h"
#include "module_psi/psi_initializer_atomic.h"
#include "module_psi/psi_initializer_atomic_random.h"
Expand Down
2 changes: 1 addition & 1 deletion source/source_esolver/esolver_ks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "module_cell/cal_atoms_info.h"
#include "module_elecstate/elecstate_print.h"
#include "module_hamilt_general/module_xc/xc_functional.h"
#include "module_hsolver/hsolver.h"
#include "source_hsolver/hsolver.h"
#include "module_io/cube_io.h"

// for NSCF calculations of band structures
Expand Down
2 changes: 1 addition & 1 deletion source/source_esolver/esolver_ks_lcao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
//-----HSolver ElecState Hamilt--------
#include "module_elecstate/elecstate_lcao.h"
#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h"
#include "module_hsolver/hsolver_lcao.h"
#include "source_hsolver/hsolver_lcao.h"

// test RDMFT
#include "module_rdmft/rdmft.h"
Expand Down
2 changes: 1 addition & 1 deletion source/source_esolver/esolver_ks_lcao_tddft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "module_elecstate/cal_ux.h"
#include "module_elecstate/elecstate_lcao.h"
#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h"
#include "module_hsolver/hsolver_lcao.h"
#include "source_hsolver/hsolver_lcao.h"
#include "module_parameter/parameter.h"
#include "module_psi/psi.h"

Expand Down
6 changes: 3 additions & 3 deletions source/source_esolver/esolver_ks_lcaopw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
#include "module_elecstate/elecstate_pw.h"
#include "module_hamilt_pw/hamilt_pwdft/hamilt_lcaopw.h"
#include "module_hamilt_pw/hamilt_pwdft/hamilt_pw.h"
#include "module_hsolver/diago_iter_assist.h"
#include "module_hsolver/hsolver_lcaopw.h"
#include "module_hsolver/kernels/dngvd_op.h"
#include "source_hsolver/diago_iter_assist.h"
#include "source_hsolver/hsolver_lcaopw.h"
#include "source_hsolver/kernels/dngvd_op.h"
#include "module_base/kernels/math_kernel_op.h"
#include "module_io/berryphase.h"
#include "module_io/numerical_basis.h"
Expand Down
2 changes: 1 addition & 1 deletion source/source_esolver/esolver_ks_lcaopw.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef ESOLVER_KS_LIP_H
#define ESOLVER_KS_LIP_H
#include "source_esolver/esolver_ks_pw.h"
#include "module_hsolver/hsolver_lcaopw.h"
#include "source_hsolver/hsolver_lcaopw.h"

#ifdef __EXX
#include "module_ri/exx_lip.h"
Expand Down
6 changes: 3 additions & 3 deletions source/source_esolver/esolver_ks_pw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
#include "module_hamilt_pw/hamilt_pwdft/hamilt_pw.h"
#include "module_hamilt_pw/hamilt_pwdft/onsite_projector.h"
#include "module_hamilt_pw/hamilt_pwdft/stress_pw.h"
#include "module_hsolver/diago_iter_assist.h"
#include "module_hsolver/hsolver_pw.h"
#include "module_hsolver/kernels/dngvd_op.h"
#include "source_hsolver/diago_iter_assist.h"
#include "source_hsolver/hsolver_pw.h"
#include "source_hsolver/kernels/dngvd_op.h"
#include "module_io/berryphase.h"
#include "module_io/cal_ldos.h"
#include "module_io/get_pchg_pw.h"
Expand Down
2 changes: 1 addition & 1 deletion source/source_esolver/esolver_sdft_pw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "module_hamilt_pw/hamilt_stodft/sto_elecond.h"
#include "module_hamilt_pw/hamilt_stodft/sto_forces.h"
#include "module_hamilt_pw/hamilt_stodft/sto_stress_pw.h"
#include "module_hsolver/diago_iter_assist.h"
#include "source_hsolver/diago_iter_assist.h"
#include "module_io/write_istate_info.h"
#include "module_parameter/parameter.h"

Expand Down
6 changes: 3 additions & 3 deletions source/source_esolver/pw_others.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
#include "module_elecstate/elecstate_pw.h"
#include "module_hamilt_general/module_vdw/vdw.h"
#include "module_hamilt_pw/hamilt_pwdft/hamilt_pw.h"
#include "module_hsolver/diago_iter_assist.h"
#include "module_hsolver/hsolver_pw.h"
#include "module_hsolver/kernels/dngvd_op.h"
#include "source_hsolver/diago_iter_assist.h"
#include "source_hsolver/hsolver_pw.h"
#include "source_hsolver/kernels/dngvd_op.h"
#include "module_base/kernels/math_kernel_op.h"
#include "module_io/berryphase.h"
#include "module_io/numerical_basis.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#include "module_hsolver/diag_hs_para.h"
#include "source_hsolver/diag_hs_para.h"

#include "module_base/scalapack_connector.h"
#include "module_base/parallel_2d.h"
#include "module_hsolver/diago_pxxxgvx.h"
#include "source_hsolver/diago_pxxxgvx.h"

#ifdef __ELPA
#include "module_hsolver/genelpa/elpa_solver.h"
#include "source_hsolver/genelpa/elpa_solver.h"
#endif

#include <iostream>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#include "module_hsolver/diago_bpcg.h"
#include "source_hsolver/diago_bpcg.h"

#include "diago_iter_assist.h"
#include "module_base/blas_connector.h"
#include "module_base/global_function.h"
#include "module_base/kernels/math_kernel_op.h"
#include "module_base/parallel_comm.h" // different MPI worlds
#include "module_hsolver/kernels/bpcg_kernel_op.h"
#include "source_hsolver/kernels/bpcg_kernel_op.h"
#include "para_linear_transform.h"

#include <ATen/kernels/blas.h>
Expand Down
Loading
Loading