29 #ifndef _chemistry_qc_scf_coefs_impl_h
30 #define _chemistry_qc_scf_coefs_impl_h
37 template<
template<
typename...>
class container,
typename map_type>
39 CADFCLHF::get_coefs_ish_jsh(
43 container<map_type>& coefsA,
44 container<map_type>& coefsB
46 const int dfnbfAB = ish.center == jsh.center ? ish.atom_dfnbf : ish.atom_dfnbf + jsh.atom_dfnbf;
50 std::shared_ptr<Decomposition> decomp = get_decomposition(
51 ish, jsh, metric_ints_2c_[ithr]
54 Eigen::MatrixXd ij_M_X(ish.nbf*jsh.nbf, dfnbfAB);
55 for(
const auto&& ksh : iter_shells_on_center(dfbs_, ish.center)){
56 auto ij_M_k = ints_to_eigen(
58 metric_ints_3c_[ithr],
64 const int ijbf = ibf.bfoff_in_shell * jsh.nbf + jbf.bfoff_in_shell;
65 ij_M_X.row(ijbf).segment(ksh.bfoff_in_atom, ksh.nbf) = ij_M_k->row(ijbf);
70 if(ish.center != jsh.center){
71 for(
const auto&& ksh : iter_shells_on_center(dfbs_, jsh.center)){
72 auto ij_M_k = ints_to_eigen(
74 metric_ints_3c_[ithr],
79 const int ijbf = ibf.bfoff_in_shell * jsh.nbf + jbf.bfoff_in_shell;
80 const int dfbfoff = ish.atom_dfnbf + ksh.bfoff_in_atom;
81 ij_M_X.row(ijbf).segment(dfbfoff, ksh.nbf) = ij_M_k->row(ijbf);
99 for(
int ijbf = 0; ijbf < ij_M_X.rows(); ++ijbf) {
100 auto& Ctmp = decomp->solve(ij_M_X.row(ijbf).transpose());
101 coefsA[ijbf] = Ctmp.head(ish.atom_dfnbf);
102 if(!coefsB.empty()) {
103 coefsB[ijbf] = Ctmp.tail(jsh.atom_dfnbf);