Skip to content

Commit efaf1e3

Browse files
Flying-dragon-boxingmohanchenWHUweiqingzhouESROAMERlanshuyue
authored
Feature: EXX PW supports a ecut different from ecutrho (#6650)
* An unit test added for DiagoPexsi * modify for changed gint interface * correct nspin related behaviors * add efermi passthrough * Revert "add efermi passthrough" This reverts commit d7b402d. * commits to resolve conversations related to codes * DM and EDM pointers in pexsi now handled by diagopexsi, and copying h s matrices no longer needed * add pexsi examples * fix pexsi unit test (original version shouldn't run) * add building docs for pexsi * set cxx standard to c++14, which is required in make_unique * Fix: Fix typo related to pexsi * update to PPEXSIDFTDriver2 * default npoints to 1, so single core pexsi will work * Feature: exx operator for pw basis, single kpt * apply pexsi changes(?) * q-e style exx_div * Correct exxdiv * Fix Compile errors * refactor to abandon `pdiagh` * Fix mu_buffer and nspin * HSE examples * Feature: Multi-K exx * Feature: Multi-K exx * Updates with latest * Remove redundant global vars * Update to v3.9.0 * Update to v3.9.0, now code works * Remove Redundant cal_exx_energy in esolver_ks_pw.cpp * Some mess * Minor Fixes * Fix separate loop and screening * Add EXX stress * EXX Energy??? * Multi-K is broken??? * Fix: Multi-K and stress * Feature: ACE for single-K * Feature: ACE should work for multi-K, but not for sure * Feature: ACE works. Next step is ACE energy. * Fix: adapt to the latest instruction for variable `conv_esolver` * Reconstruct: move exx_helper to hamilt_pwdft * Refactor: in ESolver_KS_PW, calculate deband in iter_finish, not in hamilt2density * Fix: make files in consistent with upstream * Fix: Now EXX PW doesn't depend on LibRI * Fix: Add input constraints for EXX PW * Fix: Remove redundant mpi barrier * Fix: Clean irrelevant files * Fix: Clean irrelevant files * Feature: add ace flag, exit on using gpu * Refactor: Phase 1 for refactoring exx energy * Feature: now ace calculates energy * Feature: enable exx energy * Fix: fix makefile compilation error * Fix: One minor fix for a segmentation fault * Tests: one integrate test for exx pw, only for verifying whether exx pw works * Revert "Tests: one integrate test for exx pw, only for verifying whether exx pw works" This reverts commit e7b606f. * Fix: EXX PW ACE open only when separate_loop is on * add timer * Feature: Double Grid method of EXX PW * Feature: Double Grid method of EXX PW Stress * Fix: Double Grid method of EXX PW Stress * Feature: add double grid variable * Feature: add double grid variable * Fis: HSE stress * Fix: HSE Stress * Fix: Timer * Fix: Timer * For non mp sampling, disable extrapolation * Modify test * Modify mp * Format * Format * Feature: nspin == 2 scf * Fix: nspin == 2 scf * Docs: EXX PW Docs * Feature: EXX PW for nspin=2 * Docs: EXX PW Docs * Docs: EXX PW Docs * Docs: EXX PW Docs, minor fixes * Refactor * Refactor * Refactor * Refactor * Refactor * Refactor: fix unit test * Refactor: fix unit test * Refactor: fix unit test * Refactor: fix unit test * Bump version v3.9.0.7 * Refactor: Remove set kvec funcs in `K_Vectors` * Refactor: Remove final_scf * Refactor: Fix kvecc2d/d2c * Fix: Tests * Fix: Tests * Fix: Tests * Fix: Tests * Refactor: Final? * Fix * Fix * Fix * Fix * GPU EXX PW Support * Fix: Compile Error on CUDA > 12.9 * Fix: Compile Error on CUDA > 12.9 * NVTX3 * F***ing new version * Feature: Support linear combination of coulomb_param for EXX PW * Fix: Fix compile issue * F***ing new version * F***ing new version * F***ing new version * Uploading hybrid gauge tddft (#6369) * hybrid gague * update tests * update * update * update * update * update unit test * fix tests * update tests * fix read_wfc * fix catch_properties.sh * fix restart * update gpu test * update tests * fix * fix input_conv * Improve md calculation stress output in running log (#6366) * Improve md calculation stress output in running log * Module_IO Unittest modify * ModuleMD Unittests modify * modify code comment in fire_test.cpp * maintain setprecision(8) for md stress output * Refactor: Remove redundant Input_para from ESolver Class (#6370) * Refactor: Replace PARAM.inp with inp in ESolver classes for consistency * Refactor: Replace local input parameters with PARAM.inp in ESolver classes for consistency * Refactor: Use PARAM.inp.scf_ene_thr in ESolver_KS_LCAO iter_finish method * Revert "Refactor: Use PARAM.inp.scf_ene_thr in ESolver_KS_LCAO iter_finish method" This reverts commit b1bd0fd. * Revert "Refactor: Replace local input parameters with PARAM.inp in ESolver classes for consistency" This reverts commit f4f81e3. * Fix: Fix memory leak introduced by new gint module (#6375) * fix memory leak * delete copy assignment * refactor Exx_Opt_Orb (#6378) Co-authored-by: linpz <[email protected]> * Add use sw and fix Floating point exception (#6372) * remove float error in sunway * fix ig=0 * add the sw * change the make_dir * unify the gg use * fix compile bug * add init * temporarily remove the sunway define * add the pesduo * fix compile bug * fix bug in the betar * modify the test * Update the output formats of rt-TDDFT (#6381) * update the output formats of rt-TDDFT * update the output formats of rt-TDDFT * fix a bug * update initialized velocities * found some output information is still lacking in MD module * [Refactor] Rename grid to module_grid and genelpa to module_genelpa (#6386) * Rename grid to module_grid * Rename genelpa to module_genelpa * Fix cmake * Update the outputs of geometry relaxation (#6387) * update the output formats of rt-TDDFT * update the output formats of rt-TDDFT * fix a bug * update initialized velocities * found some output information is still lacking in MD module * update output information * remove some global variables in relax_driver * update outputs * update relaxation outputs * update relaxation output messages * update tests of print info * fix a test * fix cg outputs * udpate cg test * update relax tests * update LCAO output stress format * change update_cell.cpp algorithm, when the ion move is larger than the cell length, it is fine to proceed the relaxation calculations * fix tests for unitcells * update cell * Feature: support the output of matrix representation of symm_ops (#6390) * Feature: support output the matrix representation of symmetry operation * Feature: support the output of matrix representation of symm_ops * update the document * Feature: Output real space wavefunction and partial charge density when `device=gpu` (#6391) * Fix GPU output of out_pchg and out_wfc_norm, out_wfc_re_im * GPU integrate test is functional again * Optimize RT-TDDFT dipole output (#6393) * Perf: support GPU version of cal_force_cc with LCAO basis (#6392) * support GPU version of cal_force_cc with LCAO basis * fix a bug * [Refactor] Move module_lr to source_lcao and add a new folder module_external in source_base (#6388) * Move module_lr to source_lcao * Fix test build * Move blas_connector to module_external * Fix header use * Fix internal header use * A fierce battle with Makefile😡 * Move blacs_connector.h to module_external * Move lapack_connector.h and lapack_wrapper.h to module_external * Fix header usage * Move scalapack_connector.h to module_external * Fix a bug for the output information after relaxation (#6395) * update the output formats of rt-TDDFT * update the output formats of rt-TDDFT * fix a bug * update initialized velocities * found some output information is still lacking in MD module * update output information * remove some global variables in relax_driver * update outputs * update relaxation outputs * update relaxation output messages * update tests of print info * fix a test * fix cg outputs * udpate cg test * update relax tests * update LCAO output stress format * change update_cell.cpp algorithm, when the ion move is larger than the cell length, it is fine to proceed the relaxation calculations * fix tests for unitcells * update cell * update some function names, update output A to Angstrom * change eV/A to eV/Angstrom * bump version to 3.9.0.10 (#6397) Co-authored-by: Liang Sun <[email protected]> * Fix: fix exx_gamma_extrapolation error in MPI * Fix: fix exx_gamma_extrapolation error in MPI * Update lapack.cu * Refactor: Use LAPACK interfaces from ATen * Fix: Integrate test * Fix: implement devinfo for potrf * Fix: MPI and Makefile * Fix: get_potential * Fix: ace * Refactor * Refactor * Refactor * Refactor * Refactor * Fix: conv * Revert "Fix: conv" This reverts commit d2da506. * Fix: conv * Fix: conv hard code thr for now * Fix: conv hard code thr for now * Fix: conv hard code thr for now * Fix: conv hard code thr for now * Refactor * Refactor * Refactor * Refactor * Refactor * Mod * Begin EXX KPAR * Begin EXX KPAR * Begin EXX KPAR * Begin EXX KPAR * Begin EXX KPAR * EXX KPAR WORKS * EXX KPAR WORKS Alternative * Fix GPU, but so ugly... * Undo cuda aware mpi * Undo cuda aware mpi * Revert "Undo cuda aware mpi" This reverts commit a8d71b2. * EXX KPAR WORKS on NSPIN=2 * Fix without MPI * Fix header * Separate ecut for exx pw * Documents related * Documents related --------- Co-authored-by: Mohan Chen <[email protected]> Co-authored-by: wqzhou <[email protected]> Co-authored-by: HTZhao <[email protected]> Co-authored-by: lanshuyue <[email protected]> Co-authored-by: Liang Sun <[email protected]> Co-authored-by: dzzz2001 <[email protected]> Co-authored-by: linpeize <[email protected]> Co-authored-by: linpz <[email protected]> Co-authored-by: liiutao <[email protected]> Co-authored-by: Mohan Chen <[email protected]> Co-authored-by: Critsium <[email protected]> Co-authored-by: kirk0830 <[email protected]> Co-authored-by: Taoni Bao <[email protected]> Co-authored-by: Chen Nuo <[email protected]>
1 parent a201da3 commit efaf1e3

File tree

4 files changed

+45
-2
lines changed

4 files changed

+45
-2
lines changed

docs/advanced/input_files/input-main.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,9 @@
302302
- [Exact Exchange (PW)](#exact-exchange-pw)
303303
- [exxace](#exxace)
304304
- [exx\_gamma\_extrapolation](#exx_gamma_extrapolation)
305+
- [ecutexx](#ecutexx)
306+
- [exx_thr_type](#exx_thr_type)
307+
- [exx_ene_thr](#exx_ene_thr)
305308
- [Molecular Dynamics](#molecular-dynamics)
306309
- [md\_type](#md_type)
307310
- [md\_nstep](#md_nstep)
@@ -3101,6 +3104,26 @@ These variables are relevant when using hybrid functionals with *[basis_type](#b
31013104
- **Description**: Whether to use the gamma point extrapolation method to calculate the Fock exchange operator. See [https://doi.org/10.1103/PhysRevB.79.205114](https://doi.org/10.1103/PhysRevB.79.205114) for details. Should be set to true most of the time.
31023105
- **Default**: True
31033106

3107+
### ecutexx
3108+
- **Type**: Real
3109+
- **Description**: The energy cutoff for EXX (Fock) exchange operator in plane wave basis calculations. Reducing `ecutexx` below `ecutrho` may significantly accelerate EXX computations. This speed improvement comes with a reduced numerical accuracy in the exchange energy calculation.
3110+
- **Default**: same as *[ecutrho](#ecutrho)*
3111+
- **Unit**: Ry
3112+
3113+
### exx_thr_type
3114+
- **Type**: String
3115+
- **Description**: The type of threshold used to judge whether the outer loop has converged in the separate loop EXX calculation.
3116+
- energy: use the change of exact exchange energy to judge convergence.
3117+
- density: if the change of charge density difference between two successive outer loop iterations is seen as converged according to *[scf_thr](#scf_thr)*, then the outer loop is seen as converged.
3118+
- **Default**: `density`
3119+
3120+
### exx_ene_thr
3121+
- **Type**: Real
3122+
- **Availability**: *[exx_thr_type](#exx_thr_type)*==`energy`
3123+
- **Description**: The threshold for the change of exact exchange energy to judge convergence of the outer loop in the separate loop EXX calculation.
3124+
- **Default**: 1e-5
3125+
- **Unit**: Ry
3126+
31043127
## Molecular dynamics
31053128

31063129
These variables are used to control molecular dynamics calculations. For more information, please refer to [md.md](../md.md#molecular-dynamics) in detail.

source/source_io/module_parameter/input_parameter.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,7 @@ struct Input_para
656656
bool exx_gamma_extrapolation = true; // gamma point extrapolation for exx, https://doi.org/10.1103/PhysRevB.79.205114
657657
std::string exx_thr_type = "density"; // threshold type for exx outer loop, energy or density
658658
double exx_ene_thr = 1e-5; // threshold for exx outer loop when exx_thr_type = energy
659+
double ecutexx = 0.0; // energy cutoff for exx calculation, Ry
659660

660661
// ==== #Parameters (23.XC external parameterization) ========
661662
/*

source/source_io/read_input_item_other.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,18 @@ void ReadInput::item_others()
571571
};
572572
this->add_item(item);
573573
}
574+
{
575+
Input_Item item("ecutexx");
576+
item.annotation = "energy cutoff for exx calculation, Ry";
577+
read_sync_double(input.ecutexx);
578+
item.check_value = [](const Input_Item& item, const Parameter& para) {
579+
if (para.input.ecutexx < 0)
580+
{
581+
ModuleBase::WARNING_QUIT("ReadInput", "ecutexx must >= 0");
582+
}
583+
};
584+
this->add_item(item);
585+
}
574586

575587
}
576588
} // namespace ModuleIO

source/source_pw/module_pwdft/operator_pw/op_exx_pw.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,22 @@ OperatorEXXPW<T, Device>::OperatorEXXPW(const int* isk_in,
7676
tpiba = ucell->tpiba;
7777
Real tpiba2 = tpiba * tpiba;
7878

79+
// initialize rhopw_dev
80+
double ecut_exx = PARAM.inp.ecutexx;
81+
if (ecut_exx == 0.0)
82+
{
83+
ecut_exx = PARAM.inp.ecutrho;
84+
}
85+
7986
rhopw_dev = new ModulePW::PW_Basis(wfcpw->get_device(), rhopw->get_precision());
8087
rhopw_dev->fft_bundle.setfft(wfcpw->get_device(), rhopw->get_precision());
8188
#ifdef __MPI
8289
rhopw_dev->initmpi(rhopw->poolnproc, rhopw->poolrank, rhopw->pool_world);
8390
#endif
8491
// here we can actually use different ecut to init the grids
85-
rhopw_dev->initgrids(rhopw->lat0, rhopw->latvec, rhopw->gridecut_lat * rhopw->tpiba2);
92+
rhopw_dev->initgrids(rhopw->lat0, rhopw->latvec, ecut_exx);
8693
rhopw_dev->initgrids(rhopw->lat0, rhopw->latvec, rhopw->nx, rhopw->ny, rhopw->nz);
87-
rhopw_dev->initparameters(rhopw->gamma_only, rhopw->ggecut * rhopw->tpiba2, rhopw->distribution_type, rhopw->xprime);
94+
rhopw_dev->initparameters(rhopw->gamma_only, ecut_exx, rhopw->distribution_type, rhopw->xprime);
8895
rhopw_dev->setuptransform();
8996
rhopw_dev->collect_local_pw();
9097

0 commit comments

Comments
 (0)