diff --git a/test/python/analyse_block_structure_from_gf2.py b/test/python/analyse_block_structure_from_gf2.py index 25806815..c0faeb06 100644 --- a/test/python/analyse_block_structure_from_gf2.py +++ b/test/python/analyse_block_structure_from_gf2.py @@ -54,11 +54,11 @@ def get_random_transformation(dim): assert_block_gfs_are_close(G_new[0], G_new_symm) -assert SK.gf_struct_sumk == [[('ud', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])], [('ud', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])]],\ +assert SK.gf_struct_sumk == [[('ud', 10)], [('ud', 10)]],\ "wrong gf_struct_sumk" for i in range(5): assert 'ud_{}'.format(i) in SK.gf_struct_solver[0], "missing block" - assert SK.gf_struct_solver[0]['ud_{}'.format(i)] == list(range(2)), "wrong block size" + assert SK.gf_struct_solver[0]['ud_{}'.format(i)] == 2, "wrong block size" for i in range(10): assert SK.sumk_to_solver[0]['ud',i] == ('ud_{}'.format(i//2), i%2), "wrong mapping" @@ -98,11 +98,11 @@ def get_delta_from_mesh(mesh): SK.symm_deg_gf(G_new_symm, 0) assert_block_gfs_are_close(G_new[0], G_new_symm) -assert SK.gf_struct_sumk == [[('ud', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])], [('ud', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])]],\ +assert SK.gf_struct_sumk == [[('ud', 10)], [('ud', 10)]],\ "wrong gf_struct_sumk" for i in range(5): assert 'ud_{}'.format(i) in SK.gf_struct_solver[0], "missing block" - assert SK.gf_struct_solver[0]['ud_{}'.format(i)] == list(range(2)), "wrong block size" + assert SK.gf_struct_solver[0]['ud_{}'.format(i)] == 2, "wrong block size" for i in range(10): assert SK.sumk_to_solver[0]['ud',i] == ('ud_{}'.format(i//2), i%2), "wrong mapping" diff --git a/test/python/basis_transformation.py b/test/python/basis_transformation.py index 6905cdf5..a180b999 100644 --- a/test/python/basis_transformation.py +++ b/test/python/basis_transformation.py @@ -1,3 +1,4 @@ +from tkinter import W from triqs.utility.comparison_tests import * from triqs_dft_tools.sumk_dft import * import numpy as np @@ -92,7 +93,7 @@ def call_diagonalize(SK): H3 = BS.convert_operator(h_int_slater(spin_names=['up','down'], orb_names=[0,1,2], U_matrix=U3x3, off_diag=True)) for op in H3: for c_op in op[0]: - assert(BS.gf_struct_solver_dict[0][c_op[1][0]][c_op[1][1]] is not None) # This crashes with a key error if the operator structure is not the solver structure + assert(BS.solver_to_sumk[0][(c_op[1][0], c_op[1][1])] is not None) # This crashes with a key error if the operator structure is not the solver structure U_trafod = transform_U_matrix(U3x3, BS.transformation[0]['up'].conjugate()) # The notorious .conjugate() H4 = h_int_slater(spin_names=['up','down'], orb_names=range(3), U_matrix=U_trafod, map_operator_structure=BS.sumk_to_solver[0]) diff --git a/test/python/blockstructure.py b/test/python/blockstructure.py index ed34bfe3..d902f757 100644 --- a/test/python/blockstructure.py +++ b/test/python/blockstructure.py @@ -174,11 +174,9 @@ def cmp(a, b, precision=1.e-15): # check full_structure full = BlockStructure.full_structure( - [{'up_0': [0, 1], 'up_1': [0], 'down_1': [0], 'down_0': [0, 1]}], None) + [{'up_0': 2, 'up_1': 1, 'down_1': 1, 'down_0': 2}], None) -print(original_bs.gf_struct_sumk[0]) -print(gf_struct_flatten(original_bs.gf_struct_sumk[0])) -G_sumk = BlockGf(mesh=G1.mesh, gf_struct=gf_struct_flatten(original_bs.gf_struct_sumk[0])) +G_sumk = BlockGf(mesh=G1.mesh, gf_struct=original_bs.gf_struct_sumk[0]) for i in range(3): G_sumk['up'][i, i] << SemiCircular(1 if i < 2 else 2) G_sumk['down'][i, i] << SemiCircular(4 if i < 2 else 3) @@ -204,13 +202,13 @@ def cmp(a, b, precision=1.e-15): assert_block_gfs_are_close(G1, G_bT) assert original_bs.gf_struct_sumk_list ==\ - [[('up', [0, 1, 2]), ('down', [0, 1, 2])]] + [[('up', 3), ('down', 3)]] assert original_bs.gf_struct_solver_dict ==\ - [{'up_0': [0, 1], 'up_1': [0], 'down_1': [0], 'down_0': [0, 1]}] + [{'up_0': 2, 'up_1': 1, 'down_1': 1, 'down_0': 2}] assert original_bs.gf_struct_sumk_dict ==\ - [{'down': [0, 1, 2], 'up': [0, 1, 2]}] + [{'down': 3, 'up': 3}] assert original_bs.gf_struct_solver_list ==\ - [[('down_0', [0, 1]), ('down_1', [0]), ('up_0', [0, 1]), ('up_1', [0])]] + [[('down_0', 2), ('down_1', 1), ('up_0', 2), ('up_1', 1)]] # check __eq__ assert full == full, 'equality not correct (equal structures not equal)'