@@ -188,101 +188,6 @@ void Symmetry::analyze_magnetic_group_nspin4(const Atom* atoms, const Statistics
188188 ModuleBase::GlobalFunc::OUT (GlobalV::ofs_running, " MAGNETIC SPACE GROUP OPERATIONS" , this ->nrotk );
189189}
190190
191- void Symmetry::analyze_spin_space_group_nspin2 (const Atom* atoms, const Statistics& st)
192- {
193- // (nspin=2 collinear spin space group) The FULL chemical space group is already in
194- // gmatrix[0..nrotk). Split it, using the scalar collinear moments mag[iat], into:
195- // - unitary magnetic subgroup : mag[iat] == mag[g(iat)] for every atom -> kept in gmatrix
196- // - unitary spin-flip coset : mag[iat] == -mag[g(iat)] for every atom -> gmatrix_flip[]
197- // The spin-flip coset elements are [C2_perp||g]: they swap the up/down spin channels while
198- // rotating space by g. There is NO time reversal here (the collinear Hamiltonian is real, the two
199- // spin blocks are independent), so this is a plain channel swap - distinct from the antiunitary
200- // Theta*g coset built by analyze_magnetic_group_nspin4. Operations that neither preserve nor exactly
201- // flip the moment pattern are dropped.
202- std::vector<int > keep; // unitary magnetic subgroup
203- keep.reserve (this ->nrotk );
204- std::vector<int > flip; // unitary spin-flip coset [C2_perp||g]
205- flip.reserve (this ->nrotk );
206- int nrot_new = 0 ;
207- for (int isym = 0 ; isym < this ->nrotk ; ++isym)
208- {
209- bool preserve = true ;
210- for (int iat = 0 ; iat < this ->nat && preserve; ++iat)
211- {
212- const double mi = atoms[st.iat2it [iat]].mag [st.iat2ia [iat]];
213- const int jat = this ->get_rotated_atom (isym, iat);
214- const double mj = atoms[st.iat2it [jat]].mag [st.iat2ia [jat]];
215- if (!this ->equal (mi, mj)) { preserve = false ; }
216- }
217- if (preserve)
218- {
219- keep.push_back (isym);
220- if (isym < this ->nrot ) { ++nrot_new; } // pure point-group rotations are the first nrot ops
221- continue ;
222- }
223- // g does not preserve the moment pattern; check whether it exactly FLIPS it, i.e.
224- // mag[iat] = -mag[g(iat)] for every atom. Then [C2_perp||g] (spatial g + up<->down swap) is a symmetry.
225- bool flip_ok = true ;
226- for (int iat = 0 ; iat < this ->nat && flip_ok; ++iat)
227- {
228- const double mi = atoms[st.iat2it [iat]].mag [st.iat2ia [iat]];
229- const int jat = this ->get_rotated_atom (isym, iat);
230- const double mj = atoms[st.iat2it [jat]].mag [st.iat2ia [jat]];
231- if (!this ->equal (mi, -mj)) { flip_ok = false ; }
232- }
233- if (flip_ok) { flip.push_back (isym); }
234- }
235-
236- // Capture the spin-flip coset BEFORE the unitary arrays are compacted in place below.
237- this ->nrotk_flip = static_cast <int >(flip.size ());
238- this ->spin_flip_nspin2 = (this ->nrotk_flip > 0 );
239- if (this ->nrotk_flip > 0 )
240- {
241- this ->isym_rotiat_flip_ .resize (this ->nrotk_flip );
242- for (int j = 0 ; j < this ->nrotk_flip ; ++j)
243- {
244- const int isym = flip[j];
245- this ->gmatrix_flip [j] = this ->gmatrix [isym];
246- this ->kgmatrix_flip [j] = this ->kgmatrix [isym];
247- this ->gtrans_flip [j] = this ->gtrans [isym];
248- this ->isym_rotiat_flip_ [j] = this ->isym_rotiat_ [isym];
249- }
250- ModuleBase::GlobalFunc::OUT (GlobalV::ofs_running,
251- " SPIN-FLIP COSET OPERATIONS (nspin=2 SSG)" , this ->nrotk_flip );
252- }
253-
254- const int nrotk_new = static_cast <int >(keep.size ());
255- if (nrotk_new != this ->nrotk )
256- {
257- // compact the unitary subgroup in ascending order (keeps the rotations-first layout).
258- for (int i = 0 ; i < nrotk_new; ++i)
259- {
260- const int isym = keep[i];
261- if (i != isym)
262- {
263- this ->gmatrix [i] = this ->gmatrix [isym];
264- this ->kgmatrix [i] = this ->kgmatrix [isym];
265- this ->gtrans [i] = this ->gtrans [isym];
266- this ->isym_rotiat_ [i] = this ->isym_rotiat_ [isym];
267- }
268- }
269- this ->isym_rotiat_ .resize (nrotk_new);
270- this ->nrot = nrot_new;
271- this ->nrotk = nrotk_new;
272-
273- // refresh the point-/space-group labels for the reduced (unitary magnetic) group
274- this ->pointgroup (this ->nrot , this ->pgnumber , this ->pgname , this ->gmatrix , GlobalV::ofs_running, nullptr );
275- this ->pointgroup (this ->nrotk , this ->spgnumber , this ->spgname , this ->gmatrix , GlobalV::ofs_running, nullptr );
276- ModuleBase::GlobalFunc::OUT (GlobalV::ofs_running, " MAGNETIC POINT GROUP (unitary, nspin=2)" , this ->pgname );
277- ModuleBase::GlobalFunc::OUT (GlobalV::ofs_running, " MAGNETIC SPACE GROUP OPERATIONS" , this ->nrotk );
278- }
279- if (this ->spin_flip_nspin2 )
280- {
281- ModuleBase::GlobalFunc::OUT (GlobalV::ofs_running,
282- " SPIN SPACE GROUP OPERATIONS (unitary + spin-flip)" , this ->nrotk + this ->nrotk_flip );
283- }
284- }
285-
286191bool Symmetry::magmom_same_check (const Atom* atoms)const
287192{
288193 ModuleBase::TITLE (" Symmetry" , " magmom_same_check" );
@@ -334,32 +239,3 @@ int Symmetry::density_sym_ops(std::vector<ModuleBase::Matrix3>& kgmat,
334239 return nu + na;
335240}
336241
337- int Symmetry::spin_flip_sym_ops (std::vector<ModuleBase::Matrix3>& kgmat,
338- std::vector<ModuleBase::Vector3<double >>& gtr,
339- std::vector<double >& flip_sign) const
340- {
341- // (nspin=2 collinear SSG) Assemble the full spin space group used to symmetrize the collinear
342- // density and to fold the k-points: the nrotk unitary operations (flip_sign +1) followed by the
343- // nrotk_flip spatial parts of the spin-flip coset [C2_perp||g] (flip_sign -1). The combined set
344- // is the full chemical space group -- a group, closed under inverse -- so the invmap/grouping in
345- // rhog_symmetry* remains valid. In the (charge, mag) basis the charge is invariant (all ops act
346- // as ordinary space-group operations) and the magnetization flips sign under the coset.
347- const int nu = this ->nrotk ;
348- const int nf = (this ->spin_flip_nspin2 ? this ->nrotk_flip : 0 );
349- kgmat.resize (nu + nf);
350- gtr.resize (nu + nf);
351- flip_sign.assign (nu + nf, 1.0 );
352- for (int i = 0 ; i < nu; ++i)
353- {
354- kgmat[i] = this ->kgmatrix [i];
355- gtr[i] = this ->gtrans [i];
356- }
357- for (int j = 0 ; j < nf; ++j)
358- {
359- kgmat[nu + j] = this ->kgmatrix_flip [j];
360- gtr[nu + j] = this ->gtrans_flip [j];
361- flip_sign[nu + j] = -1.0 ;
362- }
363- return nu + nf;
364- }
365-
0 commit comments