Ejemplo n.º 1
0
def TransverseIsing(nspin, R, J, h):
    H = []

    for i in range(nspin):
        j = (i + 1) % nspin
        active = [
            k for k in range(nspin)
            if dpbc(i, k, nspin) < R or dpbc(j, k, nspin) < R
        ]
        active = np.asarray(active)
        print(active)
        nact = len(active)
        h_alpha = np.zeros(4**nact)
        ii = np.where(active == i)[0][0]
        jj = np.where(active == j)[0][0]

        idx = [0] * nact
        idx[ii] = 1
        h_alpha[Bas2Int(idx, 4)] = h
        idx = [0] * nact
        idx[ii] = 3
        idx[jj] = 3
        if np.abs(i - j) == 1 and j != 0:
            h_alpha[Bas2Int(idx, 4)] = J
        imap, gmap = pauli_action(active, nspin)
        H.append((active, h_alpha, imap, gmap))
    Hm = Hmat(H)
    print()
    print_Hamiltonian(H)
    return H
Ejemplo n.º 2
0
def Heisenberg_SR(nspin, R):
    H = []
    imax = nspin
    if (nspin == 2): imax = nspin - 1
    for i in range(imax):
        j = (i + 1) % nspin
        active = [
            k for k in range(nspin)
            if dpbc(i, k, nspin) < R or dpbc(j, k, nspin) < R
        ]
        active = np.asarray(active)
        nact = len(active)
        # -----
        h_alpha = np.zeros(4**nact)
        ii = np.where(active == i)[0][0]
        jj = np.where(active == j)[0][0]
        for alpha in range(1, 4):
            idx = [0] * nact
            idx[ii] = alpha
            idx[jj] = alpha
            h_alpha[Bas2Int(idx, 4)] = 1.0
        # -----
        imap, gmap = pauli_action(active, nspin)
        H.append((active, h_alpha, imap, gmap))
    return H
Ejemplo n.º 3
0
def Ising(nspin,R,psi):
 H = []
 for i in range(nspin):
  j = (i+1)%nspin
  # -----
  active = [k for k in range(nspin) if dpbc(i,k,nspin)<R or dpbc(j,k,nspin)<R]
  active = np.asarray(active)
  nact   = len(active)
  # -----
  h_alpha = np.zeros(4**nact)
  ii = np.where(active==i)[0][0]
  jj = np.where(active==j)[0][0]

  idx     = [0]*nact
  idx[ii] = 3
  h_alpha[Bas2Int(idx,4)] = np.sin(psi)/2.0
  idx     = [0]*nact
  idx[jj] = 3
  h_alpha[Bas2Int(idx,4)] = np.sin(psi)/2.0
  idx     = [0]*nact
  idx[ii] = 1
  idx[jj] = 1
  h_alpha[Bas2Int(idx,4)] = np.cos(psi)

  # -----
  imap,gmap = pauli_action(active,nspin)
  H.append((active,h_alpha,imap,gmap))
 return H