@@ -18,12 +18,15 @@ namespace SpinAdapted{
18
18
19
19
double getCommuteParity (SpinQuantum a , SpinQuantum b , SpinQuantum c )
20
20
{
21
- int aspin = a .get_s (), airrep = a .get_symm ().getirrep ();
22
- int bspin = b .get_s (), birrep = b .get_symm ().getirrep ();
23
- int cspin = c .get_s (), cirrep = c .get_symm ().getirrep ();
21
+ int aspin = a .get_s (). getirrep () , airrep = a .get_symm ().getirrep ();
22
+ int bspin = b .get_s (). getirrep () , birrep = b .get_symm ().getirrep ();
23
+ int cspin = c .get_s (). getirrep () , cirrep = c .get_symm ().getirrep ();
24
24
25
25
int an = a .get_n (), bn = b .get_n ();
26
26
int parity = IsFermion (a ) && IsFermion (b ) ? -1 : 1 ;
27
+
28
+ if (!dmrginp .spinAdapted ()) return parity ;
29
+
27
30
for (int asz = - aspin ; asz < aspin + 1 ; asz += 2 )
28
31
for (int bsz = - bspin ; bsz < bspin + 1 ; bsz += 2 )
29
32
for (int al = 0 ; al < Symmetry ::sizeofIrrep (airrep ); al ++ )
@@ -50,11 +53,12 @@ double getCommuteParity(SpinQuantum a, SpinQuantum b, SpinQuantum c)
50
53
51
54
double Transposeview ::get_scaling (SpinQuantum leftq , SpinQuantum rightq ) const
52
55
{
56
+ if (!dmrginp .spinAdapted ()) return 1.0 ;
53
57
if (conjugacy () == 'n' ) {return 1.0 ;}
54
58
55
- int lspin = leftq .get_s (), lirrep = leftq .get_symm ().getirrep ();
56
- int rspin = rightq .get_s (), rirrep = rightq .get_symm ().getirrep ();
57
- int cspin = opdata -> get_deltaQuantum ().get_s (), cirrep = opdata -> get_deltaQuantum ().get_symm ().getirrep ();
59
+ int lspin = leftq .get_s (). getirrep () , lirrep = leftq .get_symm ().getirrep ();
60
+ int rspin = rightq .get_s (). getirrep () , rirrep = rightq .get_symm ().getirrep ();
61
+ int cspin = opdata -> get_deltaQuantum ().get_s (). getirrep () , cirrep = opdata -> get_deltaQuantum ().get_symm ().getirrep ();
58
62
59
63
for (int lsz = - lspin ; lsz < lspin + 1 ; lsz += 2 )
60
64
for (int rsz = - rspin ; rsz < rspin + 1 ; rsz += 2 )
@@ -124,7 +128,7 @@ void SparseMatrix::CleanUp ()
124
128
built = false;
125
129
initialised = false;
126
130
fermion = 0 ;
127
- deltaQuantum = SpinQuantum (0 , 0 , IrrepSpace (0 ));
131
+ deltaQuantum = SpinQuantum (0 , SpinSpace ( 0 ) , IrrepSpace (0 ));
128
132
orbs .resize (0 );
129
133
allowedQuantaMatrix .ReSize (0 ,0 );
130
134
operatorMatrix .ReSize (0 ,0 );
@@ -135,6 +139,11 @@ const Transposeview Transpose(SparseMatrix& op) { return Transposeview(op); };
135
139
ostream & operator << (ostream & os , const SparseMatrix & a )
136
140
{
137
141
assert (a .initialised );
142
+ os <<"indices : " ;
143
+ for (int i = 0 ; i < a .orbs .size (); i ++ )
144
+ os <<a .orbs [i ]<<" " ;
145
+ os <<endl ;
146
+ os <<a .get_deltaQuantum ()<<endl ;
138
147
for (int i = 0 ; i < a .allowedQuantaMatrix .Nrows (); ++ i )
139
148
for (int j = 0 ; j < a .allowedQuantaMatrix .Ncols (); ++ j )
140
149
{
0 commit comments