Skip to content

[Refactor] Rename module_basis to source_basis || module_cell to source_cell #6319

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 5 commits into from
Jun 21, 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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ For those who are interested in the source code, the following figure shows the
| | (4) Utility functions: timer, random number generator, etc.
| | (5) Global parameters: input parameters, element names, mathematical and physical constants.
| |-- module_container The container module for storing data and performing operations on them and on different architectures.
|-- module_basis Basis means the basis set to expand the wave function.
|-- source_basis Basis means the basis set to expand the wave function.
| |-- module_ao Atomic orbital basis set to be refactored.
| |-- module_nao New numerical atomic orbital basis set for two-center integrals in LCAO calculations
| `-- module_pw Data structures and relevant methods for planewave involved calculations
|-- module_cell The module for defining the unit cell and its operations, and reading pseudopotentials.
|-- source_cell The module for defining the unit cell and its operations, and reading pseudopotentials.
| |-- module_neighbor The module for finding the neighbors of each atom in the unit cell.
| |-- module_paw The module for performing PAW calculations.
| |-- module_symmetry The module for finding the symmetry operations of the unit cell.
Expand Down Expand Up @@ -257,7 +257,7 @@ To add a unit test:
./cell_unitcell_test
```

under the directory of `build/source/module_cell/test` to run the test `cell_unitcell_test`.
under the directory of `build/source/source_cell/test` to run the test `cell_unitcell_test`.
However, it is more convenient to run unit tests with `ctest` command under the `build` directory. You can check all unit tests by

```bash
Expand Down
4 changes: 2 additions & 2 deletions python/pyabacus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ find_package(pybind11 CONFIG REQUIRED)
# set source path
set(ABACUS_SOURCE_DIR "${PROJECT_SOURCE_DIR}/../../source")
set(BASE_PATH "${ABACUS_SOURCE_DIR}/source_base")
set(NAO_PATH "${ABACUS_SOURCE_DIR}/module_basis/module_nao")
set(NAO_PATH "${ABACUS_SOURCE_DIR}/source_basis/module_nao")
set(HSOLVER_PATH "${ABACUS_SOURCE_DIR}/source_hsolver")
set(PSI_PATH "${ABACUS_SOURCE_DIR}/module_psi")
set(ENABLE_LCAO ON)
Expand Down Expand Up @@ -82,7 +82,7 @@ set(PARAMETER_BINARY_DIR "${PROJECT_SOURCE_DIR}/build/parameter")
add_subdirectory(${ABACUS_SOURCE_DIR}/module_parameter ${PARAMETER_BINARY_DIR})
# add orb
set(ORB_BINARY_DIR "${PROJECT_SOURCE_DIR}/build/orb")
add_subdirectory(${ABACUS_SOURCE_DIR}/module_basis/module_ao ${ORB_BINARY_DIR})
add_subdirectory(${ABACUS_SOURCE_DIR}/source_basis/module_ao ${ORB_BINARY_DIR})
# set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

# set RPATH
Expand Down
4 changes: 2 additions & 2 deletions python/pyabacus/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ find_package(pybind11 CONFIG REQUIRED)
# Set source path
set(ABACUS_SOURCE_DIR "${PROJECT_SOURCE_DIR}/../../source")
set(BASE_PATH "${ABACUS_SOURCE_DIR}/source_base")
set(NAO_PATH "${ABACUS_SOURCE_DIR}/module_basis/module_nao")
set(NAO_PATH "${ABACUS_SOURCE_DIR}/source_basis/module_nao")
set(HSOLVER_PATH "${ABACUS_SOURCE_DIR}/source_hsolver")
set(PSI_PATH "${ABACUS_SOURCE_DIR}/module_psi")
set(ENABLE_LCAO ON)
Expand Down Expand Up @@ -147,7 +147,7 @@ set(PARAMETER_BINARY_DIR "${PROJECT_SOURCE_DIR}/build/parameter")
add_subdirectory(${ABACUS_SOURCE_DIR}/module_parameter ${PARAMETER_BINARY_DIR})
# Add orb
set(ORB_BINARY_DIR "${PROJECT_SOURCE_DIR}/build/orb")
add_subdirectory(${ABACUS_SOURCE_DIR}/module_basis/module_ao ${ORB_BINARY_DIR})
add_subdirectory(${ABACUS_SOURCE_DIR}/source_basis/module_ao ${ORB_BINARY_DIR})
```
- This section sets the position-independent code flag and adds subdirectories for the base, parameter, and orb modules. It specifies the build directories for these modules.

Expand Down
4 changes: 2 additions & 2 deletions python/pyabacus/src/ModuleNAO/py_m_nao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#include <pybind11/stl.h>

#include "source_base/vector3.h"
#include "module_basis/module_nao/radial_collection.h"
#include "module_basis/module_nao/two_center_integrator.h"
#include "source_basis/module_nao/radial_collection.h"
#include "source_basis/module_nao/two_center_integrator.h"

namespace py = pybind11;
using namespace pybind11::literals;
Expand Down
2 changes: 1 addition & 1 deletion python/pyabacus/src/py_numerical_radial.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <pybind11/numpy.h>
#include <pybind11/pybind11.h>

#include "module_basis/module_nao/numerical_radial.h"
#include "source_basis/module_nao/numerical_radial.h"

namespace py = pybind11;
using namespace pybind11::literals;
Expand Down
14 changes: 7 additions & 7 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
add_subdirectory(source_base)
add_subdirectory(module_cell)
add_subdirectory(source_cell)
add_subdirectory(module_psi)
add_subdirectory(module_elecstate)
add_subdirectory(module_hamilt_general)
add_subdirectory(module_hamilt_pw)
add_subdirectory(module_hamilt_lcao)
add_subdirectory(source_hsolver)
add_subdirectory(module_basis/module_ao)
add_subdirectory(module_basis/module_nao)
add_subdirectory(source_basis/module_ao)
add_subdirectory(source_basis/module_nao)
add_subdirectory(module_md)
add_subdirectory(module_basis/module_pw)
add_subdirectory(source_basis/module_pw)
add_subdirectory(source_esolver)
add_subdirectory(module_hamilt_lcao/module_gint)
add_subdirectory(module_io)
Expand All @@ -34,7 +34,7 @@ list(APPEND device_srcs
module_hamilt_pw/hamilt_pwdft/kernels/ekinetic_op.cpp
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
source_basis/module_pw/kernels/pw_op.cpp
source_hsolver/kernels/dngvd_op.cpp
source_hsolver/kernels/bpcg_kernel_op.cpp
module_elecstate/kernels/elecstate_op.cpp
Expand Down Expand Up @@ -64,7 +64,7 @@ if(USE_CUDA)
module_hamilt_pw/hamilt_pwdft/kernels/cuda/meta_op.cu
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
source_basis/module_pw/kernels/cuda/pw_op.cu
source_hsolver/kernels/cuda/dngvd_op.cu
source_hsolver/kernels/cuda/bpcg_kernel_op.cu
module_elecstate/kernels/cuda/elecstate_op.cu
Expand All @@ -91,7 +91,7 @@ if(USE_ROCM)
module_hamilt_pw/hamilt_pwdft/kernels/rocm/meta_op.hip.cu
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
source_basis/module_pw/kernels/rocm/pw_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
Expand Down
14 changes: 7 additions & 7 deletions source/Makefile.Objects
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ HEADERS = source_main/*.h

VPATH=./src_global:\
./source_main:\
./module_basis/module_ao:\
./module_basis/module_nao:\
./module_cell/module_neighbor:\
./module_cell/module_symmetry:\
./module_cell:\
./source_basis/module_ao:\
./source_basis/module_nao:\
./source_cell/module_neighbor:\
./source_cell/module_symmetry:\
./source_cell:\
./source_base:\
./source_base/kernels:\
./source_base/module_container/base/core:\
Expand All @@ -27,8 +27,8 @@ VPATH=./src_global:\
./source_base/module_device:\
./source_base/module_mixing:\
./module_md:\
./module_basis/module_pw:\
./module_basis/module_pw/module_fft:\
./source_basis/module_pw:\
./source_basis/module_pw/module_fft:\
./source_esolver:\
./source_hsolver:\
./source_hsolver/kernels:\
Expand Down
2 changes: 1 addition & 1 deletion source/module_elecstate/cal_nelec_nband.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef CAL_NELEC_NBAND_H
#define CAL_NELEC_NBAND_H

#include "module_cell/atom_spec.h"
#include "source_cell/atom_spec.h"

namespace elecstate {

Expand Down
2 changes: 1 addition & 1 deletion source/module_elecstate/cal_ux.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef CAL_UX_H
#define CAL_UX_H

#include "module_cell/unitcell.h"
#include "source_cell/unitcell.h"

namespace elecstate {

Expand Down
2 changes: 1 addition & 1 deletion source/module_elecstate/elecstate.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define ELECSTATE_H

#include "fp_energy.h"
#include "module_cell/klist.h"
#include "source_cell/klist.h"
#include "module_elecstate/module_charge/charge.h"
#include "module_parameter/parameter.h"
#include "module_psi/psi.h"
Expand Down
2 changes: 1 addition & 1 deletion source/module_elecstate/elecstate_pw.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <source_base/macros.h>

#include "elecstate.h"
#include "module_basis/module_pw/pw_basis_k.h"
#include "source_basis/module_pw/pw_basis_k.h"
#include "module_elecstate/kernels/elecstate_op.h"
#include "module_hamilt_pw/hamilt_pwdft/kernels/meta_op.h"
#include "source_base/kernels/math_kernel_op.h"
Expand Down
2 changes: 1 addition & 1 deletion source/module_elecstate/module_charge/charge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "source_base/parallel_reduce.h"
#include "source_base/timer.h"
#include "source_base/tool_threading.h"
#include "module_cell/unitcell.h"
#include "source_cell/unitcell.h"
#include "module_elecstate/magnetism.h"
#include "module_hamilt_general/module_xc/xc_functional.h"
#include "module_parameter/parameter.h"
Expand Down
4 changes: 2 additions & 2 deletions source/module_elecstate/module_charge/charge.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#include "source_base/global_function.h"
#include "source_base/global_variable.h"
#include "source_base/parallel_global.h"
#include "module_basis/module_pw/pw_basis.h"
#include "module_cell/module_symmetry/symmetry.h"
#include "source_basis/module_pw/pw_basis.h"
#include "source_cell/module_symmetry/symmetry.h"
#include "module_elecstate/fp_energy.h"
#include "module_hamilt_pw/hamilt_pwdft/parallel_grid.h"

Expand Down
2 changes: 1 addition & 1 deletion source/module_elecstate/module_charge/charge_extra.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define CHARGE_EXTRA_H

#include "charge.h"
#include "module_cell/unitcell.h"
#include "source_cell/unitcell.h"
#include "module_hamilt_pw/hamilt_pwdft/structure_factor.h"
#ifdef __MPI
#include "module_hamilt_pw/hamilt_pwdft/parallel_grid.h"
Expand Down
4 changes: 2 additions & 2 deletions source/module_elecstate/module_charge/symmetry_rho.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef SYMMETRY_RHO_H
#define SYMMETRY_RHO_H
#include "module_basis/module_pw/pw_basis.h"
#include "module_cell/module_symmetry/symmetry.h"
#include "source_basis/module_pw/pw_basis.h"
#include "source_cell/module_symmetry/symmetry.h"
#include "module_elecstate/module_charge/charge.h"
#include "module_hamilt_pw/hamilt_pwdft/parallel_grid.h"

Expand Down
4 changes: 2 additions & 2 deletions source/module_elecstate/module_dm/cal_edm_tddft.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef CAL_EDM_TDDFT_H
#define CAL_EDM_TDDFT_H

#include "module_basis/module_ao/parallel_orbitals.h"
#include "module_cell/klist.h"
#include "source_basis/module_ao/parallel_orbitals.h"
#include "source_cell/klist.h"
#include "module_elecstate/elecstate_lcao.h"
#include "module_hamilt_general/hamilt.h"

Expand Down
2 changes: 1 addition & 1 deletion source/module_elecstate/module_dm/density_matrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "source_base/memory.h"
#include "source_base/timer.h"
#include "source_base/tool_title.h"
#include "module_cell/klist.h"
#include "source_cell/klist.h"

namespace elecstate
{
Expand Down
2 changes: 1 addition & 1 deletion source/module_elecstate/module_dm/density_matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <string>

#include "module_cell/module_neighbor/sltk_grid_driver.h"
#include "source_cell/module_neighbor/sltk_grid_driver.h"
#include "module_hamilt_lcao/hamilt_lcaodft/record_adj.h"
#include "module_hamilt_lcao/module_hcontainer/hcontainer.h"

Expand Down
2 changes: 1 addition & 1 deletion source/module_elecstate/module_dm/density_matrix_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "source_base/memory.h"
#include "source_base/timer.h"
#include "source_base/tool_title.h"
#include "module_cell/klist.h"
#include "source_cell/klist.h"

namespace elecstate
{
Expand Down
8 changes: 4 additions & 4 deletions source/module_elecstate/module_dm/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ AddTest(
${ABACUS_SOURCE_DIR}/module_hamilt_lcao/module_hcontainer/base_matrix.cpp
${ABACUS_SOURCE_DIR}/module_hamilt_lcao/module_hcontainer/hcontainer.cpp
${ABACUS_SOURCE_DIR}/module_hamilt_lcao/module_hcontainer/atom_pair.cpp
${ABACUS_SOURCE_DIR}/module_basis/module_ao/parallel_orbitals.cpp
${ABACUS_SOURCE_DIR}/source_basis/module_ao/parallel_orbitals.cpp
${ABACUS_SOURCE_DIR}/module_io/output.cpp
)

Expand All @@ -26,7 +26,7 @@ AddTest(
${ABACUS_SOURCE_DIR}/module_hamilt_lcao/module_hcontainer/base_matrix.cpp
${ABACUS_SOURCE_DIR}/module_hamilt_lcao/module_hcontainer/hcontainer.cpp
${ABACUS_SOURCE_DIR}/module_hamilt_lcao/module_hcontainer/atom_pair.cpp
${ABACUS_SOURCE_DIR}/module_basis/module_ao/parallel_orbitals.cpp
${ABACUS_SOURCE_DIR}/source_basis/module_ao/parallel_orbitals.cpp
)

AddTest(
Expand All @@ -36,7 +36,7 @@ AddTest(
${ABACUS_SOURCE_DIR}/module_hamilt_lcao/module_hcontainer/base_matrix.cpp
${ABACUS_SOURCE_DIR}/module_hamilt_lcao/module_hcontainer/hcontainer.cpp
${ABACUS_SOURCE_DIR}/module_hamilt_lcao/module_hcontainer/atom_pair.cpp
${ABACUS_SOURCE_DIR}/module_basis/module_ao/parallel_orbitals.cpp
${ABACUS_SOURCE_DIR}/source_basis/module_ao/parallel_orbitals.cpp
)

AddTest(
Expand All @@ -46,5 +46,5 @@ AddTest(
${ABACUS_SOURCE_DIR}/module_hamilt_lcao/module_hcontainer/base_matrix.cpp
${ABACUS_SOURCE_DIR}/module_hamilt_lcao/module_hcontainer/hcontainer.cpp
${ABACUS_SOURCE_DIR}/module_hamilt_lcao/module_hcontainer/atom_pair.cpp
${ABACUS_SOURCE_DIR}/module_basis/module_ao/parallel_orbitals.cpp
${ABACUS_SOURCE_DIR}/source_basis/module_ao/parallel_orbitals.cpp
)
2 changes: 1 addition & 1 deletion source/module_elecstate/module_dm/test/test_cal_dm_R.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "gtest/gtest.h"
#include "module_elecstate/module_dm/density_matrix.h"
#include "module_hamilt_lcao/module_hcontainer/hcontainer.h"
#include "module_cell/klist.h"
#include "source_cell/klist.h"

/************************************************
* unit test of DensityMatrix constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "gtest/gtest.h"
#include "module_elecstate/module_dm/density_matrix.h"
#include "module_hamilt_lcao/module_hcontainer/hcontainer.h"
#include "module_cell/klist.h"
#include "source_cell/klist.h"

/************************************************
* unit test of DensityMatrix constructor
Expand Down
2 changes: 1 addition & 1 deletion source/module_elecstate/module_dm/test/test_dm_R_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#define private public
#include "module_elecstate/module_dm/density_matrix.h"
#include "module_hamilt_lcao/module_hcontainer/hcontainer.h"
#include "module_cell/klist.h"
#include "source_cell/klist.h"
#undef private
/************************************************
* unit test of DensityMatrix constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "gtest/gtest.h"
#include "module_elecstate/module_dm/density_matrix.h"
#include "module_hamilt_lcao/module_hcontainer/hcontainer.h"
#include "module_cell/klist.h"
#include "source_cell/klist.h"
/************************************************
* unit test of DensityMatrix constructor
***********************************************/
Expand Down
6 changes: 3 additions & 3 deletions source/module_elecstate/module_dm/test/test_dm_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "module_cell/unitcell.h"
#include "source_cell/unitcell.h"
#include "module_elecstate/module_dm/density_matrix.h"
#include "prepare_unitcell.h"

Expand Down Expand Up @@ -32,8 +32,8 @@ Magnetism::~Magnetism()
delete[] this->start_mag;
}

#include "module_cell/klist.h"
#include "module_cell/module_neighbor/sltk_grid_driver.h"
#include "source_cell/klist.h"
#include "source_cell/module_neighbor/sltk_grid_driver.h"
// mock find_atom() function
void Grid_Driver::Find_atom(const UnitCell& ucell,
const ModuleBase::Vector3<double>& tau,
Expand Down
4 changes: 2 additions & 2 deletions source/module_elecstate/module_dm/test/tmp_mocks.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


#include "module_cell/unitcell.h"
#include "source_cell/unitcell.h"

// constructor of Atom
Atom::Atom()
Expand Down Expand Up @@ -72,7 +72,7 @@ void UnitCell::set_iat2iwt(const int& npol_in)
return;
}

#include "module_cell/module_neighbor/sltk_grid_driver.h"
#include "source_cell/module_neighbor/sltk_grid_driver.h"
// mock find_atom() function
void Grid_Driver::Find_atom(const UnitCell& ucell,
const ModuleBase::Vector3<double>& tau,
Expand Down
4 changes: 2 additions & 2 deletions source/module_elecstate/module_pot/H_Hartree_pw.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#include "source_base/global_function.h"
#include "source_base/global_variable.h"
#include "source_base/matrix.h"
#include "module_cell/unitcell.h"
#include "module_basis/module_pw/pw_basis.h"
#include "source_cell/unitcell.h"
#include "source_basis/module_pw/pw_basis.h"

namespace elecstate
{
Expand Down
4 changes: 2 additions & 2 deletions source/module_elecstate/module_pot/efield.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef EFIELD_H
#define EFIELD_H

#include "module_basis/module_pw/pw_basis.h"
#include "module_cell/unitcell.h"
#include "source_basis/module_pw/pw_basis.h"
#include "source_cell/unitcell.h"
#include "module_hamilt_general/module_surchem/surchem.h"
#include "module_parameter/parameter.h"

Expand Down
Loading
Loading