File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 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):
4646 vij = tc .backend .vmap (ij , vectorized_argnums = 0 )
4747 vvij = tc .backend .vmap (vij , vectorized_argnums = 1 )
4848 jacobian = ppsioverptheta (theta , psi0 = psi0 )
49+ # fim = tc.backend.adjoint(jacobian)@jacobian is also ok
50+ # speed comparison?
4951 jacobian = tc .backend .transpose (jacobian )
5052 fim = vvij (jacobian , jacobian )
5153 fim = tc .backend .real (fim )
@@ -62,12 +64,16 @@ def energy(theta, psi0):
6264 wl = tc .backend .reshape (wl , [1 , - 1 ])
6365 wr = tc .backend .reshape (wr , [- 1 , 1 ])
6466 e = wl @ h @ wr
67+ # use sparse matrix if required
6568 return tc .backend .real (e )[0 , 0 ]
6669
6770 eg = tc .backend .grad (energy , argnums = 0 )
6871 rhs = eg (theta , psi0 )
6972 rhs = tc .backend .imag (rhs )
7073 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>
7177
7278
7379@tc .backend .jit
You can’t perform that action at this time.
0 commit comments