atoms.set_calculator(calc) atoms.get_potential_energy() calc.write('Al.gpw','all') if bse: bse = BSE('Al.gpw', w=np.linspace(0,24,241), nv=[0,4], nc=[0,4], coupling=True, mode='RPA', q=np.array([0.25, 0, 0]), ecut=50., eta=0.2) bse.get_dielectric_function('Al_bse.dat') if df: # Excited state calculation q = np.array([1/4.,0.,0.]) w = np.linspace(0, 24, 241) df = DF(calc='Al.gpw', q=q, w=w, eta=0.2, ecut=50, hilbert_trans=False) df.get_EELS_spectrum(filename='Al_df.dat') df.write('Al.pckl') df.check_sum_rule()
response = calc.hamiltonian.xc.xcs['RESPONSE'] response.calculate_delta_xc() E_ks, dis = response.calculate_delta_xc_perturbation() bse = BSE(calc, w=np.linspace(0., 5., 501), q=np.array([0.0001, 0., 0.]), optical_limit=True, ecut=10, eta=0.02, nv=np.array([8,9]), nc=np.array([9,10]), eshift=dis, nbands=15, mode='BSE', vcut='2D', ) bse.get_dielectric_function('bse_cut.dat') if rank == 0 and os.path.isfile('phi_qaGp'): os.remove('phi_qaGp') d = np.loadtxt('bse_cut.dat') Nw = 88 if d[Nw,2] > d[Nw-1,2] and d[Nw,2] > d[Nw+1,2]: pass else: raise ValueError('Absorption peak not correct ! ')
atoms.set_calculator(calc) atoms.get_potential_energy() calc.write('Al.gpw','all') if bse: bse = BSE('Al.gpw', w=np.linspace(0,24,241), nv=[0,4], nc=[0,4], coupling=True, mode='RPA', q=np.array([0.25, 0, 0]), ecut=50., eta=0.2) bse.get_dielectric_function('Al_bse.dat') if df: # Excited state calculation q = np.array([1/4.,0.,0.]) w = np.linspace(0, 24, 241) df = DF(calc='Al.gpw', q=q, w=w, eta=0.2, ecut=50, hilbert_trans=False) df.get_EELS_spectrum(filename='Al_df.dat') df.write('Al.pckl') df.check_sum_rule()
ecut = 50 eshift = 0.8 eta = 0.2 df = DielectricFunction('gs_Si.gpw', ecut=ecut, frequencies=np.linspace(0., 10., 1001), nbands=8, intraband=False, hilbert=False, eta=eta, eshift=eshift, txt='rpa_Si.txt') df.get_dielectric_function(filename='eps_rpa_Si.csv') bse = BSE('gs_Si.gpw', ecut=ecut, valence_bands=range(0, 4), conduction_bands=range(4, 8), nbands=50, eshift=eshift, mode='BSE', integrate_gamma=0, txt='bse_Si.txt') bse.get_dielectric_function(filename='eps_bse_Si.csv', eta=eta, write_eig='bse_Si_eig.dat', w_w=np.linspace(0.0, 10.0, 10001))
atoms.get_potential_energy() calc.write('Si.gpw','all') # no symmetry BSE eshift = 0.8 bse = BSE('Si.gpw', w=np.linspace(0,10,201), q=np.array([0.0001, 0, 0.0]), optical_limit=True, ecut=150., nc=np.array([4,6]), nv=np.array([2,4]), eshift=eshift, nbands=8, qsymm=False) bse.get_dielectric_function('bse_nosymm.dat') if rank == 0 and os.path.isfile('phi_qaGp'): os.remove('phi_qaGp') # with symmetry BSE eshift = 0.8 bse = BSE('Si.gpw', w=np.linspace(0,10,201), q=np.array([0.0001,0,0.0]), optical_limit=True, ecut=150., nc=np.array([4,6]), nv=np.array([2,4]), eshift=eshift,
import numpy as np from gpaw.response.bse import BSE w_grid = np.linspace(0, 15, 1001) # It stores the four-points kernel used for building the two-particles # Hamiltonian in LiF_W_qGG. bse = BSE('LiF_fulldiag.gpw', w=w_grid, q=np.array([0.0001, 0., 0.]), optical_limit=True, ecut=30, nbands=60, eta=0.1, kernel_file='LiF_W_qGG', txt='LiF_BSE_out.txt') # Calculate the dielectric function calculated at the BSE level: df_BSE = bse.get_dielectric_function()
atoms.set_calculator(calc) atoms.get_potential_energy() calc.write('Si.gpw', 'all') if bse: eshift = 0.8 bse = BSE('Si.gpw', ecut=50., valence_bands=range(4), conduction_bands=range(4, 8), eshift=eshift, nbands=8, write_h=False, write_v=False) w_w, eps_w = bse.get_dielectric_function(filename=None, eta=0.2, w_w=np.linspace(0, 10, 2001)) if check: w_ = 2.552 I_ = 421.15 w, I = findpeak(w_w, eps_w.imag) equal(w, w_, 0.01) equal(I, I_, 0.1) if GS and nosym: atoms = bulk('Si', 'diamond', a=a) calc = GPAW(mode='pw', kpts={ 'size': (2, 2, 2), 'gamma': True },
atoms.get_potential_energy() calc.write('Si.gpw', 'all') # no symmetry BSE eshift = 0.8 bse = BSE('Si.gpw', w=np.linspace(0, 10, 201), q=np.array([0.0001, 0, 0.0]), optical_limit=True, ecut=150., nc=np.array([4, 6]), nv=np.array([2, 4]), eshift=eshift, nbands=8, qsymm=False) bse.get_dielectric_function('bse_nosymm.dat') if rank == 0 and os.path.isfile('phi_qaGp'): os.remove('phi_qaGp') # with symmetry BSE eshift = 0.8 bse = BSE('Si.gpw', w=np.linspace(0, 10, 201), q=np.array([0.0001, 0, 0.0]), optical_limit=True, ecut=150., nc=np.array([4, 6]), nv=np.array([2, 4]), eshift=eshift, nbands=8,