Exemple #1
0
sval = 0.0
sz = 0.0

################################
# 0. Initialize an MPS(N,Sz)
################################
dmrg = mpo_dmrg_class.mpo_dmrg()
dmrg.occun = mol.orboccun
dmrg.path = mol.path
dmrg.nsite = mol.sbas / 2
dmrg.sbas = mol.sbas
dmrg.isym = 2
dmrg.build()
dmrg.comm = mol.comm
dmrg.qsectors = {str([mol.nelec, sz]): 1}
sc = mpo_dmrg_schedule.schedule()
sc.fixed(maxM=10, maxiter=1)
sc.prt()
dmrg.partition()
dmrg.loadInts(mol)
dmrg.dumpMPO()
dmrg.default(sc)
dmrg.checkMPS()

#-------------------------------------------------------
flmps = dmrg.flmps  #h5py.File(dmrg.path+'/lmps','r')
dmrg.checkMPS(flmps, status='L')

if sc.maxiter != 0:
    frmps = dmrg.frmps  #h5py.File(dmrg.path+'/rmps','r')
    dmrg.checkMPS(frmps, status='R')
Exemple #2
0
sz = 0.0

################################
# 0. Initialize an MPS(N,Sz)
################################
dmrg = mpo_dmrg_class.mpo_dmrg()
dmrg.occun = mol.orboccun
dmrg.path = mol.path
dmrg.nsite = mol.sbas / 2
dmrg.sbas = mol.sbas
dmrg.isym = 2
dmrg.initNsweep = 2
dmrg.build()
dmrg.comm = mol.comm
dmrg.qsectors = {str([mol.nelec, sz]): 1}
sc = mpo_dmrg_schedule.schedule()
sc.fixed(maxM=30, maxiter=0)
sc.prt()
dmrg.ifIO = True
dmrg.partition()
dmrg.loadInts(mol)
dmrg.dumpMPO()
dmrg.default(sc)
dmrg.checkMPS()

#-------------------------------------------------------
flmps = dmrg.flmps  #h5py.File(dmrg.path+'/lmps','r')
dmrg.checkMPS(flmps, status='L')

if sc.maxiter != 0:
    frmps = dmrg.frmps  #h5py.File(dmrg.path+'/rmps','r')
# One site algorithm
sval = 0.0
sz = 0.0
Dmax = max(bdim)

dmrg = mpo_dmrg_class.mpo_dmrg()
dmrg.nsite = mol.sbas / 2
dmrg.nhops = mol.sbas
dmrg.isym = 2
dmrg.build()
dmrg.comm = mol.comm
dmrg.qsectors = {str([mol.nelec, sz]): 1}
dmrg.Dmax = Dmax
dmrg.enuc = mol.enuc

sc = mpo_dmrg_schedule.schedule(maxM=Dmax, tol=1.e-7)
sc.single(noise=0.0, tol=1.e-2)
#sc.mixed(noise=0.0,tol=1.e-2)
sc.maxiter = 10
sc.prt()

dmrg.ifs2proj = True
dmrg.npts = 5
dmrg.s2quad(sval, sz=sz)

dmrg.comm.Barrier()
dmrg.partition()
dmrg.comm.Barrier()
dmrg.Dcut = [4, 16, 48, 12, 3, 4, 1, 1, 1]
dmrg.default(mol, sc, lmps, oneSite=True)
dmrg.checkMPS(mol)
Exemple #4
0
#############################
# 0. Initialize an MPS(N,Sz)
#############################
dmrg = mpo_dmrg_class.mpo_dmrg()
dmrg.occun = mol.orboccun
dmrg.comm = mol.comm
dmrg.path = mol.path
dmrg.nsite = mol.sbas / 2
dmrg.sbas = mol.sbas
dmrg.isym = 2
dmrg.build()
dmrg.qsectors = {str([mol.nelec, sz]): 1}
Dmax = 20
thresh = 1.e-10
sc = mpo_dmrg_schedule.schedule()
sc.fixed(maxM=Dmax, maxiter=0)
sc.prt()
dmrg.ifplot = False
dmrg.ifIO = True
dmrg.partition()
dmrg.loadInts(mol)
dmrg.dumpMPO()
dmrg.default(sc)
dmrg.checkMPS()
dmrg.final()

if ifQt:
    flmps0 = h5py.File(dmrg.path + '/lmps', 'r')
    flmps1 = h5py.File(dmrg.path + '/lmpsQt', 'w')
    qtensor_api.fmpsQt(flmps0, flmps1, 'L')