Beispiel #1
0
def norm_slater_cartesian(a, b, c, n, exp):
    """Normaliation of STos with cartesian harmonics. \n
     * Monte Carlo Methods in Ab Initio Quantum Chemistry page 279

    Args:
        a (torch.tensor): exponent of x
        b (torch.tensor): exponent of y
        c (torch.tensor): exponent of z
        n (torch.tensor): exponent of r
        exp (torch.tensor): Sater exponent 

    Returns:
        torch.tensor: normalization factor
    """
    from scipy.special import factorial2 as f2

    lvals = a + b + c + n + 1.

    lfact = torch.tensor([np.math.factorial(2 * i)
                          for i in lvals]).type(torch.get_default_dtype())

    prefact = 4 * np.pi * lfact / ((2 * exp)**(2 * lvals + 1))

    num = torch.tensor(
        f2(2 * a.astype('int') - 1) * f2(2 * b.astype('int') - 1) *
        f2(2 * c.astype('int') - 1)).type(torch.get_default_dtype())

    denom = torch.tensor(f2((2 * a + 2 * b + 2 * c + 1).astype('int'))).type(
        torch.get_default_dtype())

    return torch.sqrt(1. / (prefact * num / denom))
Beispiel #2
0
def norm_gaussian_cartesian(a, b, c, exp):
    """Normaliation of GTOs with cartesian harmonics. \n
     * Monte Carlo Methods in Ab Initio Quantum Chemistry page 279

    Args:
        a (torch.tensor): exponent of x
        b (torch.tensor): exponent of y
        c (torch.tensor): exponent of z
        exp (torch.tensor): Sater exponent 

    Returns:
        torch.tensor: normalization factor
    """

    from scipy.special import factorial2 as f2

    pref = torch.tensor((2 * exp / np.pi)**(0.75))
    am1 = (2 * a - 1).astype('int')
    x = (4 * exp)**(a / 2) / torch.sqrt(torch.tensor(f2(am1)))

    bm1 = (2 * b - 1).astype('int')
    y = (4 * exp)**(b / 2) / torch.sqrt(torch.tensor(f2(bm1)))

    cm1 = (2 * c - 1).astype('int')
    z = (4 * exp)**(c / 2) / torch.sqrt(torch.tensor(f2(cm1)))

    return (pref * x * y * z).type(torch.get_default_dtype())
Beispiel #3
0
 def _norm_gaussian_cart(self):
     '''Normlization of cartesian gaussian functions
     taken from http://www.chem.unifr.ch/cd/lectures/files/module5.pdf
     '''
     from scipy.special import factorial2 as f2
     L = self.lmn_cart.sum(1)
     num = 2**L * self.bas_coeffs**((2 * L + 3) / 4)
     denom = torch.sqrt(f2(2 * self.lmn - 1).prod(1))
     return (2. / np.pi)**(3. / 4.) * num / denom
Beispiel #4
0
def norm_gaussian_cartesian(a, b, c, exp):
    """normaliation of cartesian gaussian
    Monte Carlo Methods in Ab Initio Quantum Chemistry page 280

    Arguments:
        a {[type]} -- exponent of x
        b {[type]} --  exponent of y
        c {[type]} --  exponent of z
        exp {[type]} -- coefficient of the expo
    """

    from scipy.special import factorial2 as f2

    pref = torch.tensor((2 * exp / np.pi)**(0.75))
    x = (4 * exp)**(a / 2) / torch.sqrt(
        torch.tensor(f2(
            (2 * a - 1).astype('int')))).type(torch.get_default_dtype())
    y = (4 * exp)**(b / 2) / torch.sqrt(
        torch.tensor(f2(
            (2 * b - 1).astype('int')))).type(torch.get_default_dtype())
    z = (4 * exp)**(c / 2) / torch.sqrt(
        torch.tensor(f2(
            (2 * c - 1).astype('int')))).type(torch.get_default_dtype())
    return pref * x * y * z
Beispiel #5
0
def norm_slater_cartesian(a, b, c, n, exp):
    """normaliation of cartesian slater
    Monte Carlo Methods in Ab Initio Quantum Chemistry page 279

    Arguments:
        a {[type]} -- exponent of x
        b {[type]} --  exponent of y
        c {[type]} --  exponent of z
        n {[type]} --  exponent of r
        exp {[type]} -- coefficient of the expo
    """
    from scipy.special import factorial2 as f2

    l = a + b + c + n + 1.
    lfact = torch.tensor([np.math.factorial(2 * i)
                          for i in l]).type(torch.get_default_dtype())
    prefact = 4 * np.pi * lfact / ((2 * exp)**(2 * l + 1))
    num = torch.tensor(
        f2(2 * a.astype('int') - 1) * f2(2 * b.astype('int') - 1) *
        f2(2 * c.astype('int') - 1)).type(torch.get_default_dtype())
    denom = torch.tensor(f2((2 * a + 2 * b + 2 * c + 1).astype('int'))).type(
        torch.get_default_dtype())

    return torch.sqrt(1. / (prefact * num / denom))
Beispiel #6
0
def norm_gaussian_spherical(bas_n, bas_exp):
    """ Normlization of GTOs.
    [1] Computational Quantum Chemistry: An interactive Intrduction to basis set theory
        eq : 1.14 page 23.'''

    Returns:
        torch.tensor -- normalization factor
    """

    from scipy.special import factorial2 as f2

    bas_n = bas_n + 1.
    exp1 = 0.25 * (2. * bas_n + 1.)

    A = bas_exp**exp1
    B = 2**(2. * bas_n + 3. / 2)
    C = torch.tensor(f2(2 * bas_n.int() - 1) * np.pi**0.5).type(
        torch.get_default_dtype())

    return torch.sqrt(B / C) * A
Beispiel #7
0
def norm_gaussian_spherical(bas_n, bas_exp):
    """Normlization of GTOs with spherical harmonics. \n
     * Computational Quantum Chemistry: An interactive Intrduction to basis set theory \n
        eq : 1.14 page 23.

    Args:
        bas_n (torch.tensor): prinicpal quantum number
        bas_exp (torch.tensor): slater exponents

    Returns:
        torch.tensor: normalization factor
    """

    from scipy.special import factorial2 as f2

    bas_n = bas_n + 1.
    exp1 = 0.25 * (2. * bas_n + 1.)

    A = bas_exp**exp1
    B = 2**(2. * bas_n + 3. / 2)
    C = torch.tensor(f2(2 * bas_n.int() - 1) * np.pi**0.5).type(
        torch.get_default_dtype())

    return torch.sqrt(B / C) * A