Skip to content

Commit 15b99e7

Browse files
committed
refactor: remove default values of new parameters
1 parent 96903b8 commit 15b99e7

4 files changed

Lines changed: 29 additions & 29 deletions

File tree

source/source_cell/module_symmetry/symmetry.h

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -179,29 +179,29 @@ class Symmetry : public Symmetry_Basic
179179
void rhog_symmetry(std::complex<double> *rhogtot, int* ixyz2ipw, const int &nx,
180180
const int &ny, const int &nz, const int & fftnx, const int &fftny, const int &fftnz,
181181
const bool gamma_only_pw,
182-
const ModuleBase::Matrix3* kgmatrix_in = nullptr,
183-
const ModuleBase::Vector3<double>* gtrans_in = nullptr, const int nop = -1);
184-
185-
/// @brief Symmetrize the nspin=4 (non-collinear/SOC) spin density in reciprocal space.
186-
/// The three Pauli spin components (rho^x, rho^y, rho^z) are processed TOGETHER because
187-
/// each symmetry operation g couples the spatial map with a spin rotation W(g):
188-
/// m_sym(G) = (1/|G|) sum_g W(g) * m(g^{-1} G) * phase(g).
189-
/// The spatial bookkeeping (grouping/phase) is identical to rhog_symmetry; the only
190-
/// difference is that the per-g spin rotation W(g) is applied to the 3-vector. `wspin`
191-
/// is the precomputed array (size nrotk) of spin-rotation matrices, with
192-
/// wspin[s] = SpinRotation::spin_so3(direct_to_cartesian(gmatrix[s], latvec)),
193-
/// such that m'^i = sum_j wspin[s]_{ij} m^j under symmetry operation s.
194-
/// @param trs_inv time-reversal sign per operation (+1 unitary, -1 antiunitary Theta*g), from
195-
/// density_sym_ops(). Theta flips the magnetization, so the antiunitary elements
196-
/// contribute m -> -W(g) m instead of m -> W(g) m. nullptr means all +1.
197-
/// @param kgmatrix_in,gtrans_in,nop optional operation set (default: the nrotk unitary members).
198-
void rhog_symmetry_nspin4(std::complex<double>* rhogtot_x, std::complex<double>* rhogtot_y,
199-
std::complex<double>* rhogtot_z, const ModuleBase::Matrix3* wspin,
200-
int* ixyz2ipw, const int &nx, const int &ny, const int &nz,
201-
const int & fftnx, const int &fftny, const int &fftnz,
202-
const double* trs_inv = nullptr,
203-
const ModuleBase::Matrix3* kgmatrix_in = nullptr,
204-
const ModuleBase::Vector3<double>* gtrans_in = nullptr, const int nop = -1);
182+
const ModuleBase::Matrix3* kgmatrix_in,
183+
const ModuleBase::Vector3<double>* gtrans_in, const int nop);
184+
185+
/// @brief Symmetrize the nspin=4 (non-collinear/SOC) spin density in reciprocal space.
186+
/// The three Pauli spin components (rho^x, rho^y, rho^z) are processed TOGETHER because
187+
/// each symmetry operation g couples the spatial map with a spin rotation W(g):
188+
/// m_sym(G) = (1/|G|) sum_g W(g) * m(g^{-1} G) * phase(g).
189+
/// The spatial bookkeeping (grouping/phase) is identical to rhog_symmetry; the only
190+
/// difference is that the per-g spin rotation W(g) is applied to the 3-vector. `wspin`
191+
/// is the precomputed array (size nrotk) of spin-rotation matrices, with
192+
/// wspin[s] = SpinRotation::spin_so3(direct_to_cartesian(gmatrix[s], latvec)),
193+
/// such that m'^i = sum_j wspin[s]_{ij} m^j under symmetry operation s.
194+
/// @param trs_inv time-reversal sign per operation (+1 unitary, -1 antiunitary Theta*g), from
195+
/// density_sym_ops(). Theta flips the magnetization, so the antiunitary elements
196+
/// contribute m -> -W(g) m instead of m -> W(g) m. nullptr means all +1.
197+
/// @param kgmatrix_in,gtrans_in,nop optional operation set (default: the nrotk unitary members).
198+
void rhog_symmetry_nspin4(std::complex<double>* rhogtot_x, std::complex<double>* rhogtot_y,
199+
std::complex<double>* rhogtot_z, const ModuleBase::Matrix3* wspin,
200+
int* ixyz2ipw, const int &nx, const int &ny, const int &nz,
201+
const int & fftnx, const int &fftny, const int &fftnz,
202+
const double* trs_inv,
203+
const ModuleBase::Matrix3* kgmatrix_in,
204+
const ModuleBase::Vector3<double>* gtrans_in, const int nop);
205205

206206
/// symmetrize a vector3 with nat elements, which can be forces or variation of atom positions in relax
207207
void symmetrize_vec3_nat(double* v)const; // force

source/source_cell/module_symmetry/test/symmetry_rho_soc_test.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ TEST(RhogSymmetrySoc, Idempotence)
121121
std::vector<std::complex<double>> x(NXYZ), y(NXYZ), z(NXYZ);
122122
fill_density(x, y, z);
123123

124-
symm.rhog_symmetry_nspin4(x.data(), y.data(), z.data(), wspin.data(), ixyz2ipw.data(), N, N, N, N, N, N);
124+
symm.rhog_symmetry_nspin4(x.data(), y.data(), z.data(), wspin.data(), ixyz2ipw.data(), N, N, N, N, N, N, nullptr, nullptr, nullptr, -1);
125125
std::vector<std::complex<double>> x1 = x, y1 = y, z1 = z;
126-
symm.rhog_symmetry_nspin4(x.data(), y.data(), z.data(), wspin.data(), ixyz2ipw.data(), N, N, N, N, N, N);
126+
symm.rhog_symmetry_nspin4(x.data(), y.data(), z.data(), wspin.data(), ixyz2ipw.data(), N, N, N, N, N, N, nullptr, nullptr, nullptr, -1);
127127

128128
for (int i = 0; i < NXYZ; ++i)
129129
{
@@ -144,7 +144,7 @@ TEST(RhogSymmetrySoc, GroupInvariance)
144144

145145
std::vector<std::complex<double>> x(NXYZ), y(NXYZ), z(NXYZ);
146146
fill_density(x, y, z);
147-
symm.rhog_symmetry_nspin4(x.data(), y.data(), z.data(), wspin.data(), ixyz2ipw.data(), N, N, N, N, N, N);
147+
symm.rhog_symmetry_nspin4(x.data(), y.data(), z.data(), wspin.data(), ixyz2ipw.data(), N, N, N, N, N, N, nullptr, nullptr, nullptr, -1);
148148

149149
// non-triviality guard: the symmetrized density must not be all-zero, otherwise
150150
// invariance would hold trivially and the test would be meaningless.

source/source_lcao/module_ri/module_exx_symmetry/symmetry_rotation.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ namespace ModuleSymmetry
8787
/// T_mm' = [c^\dagger D c]_mm', the rotation matrix in the representation of real sphere harmonics
8888
/// @param nop number of operations in gmatc; <0 means nsym_ (the unitary ones only).
8989
/// Pass nsym_+nanti_ to also build the antiunitary operations' T_l.
90-
void cal_rotmat_Slm(const ModuleBase::Matrix3* gmatc, const int lmax, const int nop = -1);
90+
void cal_rotmat_Slm(const ModuleBase::Matrix3* gmatc, const int lmax, const int nop);
9191

9292
/// set a block matrix onto a 2d-parallelized matrix(col-maj), at the position (starti, startj)
9393
/// if trans=true, the block matrix is transposed before setting
@@ -100,7 +100,7 @@ namespace ModuleSymmetry
100100
/// finally we will use D(k)=M(R, k)^\dagger*D(Rk)*M(R, k) to recover D(k) from D(Rk).
101101
std::vector<std::complex<double>> contruct_2d_rot_mat_ao(const Symmetry& symm, const Atom* atoms, const Statistics& cell_st,
102102
const TCdouble& kvec_d_ibz, int isym, const Parallel_2D& pv,
103-
const SpinRotation::Su2& spin_U = SpinRotation::Su2{ 1.0, 0.0, 0.0, 1.0 }) const;
103+
const SpinRotation::Su2& spin_U /*= SpinRotation::Su2{ 1.0, 0.0, 0.0, 1.0 }*/) const;
104104

105105
std::vector<std::vector<RI::Tensor<std::complex<double>>>>& get_rotmat_Slm() { return this->rotmat_Slm_; }
106106

source/source_lcao/module_ri/module_exx_symmetry/test/symmetry_rotation_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ TEST_F(SymmetryRotationTest, OvlpYS)
115115

116116
TEST_F(SymmetryRotationTest, RotMat)
117117
{
118-
symrot.cal_rotmat_Slm(&C41, 1);
118+
symrot.cal_rotmat_Slm(&C41, 1, -1);
119119
RI::Tensor<std::complex<double>>& rotmat = symrot.get_rotmat_Slm()[0][1];
120120
int l = 1;
121121
for (int m1 = -l;m1 <= l;++m1)

0 commit comments

Comments
 (0)