def gutz_model_setup(u=0.0, nmesh=5000): '''Set up calculations for semi-circular DOS with two-ghost orbitals. ''' # semi-circular energy mesh sc = special.semicirular() e_list = sc.get_e_list_of_uniform_wt(nmesh=nmesh) a = tb.AtomsTB("N", [(0, 0, 0)], cell=(1, 1, 1)) a.set_orbitals_spindeg(orbitals=[("p")]) # set up hk_list hk_list = [np.array([ \ [e*1.e-0, 0, 0.j ],\ [0 , e, 0 ], \ [0 , 0, e*1.e-0]]) for e in e_list] aTB = tb.TB(a, hk_list=hk_list) # dummy k-point list kps = e_list num_k = len(kps) kps_wt = 1.0 / num_k * np.ones((num_k)) if aTB.Atoms.spindeg: kps_wt *= 2 num_e = 0.0 num_band_max = 3 # GPARAMBANDS.h5 h1e_list = [ np.zeros((num_band_max * 2, num_band_max * 2), dtype=np.complex) ] ginput.save_gparambands(kps_wt, num_e, num_band_max, \ ensemble=1, h1e_list=h1e_list) # GPARAM.h5 # self-energy structure sigma = np.zeros((6, 6), dtype=int) sigma[0::2, 0::2] = np.arange(1, 10).reshape((3, 3)) sigma[1::2, 1::2] = sigma[0::2, 0::2] # Coulomb matrix v2e = np.zeros((6, 6, 6, 6), dtype=np.complex) v2e[2, 2, 2, 2] = v2e[2, 2, 3, 3] = v2e[3, 3, 2, 2] = v2e[3, 3, 3, 3] = u vdc2_list = np.array([[0, 0, -u / 2, -u / 2, 0, 0]]) ginput.save_gparam(na2_list=[6], iembeddiag=-3, imix=0, sigma_list=[sigma], v2e_list=[v2e], nval_top_list=[6], vdc2_list=vdc2_list) # BAREHAM_0.h5 aTB.save_bareham(kps)
def gutz_model_setup(u=0.0, nmesh=5000, norb=1, tiny=0.0, mu=0): '''Set up calculations for semi-circular DOS with two-ghost orbitals. ''' # semi-circular energy mesh sc = special.semicirular() e_list = sc.get_e_list_of_uniform_wt(nmesh=nmesh) a = tb.AtomsTB("N", [(0, 0, 0)], cell=(1, 1, 1)) a.set_orbitals_spindeg(orbitals=[tuple(["s" for i in range(norb)])]) # set up hk_list hk_list = [get_hk1(e, tiny, norb) for e in e_list] aTB = tb.TB(a, hk_list=hk_list) # dummy k-point list kps = e_list num_k = len(kps) kps_wt = 1.0 / num_k * np.ones((num_k)) if aTB.Atoms.spindeg: kps_wt *= 2 num_e = 0.0 norb2 = norb * 2 # GPARAMBANDS.h5 h1e_list = [np.zeros((norb2, norb2), dtype=np.complex)] ginput.save_gparambands(kps_wt, num_e, norb, \ ensemble=1, h1e_list=h1e_list) # GPARAM.h5 # self-energy structure sigma = np.zeros((norb2, norb2), dtype=int) sigma[0::2, 0::2] = np.arange(1,norb**2+1).reshape( \ (norb,norb)) sigma[1::2, 1::2] = sigma[0::2, 0::2] # Coulomb matrix v2e = np.zeros((norb2, norb2, norb2, norb2), dtype=np.complex) v2e[0, 0, 0, 0] = v2e[0, 0, 1, 1] = v2e[1, 1, 0, 0] = v2e[1, 1, 1, 1] = u vdc2_list = np.array([np.zeros((norb2))]) vdc2_list[0, 0:2] = -u / 2 + mu ginput.save_gparam(na2_list=[norb2], iembeddiag=-3, imix=0, sigma_list=[sigma], v2e_list=[v2e], nval_top_list=[norb2], vdc2_list=vdc2_list, max_iter=5000) # BAREHAM_0.h5 aTB.save_bareham(kps)
def gutz_model_setup(u=0.0, nmesh=5000, mu=0): '''Set up Gutzwiller calculations for 1-band model with semi-circular DOS. Parameters: * u: real number Hubbard U. * nmesh: interger number number of energy mesh * mu: real number chemical potential Result: Create all the necessary input file of ``GPARAMBANDS.h5``, ``GPARAM.h5``, and ``BAREHAM_0.h5``, for *CyGutz* calculation. ''' # get semi-circular class, predifined in pyglib.model.special sc = special.semicircular() # get semi-circular energy mesh e_list = sc.get_e_list_of_uniform_wt(nmesh=nmesh) # get atomic structure with 1 atom per unit cell. a = tb.AtomsTB("N", [(0, 0, 0)], cell=(1, 1, 1)) # specify single s-orbital and orbital dimensions. a.set_orbitals_spindeg(orbitals=[('s')]) norb = 1 norb2 = norb * 2 # get a list of one-body Hamilonian for the enrgy mesh. hk_list = [np.array([[e + 0.j]]) for e in e_list] # get the tight-binding model aTB = tb.TB(a, hk_list=hk_list) # here the energy mesh is the same as k-points. kps = e_list num_k = len(kps) # set uniform k-point weight. kps_wt = 1.0 / num_k * np.ones((num_k)) # Include the spin degeneracy to k-point weight. if aTB.Atoms.spindeg: kps_wt *= 2 # We will work with grand canonical model, num_e will not be used. num_e = 0.0 # list of one-body part of the local Hamiltonians. # here the s-orbital is located at zero. h1e_list = [np.zeros((norb2, norb2), dtype=np.complex)] # generate GPARAMBANDS.h5 # ensemble is set to 1 for grand canonical system. ginput.save_gparambands(kps_wt, num_e, norb, \ ensemble=1, h1e_list=h1e_list, delta=1.e-8) # set self-energy structure sigma = np.zeros((norb2, norb2), dtype=int) sigma[0::2, 0::2] = np.arange(1,norb**2+1).reshape( \ (norb,norb)) sigma[1::2, 1::2] = sigma[0::2, 0::2] # set Coulomb matrix v2e = np.zeros((norb2, norb2, norb2, norb2), dtype=np.complex) v2e[0, 0, 0, 0] = v2e[0, 0, 1, 1] = v2e[1, 1, 0, 0] = v2e[1, 1, 1, 1] = u # set the potential shift such that the system has particle-hole # symmetry with recpect to zero. # also include chemical potential here. vdc2_list = np.array([np.zeros((norb2))]) vdc2_list[0, 0:2] = -u / 2 + mu # generate GPARAM.h5 file. ginput.save_gparam(na2_list=[norb2], iembeddiag=-1, imix=0, sigma_list=[sigma], v2e_list=[v2e], nval_top_list=[norb2], vdc2_list=vdc2_list, max_iter=500) # generate BAREHAM_0.h5 file. aTB.save_bareham(kps)
def initialize(): ''' Initialization for the Gutzwiller-Slave-Boson solver. Store all the relevant information in GPARAM.5 file. ''' log_file = open("init_ga.slog", 'w') print(" pyglib version 1.0.") print(" The executed commant line is:", file=log_file) print(" "+" ".join(sys.argv[:]), file=log_file) from pyglib.gutz.structure import get_gatoms, check_material from pyglib.gutz.gatom import h5calc_save_lrot # get the material material = get_gatoms() material.set_modify_mode() # Q & A from pyglib.gutz.usrqa import h5save_usr_qa_setup h5save_usr_qa_setup(material, log=log_file) # Setting the attributes to material material.h5set() # Set the self-energy structure material.set_SelfEnergy() # Set the Lie parameters for 3d-rotations material.set_LieParameters() # Set one-particle rotation matrix list material.set_one_particle_rotation_list() # Set Coulomb matrix list material.set_v2e_list() # Set S/L matrix vector in symmetry-adapted basis material.set_SL_vector_list() # check some info in log check_material(material, log_file) # save_gparam.h5 from pyglib.gutz.ginput import save_gparam save_gparam(iso=material.iso, ispin=material.ispin, ityp_list=material.ityp_list, imap_list=material.imap_list, na2_list=material.na2_list, imix=material.gimix, iembeddiag=material.giembeddiag, sigma_list=material.sigma_list, v2e_list=material.v2e_list, sx_list=material.sx_list, sy_list=material.sy_list, sz_list=material.sz_list, lx_list=material.lx_list, ly_list=material.ly_list, lz_list=material.lz_list, utrans_list=material.utrans_list, ldc=material.ldc, u_avg_list=material.u_avg_list, j_avg_list=material.j_avg_list, nelf_list=material.nelf_list, rotations_list=material.rotations_list, lie_odd_params_list=material.Lie_Jodd_list, lie_even_params_list=material.Lie_Jeven_list, jgenerator_list=material.jgenerator_list, sp_rotations_list=material.sp_rotations_list, nval_bot_list=material.nval_bot_list, nval_top_list=material.nval_top_list) # local rotation matrix (l) in Hilbert space. h5calc_save_lrot(material) log_file.close()
kps_wt = 1.0 / num_k * np.ones((num_k)) if aTB.Atoms.spindeg: kps_wt *= 2 num_e = 1.2 num_band_max = 2 # GPARAMBANDS.h5 h1e_list = [np.array([[0,0,0.25,0],[0,0,0,0.25],[0.25,0,0,0],[0,0.25,0,0]], \ dtype=np.complex)] ginput.save_gparambands(kps_wt, num_e, num_band_max, h1e_list=h1e_list) # GPARAM.h5 sigma = np.zeros((4, 4), dtype=np.int32) sigma[0::2, 0::2] = np.arange(1, 5).reshape((2, 2)) sigma[1::2, 1::2] = sigma[0::2, 0::2] v2e = np.zeros((4, 4, 4, 4), dtype=np.complex) v2e[0, 0, 0, 0] = v2e[0, 0, 1, 1] = v2e[1, 1, 0, 0] = v2e[1, 1, 1, 1] = 8.0 v2e[2:, 2:, 2:, 2:] = v2e[0:2, 0:2, 0:2, 0:2] ryd2ev = s_const.physical_constants['Rydberg constant times hc in eV'][0] sz = np.asarray(np.diag((1, -1, 1, -1)), dtype=np.complex) ginput.save_gparam(na2_list=[4], iembeddiag=-1, imix=-1, sigma_list=[sigma], v2e_list=[v2e], sz_list=[sz], nval_top_list=[4]) # BAREHAM_0.h5 aTB.save_bareham(kps)
((0, 0, 0), 0, 0, 0), ]) kps_size = (100, 1, 1) kps = kpoints.monkhorst_pack(kps_size) num_k = len(kps) kps_wt = 1.0 / num_k * np.ones((num_k)) if aTB.Atoms.spindeg: kps_wt *= 2 num_e = 1.0 num_band_max = 1 # GPARAMBANDS.h5 h1e_list = [np.array([[0, 0], [0, 0]], dtype=np.complex)] ginput.save_gparambands(kps_wt, num_e, num_band_max, h1e_list=h1e_list) sigma_list = [np.identity(2, dtype=np.int32)] v2e = np.zeros((2, 2, 2, 2), dtype=np.complex) v2e[0, 0, 0, 0] = v2e[0, 0, 1, 1] = v2e[1, 1, 0, 0] = v2e[1, 1, 1, 1] = 6.0 sz = np.asarray(np.diag((1, -1)), dtype=np.complex) # GPARAM.h5 ginput.save_gparam(sigma_list=sigma_list, iembeddiag=-1, v2e_list=[v2e], sz_list=[sz]) # BAREHAM_0.h5 aTB.save_bareham(kps)