File tree 1 file changed +6
-0
lines changed
1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,8 @@ def lhs_matrix(theta, psi0):
46
46
vij = tc .backend .vmap (ij , vectorized_argnums = 0 )
47
47
vvij = tc .backend .vmap (vij , vectorized_argnums = 1 )
48
48
jacobian = ppsioverptheta (theta , psi0 = psi0 )
49
+ # fim = tc.backend.adjoint(jacobian)@jacobian is also ok
50
+ # speed comparison?
49
51
jacobian = tc .backend .transpose (jacobian )
50
52
fim = vvij (jacobian , jacobian )
51
53
fim = tc .backend .real (fim )
@@ -62,12 +64,16 @@ def energy(theta, psi0):
62
64
wl = tc .backend .reshape (wl , [1 , - 1 ])
63
65
wr = tc .backend .reshape (wr , [- 1 , 1 ])
64
66
e = wl @ h @ wr
67
+ # use sparse matrix if required
65
68
return tc .backend .real (e )[0 , 0 ]
66
69
67
70
eg = tc .backend .grad (energy , argnums = 0 )
68
71
rhs = eg (theta , psi0 )
69
72
rhs = tc .backend .imag (rhs )
70
73
return rhs
74
+ # for ITE, imag is replace with real
75
+ # a simpler way to get rhs in ITE case is to directly evaluate
76
+ # 0.5*\nabla <H>
71
77
72
78
73
79
@tc .backend .jit
You can’t perform that action at this time.
0 commit comments