Skip to content
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

Refactor: make vl_grid_to_2D and Gint_inout independent of LCAO_Matrix #2758

Merged
merged 3 commits into from
Aug 2, 2023

Conversation

maki49
Copy link
Collaborator

@maki49 maki49 commented Jul 26, 2023

demanded by #2460

@dyzheng dyzheng requested a review from wenfei-li July 31, 2023 09:58
Copy link

@wenfei-li wenfei-li left a comment

Choose a reason for hiding this comment

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

I have no objection to the changes and will not block it, but I also don't see how this improves on the readability and overall structure of the code. For example, the interface now reads:

        this->vl_grid_to_2D(pvpR_grid, *lm->ParaV, lgd, new_e_iteration, lm->Hloc.data(),
            std::bind(&LCAO_Matrix::set_HSgamma, lm, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4));

which seems a little bit cumbersome. I suggest we only accept these changes if it is absolutely necessary.

@maki49
Copy link
Collaborator Author

maki49 commented Jul 31, 2023

@wenfei-li I need to call grid integral in a new ESolver without using class LCAO_Matrix.
In this function (vl_grid_to_2D) a non-static function LCAO_Matrix::set_HSgamma is called, I need to remove this dependence. Considering of universality, I decided to pass in a custom setter here, in which both row- and col-major setting are supportable.

If LCAO_Matrix::set_HSgamma will be removed in future refactor, this cumbersomeness can be removed natually.

@dyzheng dyzheng merged commit 162143c into deepmodeling:develop Aug 2, 2023
11 checks passed
denghuilu added a commit to denghuilu/abacus-develop that referenced this pull request Aug 9, 2023
* Fix:  error in specific situations refers to  2208 (deepmodeling#2742)

* Test: simplify compiling ucell info in UNIT tests (deepmodeling#2747)

* Paw : added accumulate_rhoij (deepmodeling#2734)

* Added interface for calculation of rhoij

* Added new test case

* finished accumulate_rhoij, added test

---------

Co-authored-by: wenfei-li <liwenfei@gmail.com>

* Docs: fix dead links for vdw-d3 (deepmodeling#2741)

fix deepmodeling#2711

* support reusing blacs_ctxt in Parallel_2D::set_desc (deepmodeling#2744)

* Doc: add some details of UnitTest and Converge in Documentation (deepmodeling#2752)

* add some details of UnitTest and Converge

* Update docs/CONTRIBUTING.md

Co-authored-by: Chun Cai <amoycaic@gmail.com>

---------

Co-authored-by: Chun Cai <amoycaic@gmail.com>

* Fix : update code for S(t+dt/2)  (deepmodeling#2753)

* update code for S(t+dt/2) and fix restart

* update autotest

* update autotest

* Fix: change R in LCAO_Hamilt::calculate_HR_exx_sparse(), to alleviate the output Hexx(R) errors for few k-points (deepmodeling#2749)

Co-authored-by: Mohan Chen <mohan.chen.chen.mohan@gmail.com>

* Refactor: separate 2d-to-grid operation from `Local_Orbital_Charge` into an independent class `DMgamma_2dtoGrid` (deepmodeling#2748)

* separate 2d-to-grid operation from Local_Orbital_Charge into an independent class

* separate into new file

---------

Co-authored-by: Mohan Chen <mohan.chen.chen.mohan@gmail.com>

* Feature:  Add a output interface for hcontainer and a sparse matrix class for CSR io (deepmodeling#2745)

* Feature: Add CSR file reader classes in module_io (deepmodeling#2754)

* refactor sparse_matrix class to use map

* update output_hcontainer using new sparse matrix

* add csr file reader

* try to fix error

* fix error

---------

Co-authored-by: root <hongriTianqi>

* Refactor(input model): create the input (deepmodeling#2671)

* Refactor(input model): create the input
 rebuild class and function. This has no effect on the current code.
 Refactor deepmodeling#2549

* Refactor(input model):
Fix the annotations  in the last pull request.
And fix a bug in unit test
 Refactor deepmodeling#2549

* Refactor(input model): create the input
fix some compile bugs
 Refactor deepmodeling#2549

* fix namespace using bugs

* fix some namespace using bugs

* Update CMakeLists.txt

fix conflict in io_print_info

---------

Co-authored-by: Qianrui <76200646+Qianruipku@users.noreply.github.com>
Co-authored-by: Xiaokuang Bai <baixiaokuang@gmail.com>

* Fix : DeePKS for nspin = 2 and gamma point (deepmodeling#2755)

* Fix : DeePKS for nspin = 2 and gamma point

* Fixed cal_f_delta_gamma

* fixed test

---------

Co-authored-by: wenfei-li <liwenfei@gmail.com>
Co-authored-by: dyzheng <zhengdy@dp.tech>

* Fix issue deepmodeling#2721 (deepmodeling#2739)

* Fix issue deepmodeling#2721: a correction on atom sequence check

Fix issue deepmodeling#2721

* Update read_atoms.cpp

* Update klist.cpp

* Revert "Update klist.cpp"

This reverts commit 0699982.

---------

Co-authored-by: Qianrui <76200646+Qianruipku@users.noreply.github.com>
Co-authored-by: Zhao Tianqi <hongriTianqi@users.noreply.github.com>

* update version to v3.3.1 (deepmodeling#2766)

* Update xc_functional_vxc.cpp (deepmodeling#2756)

* Refactor: Two center integral implemented in module_nao (deepmodeling#2757)

* add lookup function to TwoCenterTable

* rabtab assumes uniform grid; table behavior change

* two_center_integral initial commit

* TwoCenterIntegrator implemented with test

* Refactor: CubicSpline class stores derivatives instead of polynomial coefficients (deepmodeling#2772)

* CubicSpline add support for derivative

* function name fix

* Refactor: add UnitTests and new functions and OverlapNew operator with HContainer (deepmodeling#2777)

* update demo1_SR

* Refactor: update demos in module_hcontainer

* Test: add unit test for parallel_orbitals.cpp

* update parallel_orbitals.h with get_indexes functions

* Refactor: small modifies for constructor of OperatorLCAO

* Refactor: update get_pointer() interface in AtomPair

* Refactor: add func_folding and UnitTest

* Feature: add new Operator for overlap of NAOs - OperatorNew

* Fix: bug in CI

* remove a useless head file in cal_dm.h (deepmodeling#2774)

* Feature: add a parameter `symmetry_autoclose` to control the behavior when symmetry error occurs (deepmodeling#2740)

* fix a debugging output in the 1st ion-step

* add parameter symmetry_autoclose

* Refactor: make `vl_grid_to_2D` and `Gint_inout` independent of `LCAO_Matrix` (deepmodeling#2758)

* remove LCAO_Matrix dependence in vl_grid_to_2D

* remove LCAO_Matrix dependence in Gint_inout

---------

Co-authored-by: Zhao Tianqi <hongriTianqi@users.noreply.github.com>

* Test: add a parallel script for parallel_2d_test (deepmodeling#2764)

* Test: add a parallel script for parallel_2d_test

* Update source/module_basis/module_ao/test/parallel_2d_test.sh

---------

Co-authored-by: root <hongriTianqi>
Co-authored-by: Peng Xingliang <91927439+pxlxingliang@users.noreply.github.com>

* Fix: add a initialization of lmaxmax in UnitTests `cell_unitcell_test_setupcell` (deepmodeling#2767)

* add a initialization of lmaxmax in UnitTests #test_setupcell

* Update source/module_cell/test/unitcell_test_setupcell.cpp

* Update source/module_cell/test_pw/unitcell_test_pw.cpp

* Update source/module_cell/test/unitcell_test_setupcell.cpp

* Update source/module_cell/test_pw/unitcell_test_pw.cpp

---------

Co-authored-by: Zhao Tianqi <hongriTianqi@users.noreply.github.com>

* Test: add parallel scripts for parallel_orbitals unit tests (deepmodeling#2778)

Co-authored-by: root <hongriTianqi>

* Test: add a unit test to constructor SR from reading csr file (deepmodeling#2780)

Co-authored-by: root <hongriTianqi>

* Docs: update conda-forge docs (deepmodeling#2784)

* Fix: check atom types cpmsostence between STRU and DP model (deepmodeling#2770)

* add cuda arch 3.5 compilation support for ABACUS (deepmodeling#2794)

* Fix: bug in print_PAOs() (deepmodeling#2790)

* Fix: autoset bx/by/bz when set nx/ny/nz manually (deepmodeling#2791)

* Fix: bx = 0 if nx is set mannualy in INPUT

* add a line of comment

* add autoset bx/by/bz when set nx/ny/nz manually

---------

Co-authored-by: root <hongriTianqi>

* make RealGauntTable singleton & doxygen style change (deepmodeling#2789)

Co-authored-by: Wenfei Li <38569667+wenfei-li@users.noreply.github.com>

* new CubicSpline interface (deepmodeling#2800)

Co-authored-by: Wenfei Li <38569667+wenfei-li@users.noreply.github.com>

* Test: add a unit test for zhegv in lapack_connector (deepmodeling#2796)

---------

Co-authored-by: dyzheng <zhengdy@dp.tech>
Co-authored-by: Zhao Tianqi <hongriTianqi@users.noreply.github.com>
Co-authored-by: Wenfei Li <38569667+wenfei-li@users.noreply.github.com>
Co-authored-by: wenfei-li <liwenfei@gmail.com>
Co-authored-by: Chun Cai <amoycaic@gmail.com>
Co-authored-by: cyFortneu <33978601+maki49@users.noreply.github.com>
Co-authored-by: wqzhou <33364058+WHUweiqingzhou@users.noreply.github.com>
Co-authored-by: lyb9812 <88070104+lyb9812@users.noreply.github.com>
Co-authored-by: PeizeLin <78645006+PeizeLin@users.noreply.github.com>
Co-authored-by: Mohan Chen <mohan.chen.chen.mohan@gmail.com>
Co-authored-by: GRYS <57103981+grysgreat@users.noreply.github.com>
Co-authored-by: Qianrui <76200646+Qianruipku@users.noreply.github.com>
Co-authored-by: Xiaokuang Bai <baixiaokuang@gmail.com>
Co-authored-by: Yike Huang <67682086+kirk0830@users.noreply.github.com>
Co-authored-by: jinzx10 <jzx016@hotmail.com>
Co-authored-by: Omega <62006565+Satinelamp@users.noreply.github.com>
Co-authored-by: Peng Xingliang <91927439+pxlxingliang@users.noreply.github.com>
Co-authored-by: Yu Liu <77716030+YuLiu98@users.noreply.github.com>
@hongriTianqi hongriTianqi added this to In progress in LR-TDDFT Implementation via automation Sep 9, 2023
@hongriTianqi hongriTianqi moved this from In progress to Done in LR-TDDFT Implementation Sep 10, 2023
@maki49 maki49 deleted the refactor_gridto2d branch April 17, 2024 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants