Skip to content

Commit 66045c4

Browse files
maki49claude
andcommitted
refactor: split LibRI-free symmetry rotation out of module_ri, fix KPAR
Addresses the remaining PR #7969 review items: - Build: DFT+U (built unconditionally) was pulling in source_lcao/module_ri/module_exx_symmetry/symm_rotation.h, which requires LibRI (module_exx_symmetry is entirely gated behind ENABLE_LIBRI) -- breaking any build with LibRI disabled. - Moved irreducible_sector.{h,cpp}/irred_sec_bvk.cpp to source_cell/module_symmetry/ (unconditionally built "symmetry" library): they have no RI::Tensor dependency at all, just were bundled into the wrong CMake target. TCdouble switched from Abfs::Vector3_Order<double> (module_ri) to plain ModuleBase::Vector3<double> -- its ordering was never actually used. - Extracted the LibRI-independent k-space AO-rotation machinery (cal_Ms/restore_dm/rot_matrix_ao/Wigner-D math/cal_rotmat_Slm/...) into a new ModuleSymmetry::Symmetry_rotation_k base class in the same module, storing rotmat_Slm_ as ModuleBase::ComplexMatrix instead of RI::Tensor. EXX's own Symmetry_rotation (module_ri) now inherits from it and keeps only what genuinely needs RI::Tensor (restore_HR, rotate_atompair_serial/parallel, ...); a small ComplexMatrix->RI::Tensor adapter bridges the two remaining call sites in symm_rotation_r.hpp. DFT+U now includes only symm_rotation_k.h, no module_ri header. - Verified against a LibRI-enabled build (build_libri/, LIBRI_DIR pointed at the local checkout): module_exx_symmetry builds clean, and all 9 MODULE_RI_EXX_SYMMETRY_rotation unit tests pass, matching their pre-refactor reference values bit-for-bit. - Fixed a handful of test CMakeLists that linked "symmetry" but not "parameter" (irreducible_sector.cpp reads PARAM.globalv, previously hidden because these files only ever built inside the already-PARAM-linked EXX target) and dftu_lcao_test, which compiles dftu_nao_op.cpp directly and needs "symmetry" now. - K-point pools (KPAR>1): Symmetry_rotation_k::cal_Ms() read kv.kvec_d[ik_ibz] assuming a global array, but kv.kvec_d only holds the k-points owned by the current pool once mpi_k() has run. Gather the (small) global ibz-representative k-vector list once via MPI_Allreduce (mirroring Parallel_Kpoints::gatherkvec, inlined rather than called directly to avoid a new link dependency on parallel_kpoints.cpp for every "symmetry" consumer) before building the rotation matrices, so every pool computes correctly regardless of which pool actually owns a given ibz k-point. - accumulate_occ_over_kstar takes nspin as an explicit parameter instead of reading the global PARAM.inp.nspin (matches the local nspin already computed in cal_occ_mat_k from dftu.occmat().nspin(), which is the same value). Verified: full non-LibRI build (BUILD_TESTING=ON) compiles and links clean; MODULE_CELL_{klist,reciprocal_grid,qlist,little_group, unitcell,SYMMETRY_*} and dftu_{core,operator,lcao}_test all pass; broader ctest run reached 361/367 with only one unrelated pre-existing failure (LRI_CV_Tools.ReadCs, a missing test-data-file issue unrelated to this change). 17_DS_DFTU/03_LCAO_DFTU_S2_Z with symmetry=1 gives the same energy as before this refactor (-6771.6902262249250271 eV, bit-identical), and with kpar=2 gives -6771.6902262249113846 eV (matching to 12 significant figures, confirming the KPAR fix). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019omhQohPCePyJnLiWnG6Fa
1 parent 4c65f65 commit 66045c4

18 files changed

Lines changed: 713 additions & 722 deletions

‎source/source_cell/module_symmetry/CMakeLists.txt‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ add_library(
1717
symmetry.cpp
1818
symm_rot_spin.cpp
1919
little_group.cpp
20+
irreducible_sector.cpp
21+
irred_sec_bvk.cpp
22+
symm_rotation_k.cpp
2023
)
2124

2225
if(ENABLE_COVERAGE)

source/source_lcao/module_ri/module_exx_symmetry/irred_sec_bvk.cpp renamed to source/source_cell/module_symmetry/irred_sec_bvk.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ namespace ModuleSymmetry
7575
return;
7676
}
7777

78-
// extern lattice to minimal BvK lattice, and set direct coordinates in min BvK lattice
78+
// extern lattice to minimal BvK lattice, and set direct coordinates in min BvK lattice
7979
int bvk_gcd = gcd(bvk_period[0], gcd(bvk_period[1], bvk_period[2]));
8080
const TC bvk_min_period = TC({ bvk_period[0] / bvk_gcd, bvk_period[1] / bvk_gcd, bvk_period[2] / bvk_gcd });
8181
const int bvk_nat = st.nat * bvk_min_period[0] * bvk_min_period[1] * bvk_min_period[2];
@@ -199,4 +199,4 @@ namespace ModuleSymmetry
199199
// return in_plain;
200200
// }
201201

202-
};
202+
};

source/source_lcao/module_ri/module_exx_symmetry/irreducible_sector.cpp renamed to source/source_cell/module_symmetry/irreducible_sector.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "source_lcao/module_ri/module_exx_symmetry/irreducible_sector.h"
1+
#include "source_cell/module_symmetry/irreducible_sector.h"
22
#include "source_io/module_parameter/parameter.h"
33
namespace ModuleSymmetry
44
{
@@ -62,7 +62,7 @@ namespace ModuleSymmetry
6262
}
6363
}
6464

65-
// Perfoming {R|t} to atom position r in the R=0 lattice, we get Rr+t, which may get out of R=0 lattice,
65+
// Perfoming {R|t} to atom position r in the R=0 lattice, we get Rr+t, which may get out of R=0 lattice,
6666
// whose image in R=0 lattice is r'=Rr+t-O. This function is to get O for each atom and each symmetry operation.
6767
// the range of direct position is [-0.5, 0.5).
6868
TCdouble Irreducible_Sector::get_return_lattice(const Symmetry& symm,
@@ -109,7 +109,7 @@ namespace ModuleSymmetry
109109
ModuleBase::TITLE("Symmetry_rotation", "cal_return_lattice_all");
110110
// Columns [0, nrotk) are the unitary operations; columns [nrotk, nrotk+nrotk_anti) are the
111111
// spatial parts of the antiunitary elements Theta*g of the Shubnikov group (nspin=4 magnetic),
112-
// so that Symmetry_rotation can address both with one raw index.
112+
// so that Symmetry_rotation can address both with one raw index.
113113
this->return_lattice_.resize(st.nat, std::vector<TCdouble>(symm.nrotk + symm.nrotk_anti));
114114
for (int iat1 = 0;iat1 < st.nat;++iat1)
115115
{

source/source_lcao/module_ri/module_exx_symmetry/irreducible_sector.h renamed to source/source_cell/module_symmetry/irreducible_sector.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <vector>
33
#include <map>
44
#include <set>
5-
#include "source_lcao/module_ri/abfs_vector3_order.h"
5+
#include "source_base/vector3.h"
66
#include "source_base/matrix3.h"
77
#include "source_cell/module_symmetry/symmetry.h"
88
#include "source_cell/klist.h"
@@ -12,7 +12,7 @@ namespace ModuleSymmetry
1212
using Tap = std::pair<int, int>;
1313
using TC = std::array<int, 3>;
1414
using TapR = std::pair<Tap, TC>;
15-
using TCdouble = Abfs::Vector3_Order<double>;
15+
using TCdouble = ModuleBase::Vector3<double>;
1616

1717
class Irreducible_Sector
1818
{
@@ -60,7 +60,7 @@ namespace ModuleSymmetry
6060
// const std::map<int, std::set<std::pair<int, TC>>> convirt_irreducible_sector() {};
6161
//--------------------------------------------------------------------------------
6262

63-
/// Perfoming {R|t} to atom position r in the R=0 lattice, we get Rr+t, which may get out of R=0 lattice,
63+
/// Perfoming {R|t} to atom position r in the R=0 lattice, we get Rr+t, which may get out of R=0 lattice,
6464
/// whose image in R=0 lattice is r'=Rr+t-O. This function is to get O for each atom and each symmetry operation.
6565
/// the range of direct position is [-0.5, 0.5).
6666
TCdouble get_return_lattice(const Symmetry& symm,
@@ -140,5 +140,6 @@ namespace ModuleSymmetry
140140
int bvk_nsym_;
141141

142142
friend class Symmetry_rotation;
143+
friend class Symmetry_rotation_k;
143144
};
144-
}
145+
}

‎source/source_cell/module_symmetry/symm_rotation_k.cpp‎

Lines changed: 507 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
#pragma once
2+
#include "irreducible_sector.h"
3+
#include "source_basis/module_ao/parallel_orbitals.h"
4+
#include "source_base/complexmatrix.h"
5+
#include "source_cell/module_symmetry/symm_rot_spin.h"
6+
7+
namespace ModuleSymmetry
8+
{
9+
/// @brief k-space AO-representation symmetry restoration: reconstructs D(k) at every
10+
/// k-star member from D(k_ibz), for crystal-symmetry-reduced BZ sampling.
11+
///
12+
/// This is the LibRI-independent subset of what used to be a single
13+
/// source_lcao/module_ri/module_exx_symmetry/Symmetry_rotation class: everything needed
14+
/// to go from an irreducible-k-point density matrix to the full-BZ one, so callers that
15+
/// only need that (e.g. DFT+U's occupation-matrix/DMR restoration) do not have to depend
16+
/// on module_ri or LibRI. EXX/RPA's own real-space H(R)/RI-coefficient restoration (which
17+
/// does need RI::Tensor) is built on top of this class in
18+
/// source_lcao/module_ri/module_exx_symmetry/symm_rotation.h (ModuleSymmetry::Symmetry_rotation,
19+
/// which inherits from this one).
20+
class Symmetry_rotation_k
21+
{
22+
public:
23+
Symmetry_rotation_k() {};
24+
virtual ~Symmetry_rotation_k() {};
25+
26+
//--------------------------------------------------------------------------------
27+
// getters
28+
const std::map<Tap, std::set<TC>>& get_irreducible_sector()const { return this->irs_.get_irreducible_sector(); }
29+
TCdouble get_return_lattice(const Symmetry& symm,
30+
const ModuleBase::Matrix3& gmatd, const TCdouble gtransd,
31+
const TCdouble& posd_a1, const TCdouble& posd_a2)const
32+
{
33+
return this->irs_.get_return_lattice(symm, gmatd, gtransd, posd_a1, posd_a2);
34+
}
35+
TCdouble get_return_lattice(const int iat, const int isym) const
36+
{
37+
return this->irs_.get_return_lattice(iat, isym);
38+
}
39+
/// the rotation matrix under the basis of S_l^m. size: [nsym][lmax][nm*nm]
40+
const std::vector<std::vector<ModuleBase::ComplexMatrix>>& rotmat_Slm = this->rotmat_Slm_;
41+
const int& abfs_Lmax = this->abfs_Lmax_;
42+
//--------------------------------------------------------------------------------
43+
// setters
44+
void find_irreducible_sector(const Symmetry& symm, const Atom* atoms, const Statistics& st,
45+
const std::vector<TC>& Rs, const TC& period, const Lattice& lat)
46+
{
47+
this->irs_.find_irreducible_sector(symm, atoms, st, Rs, period, lat);
48+
}
49+
void set_abfs_Lmax(const int l) { this->abfs_Lmax_ = l; }
50+
//--------------------------------------------------------------------------------
51+
/// functions to contruct rotation matrix in AO-representation
52+
53+
/// The top-level calculation interface of this class. calculate the rotation matrix in AO representation: M
54+
/// only need once call in each ion step (decided by the configuration)
55+
/// @param kstars equal k points to each ibz-kpont, corresponding to a certain symmetry operations.
56+
void cal_Ms(const K_Vectors& kv,
57+
const UnitCell& ucell, const Parallel_2D& pv);
58+
59+
/// Use calculated M matrix to recover D(k) from D(k_ibz): D(k) = M(R, k)^\dagger D(k_ibz) M(R, k)
60+
/// the link "ik_ibz-isym-ik" can be found in kstars: k_bz = gmat[isym](k)
61+
std::vector<std::vector<std::complex<double>>>restore_dm(const K_Vectors& kv,
62+
const std::vector<std::vector<std::complex<double>>>& dm_k_ibz,
63+
const Parallel_2D& pv)const;
64+
std::vector<std::vector<double>>restore_dm(const K_Vectors& kv,
65+
const std::vector<std::vector<double>>& dm_k_ibz,
66+
const Parallel_2D& pv)const;
67+
std::vector<std::complex<double>> rot_matrix_ao(const std::vector<std::complex<double>>& DMkibz,
68+
const int ik_ibz, const int kstar_size, const int isym, const Parallel_2D& pv, const bool TRS_conj = false) const;
69+
70+
/// (nspin=4) build the 2*nao spin operator Sigma_y = I_nao (x) sigma_y in 2d-block layout.
71+
std::vector<std::complex<double>> set_sigma_y_2d(const Parallel_2D& pv) const;
72+
73+
/// (nspin=4) time-reversal on the spin density matrix: D(k) = sigma_y D^*(-k) sigma_y,
74+
/// realized distribution-safely as scale * Sigma_y * conj(X) * Sigma_y (X is the already
75+
/// space-group-rotated D(-k) stored in the transposed 2d-block convention).
76+
std::vector<std::complex<double>> trs_spin_rotate(const std::vector<std::complex<double>>& X,
77+
const std::vector<std::complex<double>>& sigma_y, const Parallel_2D& pv, const double scale) const;
78+
79+
/// calculate Wigner D matrix
80+
double wigner_d(const double beta, const int l, const int m1, const int m2) const;
81+
std::complex<double> wigner_D(const TCdouble& euler_angle, const int l, const int m1, const int m2, const bool inv) const;
82+
83+
/// c^l_{m1, m2}=<Y_l^m1|S_l^m2>
84+
std::complex<double> ovlp_Ylm_Slm(const int l, const int m1, const int m2) const;
85+
86+
/// calculate euler angle from rotation matrix
87+
TCdouble get_euler_angle(const ModuleBase::Matrix3& gmatc) const;
88+
89+
/// T_mm' = [c^\dagger D c]_mm', the rotation matrix in the representation of real sphere harmonics
90+
/// @param nop number of operations in gmatc; <0 means nsym_ (the unitary ones only).
91+
/// Pass nsym_+nanti_ to also build the antiunitary operations' T_l.
92+
void cal_rotmat_Slm(const ModuleBase::Matrix3* gmatc, const int lmax, const int nop);
93+
94+
/// set a block matrix onto a 2d-parallelized matrix(col-maj), at the position (starti, startj)
95+
/// if trans=true, the block matrix is transposed before setting
96+
void set_block_to_mat2d(const int starti, const int startj, const ModuleBase::ComplexMatrix& block,
97+
std::vector<std::complex<double>>& obj_mat, const Parallel_2D& pv, const bool trans = false) const;
98+
void set_block_to_mat2d(const int starti, const int startj, const ModuleBase::ComplexMatrix& block,
99+
std::vector<double>& obj_mat, const Parallel_2D& pv, const bool trans = false) const;
100+
101+
/// 2d-block parallized rotation matrix in AO-representation, denoted as M.
102+
/// finally we will use D(k)=M(R, k)^\dagger*D(Rk)*M(R, k) to recover D(k) from D(Rk).
103+
std::vector<std::complex<double>> contruct_2d_rot_mat_ao(const Symmetry& symm, const Atom* atoms, const Statistics& cell_st,
104+
const TCdouble& kvec_d_ibz, int isym, const Parallel_2D& pv,
105+
const SpinRotation::Su2& spin_U /*= SpinRotation::Su2{ 1.0, 0.0, 0.0, 1.0 }*/) const;
106+
107+
std::vector<std::vector<ModuleBase::ComplexMatrix>>& get_rotmat_Slm() { return this->rotmat_Slm_; }
108+
109+
//--------------------------------------------------------------------------------
110+
/// list all cells in a Born-von-Karman supercell of the given period (no LibRI dependency,
111+
/// unlike RI_Util::get_Born_von_Karmen_cells which this mirrors for 3D periods).
112+
static std::vector<TC> get_bvk_cells(const TC& period);
113+
114+
protected:
115+
int nsym_ = 1;
116+
/// (nspin=4, magnetic) number of ANTIUNITARY elements Theta*g of the Shubnikov group.
117+
/// Their orbital rotations / return lattices / Ms are appended after the nsym_ unitary
118+
/// ones, so the raw index isym in [nsym_, nsym_+nanti_) addresses gmatrix_anti[isym-nsym_].
119+
int nanti_ = 0;
120+
/// (nspin=4) true when the configuration carries a non-zero local moment. Then pure time
121+
/// reversal is NOT a symmetry (it reverses m) and the k-star must be restored with the
122+
/// Shubnikov elements Theta*gmatrix_anti[] instead of the generic -k shortcut.
123+
bool magnetic_nspin4_ = false;
124+
125+
double eps_ = 1e-6;
126+
127+
int abfs_Lmax_ = 0;
128+
129+
/// the rotation matrix under the basis of S_l^m. size: [nsym][lmax][nm*nm]
130+
std::vector<std::vector<ModuleBase::ComplexMatrix>> rotmat_Slm_;
131+
132+
/// The unitary matrix associate D(Rk) with D(k) for each ibz-kpoint Rk and each symmetry operation.
133+
/// size: [nks_ibz][nsym][nbasis*nbasis], only need to calculate once.
134+
std::vector<std::map<int, std::vector<std::complex<double>>>> Ms_;
135+
136+
/// (nspin=4) the SU(2) spin-1/2 rotation U(isym) for each symmetry operation, size [nsym].
137+
/// The spinor AO rotation is T(isym) (x) U(isym); restore_HR_nspin4 (EXX) uses it to mix
138+
/// the 4 spin channels of the real-space H(R). Filled in cal_Ms (identity for nspin<4).
139+
std::vector<SpinRotation::Su2> spin_U_;
140+
141+
/// irreducible sector
142+
Irreducible_Sector irs_;
143+
};
144+
}

‎source/source_cell/module_symmetry/test/CMakeLists.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ abacus_disable_feature_definitions(__CUDA)
44
abacus_disable_feature_definitions(__ROCM)
55
AddTest(
66
TARGET MODULE_CELL_SYMMETRY_analysis
7-
LIBS base device symmetry
7+
LIBS parameter base device symmetry
88
SOURCES symm_test.cpp symm_test_analysis.cpp
99
)
1010
AddTest(
1111
TARGET MODULE_CELL_SYMMETRY_symtrz
12-
LIBS base device symmetry
12+
LIBS parameter base device symmetry
1313
SOURCES symm_test.cpp symm_test_symtrz.cpp
1414
)
1515
AddTest(

‎source/source_cell/test/CMakeLists.txt‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,31 +85,31 @@ AddTest(
8585

8686
AddTest(
8787
TARGET MODULE_CELL_klist_test
88-
LIBS base device symmetry
88+
LIBS parameter base device symmetry
8989
SOURCES klist_test.cpp ../klist.cpp ../klist_io.cpp ../parallel_kpoints.cpp ../reciprocal_grid.cpp
9090
)
9191

9292
AddTest(
9393
TARGET MODULE_CELL_reciprocal_grid_test
94-
LIBS base device symmetry
94+
LIBS parameter base device symmetry
9595
SOURCES reciprocal_grid_test.cpp ../reciprocal_grid.cpp
9696
)
9797

9898
AddTest(
9999
TARGET MODULE_CELL_qlist_test
100-
LIBS base device symmetry
100+
LIBS parameter base device symmetry
101101
SOURCES qlist_test.cpp ../qlist.cpp ../reciprocal_grid.cpp
102102
)
103103

104104
AddTest(
105105
TARGET MODULE_CELL_little_group_test
106-
LIBS base device symmetry
106+
LIBS parameter base device symmetry
107107
SOURCES little_group_test.cpp
108108
)
109109

110110
AddTest(
111111
TARGET MODULE_CELL_klist_test_para1
112-
LIBS base device symmetry
112+
LIBS parameter base device symmetry
113113
SOURCES klist_test_para.cpp ../klist.cpp ../klist_io.cpp ../parallel_kpoints.cpp ../reciprocal_grid.cpp
114114
)
115115

@@ -172,7 +172,7 @@ add_test(NAME MODULE_CELL_parallel_kpoints_test
172172

173173
AddTest(
174174
TARGET MODULE_CELL_unitcell_test
175-
LIBS base device cell_info symmetry
175+
LIBS parameter base device cell_info symmetry
176176
SOURCES unitcell_test.cpp ../cal_ux.cpp
177177

178178
)

‎source/source_lcao/module_dftu/dftu_nao_occ.cpp‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
#include "source_estate/occ_matrix.h"
88
#include "source_lcao/hamilt_lcao.h"
99
#include "source_cell/module_symmetry/symmetry.h"
10-
#include "source_lcao/module_ri/ri_util.h"
11-
#include "source_lcao/module_ri/module_exx_symmetry/symm_rotation.h"
10+
#include "source_cell/module_symmetry/symm_rotation_k.h"
1211

1312
// cal_occ_mat_k / cal_occ_mat_gamma take Plus_U_Base& dftu directly and read all
1413
// occupation-matrix state (occ/save arrays, lookup table, nspin/npol, and the
@@ -20,7 +19,7 @@ namespace
2019
// of one run: process-lifetime static since cal_occ_mat_k has no natural
2120
// per-ion-step owning object to hang this off (unlike the dft_plus_u=1
2221
// operator path, which owns its own copy).
23-
ModuleSymmetry::Symmetry_rotation dftu_occ_symrot;
22+
ModuleSymmetry::Symmetry_rotation_k dftu_occ_symrot;
2423
bool dftu_occ_symrot_built = false;
2524

2625
/// @brief accumulate one k-star member's rotated S*DM product into occmat,
@@ -105,9 +104,9 @@ void DFTU_LCAO::cal_occ_mat_k(const Parallel_Orbitals* pv,
105104
const bool dftu_spacegroup_symmetry = (ModuleSymmetry::Symmetry::symm_flag == 1) && !kv.kstars.empty();
106105
if (dftu_spacegroup_symmetry && !dftu_occ_symrot_built)
107106
{
108-
const std::array<int, 3>& period = RI_Util::get_Born_vonKarmen_period(kv);
107+
const std::array<int, 3> period{ kv.nmp[0], kv.nmp[1], kv.nmp[2] };
109108
dftu_occ_symrot.find_irreducible_sector(ucell.symm, ucell.atoms, ucell.st,
110-
RI_Util::get_Born_von_Karmen_cells(period), period, ucell.lat);
109+
ModuleSymmetry::Symmetry_rotation_k::get_bvk_cells(period), period, ucell.lat);
111110
dftu_occ_symrot.cal_Ms(kv, ucell, *pv);
112111
dftu_occ_symrot_built = true;
113112
}

‎source/source_lcao/module_dftu/dftu_nao_op.cpp‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include "source_base/parallel_reduce.h"
1212
#include "source_cell/klist.h"
1313
#include "source_cell/module_symmetry/symmetry.h"
14-
#include "source_lcao/module_ri/ri_util.h"
1514

1615
#include <memory>
1716

@@ -140,10 +139,10 @@ void hamilt::DFTU<hamilt::OperatorLCAO<TK, TR>>::contributeHR()
140139
{
141140
if (!this->symrot_built_)
142141
{
143-
const std::array<int, 3>& period = RI_Util::get_Born_vonKarmen_period(*this->kv_);
142+
const std::array<int, 3> period{ this->kv_->nmp[0], this->kv_->nmp[1], this->kv_->nmp[2] };
144143
// for return_lattice to calculate Ms
145144
this->symrot_.find_irreducible_sector(this->ucell->symm, this->ucell->atoms, this->ucell->st,
146-
RI_Util::get_Born_von_Karmen_cells(period), period, this->ucell->lat);
145+
ModuleSymmetry::Symmetry_rotation_k::get_bvk_cells(period), period, this->ucell->lat);
147146
this->symrot_.cal_Ms(*this->kv_, *this->ucell, *pv);
148147
this->symrot_built_ = true;
149148
}

0 commit comments

Comments
 (0)