Exemplo n.º 1
0
    dmrg.build()
    dmrg.comm = mol.comm
    dmrg.qsectors = {str([mol.nelec, sz]): 1}
    sc = mpo_dmrg_schedule.schedule()
    sc.fixed(maxM=10, maxiter=0)
    sc.prt()
    dmrg.ifIO = True
    dmrg.partition()
    dmrg.loadInts(mol)
    dmrg.default(sc)
    dmrg.checkMPS()

    #-------------------------------------------------------
    flmps0 = dmrg.flmps
    flmps1 = h5py.File(dmrg.path + '/lmpsQt', 'w')
    qtensor_api.fmpsQt(flmps0, flmps1, 'L')
    flmps0.close()

    if sc.maxiter > 0:
        frmps0 = dmrg.frmps
        frmps1 = h5py.File(dmrg.path + '/rmpsQt', 'w')
        qtensor_api.fmpsQt(frmps0, frmps1, 'R')
        frmps0.close()
    #-------------------------------------------------------

    ################################
    # 1. Using an MPS in Qt form
    ################################
    dmrg2 = mpo_dmrg_class.mpo_dmrg()
    dmrg2.nsite = mol.sbas / 2
    dmrg2.sbas = mol.sbas
Exemplo n.º 2
0
    sc.prt()
    dmrg.ifQt = False
    dmrg.partition()
    #====================================
    dmrg.h1e = tmatrix
    dmrg.model_Usite = us
    dmrg.dumpMPO_Model("HubbardGeneral")
    #====================================
    dmrg.default(sc)
    dmrg.checkMPS()

    if rank == 0:
        #-------------------------------------------------------
        flmps0 = dmrg.flmps
        flmps1 = h5py.File(dmrg.path + '/lmpsQt', 'w')
        qtensor_api.fmpsQt(flmps0, flmps1, 'L', isym=isym)
        flmps0.close()
        flmps1.close()
        if ifQt:
            shutil.copy(dmrg.path + '/lmpsQt', './lmpsQ0')
        else:
            shutil.copy(dmrg.path + '/lmps', './lmpsQ0')
        #-------------------------------------------------------

else:

    # 1. Using an MPS in Qt form
    flmps1 = h5py.File('./lmpsQ0', 'r')
    dmrg2 = mpo_dmrg_class.mpo_dmrg()
    dmrg2.nsite = nsite
    dmrg2.sbas = nsite * 2