From d0ea51a1f532c040a0879cb9e59676fef582baa1 Mon Sep 17 00:00:00 2001 From: Manuel Date: Wed, 2 May 2018 16:07:51 -0400 Subject: [PATCH] Add make_copies in BlockGf construction. --- python/sumk_dft.py | 14 ++++++-------- test/analyze_block_structure_from_gf2.py | 4 ++-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/python/sumk_dft.py b/python/sumk_dft.py index 8f56f544..1c5c1f99 100644 --- a/python/sumk_dft.py +++ b/python/sumk_dft.py @@ -870,8 +870,8 @@ class SumkDFT(object): # make a GfImTime from the supplied GfImFreq if all(isinstance(g_sh._first(), GfImFreq) for g_sh in G): gf = [BlockGf(name_block_generator = [(name, GfImTime(beta=block.mesh.beta, - indices=block.indices,n_points=len(block.mesh)+1)) for name, block in g_sh]) - for g_sh in G] + indices=block.indices,n_points=len(block.mesh)+1)) for name, block in g_sh], + make_copies=False) for g_sh in G] for ish in range(len(gf)): for name, g in gf[ish]: g.set_from_inverse_fourier(G[ish][name]) @@ -892,12 +892,10 @@ class SumkDFT(object): w0 = w else: return w-w0 - gf = [BlockGf( - name_block_generator = [(name, - GfReFreq( - window=(-numpy.pi*(len(block.mesh)-1) / (len(block.mesh)*get_delta_from_mesh(block.mesh)), numpy.pi*(len(block.mesh)-1) / (len(block.mesh)*get_delta_from_mesh(block.mesh))), - n_points=len(block.mesh), - indices=block.indices)) for name, block in g_sh]) + gf = [BlockGf(name_block_generator = [(name, GfReFreq( + window=(-numpy.pi*(len(block.mesh)-1) / (len(block.mesh)*get_delta_from_mesh(block.mesh)), + numpy.pi*(len(block.mesh)-1) / (len(block.mesh)*get_delta_from_mesh(block.mesh))), + n_points=len(block.mesh), indices=block.indices)) for name, block in g_sh], make_copies=False) for g_sh in G] for ish in range(len(gf)): diff --git a/test/analyze_block_structure_from_gf2.py b/test/analyze_block_structure_from_gf2.py index d371a9c5..c3cf73e3 100644 --- a/test/analyze_block_structure_from_gf2.py +++ b/test/analyze_block_structure_from_gf2.py @@ -41,7 +41,7 @@ delta[0,1] << (V[0,0]*V[1,0].conjugate()*inverse(Omega-b1)+V[0,1]*V[1,1].conjuga delta[1,0] << (V[1,0]*V[0,0].conjugate()*inverse(Omega-b1)+V[1,1]*V[0,1].conjugate()*inverse(Omega-b2+0.02j))/2.0 delta[1,1] << (V[1,0]*V[1,0].conjugate()*inverse(Omega-b1)+V[1,1]*V[1,1].conjugate()*inverse(Omega-b2+0.02j))/2.0 # construct G -G = BlockGf(name_block_generator=(('ud',GfReFreq(window=(-5,5), indices=range(10), n_points=1001)),)) +G = BlockGf(name_block_generator=[('ud',GfReFreq(window=(-5,5), indices=range(10), n_points=1001))], make_copies=False) for i in range(0,10,2): G['ud'][i:i+2,i:i+2] << inverse(Omega-delta+0.02j) G['ud'] << inverse(inverse(G['ud']) - Hloc) @@ -86,7 +86,7 @@ def get_delta_from_mesh(mesh): Gt = BlockGf(name_block_generator = [(name, GfReTime(window=(-np.pi*(len(block.mesh)-1) / (len(block.mesh)*get_delta_from_mesh(block.mesh)), np.pi*(len(block.mesh)-1) / (len(block.mesh)*get_delta_from_mesh(block.mesh))), n_points=len(block.mesh), - indices=block.indices)) for name, block in G]) + indices=block.indices)) for name, block in G], make_copies=False) Gt['ud'].set_from_inverse_fourier(G['ud'])