Ejemplo n.º 1
0
    def __init__(self, L=2, S=0.5, J=1., Delta=1., hz=0.):
        spin = SpinSite(S=S, conserve="Sz")
        # the lattice defines the geometry
        lattice = Chain(L, spin, bc="open", bc_MPS="finite")
        CouplingModel.__init__(self, lattice)
        # add terms of the Hamiltonian
        self.add_coupling(J * 0.5, 0, "Sp", 0, "Sm", 1)  # Sp_i Sm_{i+1}
        self.add_coupling(J * 0.5, 0, "Sp", 0, "Sm", -1)  # Sp_i Sm_{i-1}
        self.add_coupling(J * Delta, 0, "Sz", 0, "Sz", 1)
        # (for site dependent prefactors, the strength can be an array)
        self.add_onsite(-hz, 0, "Sz")

        # finish initialization
        # generate MPO for DMRG
        MPOModel.__init__(self, lat, self.calc_H_MPO())
        # generate H_bond for TEBD
        NearestNeighborModel.__init__(self, lat, self.calc_H_bond())
Ejemplo n.º 2
0
    def __init__(self, L=10, J=1, gamma=1, Y=0, hz=0, options={}):
        # use predefined local Hilbert space and onsite operators
        site = SpinSite(S=1 / 2, conserve=None)
        self.L = L
        lat = Chain(L, site, bc="open", bc_MPS="finite")  # define geometry
        MultiCouplingModel.__init__(self, lat)
        # add terms of the Hamiltonian;
        # operators "Sx", "Sy", "Sz" are defined by the SpinSite
        self.add_coupling(J + gamma, 0, "Sx", 0, "Sx", 1)
        self.add_coupling(J - gamma, 0, "Sy", 0, "Sy", 1)

        self.add_multi_coupling(Y, [("Sx", -1, 0), ("Sz", 0, 0), ("Sy", 1, 0)])
        self.add_multi_coupling(-Y, [("Sy", -1, 0), ("Sz", 0, 0),
                                     ("Sx", 1, 0)])

        self.add_onsite(hz, 0, "Sz")

        # finish initialization
        MPOModel.__init__(self, lat, self.calc_H_MPO())
        self.psi = MPS.from_product_state(self.lat.mps_sites(), [0] * L,
                                          "finite")
        self.options = options
        self.dmrg_retval = None
Ejemplo n.º 3
0
    def __init__(self, L=10, J=1, Y=0, hz=0, options={}):
        # use predefined local Hilbert space and onsite operators
        site = SpinSite(S=1, conserve=None)
        self.L = L
        lat = Chain(L, site, bc="open", bc_MPS="finite")  # define geometry
        MultiCouplingModel.__init__(self, lat)
        # add terms of the Hamiltonian;
        # operators "Sx", "Sy", "Sz" are defined by the SpinSite
        self.add_coupling(J, 0, "Sx", 0, "Sx", 1)
        self.add_coupling(J, 0, "Sy", 0, "Sy", 1)
        self.add_coupling(J, 0, "Sz", 0, "Sz", 1)

        for oper1 in ['Sx', 'Sy', 'Sz']:
            for oper2 in ['Sx', 'Sy',
                          'Sz']:  # (\vec S(i) \cdot \vec S(i+1))^2 coupling
                self.add_multi_coupling(Y, [(oper1, 0, 0),(oper2, 0, 0),\
                                            (oper1, 1, 0),(oper2, 1, 0)] ) #note that there are two operators on one site
        self.add_onsite(hz, 0, "Sz")
        # finish initialization
        MPOModel.__init__(self, lat, self.calc_H_MPO())
        self.psi = MPS.from_product_state(self.lat.mps_sites(), [0] * L,
                                          "finite")
        self.options = options
        self.dmrg_retval = None
Ejemplo n.º 4
0
 def init_sites(self, model_params):
     # conserve = get_parameter(model_params, 'conserve', None, self.name)
     conserve = model_params.get('conserve', None)
     S = model_params.get('S', 0.5)
     fs = SpinSite(S=S, conserve=conserve)
     return [fs, fs, fs, fs]