示例#1
0
    def __init__(self,
                 Nsites,
                 Nele,
                 Nfrag,
                 impindx,
                 h_site,
                 V_site,
                 hamtype=0,
                 mubool=True,
                 nproc=1,
                 periodic=False,
                 Maxitr=100,
                 tol=1e-12):

        #Nsites  - total number of sites (or basis functions) in total system
        #Nele    - total number of electrons
        #Nfrag   - total number of fragments for DMET calculation
        #impindx - a list of numpy arrays containing the impurity indices for each fragment
        #h_site  - 1 e- hamiltonian in site-basis for total system
        #V_site  - 2 e- hamiltonian in site-basis for total system
        #hamtype - integer defining if using a special Hamiltonian like Hubbard or Anderson Impurity
        #mubool  - boolean switching between using a global chemical potential to optimize DMET # of electrons or not
        #nproc   - number of processors for calculation - careful, there is no check that this matches the pbs script
        #periodic - boolean which states whether system is periodic or not and thus only need to solve for one impurity as they're all the same
        #Maxitr  - max number of DMET iterations
        #tol     - tolerance for difference in 1RDM during DMET cycle

        print()
        print('********************************************')
        print('     INITIALIZING STATIC DMET CALCULATION       ')
        print('********************************************')
        print()

        self.mubool = mubool
        self.Maxitr = Maxitr
        self.tol = tol
        self.nproc = nproc

        #Check for input errors
        self.check_for_error(Nsites, Nele, Nfrag, impindx, h_site, V_site,
                             hamtype, periodic)

        #Begin by calculating initial mean-field Hamiltonian
        print('Calculating initial mean-field 1RDM for total system')
        if (hamtype == 0):
            mf1RDM = hf.rhf_calc_hubbard(
                Nele, h_site)  #PING need to change this to general HF call
        elif (hamtype == 1):
            mf1RDM = hf.rhf_calc_hubbard(Nele, h_site)

        #utils.printarray(mf1RDM)#msh

        #Initialize the total system including the mf 1RDM and fragment information
        print('Initialize fragment information')
        self.tot_system = system_mod.system(Nsites, Nele, Nfrag, impindx,
                                            h_site, V_site, hamtype, mf1RDM,
                                            periodic)
示例#2
0
NL     = 4
NR     = 3
Nsites = NL+NR+1
Nele   = Nsites

t  = 0.4
Vg = 0.0

tleads  = 1.0
Full    = False

delt   = 0.001
Nstep  = 5000
Nprint = 1

#Initital Static Calculation
U     = 0.0
Vbias = 0.0
h_site, V_site = make_hams.make_ham_single_imp_anderson_realspace( NL, NR, Vg, U, t, Vbias, tleads, Full  )

mf1RDM = hartreefock.rhf_calc_hubbard( Nele, h_site )

#Dynamics Calculation
U     = 0.0
Vbias = -0.001
h_site, V_site = make_hams.make_ham_single_imp_anderson_realspace( NL, NR, Vg, U, t, Vbias, tleads, Full  )

tdhf = tdhf.tdhf( Nsites, Nele, h_site, mf1RDM, delt, Nstep, Nprint )
tdhf.kernel()