Skip to content

Commit 7fff0c9

Browse files
author
dyzheng
committed
Fix(deltaspin): fix pauli_to_moment My sign convention and enable PW escon
Source fixes: - spin_constrain.h: fix My = -Im(occ1-occ2) → Im(occ1-occ2) The magnetic moment y-component had the wrong sign in the Pauli matrix transformation, causing incorrect Mi computation for nspin=4 DeltaSpin. - cal_escon(): replace is_Mi_converged guard with lambda_/Mi_ empty check - elecstate_pw: add get_spin_constrain_energy() for PW basis DeltaSpin Refs regenerated for nspin=4 DeltaSpin cases: 14, 15, 16, 19, 21, 41 Test 18 unchanged, nspin=2 tests unchanged.
1 parent 21117cb commit 7fff0c9

8 files changed

Lines changed: 16 additions & 16 deletions

File tree

source/source_lcao/module_deltaspin/spin_constrain.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ inline ModuleBase::Vector3<double> pauli_to_moment(const std::complex<double> oc
7979
{
8080
return ModuleBase::Vector3<double>(
8181
weight * (occ[1] + occ[2]).real(),
82-
-weight * (occ[1] - occ[2]).imag(),
82+
weight * (occ[1] - occ[2]).imag(),
8383
weight * (occ[0] - occ[3]).real()
8484
);
8585
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
etotref -6396.381001785331
2-
etotperatomref -3198.1905008926656
1+
etotref -6369.19895097706
2+
etotperatomref -3184.59947548853
33
totaltimeref 1.0
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
etotref -6370.809681073991
2-
etotperatomref -3185.4048405369954
1+
etotref -6369.198273166801
2+
etotperatomref -3184.5991365834007
33
totaltimeref 1.0
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
etotref -6378.090151037823
2-
etotperatomref -3189.0450755189113
1+
etotref -6369.198274098935
2+
etotperatomref -3184.5991370494676
33
totaltimeref 1.0
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
etotref -6360.5555597262455194
2-
etotperatomref -3180.2777798631228
3-
totaltimeref 1.0
1+
etotref -6355.9855588350255857
2+
etotperatomref -3177.9927794175
3+
totaltimeref 2.89
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
etotref -6360.5528100225901653
2-
etotperatomref -3180.276405011295
1+
etotref -6360.5554588729937677
2+
etotperatomref -3180.277729436497
33
totaltimeref 1.0
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
etotref -6360.5035660234671013
2-
etotperatomref -3180.2517830117336
1+
etotref -6360.5554655414534864
2+
etotperatomref -3180.2777327707267
33
totaltimeref 1.0
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
etotref -6372.011126477043
2-
etotperatomref -3186.0055632385215
1+
etotref -6369.198254647004
2+
etotperatomref -3184.599127323502
33
totaltimeref 1.0

0 commit comments

Comments
 (0)