Skip to content
Snippets Groups Projects
Commit ec885649 authored by Philipp Rüssmann's avatar Philipp Rüssmann
Browse files

Fix BdG tests

parent 4a790dda
No related branches found
No related tags found
No related merge requests found
......@@ -22,14 +22,14 @@ class Test_BdG():
"""
path0 = 'test_run26_hybrid_4_1/eh_symm/'
print('t^ee(E+i0+) = -t^hh(E+i0+) ?')
print('Check if t^ee(E+i0+) == -t^hh(E+i0+) :')
tmat = load(path0+'tmat_atom_001_energ_001.npy')
check_ehsymm(tmat)
print('Gref')
gref = load(path0+'ginp.npy')[:,:,-1]
print('\n Check Gref:')
gref = load(path0+'ginp_energ_001.npy')[:,:,-1]
check_ehsymm(gref)
print('G')
gmat = load(path0+'gmat.npy')
print('\n Check Gmat:')
gmat = load(path0+'gmat_001_energ_001.npy')
check_ehsymm(gmat)
def test_27_BdG1_eh_sym_and_gap(self):
......@@ -55,12 +55,11 @@ class Test_BdG():
#pcolormesh(k, e, dqh, shading='nearest')
#colorbar()
#title('BdG=0, hh')
dm = (dqe-dqh[::-1]).max()
ds = (dqe-dqh[::-1]).std()
print('ehsymm', dm, ds)
assert dm<0.0002
assert ds<1e-5
d = abs(dqe-dqh[::-1])
dm = d.max()
print('ehsymm', dm, dm/dqe[d==dm])
assert dm/dqe[d==dm] < 2e-4
gz = (dqe[1]).max()/(dqe[0]).max()
print('gapzero', gz)
assert gz<0.012
......@@ -125,5 +124,5 @@ def check_BdG1_block_charges(testpath, eps=10**-14):
def check_ehsymm(m):
d = sum(abs(m[:16,:16]+conjugate(m[16:32,16:32])))
print('absdiff, reldiff=', d, d/sum(abs(m[:16,:16])))
print('absdiff, reldiff=', d, d/sum(abs(m[:16,:16])), '(threshold=1e-13)')
assert d<10**-13
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment