Skip to content

Commit

Permalink
entanglement entropy added to ES and tested
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandreday committed Sep 17, 2017
1 parent c7723bf commit d22aa9c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions SA_v2/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ def run_ES(parameters, model:MODEL, utils):

n_step = parameters['n_step']
n_protocol = 2**n_step
exact_data = np.zeros((n_protocol,2), dtype=np.float64) # 15 digits precision
exact_data = np.zeros((n_protocol,3), dtype=np.float64) # 15 digits precision

b2_array = lambda n10 : np.array(list(np.binary_repr(n10, width=n_step)), dtype=np.int)
st=time.time()
Expand All @@ -581,7 +581,7 @@ def run_ES(parameters, model:MODEL, utils):
model.compute_fidelity(psi_evolve=psi)
model.compute_Sent(psi_evolve=psi)
model.compute_energy(psi_evolve=psi)
print("Est. run time : \t %.3f s"%(0.5*n_protocol*(time.time()-st)))
print("Est. run time : \t %.3f s"%(0.5* n_protocol*(time.time()-st)))
# ---> Starting real calculation <---

st=time.time()
Expand All @@ -593,6 +593,8 @@ def run_ES(parameters, model:MODEL, utils):
outfile = utils.make_file_name(parameters, root=parameters['root'])
with open(outfile,'wb') as f:
pickle.dump(exact_data, f, protocol=4)

print("Saved results in %s"%outfile)
print("Total run time : \t %.3f s"%(time.time()-st))
print("\n Thank you and goodbye !")
f.close()
Expand Down
6 changes: 3 additions & 3 deletions SA_v2/para.dat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
task SD
L 2
task ES
L 8
J 1.0
hz 1.0
hx_i -2.
Expand All @@ -8,7 +8,7 @@ hx_max 4.
hx_min -4.
dh 8.
dt -1
n_step 100
n_step 12
n_sample 50
n_quench 1000
T 2.0
Expand Down

0 comments on commit d22aa9c

Please sign in to comment.