Skip to content

Commit

Permalink
Update cal_gdmx and cal_gdmepsl.
Browse files Browse the repository at this point in the history
  • Loading branch information
ErjieWu committed Jan 4, 2025
1 parent 2b34442 commit b4eae9c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 37 deletions.
11 changes: 0 additions & 11 deletions source/module_hamilt_lcao/module_deepks/cal_gdmepsl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,17 +188,6 @@ void LCAO_Deepks::cal_gdmepsl(const std::vector<std::vector<TK>>& dm,
* grad_overlap_1[jpol]->get_value(row_indexes[iw1],
ib + m2)
* r1[ipol]);
// gdmepsl.index_put_({mm, inl, m2, m1},
// ucell.lat0 * *dm_current
// * (grad_overlap_2[jpol]->get_value(col_indexes[iw2], ib +
// m2)
// * overlap_1->get_value(row_indexes[iw1], ib + m1)
// * r0[ipol]));
// gdmepsl.index_put_({mm, inl, m2, m1},
// ucell.lat0 * *dm_current
// * (overlap_2->get_value(col_indexes[iw2], ib + m1)
// * grad_overlap_1[jpol]->get_value(row_indexes[iw1], ib + m2)
// * r1[ipol]));
mm++;
}
}
Expand Down
28 changes: 2 additions & 26 deletions source/module_hamilt_lcao/module_deepks/cal_gdmx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,47 +167,23 @@ void LCAO_Deepks::cal_gdmx(const std::vector<std::vector<TK>>& dm,
for (int i = 0; i < 3; i++)
{
//(<d/dX chi_mu|alpha_m>)<chi_nu|alpha_m'>
// gdmx.index_put_({i, iat, inl, m1, m2},
// grad_overlap_2[i]->get_value(col_indexes[iw2], ib + m2)
// * overlap_1->get_value(row_indexes[iw1], ib + m1) *
// *dm_current);
accessor[i][iat][inl][m1][m2]
+= grad_overlap_2[i]->get_value(col_indexes[iw2], ib + m2)
* overlap_1->get_value(row_indexes[iw1], ib + m1) * *dm_current;

//(<d/dX chi_nu|alpha_m'>)<chi_mu|alpha_m>
// gdmx.index_put_({i, iat, inl, m2, m1},
// grad_overlap_2[i]->get_value(col_indexes[iw2], ib + m2)
// * overlap_1->get_value(row_indexes[iw1], ib + m1) *
// *dm_current);
// gdmx[i][iat][inl][m2][m1]
// += grad_overlap_2[i]->get_value(col_indexes[iw2], ib + m2)
// * overlap_1->get_value(row_indexes[iw1], ib + m1) *
// *dm_current;
accessor[i][iat][inl][m1][m2]
+= grad_overlap_2[i]->get_value(col_indexes[iw2], ib + m1)
* overlap_1->get_value(row_indexes[iw1], ib + m2) * *dm_current;

// (<chi_mu|d/dX alpha_m>)<chi_nu|alpha_m'> = -(<d/dX
// chi_mu|alpha_m>)<chi_nu|alpha_m'> gdmx.index_put_({i, ibt2, inl, m1,
// m2},
// -grad_overlap_2[i]->get_value(col_indexes[iw2], ib + m2)
// * overlap_1->get_value(row_indexes[iw1], ib + m1) *
// *dm_current);
// chi_mu|alpha_m>)<chi_nu|alpha_m'>
accessor[i][ibt2][inl][m1][m2]
-= grad_overlap_2[i]->get_value(col_indexes[iw2], ib + m2)
* overlap_1->get_value(row_indexes[iw1], ib + m1) * *dm_current;

//(<chi_nu|d/dX alpha_m'>)<chi_mu|alpha_m> = -(<d/dX
// chi_nu|alpha_m'>)<chi_mu|alpha_m>
// gdmx.index_put_({i, ibt2, inl, m2, m1},
// -grad_overlap_2[i]->get_value(col_indexes[iw2], ib + m2)
// * overlap_1->get_value(row_indexes[iw1], ib + m1) *
// *dm_current);
// gdmx[i][ibt2][inl][m2][m1]
// -= grad_overlap_2[i]->get_value(col_indexes[iw2], ib + m2)
// * overlap_1->get_value(row_indexes[iw1], ib + m1) *
// *dm_current;
//chi_nu|alpha_m'>)<chi_mu|alpha_m>
accessor[i][ibt2][inl][m1][m2]
-= grad_overlap_2[i]->get_value(col_indexes[iw2], ib + m1)
* overlap_1->get_value(row_indexes[iw1], ib + m2) * *dm_current;
Expand Down

0 comments on commit b4eae9c

Please sign in to comment.