@@ -80,6 +80,7 @@ ModuleBase::Vector3<double> LR::LR_Spectrum<double>::cal_transition_dipole_istat
8080 LR_Util::_deallocate_2order_nested_ptr (rho_trans, 1 );
8181 }
8282 trans_dipole *= (ucell.omega / static_cast <double >(gint->get_ncxyz ())); // dv
83+ trans_dipole *= static_cast <double >(this ->nk ); // nk is divided inside DM_trans, now recover it
8384 Parallel_Reduce::reduce_all (trans_dipole.x );
8485 Parallel_Reduce::reduce_all (trans_dipole.y );
8586 Parallel_Reduce::reduce_all (trans_dipole.z );
@@ -132,6 +133,7 @@ ModuleBase::Vector3<std::complex<double>> LR::LR_Spectrum<std::complex<double>>:
132133 LR_Util::_deallocate_2order_nested_ptr (rho_trans_imag, 1 );
133134 }
134135 trans_dipole *= (ucell.omega / static_cast <double >(gint->get_ncxyz ())); // dv
136+ trans_dipole *= static_cast <double >(this ->nk ); // nk is divided inside DM_trans, now recover it
135137 Parallel_Reduce::reduce_all (trans_dipole.x );
136138 Parallel_Reduce::reduce_all (trans_dipole.y );
137139 Parallel_Reduce::reduce_all (trans_dipole.z );
@@ -192,7 +194,7 @@ void LR::LR_Spectrum<T>::optical_absorption_method1(const std::vector<double>& f
192194 std::ofstream ofs (PARAM.globalv .global_out_dir + " absorption_" + spintype + " .dat" );
193195 if (GlobalV::MY_RANK == 0 ) { ofs << " Frequency (eV) | wave length(nm) | Absorption (a.u.)" << std::endl; }
194196 double FourPI_div_c = ModuleBase::FOUR_PI / 137.036 ;
195- double fac = 4 * M_PI / ucell.omega * ModuleBase::e2 ; // e2 for Ry to Hartree in the denominator
197+ double fac = 4 * M_PI / ucell.omega * ModuleBase::e2 / this -> nk ; // e2 for Ry to Hartree in the denominator
196198 for (int f = 0 ;f < freq.size ();++f)
197199 {
198200 std::complex <double > f_complex = std::complex <double >(freq[f], eta);
0 commit comments