Commit 5f5a4f2f authored by Jacob Davison's avatar Jacob Davison
Browse files

testing

parent a7fe7a02
......@@ -910,34 +910,34 @@ def main(n_holes):
print(dE)
# integrate flow equations
# solver = ode(derivative_wrapper,jac=None)
# solver.set_integrator('vode', method='bdf', order=5, nsteps=1000)
# solver.set_f_params(user_data)
# solver.set_initial_value(y0, 0.)
# sfinal = 50
# ds = 0.1
# print("%-8s %-14s %-14s %-14s %-14s %-14s %-14s %-14s %-14s"%(
# "s", "E" , "DE(2)", "DE(3)", "E+DE", "dE/ds",
# "||eta||", "||fod||", "||Gammaod||"))
# # print "-----------------------------------------------------------------------------------------------------------------"
# print("-" * 148)
# while solver.successful() and solver.t < sfinal:
# ys = solver.integrate(sfinal, step=True)
solver = ode(derivative_wrapper,jac=None)
solver.set_integrator('vode', method='bdf', order=5, nsteps=1000)
solver.set_f_params(user_data)
solver.set_initial_value(y0, 0.)
sfinal = 50
ds = 0.1
print("%-8s %-14s %-14s %-14s %-14s %-14s %-14s %-14s %-14s"%(
"s", "E" , "DE(2)", "DE(3)", "E+DE", "dE/ds",
"||eta||", "||fod||", "||Gammaod||"))
# print "-----------------------------------------------------------------------------------------------------------------"
print("-" * 148)
while solver.successful() and solver.t < sfinal:
ys = solver.integrate(sfinal, step=True)
# dim2B = dim1B*dim1B
# E, f, Gamma = get_operator_from_y(ys, dim1B, dim2B)
dim2B = dim1B*dim1B
E, f, Gamma = get_operator_from_y(ys, dim1B, dim2B)
# DE2 = calc_mbpt2(f, Gamma, user_data)
# DE3 = calc_mbpt3(f, Gamma, user_data)
DE2 = calc_mbpt2(f, Gamma, user_data)
DE3 = calc_mbpt3(f, Gamma, user_data)
# norm_fod = calc_fod_norm(f, user_data)
# norm_Gammaod = calc_Gammaod_norm(Gamma, user_data)
norm_fod = calc_fod_norm(f, user_data)
norm_Gammaod = calc_Gammaod_norm(Gamma, user_data)
# print("%8.5f %14.8f %14.8f %14.8f %14.8f %14.8f %14.8f %14.8f %14.8f"%(
# solver.t, E , DE2, DE3, E+DE2+DE3, user_data["dE"], user_data["eta_norm"], norm_fod, norm_Gammaod))
# if abs(DE2/E) < 10e-8: break
print("%8.5f %14.8f %14.8f %14.8f %14.8f %14.8f %14.8f %14.8f %14.8f"%(
solver.t, E , DE2, DE3, E+DE2+DE3, user_data["dE"], user_data["eta_norm"], norm_fod, norm_Gammaod))
if abs(DE2/E) < 10e-8: break
# solver.integrate(solver.t + ds)
......
......@@ -435,23 +435,28 @@ def test_refs(plots_dir):
# print('{:2.4f} | {d}'.format(E_conv[i], d=refs_conv[i]))
if __name__ == '__main__':
#<<<<<<< Updated upstream
# test_refs('logs_refs\\')
# test_exact('plots_exact\\')
# print(ci_matrix.exact_diagonalization(1.0, 0.5,0.0))
#=======
#test_refs('logs_refs\\')
test = main(4,4)
# >>>>>>> Stashed changes
# # test_exact('plots_exact\\')
# # print(ci_matrix.exact_diagonalization(1.0, 0.5,0.0))
tracemalloc.start()
# tracemalloc.start()
for i in range(5):
test = main(4,4)
print(test[-1])
snapshot = tracemalloc.take_snapshot()
top_stats = snapshot.statistics('lineno')
total = sum(stat.size for stat in top_stats)
print("Total allocated size: %.1f KiB" % (total / 1024))
# for i in range(5):
# test = main(4,4)
# print(test[-1])
# snapshot = tracemalloc.take_snapshot()
# top_stats = snapshot.statistics('lineno')
# total = sum(stat.size for stat in top_stats)
# print("Total allocated size: %.1f KiB" % (total / 1024))
snapshot = tracemalloc.take_snapshot()
top_stats = snapshot.statistics('lineno')
total = sum(stat.size for stat in top_stats)
print("Final allocated size: %.1f KiB" % (total / 1024))
# snapshot = tracemalloc.take_snapshot()
# top_stats = snapshot.statistics('lineno')
# total = sum(stat.size for stat in top_stats)
# print("Final allocated size: %.1f KiB" % (total / 1024))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment