mirror of
https://github.com/triqs/dft_tools
synced 2024-11-01 03:33:50 +01:00
Allow indices in gf_struct/operator names to be strings.
This commit is contained in:
parent
3b59d26a67
commit
9be131e8e1
@ -122,7 +122,7 @@ def get_mkind(off_diag):
|
|||||||
if off_diag:
|
if off_diag:
|
||||||
mkind = lambda sn, on: (sn, on)
|
mkind = lambda sn, on: (sn, on)
|
||||||
else:
|
else:
|
||||||
mkind = lambda sn, on: (sn+'_'+on, 0)
|
mkind = lambda sn, on: (sn+'_%s'%on, 0)
|
||||||
|
|
||||||
return mkind
|
return mkind
|
||||||
|
|
||||||
@ -131,9 +131,9 @@ def set_operator_structure(spin_names,orb_names,off_diag):
|
|||||||
gf_struct = {}
|
gf_struct = {}
|
||||||
if off_diag: # outer blocks are spin blocks
|
if off_diag: # outer blocks are spin blocks
|
||||||
for sn in spin_names:
|
for sn in spin_names:
|
||||||
gf_struct[sn] = [int(i) for i in orb_names]
|
gf_struct[sn] = [on for on in orb_names]
|
||||||
else: # outer blocks are spin-orbital blocks
|
else: # outer blocks are spin-orbital blocks
|
||||||
for sn, an in product(spin_names,orb_names):
|
for sn, on in product(spin_names,orb_names):
|
||||||
gf_struct[sn+'_'+an] = [0]
|
gf_struct[sn+'_%s'%on] = [0]
|
||||||
|
|
||||||
return gf_struct
|
return gf_struct
|
||||||
|
Loading…
Reference in New Issue
Block a user