Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge dev GW embedding (includes other fixes as well) #78

Merged
merged 37 commits into from
May 20, 2024
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
b2827e8
[fix] small FTPS problems and introduce a different eta for FTPS
the-hampel Jul 17, 2023
b5be67a
[feat] add direct G_iw cthyb measurement
the-hampel Jul 17, 2023
add2108
[fix] tests
the-hampel Jul 17, 2023
ce588fd
[doc] small fix in read_config documentation
the-hampel Jul 18, 2023
f814aeb
[feat] read bdft interaction from h5
the-hampel Sep 29, 2023
5ead372
[feat] add DC from bdft
the-hampel Oct 3, 2023
1062ace
[fix] remove not yet merged cthyb feature
the-hampel Oct 3, 2023
fc0ca41
add test data
the-hampel Oct 7, 2023
69c469c
add rotations of U/V and add par n_w_b_nn
the-hampel Oct 13, 2023
2d90f4f
[feat] calc Wloc from Gloc for DC pot
the-hampel Jan 17, 2024
352c121
[test] fix old tests after changes
the-hampel Jan 18, 2024
936fe8c
version in eV
the-hampel Jan 30, 2024
35db7ce
updates
the-hampel Jan 31, 2024
8b387d8
add missing test
the-hampel Jan 31, 2024
2ec53dd
[feat] new gw_flow embedding driver module
the-hampel Feb 8, 2024
88dd3da
enable hubbardi
the-hampel Feb 9, 2024
703dd21
allow qp embedding from aimbes
the-hampel Feb 9, 2024
d5efd8b
fix dim of return Sigma_ir depending on spin
the-hampel Feb 12, 2024
2d59359
fix for last commit
the-hampel Feb 12, 2024
8f7fffa
allow to specify aimbes iteration to load
the-hampel Feb 14, 2024
57b43cb
minor fixes
cnyeh Feb 14, 2024
a0765b8
[feat] use it_1e to determine iteration
the-hampel Feb 16, 2024
38616bb
small fixes to example
the-hampel Feb 28, 2024
7958652
Merge remote-tracking branch 'origin/unstable' into dev_gw_embedding
the-hampel Mar 9, 2024
e87385c
Merge remote-tracking branch 'origin/unstable' into dev_gw_embedding
the-hampel Mar 9, 2024
6a33da6
clean up imports
the-hampel Mar 10, 2024
e8a34f9
[feat] allow diagonal approximation of imp problem via enforce_off_di…
the-hampel Apr 2, 2024
add583a
Merge remote-tracking branch 'origin/unstable' into dev_gw_embedding
the-hampel Apr 5, 2024
f69632e
[feat] add triqs CRM Dyson solver for cthyb
the-hampel Apr 9, 2024
f56c189
[fix] use DLR CRM in gw embedding and use GW params for DLR -> IR
the-hampel Apr 10, 2024
2192a22
Merge remote-tracking branch 'origin/unstable' into dev_gw_embedding
the-hampel May 15, 2024
ec673e2
[feat] new ctseg solver, cRPA reader, new DC
the-hampel May 17, 2024
e8c5f7a
remove comments
the-hampel May 20, 2024
8af80d1
Merge remote-tracking branch 'origin/unstable' into dev_gw_embedding
the-hampel May 20, 2024
13fb7ea
move imports closer to gw_converter functions
the-hampel May 20, 2024
d7732fa
move imports closer to gw_converter functions
the-hampel May 20, 2024
412e80c
[feat] allow PCB to read from TRIQS TB object
the-hampel May 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
[feat] allow PCB to read from TRIQS TB object
the-hampel committed May 20, 2024
commit 412e80ca29097703866a021de1e25f5ec60b887e
38 changes: 25 additions & 13 deletions python/solid_dmft/postprocessing/plot_correlated_bands.py
Original file line number Diff line number Diff line change
@@ -668,23 +668,27 @@ def plot_kslice(fig, ax, alatt_k_w, tb_data, freq_dict, n_orb, tb_dict, tb=True,
return ax


def get_dmft_bands(n_orb, w90_path, w90_seed, mu_tb, add_spin=False, add_lambda=None, add_local=None,
def get_dmft_bands(n_orb, mu_tb, w90_path=None, w90_seed=None, TB_obj=None, add_spin=False, add_lambda=None, add_local=None,
with_sigma=None, fermi_slice=False, qp_bands=False, orbital_order_to=None,
add_mu_tb=False, band_basis=False, proj_on_orb=None, trace=True, eta=0.0,
mu_shift=0.0, proj_nuk=None, **specs):
'''
Extract tight-binding from given w90 seed_hr.dat and seed.wout files, and then extract from
Extract tight-binding from given w90 seed_hr.dat and seed.wout files or alternatively given TB_obj, and then extract from
given solid_dmft calculation the self-energy and construct the spectral function A(k,w) on
given k-path.

Parameters
----------
n_orb : int
Number of Wannier orbitals in seed_hr.dat
mu_tb : float
Chemical potential of tight-binding calculation
w90_path : string
Path to w90 files
w90_seed : string
Seed of wannier90 calculation, i.e. seed_hr.dat and seed.wout
TB_obj : TB object
Tight-binding object from TB_from_wannier90
add_spin : bool, default=False
Extend w90 Hamiltonian by spin indices
add_lambda : float, default=None
@@ -764,19 +768,27 @@ def get_dmft_bands(n_orb, w90_path, w90_seed, mu_tb, add_spin=False, add_lambda=
if isinstance(proj_nuk, np.ndarray) and not band_basis:
band_basis = True

# set up Wannier Hamiltonian
n_orb = 2 * n_orb if add_spin else n_orb
change_of_basis = change_basis(n_orb, orbital_order_to, orbital_order_w90)
H_add_loc = np.zeros((n_orb, n_orb), dtype=complex)
if not isinstance(add_local, type(None)):
assert np.shape(add_local) == (n_orb, n_orb), 'add_local must have dimension (n_orb, n_orb), but has '\
f'dimension {np.shape(add_local)}'
H_add_loc += add_local
if add_spin and add_lambda:
H_add_loc += lambda_matrix_w90_t2g(add_lambda)
if TB_obj is None:
assert w90_path is not None and w90_seed is not None, 'Please provide either a TB object or a path to the wannier90 files'
# set up Wannier Hamiltonian
n_orb = 2 * n_orb if add_spin else n_orb
change_of_basis = change_basis(n_orb, orbital_order_to, orbital_order_w90)
H_add_loc = np.zeros((n_orb, n_orb), dtype=complex)
if not isinstance(add_local, type(None)):
assert np.shape(add_local) == (n_orb, n_orb), 'add_local must have dimension (n_orb, n_orb), but has '\
f'dimension {np.shape(add_local)}'
H_add_loc += add_local
if add_spin and add_lambda:
H_add_loc += lambda_matrix_w90_t2g(add_lambda)

tb = TB_from_wannier90(path=w90_path, seed=w90_seed, extend_to_spin=add_spin, add_local=H_add_loc)
else:
assert not add_spin, 'add_spin is only valid when reading from wannier90 files'
change_of_basis = change_basis(n_orb, orbital_order_to, orbital_order_w90)
tb = TB_obj

eta = eta * 1j

tb = TB_from_wannier90(path=w90_path, seed=w90_seed, extend_to_spin=add_spin, add_local=H_add_loc)
# print local H(R)
h_of_r = np.einsum('ij, jk -> ik', np.linalg.inv(change_of_basis), np.einsum('ij, jk -> ik', tb.hoppings[(0, 0, 0)], change_of_basis))
if n_orb <= 12:
14 changes: 13 additions & 1 deletion test/python/test_plot_correlated_bands.py
Original file line number Diff line number Diff line change
@@ -121,7 +121,7 @@ def test_get_kslice_nokz(self):
assert np.allclose(tb_data['e_mat'], emat_ref)
assert np.allclose(alatt_k_w, Akw_ref)

def test_get_dmft_bands_reg_mesh(self):
def test_get_dmft_bands_reg_mesh_read_TB_obj(self):
tb_bands = {'kmesh': 'regular', 'n_k': 7}

tb_data, alatt_k_w, freq_dict = pcb.get_dmft_bands(with_sigma='calc', add_mu_tb=True,
@@ -135,5 +135,17 @@ def test_get_dmft_bands_reg_mesh(self):
assert np.allclose(tb_data['e_mat'], emat_ref)
assert np.allclose(alatt_k_w, Akw_ref)

# read now from TB_obj
w90_dict = {'TB_obj': tb_data['tb'], 'mu_tb': 12.3958, 'n_orb': 3,
'orbital_order_w90': ['dxz', 'dyz', 'dxy']}

tb_data_obj, alatt_k_w_obj, freq_dict_obj = pcb.get_dmft_bands(with_sigma='calc', add_mu_tb=True,
orbital_order_to=self.orbital_order_to,
**w90_dict, **tb_bands, **self.sigma_dict)

assert np.allclose(tb_data_obj['e_mat'], emat_ref)
assert np.allclose(alatt_k_w_obj, Akw_ref)


if __name__ == '__main__':
unittest.main()