45 const Eigen::MatrixXd &localized_mo_coeff) {
48 overlap.
Fill(aobasis);
49 Index numOfActiveOrbs = 0;
50 Index numOfInactiveOrbs = 0;
52 Eigen::MatrixXd active_mo_coeff;
53 Eigen::MatrixXd inactive_mo_coeff;
55 for (
Index LocMoCoeff_col_i = 0; LocMoCoeff_col_i < localized_mo_coeff.cols();
58 const Eigen::MatrixXd orbital_wise_population =
59 localized_mo_coeff.col(LocMoCoeff_col_i).transpose() *
61 localized_mo_coeff.col(LocMoCoeff_col_i).asDiagonal();
62 const Eigen::RowVectorXd MullikenPop_per_basisfunc =
63 orbital_wise_population.colwise().sum();
66 for (
Index atom_id = 0; atom_id <
Index(numfuncpatom.size()); atom_id++) {
67 const double MullikenPop_per_atom =
68 MullikenPop_per_basisfunc.segment(start, numfuncpatom[atom_id]).sum();
72 active_mo_coeff.conservativeResize(localized_mo_coeff.rows(),
74 active_mo_coeff.col(numOfActiveOrbs) =
75 localized_mo_coeff.col(LocMoCoeff_col_i);
80 start += numfuncpatom[atom_id];
83 inactive_mo_coeff.conservativeResize(localized_mo_coeff.rows(),
84 numOfInactiveOrbs + 1);
85 inactive_mo_coeff.col(numOfInactiveOrbs) =
86 localized_mo_coeff.col(LocMoCoeff_col_i);
90 const Eigen::MatrixXd dmat_active =
91 2 * active_mo_coeff * active_mo_coeff.transpose();
92 std::array<Eigen::MatrixXd, 3> result;
93 result[0] = dmat_active;
94 result[1] = active_mo_coeff;
95 result[2] = inactive_mo_coeff;