3
0
mirror of https://github.com/triqs/dft_tools synced 2024-06-29 08:24:54 +02:00

block_structure: effective_transformation_solver

This commit is contained in:
Gernot J. Kraberger 2018-09-07 15:31:41 +02:00 committed by Hermann Schnait
parent bc78560ee1
commit e9bfb3ed2c
2 changed files with 48 additions and 0 deletions

View File

@ -251,6 +251,28 @@ class BlockStructure(object):
trans[icrsh][block][iorb, :] = 0.0
return trans
@property
def effective_transformation_solver(self):
eff_trans_sumk = self.effective_transformation_sumk
ets = []
for ish in range(len(self.gf_struct_solver)):
icrsh = self.inequiv_to_corr[ish]
ets.append(dict())
for block in self.gf_struct_solver[ish]:
block_sumk = self.solver_to_sumk_block[ish][block]
T = eff_trans_sumk[icrsh][block_sumk]
ets[ish][block] = np.zeros((len(self.gf_struct_solver[ish][block]),
len(T)),
dtype=T.dtype)
for i in self.gf_struct_solver[ish][block]:
i_sumk = self.solver_to_sumk[ish][block, i]
assert i_sumk[0] == block_sumk,\
"Wrong block in solver_to_sumk"
i_sumk = i_sumk[1]
ets[ish][block][i, :] = T[i_sumk, :]
return ets
@classmethod
def full_structure(cls,gf_struct,corr_to_inequiv):

View File

@ -22,6 +22,14 @@ cmp(original_bs.effective_transformation_sumk,
'up': np.array([[1., 0., 0.],
[0., 1., 0.],
[0., 0., 1.]])}])
cmp(original_bs.effective_transformation_solver,
[{'up_0': np.array([[1., 0., 0.],
[0., 1., 0.]]),
'up_1': np.array([[0., 0., 1.]]),
'down_1': np.array([[0., 0., 1.]]),
'down_0': np.array([[1., 0., 0.],
[0., 1., 0.]])}])
# check pick_gf_struct_solver
pick1 = original_bs.copy()
@ -34,6 +42,10 @@ cmp(pick1.effective_transformation_sumk,
'up': np.array([[0., 0., 0.],
[0., 1., 0.],
[0., 0., 1.]])}])
cmp(pick1.effective_transformation_solver,
[{'up_0': np.array([[0., 1., 0.]]),
'up_1': np.array([[0., 0., 1.]]),
'down_1': np.array([[0., 0., 1.]])}])
# check loading a block_structure from file
SK.block_structure = SK.load(['block_structure'], 'mod')[0]
@ -56,6 +68,10 @@ cmp(pick1.effective_transformation_sumk,
'up': np.array([[0., 0., 0.],
[0., 1., 0.],
[0., 0., 1.]])}])
cmp(pick1.effective_transformation_solver,
[{'up_0': np.array([[0., 1., 0.]]),
'up_1': np.array([[0., 0., 1.]]),
'down_1': np.array([[0., 0., 1.]])}])
# check pick_gf_struct_sumk
pick2 = original_bs.copy()
@ -68,6 +84,11 @@ cmp(pick2.effective_transformation_sumk,
'up': np.array([[0., 0., 0.],
[0., 1., 0.],
[0., 0., 1.]])}])
cmp(pick2.effective_transformation_solver,
[{'up_0': np.array([[0., 1., 0.]]),
'up_1': np.array([[0., 0., 1.]]),
'down_0': np.array([[1., 0., 0.],
[0., 1., 0.]])}])
pick3 = pick2.copy()
pick3.transformation = [np.reshape(range(9), (3, 3))]
@ -78,6 +99,11 @@ cmp(pick3.effective_transformation_sumk,
'up': np.array([[0, 0, 0],
[3, 4, 5],
[6, 7, 8]])}])
cmp(pick3.effective_transformation_solver,
[{'up_0': np.array([[3, 4, 5]]),
'up_1': np.array([[6, 7, 8]]),
'down_0': np.array([[0, 1, 2],
[3, 4, 5]])}])
# check map_gf_struct_solver
mapping = [{('down_0', 0): ('down', 0),