mirror of
https://github.com/triqs/dft_tools
synced 2024-12-30 16:15:47 +01:00
Merge branch 'unstable'
This commit is contained in:
commit
2468331dc1
@ -16,7 +16,7 @@ project(dft_tools C CXX Fortran)
|
||||
set(BUILD_SHARED_LIBS ON)
|
||||
|
||||
# Load TRIQS and Cpp2Py
|
||||
find_package(TRIQS 1.5 EXACT REQUIRED)
|
||||
find_package(TRIQS 2.0 REQUIRED)
|
||||
find_package(Cpp2Py REQUIRED)
|
||||
|
||||
if (NOT ${TRIQS_WITH_PYTHON_SUPPORT})
|
||||
|
@ -73,12 +73,6 @@ for d in SK.deg_shells[0]:
|
||||
for i in range(len(normalized_gfs)):
|
||||
for j in range(i+1,len(normalized_gfs)):
|
||||
assert_arrays_are_close(normalized_gfs[i].data, normalized_gfs[j].data, 1.e-5)
|
||||
# the tails have to be compared using a relative error
|
||||
for o in range(normalized_gfs[i].tail.order_min,normalized_gfs[i].tail.order_max+1):
|
||||
if np.abs(normalized_gfs[i].tail[o][0,0]) < 1.e-10:
|
||||
continue
|
||||
assert np.max(np.abs((normalized_gfs[i].tail[o]-normalized_gfs[j].tail[o])/(normalized_gfs[i].tail[o][0,0]))) < 1.e-5, \
|
||||
"tails are different"
|
||||
|
||||
#######################################################################
|
||||
# Second test #
|
||||
|
@ -35,13 +35,13 @@ Hloc[8:,8:] = Hloc1
|
||||
V = get_random_hermitian(2) # the hopping elements from impurity to bath
|
||||
b1 = np.random.rand() # the bath energy of the first bath level
|
||||
b2 = np.random.rand() # the bath energy of the second bath level
|
||||
delta = GfReFreq(window=(-5,5), indices=range(2), n_points=1001)
|
||||
delta = GfReFreq(window=(-10,10), indices=range(2), n_points=1001)
|
||||
delta[0,0] << (V[0,0]*V[0,0].conjugate()*inverse(Omega-b1)+V[0,1]*V[0,1].conjugate()*inverse(Omega-b2+0.02j))/2.0
|
||||
delta[0,1] << (V[0,0]*V[1,0].conjugate()*inverse(Omega-b1)+V[0,1]*V[1,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
|
||||
# construct G
|
||||
G = BlockGf(name_block_generator=[('ud',GfReFreq(window=(-5,5), indices=range(10), n_points=1001))], make_copies=False)
|
||||
G = BlockGf(name_block_generator=[('ud',GfReFreq(window=(-10,10), 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)
|
||||
@ -88,7 +88,9 @@ Gt = BlockGf(name_block_generator = [(name,
|
||||
n_points=len(block.mesh),
|
||||
indices=block.indices)) for name, block in G], make_copies=False)
|
||||
|
||||
Gt['ud'].set_from_inverse_fourier(G['ud'])
|
||||
known_moments = np.zeros((2,10,10), dtype=np.complex)
|
||||
known_moments[1,:] = np.eye(10)
|
||||
Gt['ud'].set_from_inverse_fourier(G['ud'], known_moments)
|
||||
|
||||
G_new = SK.analyse_block_structure_from_gf([Gt])
|
||||
G_new_symm = G_new[0].copy()
|
||||
|
Loading…
Reference in New Issue
Block a user