def vcaconstruct(name, parameters, sectors, cell, lattice, terms, weiss, baths=(), mask=('nambu', ), **karg): config = IDFConfig(priority=DEFAULT_FOCK_PRIORITY, pids=lattice.pids, map=idfmap) vca = VCA.VCA(dlog='log', din='data', dout='result/vca', name='%s_%s_%s_%s' % (name, lattice.name, cell.name, '_'.join( repr(sector) for sector in sectors)), cgf=VCA.VGF(nstep=150, method='S', prepare=ED.EDGFP, run=ED.EDGF), parameters=parameters, map=parametermap, sectors=sectors, cell=cell, lattice=lattice, config=config, terms=[term(**parameters) for term in terms], weiss=[term(**parameters) for term in weiss], baths=[term(**parameters) for term in baths], mask=mask, dtype=np.complex128) return vca
def test_vca(self): print t,U,m,n=-1.0,8.0,2,2 basis=FBasis(2*m*n,m*n,0.0) cell=Square('S1')('1P-1P',1) lattice=Square('S1')('%sP-%sP'%(m,n),1) config=IDFConfig(priority=DEFAULT_FERMIONIC_PRIORITY,pids=lattice.pids,map=lambda pid: Fermi(atom=0,norbital=1,nspin=2,nnambu=1)) cgf=VCA.VGF(nstep=200,prepare=ED.EDGFP,savedata=False,run=ED.EDGF) vca=VCA.VCA( name= 'WG-%s-%s'%(lattice.name,basis.rep), cgf= cgf, sectors= [basis], cell= cell, lattice= lattice, config= config, terms= [Hopping('t',t,neighbour=1),Hubbard('U',U)], weiss= [Onsite('afm',0.0,indexpacks=sigmaz('sp'),amplitude=lambda bond: 1 if bond.spoint.pid.site in (0,3) else -1,modulate=True)], mask= ['nambu'], dtype= np.float64 ) vca.add(GP(name='GP',mu=U/2,BZ=square_bz(reciprocals=lattice.reciprocals,nk=100),run=VCA.VCAGP)) vca.register(VCA.GPM(name='afm-1',BS=BaseSpace(('afm',np.linspace(0.0,0.3,16))),dependences=['GP'],savedata=False,run=VCA.VCAGPM)) vca.register(VCA.GPM(name='afm-2',BS={'afm':0.1},options={'method':'BFGS','tol':10**-4},dependences=['GP'],savedata=False,run=VCA.VCAGPM)) vca.register(VCA.EB(name='EB',parameters={'afm':0.20},path=square_gxm(nk=100),mu=U/2,emax=6.0,emin=-6.0,eta=0.05,ne=400,savedata=False,run=VCA.VCAEB)) vca.register(DOS(name='DOS',parameters={'afm':0.20},BZ=KSpace(reciprocals=lattice.reciprocals,nk=20),mu=U/2,emin=-10,emax=10,ne=400,eta=0.05,savedata=False,run=VCA.VCADOS)) vca.register(FS(name='FS',parameters={'afm':0.20},mu=U/2,BZ=square_bz(nk=100),savedata=False,run=VCA.VCAFS)) vca.register(VCA.OP(name='OP',parameters={'afm':0.20},mu=U/2,terms=vca.weiss,BZ=square_bz(reciprocals=lattice.reciprocals,nk=100),run=VCA.VCAOP)) vca.register(VCA.DTBT(name='DTBT',parameters={'afm':0.20},path=square_gxm(nk=100),mu=U/2,savedata=False,run=VCA.VCADTBT)) vca.register(VCA.CPFF(name='FF',task='FF',parameters={'afm':0.20},cf=U/2,BZ=KSpace(reciprocals=lattice.reciprocals,nk=100),run=VCA.VCACPFF)) #vca.register(VCA.CPFF(name='CP',task='CP',cf=0.5,BZ=KSpace(reciprocals=lattice.reciprocals,nk=100),options={'x0':1.0,'x_tol':10**-6,'maxiter':20},run=VCA.VCACPFF)) vca.summary()
def vcatasks(name, parameters, basis, cell, lattice, terms, weiss, baths=(), jobs=()): import HamiltonianPy.VCA as VCA vca = vcaconstruct(name, parameters, [basis], cell, lattice, terms, weiss) if 'EB' in jobs: vca.register( VCA.EB(name='EB', path=hexagon_gkm(reciprocals=cell.reciprocals, nk=100), mu=parameters['U'] / 2, emin=-5.0, emax=5.0, eta=0.05, ne=401, run=VCA.VCAEB)) if 'TEB' in jobs: vca.register( VCA.EB(name='TEB', path=hexagon_gkm(reciprocals=cell.reciprocals, nk=100), mu=parameters['U'] / 2, run=VCA.VCATEB)) if 'CN' in jobs: vca.register( BC(name='CN', BZ=KSpace(reciprocals=cell.reciprocals, nk=100), mu=parameters['U'] / 2, savedata=False, plot=False, run=VCA.VCABC)) if 'GPM' in jobs: vca.add( GP(name='GP', mu=parameters['U'] / 2, BZ=KSpace(reciprocals=lattice.reciprocals, nk=100), run=VCA.VCAGP)) vca.register( VCA.GPM(name='afm', BS=BaseSpace(('afm', np.linspace(0.0, 0.1, 11))), dependences=['GP'], run=VCA.VCAGPM)) vca.summary()
def vcatasks(parameters, basis, cell, lattice, job='EB'): import HamiltonianPy.VCA as VCA vca = vcaconstruct(parameters, basis, cell, lattice, [t1, t2, U], [afm]) if job == 'EB': vca.register( VCA.EB(name='EB', path=hexagon_gkm(nk=100), mu=parameters[2] / 2, emin=-5.0, emax=5.0, eta=0.05, ne=401, run=VCA.VCAEB)) if job == 'GPM': gp = GP(name='GP', mu=parameters[2] / 2, BZ=KSpace(reciprocals=lattice.reciprocals, nk=100), run=VCA.VCAGP) vca.register( VCA.GPM(name='afm', BS=BaseSpace(('afm', np.linspace(0.0, 0.1, 11))), dependences=[gp], run=VCA.VCAGPM)) vca.summary()
def vcaconstruct(parameters,basis,cell,lattice,terms,weiss,mask=['nambu'],**karg): config=IDFConfig(priority=DEFAULT_FERMIONIC_PRIORITY,pids=lattice.pids,map=idfmap) # edit the value of nstep if needed cgf=ED.FGF(operators=fspoperators(config.table(),lattice),nstep=150,prepare=ED.EDGFP,run=ED.EDGF) vca=VCA.VCA( dlog= 'log/vca', din= 'data/vca', dout= 'result/vca', log= '%s_%s_%s_%s_VCA.log'%(name,lattice.name,basis.rep,parameters), cgf= cgf, name= '%s_%s_%s'%(name,lattice.name,basis.rep), basis= basis, cell= cell, lattice= lattice, config= config, terms= [term(*parameters) for term in terms], weiss= [term(*parameters) for term in weiss], mask= mask, dtype= np.complex128 ) return vca