Ejemplo n.º 1
0
def summand(e, L, nna, nnk, gamma, x2, l1, m1, l2, m2, alpha):

    nk = norm(nnk)

    nnA = np.array(nna)
    nnK = np.array(nnk)
    nnb = -1 * nnA - 1 * nnK

    if (nk == 0):
        rr = nnA
    else:
        rr = nnA + nnK / (2 * gamma) + nnK * (1 / gamma - 1) * np.dot(
            nnA, nnK) / nk**2

    rr2 = np.dot(rr, rr)
    twopibyL = 2 * math.pi / L
    a = norm(nnA) * twopibyL
    b = norm(nnb) * twopibyL

    # TB: Choose spherical harmonic basis
    Ytype = 'r'  # 'r' for real, 'c' for complex
    Ylmlm = 1
    if l1 == 2:
        Ylmlm = defns.y2(rr, m1, Ytype)
    if l2 == 2:
        Ylmlm = Ylmlm * defns.y2(rr, m2, Ytype)

    exponential = np.exp(alpha * (x2 - rr2))

    out = Ylmlm * exponential / (x2 - rr2)
    if (Ytype == 'r' or Ytype == 'real') and abs(out.imag) > 1e-15:
        print('Error in summand: imaginary part in real basis')
    else:
        out = out.real
    return out
Ejemplo n.º 2
0
def omega2sum(E, pvec, lp, mp, kvec, l, m, Ytype='r'):
    k = LA.norm(kvec)
    p = LA.norm(pvec)

    if (lp == 0 and mp == 0):
        if (l == 0 and m == 0):
            S1 = omega(k)**2 + (
                (E - omega(k))**2) / 2 + 2 / 3 * (k * qst(E, k) / E2k(E, k))**2
        elif l == 2:
            #S1 = 4/15*(qst(E,k) / E2k(E,k))**2 * conj(y2(kvec,m,Ytype))
            S1 = 4 / 15 * (1 / E2k(E, k))**2 * conj(y2(kvec, m,
                                                       Ytype))  # TB, no q
        else:
            S1 = 0
    else:
        S1 = 0

    if (l == 0 and m == 0):
        if (lp == 0 and mp == 0):
            S2 = omega(p)**2 + (
                (E - omega(p))**2) / 2 + 2 / 3 * (p * qst(E, p) / E2k(E, p))**2
        elif lp == 2:
            #S2 = 4/15*(qst(E,p) / E2k(E,p))**2 * y2(pvec,mp,Ytype)
            S2 = 4 / 15 * (1 / E2k(E, p))**2 * y2(pvec, mp, Ytype)  # TB, no q
        else:
            S2 = 0
    else:
        S2 = 0

    if np.imag(S1 + S2) > 10**-8:
        print('Error: imaginary part in omega2sum')
    return np.real(S1 + S2)
Ejemplo n.º 3
0
def G(e, L, nnp, nnk, l1, m1, l2, m2):
    p = sums.norm(nnp) * 2. * math.pi / L
    k = sums.norm(nnk) * 2. * math.pi / L
    pk = sums.norm(np.add(nnk, nnp)) * 2. * math.pi / L
    omp = np.sqrt(1 + p**2)
    omk = np.sqrt(1 + k**2)
    #ompk = np.sqrt(1+pk**2)

    bkp2 = (e - omp -
            omk)**2 - (2 * math.pi / L)**2 * sums.norm(np.add(nnk, nnp))**2

    # nnps and nnks are the full vectors p* and k*
    nnps = boost(np.multiply(nnp, 2 * math.pi / L),
                 np.multiply(nnk, 2 * math.pi / L), e)
    nnks = boost(np.multiply(nnk, 2 * math.pi / L),
                 np.multiply(nnp, 2 * math.pi / L), e)
    #ps = sums.norm(nnps)
    #ks = sums.norm(nnks)
    qps2 = (e - omp)**2 / 4 - p**2 / 4 - 1
    qks2 = (e - omk)**2 / 4 - k**2 / 4 - 1

    # TB: Choose spherical harmonic basis
    Ytype = 'r'  # 'r' for real, 'c' for complex
    Ylmlm = 1

    momfactor1 = 1
    momfactor2 = 1
    if (l1 == 2):
        #momfactor1 = (ks)**l1/qps2
        momfactor1 = qps2**(-l1 / 2)  # TB: ks**l1 included in my y2(nnks)
        Ylmlm = y2(nnks, m1, Ytype)
    if (l2 == 2):
        #momfactor2 = (ps)**l2/qks2
        momfactor2 = qks2**(-l2 / 2)  # TB: ps**l2 included in my y2(nnps)
        Ylmlm = Ylmlm * y2(nnps, m2, Ytype)

    # out = sums.hh(e,p)*sums.hh(e,k)/(L**3 * 4*omp*omk*(bkp2-1)) *Ylmlm * momfactor1 * momfactor2
    out = sums.hh(e, p) * sums.hh(e, k) / (L**3 * 4 * omp * omk *
                                           (bkp2 - 1)) * Ylmlm  # TB, no q

    if (Ytype == 'r' or Ytype == 'real') and abs(out.imag) > 1e-15:
        print('Error in G: imaginary part in real basis output')
    else:
        out = out.real
    return out
Ejemplo n.º 4
0
def wds(E,pvec,lp,mp,kvec,l,m,Ytype='r'):
  if lp==mp==0:
    k=LA.norm(kvec); p=LA.norm(pvec)
    psk = pstark(E,pvec,kvec)
    if l==m==0:
      return 1/2*(E*omega(p)-sqrt(wss(E,pvec,0,0,kvec,0,0)))**2 + 2/3*(qst(E,k)*LA.norm(psk))**2
    elif l==2:
      #return 4/15 * qst(E,k)**2 * conj(y2(psk,m,Ytype))
      return 4/15 * conj(y2(psk,m,Ytype)) # TB, no q
  else:
    return 0
Ejemplo n.º 5
0
def wddmp(E, pvec, lp, mp, kvec, l, m, Ytype):
    if lp == mp == 0:
        k = LA.norm(kvec)
        p12sk = p12stark(E, pvec, kvec)
        if l == m == 0:
            return 1 / 3 * (qst(E, k) * LA.norm(p12sk))**2
        elif l == 2:
            # return 2/15 * qst(E,k)**2 * conj(y2(p12sk,m,Ytype))
            return 2 / 15 * conj(y2(p12sk, m, Ytype))  # TB, no q

    else:
        return 0