Example #1
0
File: csh.py Project: qsnake/gpaw
def intYY_ey(l1, m1, l2, m2):
    """Calculates::

                  pi 2pi
                  /  /      *
           A    = |  |    Y (u,v) sin(u)*sin(v) Y (u,v) sin(u) dv du
            LL'   /  /     lm                    l'm'
                  0  0

    where u = theta and v = phi in the usual notation. Note that the result
    is only non-zero if `|l1-l2|` = 1 and `|m1-m2|` = 1.
    """
    if abs(l1-l2) != 1 or abs(m1-m2) != 1:
        return 0.0
    scale = C(l1,m1)*C(l2,m2)*np.sign(m1-m2)*np.pi/1j
    if abs(m1) == abs(m2)+1:
        return scale*np.sign(l1-l2)/(2.*l2+1.)*ilegendre(l1,m1)
    else:
        assert abs(m1) == abs(m2)-1
        return scale*np.sign(l2-l1)/(2.*l1+1.)*ilegendre(l2,m2)
Example #2
0
def intYY_ey(l1, m1, l2, m2):
    """Calculates::

                  pi 2pi
                  /  /      *
           A    = |  |    Y (u,v) sin(u)*sin(v) Y (u,v) sin(u) dv du
            LL'   /  /     lm                    l'm'
                  0  0

    where u = theta and v = phi in the usual notation. Note that the result
    is only non-zero if `|l1-l2|` = 1 and `|m1-m2|` = 1.
    """
    if abs(l1-l2) != 1 or abs(m1-m2) != 1:
        return 0.0
    scale = C(l1,m1)*C(l2,m2)*np.sign(m1-m2)*np.pi/1j
    if abs(m1) == abs(m2)+1:
        return scale*np.sign(l1-l2)/(2.*l2+1.)*ilegendre(l1,m1)
    else:
        assert abs(m1) == abs(m2)-1
        return scale*np.sign(l2-l1)/(2.*l1+1.)*ilegendre(l2,m2)
Example #3
0
File: rsh.py Project: qsnake/gpaw
def intYY(l1, m1, l2, m2):
    """Calculates::

                  pi 2pi
                  /  /
           A    = |  |    y (u,v) y (u,v) sin(u) dv du
            LL'   /  /     lm      l'm'
                  0  0

    where u = theta and v = phi in the usual notation. Note that the result
    is only non-zero if l1 = l2 and m1 = m2.
    """
    if (l1,m1) == (l2,m2):
        return C(l1,m1)**2*2*np.pi*ilegendre(l1,m1) # == 1 always, XXX right?
    else:
        return 0.0
Example #4
0
File: csh.py Project: qsnake/gpaw
def intYY_ez(l1, m1, l2, m2):
    """Calculates::

                  pi 2pi
                  /  /      *
           A    = |  |    Y (u,v) cos(u) Y (u,v) sin(u) dv du
            LL'   /  /     lm             l'm'
                  0  0

    where u = theta and v = phi in the usual notation. Note that the result
    is only non-zero if `|l1-l2|` = 1 and m1 = m2.
    """
    if abs(l1-l2) != 1 or m1 != m2:
        return 0.0
    scale = C(l1,m1)*C(l2,m2)*2*np.pi
    return scale*(l2-np.sign(l1-l2)*abs(m1)+heaviside(l1-l2))/(2.*l2+1.)*ilegendre(l1,m1)
Example #5
0
def intYY_ez(l1, m1, l2, m2):
    """Calculates::

                  pi 2pi
                  /  /      *
           A    = |  |    Y (u,v) cos(u) Y (u,v) sin(u) dv du
            LL'   /  /     lm             l'm'
                  0  0

    where u = theta and v = phi in the usual notation. Note that the result
    is only non-zero if `|l1-l2|` = 1 and m1 = m2.
    """
    if abs(l1-l2) != 1 or m1 != m2:
        return 0.0
    scale = C(l1,m1)*C(l2,m2)*2*np.pi
    return scale*(l2-np.sign(l1-l2)*abs(m1)+heaviside(l1-l2))/(2.*l2+1.)*ilegendre(l1,m1)
Example #6
0
def intYY(l1, m1, l2, m2):
    """Calculates::

                  pi 2pi
                  /  /      *
           A    = |  |    Y (u,v) Y (u,v) sin(u) dv du
            LL'   /  /     lm      l'm'
                  0  0

    where u = theta and v = phi in the usual notation. Note that the result
    is only non-zero if l1 = l2 and m1 = m2.
    """
    if (l1,m1) == (l2,m2):
        return C(l1,m1)**2*2*np.pi*ilegendre(l1,m1) # == 1 always, XXX right?
    else:
        return 0.0
Example #7
0
def intYdYdtheta_ez(l1, m1, l2, m2):
    """Calculates::

                     pi 2pi
                     /  /      *             d Y(u,v)
           A    =  - |  |    Y (u,v) sin(u) --- l'm'  sin(u) dv du
            LL'      /  /     lm             du  
                     0  0

    where u = theta and v = phi in the usual notation. Note that the result
    is only non-zero if `|l1-l2|` = 1 and m1 = m2.
    """
    if abs(l1 - l2) != 1 or m1 != m2:
        return 0.0
    scale = -C(l1, m1) * C(l2, m2) * 2 * np.pi
    return scale * np.sign(l1 - l2) * (l2 + 1 - heaviside(l1 - l2)) * (
        l2 - np.sign(l1 - l2) * abs(m1) +
        heaviside(l1 - l2)) / (2 * l2 + 1) * ilegendre(l1, m1)
Example #8
0
File: csh.py Project: qsnake/gpaw
def intYdYdtheta_ez(l1, m1, l2, m2):
    """Calculates::

                     pi 2pi
                     /  /      *             d Y(u,v)
           A    =  - |  |    Y (u,v) sin(u) --- l'm'  sin(u) dv du
            LL'      /  /     lm             du  
                     0  0

    where u = theta and v = phi in the usual notation. Note that the result
    is only non-zero if `|l1-l2|` = 1 and m1 = m2.
    """
    if abs(l1-l2) != 1 or m1 != m2:
        return 0.0
    scale = -C(l1,m1)*C(l2,m2)*2*np.pi
    return scale*np.sign(l1-l2)*(l2+1-heaviside(l1-l2))*(l2-np.sign(l1-l2)*abs(m1)+heaviside(l1-l2))/(2*l2+1)*ilegendre(l1,m1)