From 5fc440e252002ead6d6bcf53c908b5ee77a37b63 Mon Sep 17 00:00:00 2001 From: Simon Pintarelli Date: Mon, 8 Jul 2024 11:20:01 +0200 Subject: [PATCH] use cached rotation matrices --- src/density/density.cpp | 2 +- src/symmetry/symmetrize_occupation_matrix.hpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/density/density.cpp b/src/density/density.cpp index 2841a33ab..3a9a8b2e2 100644 --- a/src/density/density.cpp +++ b/src/density/density.cpp @@ -1116,7 +1116,7 @@ Density::generate(K_point_set const& ks__, bool symmetrize__, bool add_core__, b if (occupation_matrix_) { /* all symmetrization is done in the occupation_matrix class */ - symmetrize_occupation_matrix(*occupation_matrix_); + symmetrize_occupation_matrix(*occupation_matrix_, ctx_.rotm()); } /* compare with reference density matrix */ diff --git a/src/symmetry/symmetrize_occupation_matrix.hpp b/src/symmetry/symmetrize_occupation_matrix.hpp index b8e98a944..5bc4b7ead 100644 --- a/src/symmetry/symmetrize_occupation_matrix.hpp +++ b/src/symmetry/symmetrize_occupation_matrix.hpp @@ -19,7 +19,7 @@ namespace sirius { inline void -symmetrize_occupation_matrix(Occupation_matrix& om__) +symmetrize_occupation_matrix(Occupation_matrix& om__, std::vector> const& rotm__) { PROFILE("sirius::symmetrize_occupation_matrix"); auto& ctx = om__.ctx(); @@ -61,7 +61,7 @@ symmetrize_occupation_matrix(Occupation_matrix& om__) for (int isym = 0; isym < sym.size(); isym++) { int pr = sym[isym].spg_op.proper; auto eang = sym[isym].spg_op.euler_angles; - auto rotm = sht::rotation_matrix(4, eang, pr); + auto& rotm = rotm__[isym]; auto spin_rot_su2 = rotation_matrix_su2(sym[isym].spin_rotation); int iap = sym[isym].spg_op.inv_sym_atom[ia];