def __init__(self, J, Jz, h, nsite): self.spaceconfig = SpinSpaceConfig([1, 2]) I = OpUnitI(hndim=2) scfg = SpinSpaceConfig([1, 2]) Sz = opunit_Sz(spaceconfig=scfg) Sp = opunit_Sp(spaceconfig=scfg) Sm = opunit_Sm(spaceconfig=scfg) wi = zeros((5, 5), dtype='O') wi[:, 0], wi[4, 1:] = (I, Sp, Sm, Sz, -h * Sz), (J / 2. * Sm, J / 2. * Sp, Jz * Sz, I) WL = [copy.deepcopy(wi) for i in xrange(nsite)] WL[0] = WL[0][4:] WL[-1] = WL[-1][:, :1] self.H_serial = WL2OPC(WL)
def __init__(self,J,Jz,h,nsite): self.spaceconfig=SpinSpaceConfig([2,1]) I=OpUnitI(hndim=2) scfg=SpinSpaceConfig([2,1]) Sz=opunit_Sz(spaceconfig=scfg) Sp=opunit_Sp(spaceconfig=scfg) Sm=opunit_Sm(spaceconfig=scfg) wi=zeros((5,5),dtype='O') wi[:,0],wi[4,1:]=(I,Sp,Sm,Sz,-h*Sz),(J/2.*Sm,J/2.*Sp,Jz*Sz,I) WL=[copy.deepcopy(wi) for i in xrange(nsite)] WL[0]=WL[0][4:] WL[-1]=WL[-1][:,:1] self.H=MPO(WL) mpc=self.H.serialize() mpc.compactify() self.H_serial=mpc
def __init__(self,J,Jz,D,nsite): self.spaceconfig=SpinSpaceConfig([3,1]) self.J,self.Jz,self.D,self.nsite=J,Jz,D,nsite I=OpUnitI(hndim=self.spaceconfig.hndim) Sz=opunit_Sz(spaceconfig=self.spaceconfig) Sp=opunit_Sp(spaceconfig=self.spaceconfig) Sm=opunit_Sm(spaceconfig=self.spaceconfig) wi=zeros((5,5),dtype='O') wi[:,0],wi[4,1:]=(I,Sp,Sm,Sz,D*Sz*Sz),(J/2.*Sm,J/2.*Sp,Jz*Sz,I) WL=[copy.deepcopy(wi) for i in xrange(nsite)] WL[0]=WL[0][4:] WL[-1]=WL[-1][:,:1] self.H=MPO(WL) mpc=self.H.serialize() mpc.compactify() self.H_serial=mpc ion() cla() mpc.show_advanced() pdb.set_trace()