Beispiel #1
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)
Beispiel #2
0
def wddmm(E, pvec, lp, mp, kvec, l, m, Ytype):
    k = LA.norm(kvec)
    p = LA.norm(pvec)
    t = T(E, pvec, kvec)

    if l == m == lp == mp == 0:
        S00 = sum([t[i][j]**2 for i in range(0, 3) for j in range(0, 3)])
        return 4 / 9 * (qst(E, k) * qst(E, p))**2 * S00

    elif l == 2 and lp == mp == 0:
        S20 = np.dot(t, np.transpose(t))
        # return 4/3*(qst(E,k)*qst(E,p))**2 * conj(sph2(S20,m,Ytype))
        return 4 / 3 * qst(E, p)**2 * conj(sph2(S20, m,
                                                Ytype))  # TB, no q (of k)

    elif lp == 2 and l == m == 0:
        S02 = np.dot(np.transpose(t), t)
        # return 4/3*(qst(E,k)*qst(E,p))**2 * sph2(S02,mp,Ytype)
        return 4 / 3 * qst(E, k)**2 * sph2(S02, mp, Ytype)  # TB, no q (of p)

    elif l == lp == 2:
        # TB: This method is probably a tad slower than listing all cases, but not by much (speed seems fine to me)
        s = 0
        for i1 in range(0, 3):
            for i2 in range(0, 3):
                for j1 in range(0, 3):
                    for j2 in range(0, 3):
                        s += conj(sphcoeff(m, i1, i2, Ytype)) * sphcoeff(
                            mp, j1, j2, Ytype) * t[i1][j1] * t[i2][j2]
        # return 4*(qst(E,k)*qst(E,p))**2 * s
        return 4 * s  # TB, no q
    else:
        return 0
Beispiel #3
0
def K3cubicA(E, pvec, lp, mp, kvec, l, m):
    p = norm(pvec)
    k = norm(kvec)
    Ep = defns.E2k(E, p)
    Ek = defns.E2k(E, k)
    wp = defns.omega(p)
    wk = defns.omega(k)
    ap = defns.qst(E, p)
    a = defns.qst(E, k)
    pterm = E * wp - 3
    kterm = E * wk - 3

    if lp == l == mp == m == 0:
        D3p = Ep**2 - 4
        D3 = Ek**2 - 4
        out = D3p**3 + D3**3 + 2 * (pterm**3 + kterm**3) + 8 * E**2 * (
            pterm * (p * ap / Ep)**2 + kterm * (k * a / Ek)**2)
    elif lp == 0 and l == 2:
        #out = 16/5 * kterm * (E*a/Ek)**2 * defns.y2real(kvec,m)
        out = 16 / 5 * kterm * (E / Ek)**2 * defns.y2real(
            kvec, m)  # removed a=qk* factor (no q)
    elif lp == 2 and l == 0:
        #out = 16/5 * pterm * (E*ap/Ep)**2 * defns.y2real(pvec,m)
        out = 16 / 5 * pterm * (E / Ep)**2 * defns.y2real(
            pvec, mp)  # removed ap=qp* factor (no q)
    else:
        out = 0

        #out *= ap**lp * a**l   # q factors are NOT included here (no q)

    if out.imag > 1e-15:
        print('Error: imaginary part in K3cubicA')
    return out.real
Beispiel #4
0
def K2inv(E,kvec,l,m,a0,r0,P0,a2):
  k = LA.norm(kvec)
  omk = defns.omega(k)
  E2star = defns.E2k(E,k)
  qk = defns.qst(E,k)
  h = sums.hh(E,k)

  if h==0:
    print('Error: invalid kvec in K2inv')

  if l==m==0:
    out = 1/(32*pi*omk*E2star) * ( -1/a0 + r0*qk**2/2 + P0*r0**3*qk**4 + abs(qk)*(1-h))

  elif l==2 and -2<=m<=2:
    # out = 1/(32*pi*omk*E2star*qk**4) * ( -1/a2**5 + abs(qk)**5*(1-h) )
    out = 1/(32*pi*omk*E2star) * ( -1/a2**5 + abs(qk)**5*(1-h) ) # TB, no q

  else:
    return 0
  
  if out.imag > 1e-15:
    print('Error in K2inv: imaginary part in output')
  else:
    out = out.real
  return out
Beispiel #5
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
Beispiel #6
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
Beispiel #7
0
def x2(E,L,nnk):
  k = LA.norm(nnk)*2*pi/L
  return defns.qst(E,k)**2*(L/(2*pi))**2
Beispiel #8
0
def K3cubicB(E, pvec, lp, mp, kvec, l, m):
    #pvec=np.array(pvec); kvec=np.array(kvec)
    p = norm(pvec)
    k = norm(kvec)
    phat = np.array([x / p for x in pvec]) if p != 0 else pvec
    khat = np.array([x / k for x in kvec]) if k != 0 else kvec

    Ep = defns.E2k(E, p)
    Ek = defns.E2k(E, k)
    wp = defns.omega(p)
    wk = defns.omega(k)
    ap = defns.qst(E, p)
    a = defns.qst(E, k)
    # Bp = p/(E-wp); Bk = k/(E-wk)
    # gp = 1/sqrt(1-Bp**2); gk = 1/sqrt(1-Bk**2)
    k_p = np.dot(pvec, kvec)

    # Denote primed (outgoing) momenta with t
    # Denote p_{12}^+ by p12, and p_{12}^- by m12; add t for primed versions

    pstark_vec = K3_defns.pstark(
        E, pvec, kvec)  #gk*Bk*wp*khat + (gk-1)*p*khat_phat*khat + pvec
    kstarp_vec = K3_defns.pstark(
        E, kvec, pvec)  #gp*Bp*wk*phat + (gp-1)*k*khat_phat*phat + kvec
    p12t_stark_vec = K3_defns.p12stark(
        E, pvec, kvec)  #gk*Bk*(E-wp)*khat - (gk-1)*p*khat_phat*khat - pvec
    p12_starp_vec = K3_defns.p12stark(
        E, kvec, pvec)  #gp*Bp*(E-wk)*phat - (gp-1)*k*khat_phat*phat - kvec

    pstark = norm(pstark_vec)
    kstarp = norm(kstarp_vec)
    p12t_stark = norm(p12t_stark_vec)
    p12_starp = norm(p12_starp_vec)

    p3_p3t = wk * wp - k_p
    p12_p12t = (E - wk) * (E - wp) - k_p
    p12_p3t = (E - wk) * wp + k_p
    p3_p12t = (E - wp) * wk + k_p

    t = K3_defns.T(E, pvec, kvec)
    u = np.outer(p12t_stark_vec, p12_starp_vec)  # tensor needed for full U

    if lp == l == mp == m == 0:
        out = p3_p3t**3 + 1/4*( (p12_p3t)**3 + (p3_p12t)**3 ) + p12_p3t*pstark**2*a**2 + p3_p12t*kstarp**2*ap**2 \
        + 1/16*p12_p12t**3 + 1/4*p12_p12t*( p12t_stark**2*a**2 + p12_starp**2*ap**2 ) \
        + 1/3*p12_p12t*a**2*ap**2*Sspher(t,0,0,0,0) + 2/3*a**2*ap**2*Uspher(t,u,0,0,0,0)

    elif lp == mp == 0 and l == 2:
        out = 2/5*p12_p3t*y2real(pstark_vec,m) + 1/10*p12_p12t*y2real(p12t_stark_vec,m) \
        + p12_p12t*ap**2*Sspher(t,0,0,2,m) + 2*ap**2*Uspher(t,u,0,0,2,m) # removed a^2=qk*^2 factor (no q)
        # factor of 1/sqrt(15) that Steve has is inside Sspher and Uspher

    elif lp == 2 and l == m == 0:
        out = 2/5*p3_p12t*y2real(kstarp_vec,mp) + 1/10*p12_p12t*y2real(p12_starp_vec,mp) \
        + p12_p12t*a**2*Sspher(t,2,mp,0,0) + 2*a**2*Uspher(t,u,2,mp,0,0) # removed ap^2=qp*^2 factor (no q)
        # factor of 1/sqrt(15) that Steve has is inside Sspher and Uspher

    elif lp == l == 2:
        out = 3 * p12_p12t * Sspher(t, 2, mp, 2, m) + 6 * Uspher(
            t, u, 2, mp, 2, m)  # removed (ap*a)^2=(qk*qp*)^2 factor (no q)
        # factor of 1/15 that Steve has is inside Sspher and Uspher
    else:
        out = 0

        #out *= ap**lp * a**l   # q factors are NOT included here (no q)

    if out.imag > 1e-15:
        print('Error: imaginary part in K3cubicB')
    return out.real