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

Feature: RI-Hartree for LR-TDDFT benchmark with FHI-aims #5084

Merged
merged 11 commits into from
Sep 17, 2024
26 changes: 26 additions & 0 deletions docs/advanced/input_files/input-main.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@
- [exx\_real\_number](#exx_real_number)
- [exx\_symmetry\_realspace](#exx_symmetry_realspace)
- [rpa\_ccp\_rmesh\_times](#rpa_ccp_rmesh_times)
- [out\_ri\_cv](#out_ri_cv)
- [Molecular dynamics](#molecular-dynamics)
- [md\_type](#md_type)
- [md\_nstep](#md_nstep)
Expand Down Expand Up @@ -424,6 +425,8 @@
- [abs\_wavelen\_range](#abs_wavelen_range)
- [out\_wfc\_lr](#out_wfc_lr)
- [abs\_broadening](#abs_broadening)
- [ri\_hartree\_benchmark](#ri_hartree_benchmark)
- [aims_nbasis](#aims_nbasis)

[back to top](#full-list-of-input-keywords)
## System variables
Expand Down Expand Up @@ -2436,6 +2439,12 @@ These variables are relevant when using hybrid functionals.
- True: rotate both D(k) and Hexx(R) to accelerate both diagonalization and EXX calculation
- **Default**: True

### out_ri_cv

- **Type**: Boolean
- **Description**: Whether to output the coefficient tensor C(R) and ABFs-representation Coulomb matrix V(R) for each atom pair and cell in real space.
- **Default**: false

[back to top](#full-list-of-input-keywords)

## Molecular dynamics
Expand Down Expand Up @@ -3946,4 +3955,21 @@ The output files are `OUT.${suffix}/Excitation_Energy.dat` and `OUT.${suffix}/Ex
- **Description**: The broadening factor $\eta$ for the absorption spectrum calculation.
- **Default**: 0.01

### ri_hartree_benchmark
- **Type**: String
- **Description**: Whether to use the localized resolution-of-identity (LRI) approximation for the **Hartree** term of kernel in the $A$ matrix of LR-TDDFT for benchmark (with FHI-aims or another ABACUS calculation). Now it only supports molecular systems running with a single processor, and a large enough supercell should be used to make LRI C, V tensors contain only the R=(0 0 0) cell.
- `aims`: The `OUT.${suffix}`directory should contain the FHI-aims output files: RI-LVL tensors`Cs_data_0.txt` and `coulomb_mat_0.txt`, and KS eigenstates from FHI-aims: `band_out`and `KS_eigenvectors.out`. The Casida equation will be constructed under FHI-aims' KS eigenpairs.
- LRI tensor files (`Cs_data_0.txt` and `coulomb_mat_0.txt`)and Kohn-Sham eigenvalues (`bands_out`): run FHI-aims with periodic boundary conditions and with `total_energy_method rpa` and `output librpa`.
- Kohn-Sham eigenstates under aims NAOs (`KS_eigenvectors.out`): run FHI-aims with `output eigenvectors`.
- If the number of atomic orbitals of any atom type in FHI-aims is different from that in ABACUS, the `aims_nbasis` should be set.
- `abacus`: The `OUT.${suffix}`directory should contain the RI-LVL tensors `Cs` and `Vs` (written by setting `out_ri_cv` to 1). The Casida equation will be constructed under ABACUS' KS eigenpairs, with the only difference that the Hartree term is constructed with RI approximation.
- `none`: Construct the Hartree term by Poisson equation and grid integration as usual.
- **Default**: none

### aims_nbasis
- **Type**: A number(ntype) of Integers
- **Availability**: `ri_hartree_benchmark` = `aims`
- **Description**: Atomic basis set size for each atom type (with the same order as in `STRU`) in FHI-aims.
- **Default**: {} (empty list, where ABACUS use its own basis set size)

[back to top](#full-list-of-input-keywords)
39 changes: 39 additions & 0 deletions examples/lr-tddft/H2-RI-J-aims-benchmark/INPUT
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
INPUT_PARAMETERS
#Parameters (1.General)
suffix aims-benchmark-tdhf
pseudo_dir /home/fortneu49/LR-TDDFT/abacus-develop/tests/PP_ORB
orbital_dir /home/fortneu49/LR-TDDFT/abacus-develop/tests/PP_ORB
calculation scf
nbands 4
symmetry 0

#Parameters (2.Iteration)
ecutwfc 50
scf_thr 1e-6
scf_nmax 100

#Parameters (3.Basis)
basis_type lcao
gamma_only 1
nspin 2

#Parameters (4.Smearing)
smearing_method gaussian
smearing_sigma 0.02

#Parameters (5.Mixing)
mixing_type pulay
mixing_beta 0.4
mixing_gg0 0.0


exx_real_number 1
lr_nstates 3
nvirt 3
xc_kernel hf
lr_solver lapack

esolver_type lr
ri_hartree_benchmark aims
aims_nbasis 5
read_file_dir aims-files
4 changes: 4 additions & 0 deletions examples/lr-tddft/H2-RI-J-aims-benchmark/KPT
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
K_POINTS
0
Gamma
1 1 1 0 0 0
22 changes: 22 additions & 0 deletions examples/lr-tddft/H2-RI-J-aims-benchmark/STRU
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
ATOMIC_SPECIES
H 1.008 H_ONCV_PBE-1.0.upf

NUMERICAL_ORBITAL
H_gga_8au_60Ry_2s1p.orb

LATTICE_CONSTANT
1.889725989

LATTICE_VECTORS
30 0 0
0 30 0
0 0 30

ATOMIC_POSITIONS
Cartesian

H
0
2
0 0 10.37 0 0 0
0 0 9.63 0 0 0
109 changes: 109 additions & 0 deletions examples/lr-tddft/H2-RI-J-aims-benchmark/aims-files/Cs_data_0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
2 1
1 1 0 0 0
5 5 18
0 -0 -0 -0 -0 -0 -0.230626 0.135762 0.10707 -0 0 0 0 -0 -0 0 -0 0.242585
0 -0 0 -0 -0 0 -0.191217 -7.31941e-10 4.43558e-09 -0 0 0 -0 0 -0 0 0 -3.29021e-10
-0.139801 -0 0 -0.0641414 -0 -0 0 0 -0 -0 -0 -0 -0 -0 0.081299 0 0 -0
-0 -0.139801 0 -0 -0.0641414 -0 -0 -0 0 0 -0 -0 -0 0 0 0.081299 0 -0
0 0 -0.139801 0 -0 -0.0641414 -0 0 -0 0 -0 -0 -0 -0 -0 -0 0.081299 -0
0 -0 0 -0 -0 0 -0.191217 -7.31941e-10 4.43558e-09 -0 0 0 -0 0 -0 0 0 -3.29021e-10
0 -0 -0 -0 -0 -0 -0.270925 0.0250371 0.10707 -0 0 0 -0 0 -0 0 -0 0.242585
-0.094218 -0 0 0.0193009 -0 -0 0 0 -0 -0 -0 0 -0 -0 -0.0244638 0 0 0
-0 -0.094218 0 -0 0.0193009 -0 -0 0 -0 0 -0 -0 -0 0 0 -0.0244638 -0 0
0 0 -0.094218 -0 -0 0.0193009 0 -0 0 -0 -0 -0 -0 -0 -0 -0 -0.0244638 0
-0.139801 -0 0 -0.0641414 -0 -0 0 0 -0 -0 -0 -0 -0 -0 0.081299 0 0 -0
-0.094218 -0 0 0.0193009 -0 -0 0 0 -0 -0 -0 0 -0 -0 -0.0244638 0 0 0
0 -0 -0 -0 -0 -0 -0.241876 0.177655 0.100239 0 -0 -0.0554715 0 -0.0960795 -0 0 -0 0.242585
0 0 0 0 0 -0 -0 -0 -0 -0 0.0960795 0 0 -0 -0 -0 -0 -0
-0 0 -0 -0 -0 0 -0 0 -0 -0.0960795 0 -0 0 0 0 -0 -0 0
-0 -0.139801 0 -0 -0.0641414 -0 -0 -0 0 0 -0 -0 -0 0 0 0.081299 0 -0
-0 -0.094218 0 -0 0.0193009 -0 -0 0 -0 0 -0 -0 -0 0 0 -0.0244638 -0 0
0 0 0 0 0 -0 -0 -0 -0 -0 0.0960795 0 0 -0 -0 -0 -0 -0
0 -0 0 0 -0 -0 -0.241876 0.177655 0.100239 0 0 0.110943 -0 0 -0 0 -0 0.242585
0 0 0 -0 0 -0 0 0 -0 -0 0 -0 0.0960795 -0 0 -0 -0 -0
0 0 -0.139801 0 -0 -0.0641414 -0 0 -0 0 -0 -0 -0 -0 -0 -0 0.081299 -0
0 0 -0.094218 -0 -0 0.0193009 0 -0 0 -0 -0 -0 -0 -0 -0 -0 -0.0244638 0
-0 0 -0 -0 -0 0 -0 0 -0 -0.0960795 0 -0 0 0 0 -0 -0 0
0 0 0 -0 0 -0 0 0 -0 -0 0 -0 0.0960795 -0 0 -0 -0 -0
0 -0 0 -0 -0 0 -0.241876 0.177655 0.100239 -0 -0 -0.0554715 0 0.0960795 -0 0 0 0.242585
1 2 0 0 0
5 5 18
-0 0.0245651 -0 -0 0.0149391 -0 -0.160825 0.110624 0.0842319 0 -0 0.00316491 -0 -0 0 -0.0201565 0 0.190989
-0 0.0130036 -0 -0 -0.00144702 -0 0.0873035 -0.101632 -0.0886519 0 -0 0.00510166 -0 0 0 0.00807733 0 -0.19489
-0.0513167 -1e-15 0 -0.0310758 -1e-15 0 2e-15 -2e-15 -1e-15 0 -0.0172149 -0 0 -0 0.0368716 1e-15 -0 -2e-15
0 0.0681457 0 0 0.0361164 0 -0.344411 0.204408 0.140775 -0 0 0.00968773 0 -0 -0 -0.0424824 -0 0.323148
0 8e-15 -0.0513167 0 6e-15 -0.0310758 -2.1e-14 1.7e-14 1.2e-14 -0 0 2e-15 -0.0172149 -0 -0 -7e-15 0.0368716 2.7e-14
0 0.0430242 0 0 0.0146274 0 -0.225913 0.0721899 0.0360992 -0 0 0.00699694 0 -0 -0 -0.0114642 -0 0.0883786
-0 0.0496907 -0 -0 0.0127808 -0 -0.00329405 0.0145957 0.0436375 0 -0 0.0201143 -0 -0 0 -0.0236424 -0 0.116296
-0.0687941 0 -0 -0.0150028 0 -0 0 -0 -1e-15 -0 -0.0257909 0 -0 0 0.00485231 0 0 -1e-15
0 0.117954 -0 0 0.0354104 0 -0.438074 0.11865 0.0752525 -0 0 0.0324734 0 -0 0 -0.031651 -0 0.211856
-0 -5e-15 -0.0687941 -0 -4e-15 -0.0150028 1.3e-14 -1.1e-14 -8e-15 -0 -0 -1e-15 -0.0257909 0 0 5e-15 0.00485231 -1.7e-14
-0.12976 -3e-15 -0 -0.0721682 -2e-15 -0 8e-15 -6e-15 -4e-15 -0 -0.0257943 -1e-15 -0 -0 0.0862768 3e-15 0 -9e-15
0.0462496 3e-15 0 0.0575141 2e-15 0 -7e-15 5e-15 4e-15 0 -0.0190369 1e-15 0 -0 -0.0837727 -2e-15 -0 8e-15
-0 0.0403407 0 -0 0.0399023 0 -0.099139 0.111631 0.0646994 -0 -0 -0.0100625 0 -0.0612892 0 -0.0370237 -0 0.142616
-0.224274 -6e-15 -1e-15 -0.0959317 -4e-15 -1e-15 1.3e-14 -1.1e-14 -7e-15 -0 -0.0515269 -2e-15 -1e-15 0 0.10232 5e-15 1e-15 -1.6e-14
-0 -5e-15 -0 -0 -3e-15 -0 1.1e-14 -8e-15 -5e-15 -0.0612892 0 -1e-15 -0 0 -0 3e-15 0 -1.2e-14
0 -0.0766775 0 0 -0.0331645 0 -0.0961604 0.0703217 0.0508962 -0 0 -0.0142829 0 0 -0 0.038973 -0 0.111617
0 0.0978254 0 0 0.0710041 0 -0.0631855 0.0154977 -0.0054804 -0 0 -0.00102598 0 0 -0 -0.0731032 -0 0.00471846
-0.0315763 -3e-15 -1e-15 -0.0233826 -2e-15 -1e-15 7e-15 -6e-15 -4e-15 -0 0.0168434 -1e-15 -1e-15 0 0.0249668 2e-15 1e-15 -9e-15
-0 -0.173038 0 -0 -0.0691469 0 -0.0218471 -0.000300658 0.00271948 -0 -0 -0.0382597 0 0 -0 0.0789792 -0 0.00620806
-1e-15 -8e-15 -0.0315763 -0 -6e-15 -0.0233826 2e-14 -1.6e-14 -1.1e-14 -0 -0 -2e-15 0.0168434 0 1e-15 7e-15 0.0249668 -2.5e-14
0 6e-15 -0.12976 0 4e-15 -0.0721682 -1.6e-14 1.3e-14 9e-15 -0 0 2e-15 -0.0257943 -0 -0 -5e-15 0.0862768 2e-14
0 -1e-15 0.0462496 -0 -1e-15 0.0575141 3e-15 -2e-15 -2e-15 0 0 -0 -0.0190369 -0 -0 1e-15 -0.0837727 -4e-15
-0 -5e-15 -0 -0 -3e-15 -0 1.1e-14 -8e-15 -5e-15 -0.0612892 0 -1e-15 -0 0 -0 3e-15 0 -1.2e-14
0 3e-15 -0.224274 0 2e-15 -0.0959317 -8e-15 6e-15 4e-15 -0 0 1e-15 -0.0515269 0 -0 -3e-15 0.10232 9e-15
-0 0.0403407 -0 -0 0.0399023 -0 -0.099139 0.111631 0.0646994 0 -0 -0.0100625 -0 0.0612892 0 -0.0370237 0 0.142616
2 1 0 0 0
5 5 18
0 -0.0245651 -0 0 -0.0149391 -0 -0.160825 0.110624 0.0842319 0 -0 0.00316491 0 -0 -0 0.0201565 -0 0.190989
0 -0.0130036 -0 0 0.00144702 -0 0.0873035 -0.101632 -0.0886519 0 -0 0.00510166 0 -0 -0 -0.00807733 0 -0.19489
-0.0513167 -1e-15 -0 -0.0310758 -1e-15 -0 -2e-15 2e-15 1e-15 -0 0.0172149 0 0 0 0.0368716 1e-15 0 2e-15
0 0.0681457 -0 0 0.0361164 -0 0.344411 -0.204408 -0.140775 -0 -0 -0.00968773 0 -0 -0 -0.0424824 0 -0.323148
-0 -9e-15 -0.0513167 -0 -6e-15 -0.0310758 -2.3e-14 1.9e-14 1.3e-14 -0 0 3e-15 0.0172149 0 0 8e-15 0.0368716 2.9e-14
-0 -0.0430242 0 -0 -0.0146274 0 -0.225913 0.0721899 0.0360992 -0 0 0.00699694 -0 0 0 0.0114642 -0 0.0883786
0 -0.0496907 -0 0 -0.0127808 -0 -0.00329405 0.0145957 0.0436375 0 -0 0.0201143 0 -0 -0 0.0236424 -0 0.116296
-0.0687941 0 0 -0.0150028 0 0 0 0 1e-15 0 0.0257909 -0 -0 -0 0.00485231 0 -0 1e-15
0 0.117954 0 0 0.0354104 -0 0.438074 -0.11865 -0.0752525 -0 -0 -0.0324734 0 0 -0 -0.031651 0 -0.211856
0 4e-15 -0.0687941 0 3e-15 -0.0150028 1.1e-14 -9e-15 -7e-15 -0 -0 -1e-15 0.0257909 -0 -0 -4e-15 0.00485231 -1.5e-14
-0.12976 -3e-15 0 -0.0721682 -2e-15 -0 -8e-15 6e-15 4e-15 0 0.0257943 1e-15 0 0 0.0862768 3e-15 0 1e-14
0.0462496 3e-15 -0 0.0575141 2e-15 -0 7e-15 -5e-15 -4e-15 -0 0.0190369 -1e-15 0 -0 -0.0837727 -2e-15 0 -8e-15
-0 -0.0403407 -0 -0 -0.0399023 -0 -0.099139 0.111631 0.0646994 0 0 -0.0100625 0 -0.0612892 -0 0.0370237 0 0.142616
0.224274 5e-15 -0 0.0959317 4e-15 -0 1.3e-14 -1.1e-14 -8e-15 -0 -0.0515269 -1e-15 0 -0 -0.10232 -5e-15 0 -1.7e-14
0 5e-15 0 -0 3e-15 0 1.1e-14 -8e-15 -5e-15 -0.0612892 0 -1e-15 -0 0 0 -3e-15 -0 -1.2e-14
0 -0.0766775 -0 0 -0.0331645 -0 0.0961604 -0.0703217 -0.0508962 0 -0 0.0142829 0 -0 -0 0.038973 0 -0.111617
0 0.0978254 -0 0 0.0710041 -0 0.0631855 -0.0154977 0.0054804 0 -0 0.00102598 0 -0 -0 -0.0731032 -0 -0.00471846
0.0315763 3e-15 -1e-15 0.0233826 2e-15 -1e-15 7e-15 -6e-15 -4e-15 -0 0.0168434 -1e-15 1e-15 -0 -0.0249668 -2e-15 1e-15 -9e-15
0 0.173038 0 -0 0.0691469 0 -0.0218471 -0.000300658 0.00271948 -0 -0 -0.0382597 -0 0 0 -0.0789792 -0 0.00620806
-0 -8e-15 0.0315763 -0 -6e-15 0.0233826 -2.1e-14 1.7e-14 1.2e-14 -0 0 2e-15 0.0168434 0 0 7e-15 -0.0249668 2.7e-14
-0 -7e-15 -0.12976 0 -5e-15 -0.0721682 -1.9e-14 1.6e-14 1.1e-14 -0 0 2e-15 0.0257943 -0 -0 7e-15 0.0862768 2.4e-14
-0 1e-15 0.0462496 -0 1e-15 0.0575141 3e-15 -3e-15 -2e-15 -0 -0 -0 0.0190369 0 0 -1e-15 -0.0837727 -4e-15
0 5e-15 0 -0 3e-15 0 1.1e-14 -8e-15 -5e-15 -0.0612892 0 -1e-15 -0 0 0 -3e-15 -0 -1.2e-14
-0 5e-15 0.224274 -0 4e-15 0.0959317 1.3e-14 -1e-14 -7e-15 0 0 -1e-15 -0.0515269 0 0 -4e-15 -0.10232 -1.6e-14
0 -0.0403407 0 0 -0.0399023 0 -0.099139 0.111631 0.0646994 0 -0 -0.0100625 -0 0.0612892 -0 0.0370237 -0 0.142616
2 2 0 0 0
5 5 18
0 -0 -0 -0 -0 -0 -0.230626 0.135762 0.10707 -0 0 0 0 -0 -0 0 -0 0.242585
0 -0 0 -0 -0 0 -0.191217 -7.31941e-10 4.43558e-09 -0 0 0 -0 0 -0 0 0 -3.29021e-10
-0.139801 -0 0 -0.0641414 -0 -0 0 0 -0 -0 -0 -0 -0 -0 0.081299 0 0 -0
-0 -0.139801 0 -0 -0.0641414 -0 -0 -0 0 0 -0 -0 -0 0 0 0.081299 0 -0
0 0 -0.139801 0 -0 -0.0641414 -0 0 -0 0 -0 -0 -0 -0 -0 -0 0.081299 -0
0 -0 0 -0 -0 0 -0.191217 -7.31941e-10 4.43558e-09 -0 0 0 -0 0 -0 0 0 -3.29021e-10
0 -0 -0 -0 -0 -0 -0.270925 0.0250371 0.10707 -0 0 0 -0 0 -0 0 -0 0.242585
-0.094218 -0 0 0.0193009 -0 -0 0 0 -0 -0 -0 0 -0 -0 -0.0244638 0 0 0
-0 -0.094218 0 -0 0.0193009 -0 -0 0 -0 0 -0 -0 -0 0 0 -0.0244638 -0 0
0 0 -0.094218 -0 -0 0.0193009 0 -0 0 -0 -0 -0 -0 -0 -0 -0 -0.0244638 0
-0.139801 -0 0 -0.0641414 -0 -0 0 0 -0 -0 -0 -0 -0 -0 0.081299 0 0 -0
-0.094218 -0 0 0.0193009 -0 -0 0 0 -0 -0 -0 0 -0 -0 -0.0244638 0 0 0
0 -0 -0 -0 -0 -0 -0.241876 0.177655 0.100239 0 -0 -0.0554715 0 -0.0960795 -0 0 -0 0.242585
0 0 0 0 0 -0 -0 -0 -0 -0 0.0960795 0 0 -0 -0 -0 -0 -0
-0 0 -0 -0 -0 0 -0 0 -0 -0.0960795 0 -0 0 0 0 -0 -0 0
-0 -0.139801 0 -0 -0.0641414 -0 -0 -0 0 0 -0 -0 -0 0 0 0.081299 0 -0
-0 -0.094218 0 -0 0.0193009 -0 -0 0 -0 0 -0 -0 -0 0 0 -0.0244638 -0 0
0 0 0 0 0 -0 -0 -0 -0 -0 0.0960795 0 0 -0 -0 -0 -0 -0
0 -0 0 0 -0 -0 -0.241876 0.177655 0.100239 0 0 0.110943 -0 0 -0 0 -0 0.242585
0 0 0 -0 0 -0 0 0 -0 -0 0 -0 0.0960795 -0 0 -0 -0 -0
0 0 -0.139801 0 -0 -0.0641414 -0 0 -0 0 -0 -0 -0 -0 -0 -0 0.081299 -0
0 0 -0.094218 -0 -0 0.0193009 0 -0 0 -0 -0 -0 -0 -0 -0 -0 -0.0244638 0
-0 0 -0 -0 -0 0 -0 0 -0 -0.0960795 0 -0 0 0 0 -0 -0 0
0 0 0 -0 0 -0 0 0 -0 -0 0 -0 0.0960795 -0 0 -0 -0 -0
0 -0 0 -0 -0 0 -0.241876 0.177655 0.100239 -0 -0 -0.0554715 0 0.0960795 -0 0 0 0.242585
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
1 2 3 4
1 1 atomic 1 s 0 -0.523569621 -2.197503980 -0.062143244 0.000000000
2 1 hydro 2 s 0 -0.110309474 0.611206163 0.545808873 -0.000000000
3 1 hydro 2 p -1 0.000000000 -0.000000000 0.000000000 -0.560724947
4 1 hydro 2 p 0 0.030169911 0.106470988 -0.079177632 -0.000000000
5 1 hydro 2 p 1 -0.000000000 0.000000000 0.000000000 -0.006309400
6 2 atomic 1 s 0 -0.523569621 2.197503980 -0.062143244 -0.000000000
7 2 hydro 2 s 0 -0.110309474 -0.611206163 0.545808873 0.000000000
8 2 hydro 2 p -1 -0.000000000 -0.000000000 0.000000000 -0.560724947
9 2 hydro 2 p 0 -0.030169911 0.106470988 0.079177632 -0.000000000
10 2 hydro 2 p 1 0.000000000 -0.000000000 0.000000000 -0.006309400
10 changes: 10 additions & 0 deletions examples/lr-tddft/H2-RI-J-aims-benchmark/aims-files/band_out
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
1
1
4
4
-3.017559622833094E-002
1 1
1 2.00000 -0.596181 -16.22290
2 0.00000 0.207317 5.64139
3 0.00000 0.511918 13.93000
4 0.00000 0.969372 26.37794
Loading
Loading