Exemple #1
0
#---------------------------
if ifs2proj:
    dmrg2.ifs2proj = True
    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>
Exemple #2
0
dmrg2.comm = comm
#---------------------------
if ifs2proj:
   dmrg2.ifs2proj = True
   dmrg2.npts = 11
   dmrg2.s2quad(sval,sz)
#---------------------------
dmrg2.path = './'
dmrg2.ifQt = True
dmrg2.partition()

if fname == 'lmpsQs':
   pop = 0.280309490026
elif fname == 'lmpsQ0':
   mpo_dmrg_io.dumpMPO_R(dmrg2)
   pop = mpo_dmrg_init.genPops(dmrg2,flmps0,flmps0,'./tmp_pop','L')
   pop = numpy.dot(dmrg2.qwts,pop)
   
dmrg2.ifs2proj = False
sop = mpo_dmrg_init.genSops(dmrg2,flmps0,flmps1,'./tmp_sop','L')
print()
print('pop(<Psi0|P|Psi0>)=',pop)
print('sop(<Psi0|P|Psi1>)=',sop)
print('Overlap: <Psi|P|Psi0>*N0=',sop/math.sqrt(pop))
sop = mpo_dmrg_init.genSops(dmrg2,flmps1,flmps1,'./tmp_sop','L')
print('sop(<Psi1|P|Psi1>)=',sop)

#> # <S2>	 
#> if not ifs2proj:
#>    info=None
#> else: