@@ -72,7 +72,7 @@ namespace LR
7272 const double & exx_alpha,
7373#endif
7474 TGint* gint,
75- std::weak_ptr<PotHxcLR> pot ,
75+ std::weak_ptr<PotHxcLR> pot_hxc_gs ,
7676 const K_Vectors& kv,
7777 const std::vector<Parallel_2D>& px,
7878 const Parallel_2D& pc,
@@ -90,9 +90,9 @@ namespace LR
9090 elecstate::DensityMatrix<T, T> DM_diff_relaxed (&pmat, 1 , kv.kvec_d , nk); // T+DZ
9191 LR_Util::initialize_DMR (DM_diff_relaxed, pmat, ucell, gd, orb_cutoff);
9292 // / operators
93- // 1. 0.5$H_{ia}[T]$, equals to $K_{ab}[T]$ when $T $ is symmetrized
93+ // 1. 0.5$H_{ia}[T+Z ]$, equals to $K_{ab}[T+Z ]$ when $(T+Z) $ is symmetrized
9494 OperatorLRHxc<T> op_ht (nspin, naos, nocc, nvirt, psi_ks,
95- DM_diff_relaxed, gint, pot , ucell, orb_cutoff, gd, kv, p_occ_occ, pc, pmat,
95+ DM_diff_relaxed, gint, pot_hxc_gs , ucell, orb_cutoff, gd, kv, p_occ_occ, pc, pmat,
9696 { 0 }, T (1.0 ), ATYPE::CC_oo);
9797 // 2. $2\sum_{jb,kc} g^{xc}_{ia, jb, kc}X_{jb}X_{kc}$
9898 // use pointer here for polymorphism
@@ -101,7 +101,7 @@ namespace LR
101101 // `weak_ptr=shared_ptr` is automatically called in the constructor of OperatorLRHxc, so we don't need to do it manually
102102 // if `pot_grad` is passed into a function rather than a class, we need to write `weak_ptr=shared_ptr` explicitly
103103 std::shared_ptr<PotGradXCLR> pot_grad =
104- std::make_shared<PotGradXCLR>(pot .lock ()->xc_kernel_components , pot .lock ()->get_rho_basis (), ucell, pot .lock ()->nrxx );
104+ std::make_shared<PotGradXCLR>(pot_hxc_gs .lock ()->xc_kernel_components , pot_hxc_gs .lock ()->get_rho_basis (), ucell, pot_hxc_gs .lock ()->nrxx );
105105 OperatorLRHxc<T> op_gxc (nspin, naos, nocc, nvirt, psi_ks,
106106 DM_trans, gint, pot_grad, ucell, orb_cutoff, gd, kv, p_occ_occ, pc, pmat,
107107 { 0 }, T (-2.0 ), ATYPE::CC_oo);
@@ -150,7 +150,7 @@ namespace LR
150150 cal_dm_trans (0 , X); // transition density matrix DX
151151 cal_dm_diff_relaxed (0 , X, Z); // relaxed difference density matrix T+DZ
152152 // the 3 terms
153- op_ht.act (/* nband=*/ 1 , ld_oo, /* npol=*/ 1 , X, W);
153+ op_ht.act (/* nband=*/ 1 , ld_oo, /* npol=*/ 1 , X, W); // comment out this line to test H[T+Z]=0
154154 if (has_local_xc) { op_gxc.act (/* nband=*/ 1 , ld_oo, /* npol=*/ 1 , X, W); }
155155 std::cout << " W (H[T+Z]) + W(gxc) terms: " << std::endl;
156156 LR_Util::print_value (W, nk, p_occ_occ[0 ].get_col_size (), p_occ_occ[0 ].get_row_size ());
0 commit comments