@@ -62,23 +62,25 @@ class xxz_spm(object):
62
62
"""
63
63
def __init__ (self , Jz , Jxy , dtype , device ):
64
64
s = spin_half (dtype , device )
65
+ Jxy_sign = np .sign (Jxy )
66
+ Jxy_abs = np .abs (Jxy )
65
67
Jz_sign = np .sign (Jz )
66
68
Jz_abs = np .abs (Jz )
67
69
68
70
Q = torch .zeros (2 ,2 , dtype = dtype , device = device )
69
71
L = torch .cat ((
70
- s .Sp .view (1 ,2 ,2 )* np .sqrt (Jxy / 2 ),
71
- s .Sm .view (1 ,2 ,2 )* np .sqrt (Jxy / 2 ),
72
+ s .Sp .view (1 ,2 ,2 )* np .sqrt (Jxy_abs / 2 ),
73
+ s .Sm .view (1 ,2 ,2 )* np .sqrt (Jxy_abs / 2 ),
72
74
np .sqrt (Jz_abs )* s .Z .view (1 ,2 ,2 )/ 2
73
75
), dim = 0 )
74
76
R = torch .cat ((
75
- s .Sm .view (1 ,2 ,2 )* np .sqrt (Jxy / 2 ),
76
- s .Sp .view (1 ,2 ,2 )* np .sqrt (Jxy / 2 ),
77
- - Jz_sign * np .sqrt (Jz_abs )* s .Z .view (1 ,2 ,2 )/ 2
77
+ s .Sm .view (1 ,2 ,2 )* np .sqrt (Jxy_abs / 2 )* Jxy_sign ,
78
+ s .Sp .view (1 ,2 ,2 )* np .sqrt (Jxy_abs / 2 )* Jxy_sign ,
79
+ np .sqrt (Jz_abs )* s .Z .view (1 ,2 ,2 )/ 2 * ( - Jz_sign )
78
80
), dim = 0 )
79
81
P = torch .zeros (3 ,3 ,2 ,2 , dtype = dtype , device = device )
80
82
self .T = cmpo (Q , L , R , P )
81
- self .W = torch .tensor ([[0 , 1 , 0 ], [1 , 0 , 0 ], [0 , 0 , - Jz_sign ]], dtype = dtype , device = device )
83
+ self .W = torch .tensor ([[0 , Jxy_sign , 0 ], [Jxy_sign , 0 , 0 ], [0 , 0 , - Jz_sign ]], dtype = dtype , device = device )
82
84
self .ph_leg = 2
83
85
self .d = 3
84
86
@@ -89,23 +91,25 @@ class xxz(object):
89
91
"""
90
92
def __init__ (self , Jz , Jxy , dtype , device ):
91
93
s = spin_half (dtype , device )
94
+ Jxy_sign = np .sign (Jxy )
95
+ Jxy_abs = np .abs (Jxy )
92
96
Jz_sign = np .sign (Jz )
93
97
Jz_abs = np .abs (Jz )
94
98
95
99
Q = torch .zeros (2 ,2 , dtype = dtype , device = device )
96
100
L = torch .cat ((
97
- np .sqrt (Jxy )/ 2 * s .X .view (1 ,2 ,2 ),
98
- np .sqrt (Jxy )/ 2 * s .iY .view (1 ,2 ,2 ),
101
+ np .sqrt (Jxy_abs )/ 2 * s .X .view (1 ,2 ,2 ),
102
+ np .sqrt (Jxy_abs )/ 2 * s .iY .view (1 ,2 ,2 ),
99
103
np .sqrt (Jz_abs )/ 2 * s .Z .view (1 ,2 ,2 )
100
104
), dim = 0 )
101
105
R = torch .cat ((
102
- np .sqrt (Jxy )/ 2 * s .X .view (1 ,2 ,2 ),
103
- - np .sqrt (Jxy )/ 2 * s .iY .view (1 ,2 ,2 ),
106
+ np .sqrt (Jxy_abs )/ 2 * s .X .view (1 ,2 ,2 )* Jxy_sign ,
107
+ - np .sqrt (Jxy_abs )/ 2 * s .iY .view (1 ,2 ,2 )* Jxy_sign ,
104
108
- Jz_sign * np .sqrt (Jz_abs )/ 2 * s .Z .view (1 ,2 ,2 )
105
109
), dim = 0 )
106
110
P = torch .zeros (3 ,3 ,2 ,2 , dtype = dtype , device = device )
107
111
self .T = cmpo (Q , L , R , P )
108
- self .W = torch .diag (torch .tensor ([1 , - 1 ,- Jz_sign ], dtype = dtype , device = device ))
112
+ self .W = torch .diag (torch .tensor ([Jxy_sign , - Jxy_sign ,- Jz_sign ], dtype = dtype , device = device ))
109
113
self .ph_leg = 2
110
114
self .d = 3
111
115
0 commit comments