def diag(dmrg, fbmps, debug=False): print '\n[mpo_dmrg_rdm.diag]' if not dmrg.ifs2proj: fname = dmrg.path + '/rdm_diag' mpo_dmrg_init.genSops(dmrg, fbmps, fbmps, fname + 'L', 'L', debug) mpo_dmrg_init.genSops(dmrg, fbmps, fbmps, fname + 'R', 'R', debug) if dmrg.ifQt: print 'error' exit() #nii = diagQt(dmrg,fbmps,fname,debug) else: nii = diagNQt(dmrg, fbmps, fname, debug) else: print 'error' exit() #mpo_dmrg_init.genPops(dmrg,fbmps,fbmps,fname,'R',debug) return nii
dmrg2.npts = 4 dmrg2.s2quad(sval, sz) #--------------------------- mol.build() dmrg2.path = mol.path dmrg2.ifQt = True dmrg2.partition() dmrg2.loadInts(mol) dmrg2.dumpMPO() #dmrg2.checkMPS(flmps2) from zmpo_dmrg.source import mpo_dmrg_init pop = mpo_dmrg_init.genPops(dmrg2, flmpsQ, flmpsQ, './tmp_sop', 'L') pop = numpy.dot(dmrg2.qwts, pop) dmrg2.ifs2proj = False sop = mpo_dmrg_init.genSops(dmrg2, flmpsQ, flmps2, './tmp_sop', 'L') # # pop= 0.455118136425 # sop= 0.674518871551 # Overlap: <Psi|P|Psi0>*N0= 0.999843513716 # print print 'pop=', pop print 'sop=', sop print 'Overlap: <Psi|P|Psi0>*N0=', sop / math.sqrt(pop) exit() # <S2> if not ifs2proj: info = None else:
# Check energy dmrg2.checkMPS(flmps1) #P11 = dmrg2.checkMPS(flmps1)[-1] #P01 = dmrg2.checkMPS(flmps0,flmps1)[-1] #print 'Overlap: <Psi|P|Psi0>*N0=',P01/math.sqrt(P00) # # The Remarkable fact is that P11=1 by construction, # such that P01=O01, and <Psi|P|Psi0>*N0=<Psi|Psi0>*N0, # which is extremely easy to compute as no projector is involved. # from zmpo_dmrg.source import mpo_dmrg_init pop = mpo_dmrg_init.genPops(dmrg2,flmps0,flmps0,'./tmp_sop','L') pop = numpy.dot(dmrg2.qwts,pop) dmrg2.ifs2proj = False sop = mpo_dmrg_init.genSops(dmrg2,flmps0,flmps1,'./tmp_sop','L') # # pop= 0.618247725148 # sop= 0.770106557564 # Overlap: <Psi|P|Psi0>*N0= 0.979421330091 # print print 'pop=',pop print 'sop=',sop print 'Overlap: <Psi|P|Psi0>*N0=',sop/math.sqrt(pop) exit() # <S2> if not ifs2proj: info=None else: