Skip to content

Commit

Permalink
[bench] measure_g2 hubbard_atom_2bath update scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoStrand committed Sep 26, 2023
1 parent 9f76965 commit f4fe85f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
5 changes: 5 additions & 0 deletions benchmark/measure_g2/hubbard_atom_2bath/calc_cthyb.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from triqs.operators import *
from h5 import HDFArchive
from triqs_cthyb import Solver
import triqs_cthyb.version

# ----------------------------------------------------------------------
if __name__ == '__main__':
Expand Down Expand Up @@ -128,6 +129,10 @@ def __init__(self):

d.perturbation_order = solv.perturbation_order
d.perturbation_order_total = solv.perturbation_order_total

d.version = triqs_cthyb.version.version
d.triqs_hash = triqs_cthyb.version.triqs_hash
d.triqs_cthyb_hash = triqs_cthyb.version.triqs_cthyb_hash

# ------------------------------------------------------------------
# -- Store results
Expand Down
13 changes: 8 additions & 5 deletions benchmark/measure_g2/hubbard_atom_2bath/calc_ed.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,21 +97,24 @@ def __init__(self):

imtime = MeshImTime(beta, 'Fermion', ntau)
prodmesh = MeshProduct(imtime, imtime, imtime)

G2opt = dict(mesh=prodmesh, target_shape=[])
G2opt_1111 = dict(mesh=prodmesh, target_shape=[1, 1, 1, 1])

G02_tau = Gf(name='$G^{(2)}_0(\tau_1, \tau_2, \tau_3)$', **G2opt)
G02_tau = Gf(name='$G^{(2)}_0(\tau_1, \tau_2, \tau_3)$', **G2opt_1111)
ed.set_g40_tau(G02_tau, d.G_tau)

G2_tau = Gf(name='$G^{(2)}(\tau_1, \tau_2, \tau_3)$', **G2opt)
ed.set_g4_tau(G2_tau, c_dag(up,0), c(up,0), c_dag(do,0), c(do,0))

G2opt_1111 = dict(mesh=prodmesh, target_shape=[1, 1, 1, 1])

d.G02_tau = Gf(**G2opt_1111)
#d.G02_tau = Gf(**G2opt_1111)
d.G2_tau = Gf(**G2opt_1111)

d.G02_tau.data[:, :, :, 0, 0, 0, 0] = G02_tau.data
#d.G02_tau.data[:, :, :, 0, 0, 0, 0] = G02_tau.data
d.G2_tau.data[:, :, :, 0, 0, 0, 0] = G2_tau.data

d.G02_tau = G02_tau
#d.G2_tau = G2_tau

# ------------------------------------------------------------------
# -- Store to hdf5
Expand Down
17 changes: 9 additions & 8 deletions benchmark/measure_g2/hubbard_atom_2bath/calc_pomerol.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ def __init__(self):
d = Dummy() # storage space
d.params = params

print('--> Solving SIAM with parameters')
if mpi.is_master_node(): print('--> Solving SIAM with parameters')
for key, value in list(params.items()):
print('%10s = %-10s' % (key, str(value)))
if mpi.is_master_node(): print('%10s = %-10s' % (key, str(value)))
globals()[key] = value # populate global namespace

# ------------------------------------------------------------------
Expand Down Expand Up @@ -82,7 +82,7 @@ def __init__(self):
ed = PomerolED(index_converter, verbose=True)
ed.diagonalize(d.H) # -- Diagonalize H

gf_struct = [[up, [0]], [do, [0]]]
gf_struct = [[up, 1], [do, 1]]

# -- Single-particle Green's functions
G_iw = ed.G_iw(gf_struct, beta, n_iw=niw)
Expand Down Expand Up @@ -111,11 +111,12 @@ def __init__(self):

# ------------------------------------------------------------------
# -- Store to hdf5

filename = 'data_pomerol.h5'
with HDFArchive(filename,'w') as res:
for key, value in list(d.__dict__.items()):
res[key] = value

if mpi.is_master_node():
filename = 'data_pomerol.h5'
with HDFArchive(filename,'w') as res:
for key, value in list(d.__dict__.items()):
res[key] = value

# ----------------------------------------------------------------------
if __name__ == '__main__':
Expand Down

0 comments on commit f4fe85f

Please sign in to comment.