Ejemplo n.º 1
0
def radial_wave_func(n, l, r):
    # a=c.physical_constants['Bohr radius'][0]
    n = str(n)
    l = str(l)
    nl = n + l
    A = a[nl]
    B = bohr(nl, r)
    C = c(nl, r)
    output = round(A * B * C, 5)
    return output
Ejemplo n.º 2
0
def angular_wave_func(m, l, theta, phi):
    m = str(m)
    l = str(l)
    ml = m + l
    Ax = "a" + ml
    A = round(a(Ax, m), 5)
    B = round(b(ml, theta), 5)
    C = round(c(m, theta), 5)
    D = round(d(m, phi), 5)

    Y = round(A * B * C * D, 5)
    return Y
Ejemplo n.º 3
0
def radial_wave_func(n,l,r):
    import scipy.constants as c
    # global constants
    b = c.physical_constants['Bohr radius'][0]  # Bohr's radius
    # normalised means just the term a^(-3/2) is 1
    a = {
        "10": 2,
        "20": np.sqrt(1 / 2),
        "21": np.sqrt(1 / 24),
        "30": np.sqrt(4 / 19683),
        "31": np.sqrt(64 / 4374),
        "32": np.sqrt(16 / 196830),
        "40": np.sqrt(1 / 16),
        "41": np.sqrt(5 / 768),
        "42": np.sqrt(1 / 20480),
        "43": np.sqrt(1 / 20643840)
    }

    def bohr(x1, x2):  # x1 - name     x2 - r(float)
        if (x1 == "10"):
            output = 1
            return output
        elif (x1 == "20"):
            output = 1 - (x2 / (2 * b))
            return output
        elif (x1 == "21"):
            output = x2 / b
            return output
        elif (x1 == "30"):
            output = 27 - (18 * (x2 / b)) + (2 * ((x2 / b) ** 2))
            return output
        elif (x1 == "31"):
            output = (1 - (x2 / (6 * b))) * (x2 / b)
            return output
        elif (x1 == "32"):
            output = (x2 / b) ** 2
            return output
        elif (x1 == "40"):
            output = 1 - ((3 / 4) * (x2 / b)) + ((1 / 8) * ((x2 / b) ** 2)) - ((1 / 192) * ((x2 / b) ** 3))
            return output
        elif (x1 == "41"):
            output = (x2 / b) * (1 - ((1 / 4) * (x2 / b)) + ((1 / 80) * ((x2 / b) ** 2)))
            return output
        elif (x1 == "42"):
            output = ((x2 / b) ** 2) * (1 - (1 / 12) * (x2 / b))
            return output
        elif (x1 == "43"):
            output = (x2 / b) ** 3
            return output
        else:
            print("value B error")
            return

    def c(x1, x2):  # x1 - name      x2 - r(float)
        x1 = int(x1[0])
        output = np.exp((-1) * (x2 / (x1 * b)))
        return output

    # a=c.physical_constants['Bohr radius'][0]
    n = str(n)
    l = str(l)
    nl = n + l
    A = a[nl]
    B = bohr(nl, r)
    C = c(nl, r)
    output = round(A * B * C, 5)
    return output
Ejemplo n.º 4
0
def angular_wave_func(m,l,theta,phi):
    # y= a * b * c * d
    # global constants
    pi = math.pi
    # constants for a
    aDict = {
        "a00": np.sqrt(1 / (4 * pi)),
        "a01": np.sqrt(3 / (4 * pi)),
        "a02": np.sqrt(5 / (16 * pi)),
        "a03": np.sqrt(7 / (16 * pi)),
        "a11": np.sqrt(3 / (8 * pi)),
        "a12": np.sqrt(15 / (8 * pi)),
        "a13": np.sqrt(21 / (64 * pi)),
        "a22": np.sqrt(15 / (32 * pi)),
        "a23": np.sqrt(105 / (32 * pi)),
        "a33": np.sqrt(35 / (64 * pi))
    }

    def a(x1, x2):  # x1 - dictionary input   x2 - m
        x2 = int(x2)

        if (x2 == 1) or (x2 == 3):
            neg = -1
        else:
            neg = 1

        output = neg * aDict[x1]
        return output

    # constants for b
    def b(x1, x2):  # x1 - ml(str)     x2 - theta(int)
        x2 = float(x2)
        if x1 == "00":
            b00 = float(1)
            return b00
        elif x1 == "01":
            b01 = float(np.cos(x2))
            return b01
        elif x1 == "02":
            b02 = float((3 * (np.cos(x2) ** 2)) - 1)
            return b02
        elif x1 == "03":
            b03 = float((5 * (np.cos(x2) ** 3)) - (3 * np.cos(x2)))
            return b03
        elif x1 == "11":
            b11 = float(1)
            return b11
        elif x1 == "12":
            b12 = float(np.cos(x2))
            return b12
        elif x1 == "13":
            b13 = float((5 * (np.cos(x2)) ** 2) - 1)
            return b13
        elif x1 == "22":
            b22 = float(1)
            return b22
        elif x1 == "23":
            b23 = float(np.cos(x2))
            return b23
        elif x1 == "33":
            b33 = float(1)
            return b33
        else:
            print("variable b error")
            return

    def c(x1, x2):  # x1 - m(str)  x2 - theta(int)
        x1 = abs(int(x1))
        output = float((np.sin(x2)) ** x1)
        return output

    def d(x1, x2):  # x1 - m(str)     x2 - phi(int)
        x1 = int(x1)
        x = x2 * x1
        output = np.cos(x) + (1j) * round(np.sin(x), 5)
        return output

    m = str(m)
    l = str(l)
    ml = m + l
    Ax = "a" + ml
    A = round(a(Ax, m), 5)
    B = round(b(ml, theta), 5)
    C = round(c(m, theta), 5)
    D = round(d(m, phi), 5)

    Y = round(A * B * C * D, 5)
    return Y