Skip to content

Add new search algorithm#7331

Open
19hello wants to merge 14 commits into
deepmodeling:developfrom
19hello:search_algorithm
Open

Add new search algorithm#7331
19hello wants to merge 14 commits into
deepmodeling:developfrom
19hello:search_algorithm

Conversation

@19hello
Copy link
Copy Markdown
Collaborator

@19hello 19hello commented May 10, 2026

Reminder

  • Have you linked an issue with this pull request?
  • Have you added adequate unit tests and/or case tests for your pull request?
  • Have you noticed possible changes of behavior below or in the linked issue?
  • Have you explained the changes of codes in core modules of ESolver, HSolver, ElecState, Hamilt, Operator or Psi? (ignore if not applicable)

Linked Issue

Fix #...

Unit Tests and/or Case Tests for my changes

  • A unit test is added for each new feature or bug fix.

What's changed?

  • Example: My changes might affect the performance of the application under certain conditions, and I have tested the impact on various scenarios...

Any changes of core modules? (ignore if not applicable)

  • Example: I have added a new virtual function in the esolver base class in order to ...

Copilot AI review requested due to automatic review settings May 10, 2026 12:20
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new cell neighbor-search implementation (bin-based neighbor list) under source_cell/module_neighbor_search and integrates it into the Lennard-Jones ESolver path, with accompanying build wiring and unit tests. It also adjusts an existing PW float test threshold to account for precision differences.

Changes:

  • Added module_neighbor_search (NeighborSearch + BinManager + NeighborList/PageAllocator) and hooked it into the build (CMake + Makefile.Objects).
  • Updated UnitCell to implement a new IAtomProvider interface; added UnitCellPlus adapter.
  • Switched ESolver_LJ neighbor iteration from the legacy grid neighbor search to the new NeighborSearch implementation and added unit tests for the new module.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
tests/01_PW/208_PW_CG_float/threshold Loosened integration threshold for float PW CG test.
source/source_esolver/esolver_lj.h Included UnitCellPlus and added conversion helper declaration.
source/source_esolver/esolver_lj.cpp Integrated new NeighborSearch into LJ runner (replacing legacy neighbor driver code path).
source/source_cell/unitcell.h Made UnitCell implement IAtomProvider by adding accessor overrides.
source/source_cell/module_neighbor_search/unitcell_interface.h Added IAtomProvider interface for neighbor search inputs.
source/source_cell/module_neighbor_search/unitcell_plus.h Added UnitCellPlus adapter implementing IAtomProvider.
source/source_cell/module_neighbor_search/neighbor_atom.h Added neighbor atom/value types used by the new neighbor search.
source/source_cell/module_neighbor_search/neighbor_list.h Added NeighborList + PageAllocator for adjacency storage.
source/source_cell/module_neighbor_search/bin_manager.h Added binning manager interface.
source/source_cell/module_neighbor_search/bin_manager.cpp Implemented bin construction, binning, and neighbor list building.
source/source_cell/module_neighbor_search/neighbor_search.h Added NeighborSearch API and internal state.
source/source_cell/module_neighbor_search/neighbor_search.cpp Implemented neighbor search initialization, expansion, and domain logic.
source/source_cell/module_neighbor_search/CMakeLists.txt Added object library target and conditional test subdir.
source/source_cell/module_neighbor_search/test/CMakeLists.txt Added test targets for new module.
source/source_cell/module_neighbor_search/test/neighbor_search_test.cpp Added gtest coverage for NeighborSearch.
source/source_cell/module_neighbor_search/test/bin_manager_test.cpp Added gtest coverage for BinManager.
source/source_cell/module_neighbor_search/test/neighbor_list_test.cpp Added gtest coverage for PageAllocator/NeighborList.
source/source_cell/module_neighbor_search/test/test_neighbor_search.cpp Added additional tests file (currently not built).
source/source_cell/CMakeLists.txt Added module_neighbor_search subdirectory to cell build.
source/Makefile.Objects Added neighbor_search objects to Makefile build graph.
CMakeLists.txt Linked neighbor_search into main executable.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread source/source_cell/module_neighlist/neighbor_search.cpp
Comment thread source/source_cell/module_neighlist/neighbor_search.cpp
Comment thread source/source_cell/module_neighbor_search/neighbor_search.cpp Outdated
Comment thread source/source_cell/module_neighbor_search/neighbor_search.cpp Outdated
Comment thread source/source_cell/module_neighbor_search/neighbor_search.cpp Outdated
Comment thread source/source_esolver/esolver_lj.h Outdated
Comment thread source/source_cell/module_neighlist/test/CMakeLists.txt
Comment thread source/source_cell/module_neighlist/neighbor_search.cpp
Comment thread source/source_cell/module_neighbor_search/test/neighbor_search_test.cpp Outdated
Comment thread source/source_cell/module_neighbor_search/unitcell_plus.h Outdated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems not relevant to this PR

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the changes from the previous PR. I forgot to clean up the old commit history.

@mohanchen mohanchen added Features Needed The features are indeed needed, and developers should have sophisticated knowledge Refactor Refactor ABACUS codes Large Systems Issues related to large-size systems labels May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Features Needed The features are indeed needed, and developers should have sophisticated knowledge Large Systems Issues related to large-size systems Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants