mirror of
https://github.com/triqs/dft_tools
synced 2024-12-22 04:13:47 +01:00
Add make_copies in BlockGf construction.
This commit is contained in:
parent
07397ca42e
commit
d0ea51a1f5
@ -870,8 +870,8 @@ class SumkDFT(object):
|
|||||||
# make a GfImTime from the supplied GfImFreq
|
# make a GfImTime from the supplied GfImFreq
|
||||||
if all(isinstance(g_sh._first(), GfImFreq) for g_sh in G):
|
if all(isinstance(g_sh._first(), GfImFreq) for g_sh in G):
|
||||||
gf = [BlockGf(name_block_generator = [(name, GfImTime(beta=block.mesh.beta,
|
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])
|
indices=block.indices,n_points=len(block.mesh)+1)) for name, block in g_sh],
|
||||||
for g_sh in G]
|
make_copies=False) for g_sh in G]
|
||||||
for ish in range(len(gf)):
|
for ish in range(len(gf)):
|
||||||
for name, g in gf[ish]:
|
for name, g in gf[ish]:
|
||||||
g.set_from_inverse_fourier(G[ish][name])
|
g.set_from_inverse_fourier(G[ish][name])
|
||||||
@ -892,12 +892,10 @@ class SumkDFT(object):
|
|||||||
w0 = w
|
w0 = w
|
||||||
else:
|
else:
|
||||||
return w-w0
|
return w-w0
|
||||||
gf = [BlockGf(
|
gf = [BlockGf(name_block_generator = [(name, GfReFreq(
|
||||||
name_block_generator = [(name,
|
window=(-numpy.pi*(len(block.mesh)-1) / (len(block.mesh)*get_delta_from_mesh(block.mesh)),
|
||||||
GfReFreq(
|
numpy.pi*(len(block.mesh)-1) / (len(block.mesh)*get_delta_from_mesh(block.mesh))),
|
||||||
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)
|
||||||
n_points=len(block.mesh),
|
|
||||||
indices=block.indices)) for name, block in g_sh])
|
|
||||||
for g_sh in G]
|
for g_sh in G]
|
||||||
|
|
||||||
for ish in range(len(gf)):
|
for ish in range(len(gf)):
|
||||||
|
@ -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,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
|
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
|
# 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):
|
for i in range(0,10,2):
|
||||||
G['ud'][i:i+2,i:i+2] << inverse(Omega-delta+0.02j)
|
G['ud'][i:i+2,i:i+2] << inverse(Omega-delta+0.02j)
|
||||||
G['ud'] << inverse(inverse(G['ud']) - Hloc)
|
G['ud'] << inverse(inverse(G['ud']) - Hloc)
|
||||||
@ -86,7 +86,7 @@ def get_delta_from_mesh(mesh):
|
|||||||
Gt = BlockGf(name_block_generator = [(name,
|
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))),
|
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),
|
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'])
|
Gt['ud'].set_from_inverse_fourier(G['ud'])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user