Exemple #1
0
def get_nnZ_couplings(n, Jz, Jx, coup_list, L, bc):
    """ returns tuple [z_list, x_list, zz_list] of lists of coupling terms, that can be
    fed to the quspin hamiltonian constructor."""

    coupling_z = get_site_coupling(Jz, L)
    coupling_x = get_site_coupling(Jx, L)
    coupling_zz = []
    for i in range(n):
        coupling_zz = coupling_zz + get_nth_order_coupling(
            coup_list[i], L, i + 1, bc)
    return (coupling_z, coupling_x, coupling_zz)
Exemple #2
0
def get_2d_radial_static(Delta,
                         Omega,
                         f,
                         dmax,
                         Lx,
                         Ly,
                         bc='periodic',
                         gamma=None):
    N = Lx * Ly
    n_coupling = get_site_coupling(-Delta, N)
    x_coupling = get_site_coupling(-Omega / 2, N)
    nn_coupling = get_2d_nn_coupling(f, Lx, Ly, dmax, bc)

    static = [['n', n_coupling], ['+', x_coupling], ['-', x_coupling],
              ['nn', nn_coupling]]
    if gamma is not None:
        static += get_decay_static(gamma, N)
    return static
Exemple #3
0
def make_1d_TFI_static(J, Omega, L, bc='periodic', dtype=np.float64):
    coupling_x = get_site_coupling(-Omega, L)
    coupling_zz = get_nth_order_coupling(-J, L, 1, bc)
    static = [["x", coupling_x], ["zz", coupling_zz]]
    return static
Exemple #4
0
def make_kladder_symmetric_SPIN(Delta,
                                Omega,
                                V1,
                                V2,
                                k,
                                L,
                                basis=None,
                                bc='periodic'):
    """ Returns the following hamiltonian:
        H = - Delta sum_i n_i - (Omega/2) sum_i X_i + V1 sum_e (nn)_e
        where the last term joins any two sites which are the same or adjacent rungs.
        
        Assumes periodic boundary conditions (in the sense that the last rung joins to the first)
        L = number of rungs
        k = width (number of sites) of each rung
        
      Site ordering: The index i of the individual sites always increases left-to-right. At the end of the ladder, it moves down one step and keeps increasing.
      For a example, for a 2-ladder of length 8 the sites are as follows:
          0  1  2  3  4  5  6  7
          8  9  10 11 12 13 14 15
          
     This is 'thread' ordering, as opposed to 'snake' ordering where sites i, i+1 are always adjacent.  
     
        
    """
    raise TypeError("deprecated")
    check_bc(bc)
    if bc == 'open':
        raise TypeError("Ladder with open BC's is not implemented!")
    if basis is None:
        print("Generating basis")
        basis = spin_basis_1d(k * L, pauli=True)

    #coupling strengths in the Pauli basis
    #special case, the next-nearest will overcount by factor 2
    if L == 4:
        V2 = V2 / 2.0
    Jx_pauli = -(Omega / 2.0)
    Jz_pauli = -Delta / 2.0 + (V1 / 4.0) * (3 * k - 1) + (V2 / 4.0) * 2 * k
    Jzz_pauli_1nn = V1 / 4.0
    Jzz_pauli_2nn = V2 / 4.0

    N = k * L
    coupling_x = get_site_coupling(Jx_pauli, N)
    coupling_z = get_site_coupling(Jz_pauli, N)

    #matrix which stores the thread-order labels
    site_labels = np.empty((k, L), dtype=int)
    for i in range(k):
        site_labels[i, :] = np.array(range(L)) + i * L

    #all terms proportional to V1, ie nearest-neighbor sites
    coupling_zz_1nn = []

    for i in range(L):
        #this adds the interactions between sites on the same rung
        prs = get_all_pairs(site_labels[:, i])
        coupling_zz_1nn += [[Jzz_pauli_1nn] + p for p in prs]
        #this adds the interactions between sites on neighboring rungs
        for j in range(k):
            coupling_zz_1nn += [[
                Jzz_pauli_1nn, site_labels[j, i], site_labels[m, (i + 1) % L]
            ] for m in range(k)]

    #all terms proportional to V2, i.e. next-nearest-neighbor rungs
    coupling_zz_2nn = []
    for i in range(L):
        for j in range(k):
            coupling_zz_2nn += [[
                Jzz_pauli_2nn, site_labels[j, i], site_labels[m, (i + 2) % L]
            ] for m in range(k)]

    static = [["z", coupling_z], ["x", coupling_x],
              ["zz", coupling_zz_1nn + coupling_zz_2nn]]
    dynamic = []

    return hamiltonian(static, dynamic, basis=basis)
Exemple #5
0
def make_kladder_symmetric(Delta,
                           Omega,
                           V1,
                           V2,
                           k,
                           L,
                           basis=None,
                           bc='periodic',
                           dtype=np.float64):
    """ Returns the following hamiltonian:
        H = - Delta sum_i n_i - (Omega/2) sum_i X_i + V1 sum_e (nn)_e
        where the last term joins any two sites which are the same or adjacent rungs.
        
        Assumes periodic boundary conditions (in the sense that the last rung joins to the first)
        L = number of rungs
        k = width (number of sites) of each rung
        
      Site ordering: The index i of the individual sites always increases left-to-right. At the end of the ladder, it moves down one step and keeps increasing.
      For a example, for a 2-ladder of length 8 the sites are as follows:
          0  1  2  3  4  5  6  7
          8  9  10 11 12 13 14 15
          
     This is 'thread' ordering, as opposed to 'snake' ordering where sites i, i+1 are always adjacent.  
     
        
    """

    check_bc(bc)
    if bc == 'open':
        raise TypeError("Ladder with open BC's is not implemented!")
    if basis is None:
        print("Generating basis")
        basis = get_hcb_basis(k * L)
    if not (isinstance(basis, boson_basis_1d)
            or isinstance(basis, boson_basis_general)):
        raise TypeError("Only implemented for hcb basis")

    #special case, the next-nearest will overcount by factor 2
    if L == 4:
        V2 = V2 / 2.0
    Jx = -(Omega / 2.0)
    Jn = -Delta
    Jnn_nn1 = V1
    Jnn_nn2 = V2
    #total number of sites
    N = k * L
    coupling_x = get_site_coupling(Jx, N)
    coupling_n = get_site_coupling(Jn, N)

    #matrix which stores the thread-order labels
    site_labels = np.empty((k, L), dtype=int)
    for i in range(k):
        site_labels[i, :] = np.array(range(L)) + i * L

    #all terms proportional to V1, ie nearest-neighbor sites
    coupling_nn_nn1 = []

    for i in range(L):
        #this adds the interactions between sites on the same rung
        prs = get_all_pairs(site_labels[:, i])
        coupling_nn_nn1 += [[Jnn_nn1] + p for p in prs]
        #this adds the interactions between sites on neighboring rungs
        for j in range(k):
            coupling_nn_nn1 += [[
                Jnn_nn1, site_labels[j, i], site_labels[m, (i + 1) % L]
            ] for m in range(k)]

    #all terms proportional to V2, i.e. next-nearest-neighbor rungs
    coupling_nn_nn2 = []
    for i in range(L):
        for j in range(k):
            coupling_nn_nn2 += [[
                Jnn_nn2, site_labels[j, i], site_labels[m, (i + 2) % L]
            ] for m in range(k)]

    static = [["n", coupling_n], ["+", coupling_x], ["-", coupling_x],
              ["nn", coupling_nn_nn1 + coupling_nn_nn2]]
    dynamic = []

    return hamiltonian(static, dynamic, basis=basis, dtype=dtype)
Exemple #6
0
def get_decay_coupling(gamma, L, verbose=False):
    """ Returns (decay_coup_n, decay_coup_I), two single-site coupling lists which correspond to the n and I operators, respectively, in the hcb basis. 
        gamma = a list of decay rates, for upper and lower states respectively."""
    decay_coup_n = get_site_coupling(-1j * (gamma[0] - gamma[1]) / 2.0, L)
    decay_coup_I = get_site_coupling(-1j * gamma[1] / 2.0, L)
    return decay_coup_n, decay_coup_I
Exemple #7
0
def get_ryd_coupling_n(Delta, L, verbose=False):
    return get_site_coupling(-Delta, L, verbose=verbose)
Exemple #8
0
def get_ryd_coupling_x(Omega, L, verbose=False):
    return get_site_coupling(-Omega / 2.0, L, verbose=verbose)