lime/ToBeErased/FranckCondon/DiffFreqs.py
def diffFreqOverlap(Ln, Lm, d):
    """ Ln and Lm are lists where L[0] is the state number, L[1]
        is the frequency in wavenumbers.
        d is the change in normal coordinate (in bohr)
    """

    # If the excited state frequency (Ln[1]) is greater than the ground state
    # frequency (Lm[1]) then we must swap Ln and Lm for the program, but then
    # take the absolute value of the result.
    if (Ln[1] > Lm[1]):
        Ln, Lm = Lm, Ln

    n = Ln[0]
    m = Lm[0]
    wn_wavenumbers = Ln[1]
    wm_wavenumbers = Lm[1]

    wn = wn_wavenumbers/8065.5/27.2116
    wm = wm_wavenumbers/8065.5/27.2116
    f = wn/wm
    # w = wm

    # F is the (massless) force constant for the mode. But which w?
    # F = w ** 2

    #convertedQSquared = deltaQ**2/(6.02214*(10**23) * 9.1094*(10**-28))
    convertedQSquared = d**2



    # X is defined as such in Siders, Marcus 1981 Average frequency?
    X = convertedQSquared / 2
    P0 = (-1)**(m+n) # Should data be alternating plus minus?

    P1 = sqrt(2*sqrt(f)/(1.0+f))
    P2 = ((2**(m+n) * factorial(m) * factorial(n))**(-0.5)
          * exp(-X*f/(1.0+f)))
    P3 = (abs((1-f)/(1+f)))**((float(m)+n)/2.0)

    l = min(m,n)
    P4 = 0
    for i in range(l+1):
        #In Siders and Marcus's 'F_n(x)' is equal to my G(x)
        G = iHermite(n-i)
        # G = hermite(n-i)
        H = hermite(m-i)
        P4 += ((factorial(m)*factorial(n) /
                (float(factorial(i))*float(factorial(m-i))*float(factorial(n-i)))) *
               (4*sqrt(f)/abs(1-f))**i
               * H(sqrt(abs(2*X*f/(1-f**2))))
               * G(f*sqrt(abs(2*X/(1-f**2))))
               )
    fc = P0*P1*P2*P3*P4
    return fc
 Ln and Lm are lists where L[0] is the state number, L[1]
        is the frequency in wavenumbers.
        d is the change in normal coordinate (in bohr)
    
Ln and Lm are lists where L[0] is the state number, L[1]
is the frequency in wavenumbers.
d is the change in normal coordinate (in bohr)
Ln and Lm are lists where L [ 0 ] is the state number L [ 1 ] is the frequency in wavenumbers . d is the change in normal coordinate ( in bohr )
def diffFreqOverlap(Ln, Lm, d):
    if (Ln[1] > Lm[1]):
        Ln, Lm = Lm, Ln
    n = Ln[0]
    m = Lm[0]
    wn_wavenumbers = Ln[1]
    wm_wavenumbers = Lm[1]
    wn = wn_wavenumbers/8065.5/27.2116
    wm = wm_wavenumbers/8065.5/27.2116
    f = wn/wm
    convertedQSquared = d**2
    X = convertedQSquared / 2
    P0 = (-1)**(m+n) 
    P1 = sqrt(2*sqrt(f)/(1.0+f))
    P2 = ((2**(m+n) * factorial(m) * factorial(n))**(-0.5)
          * exp(-X*f/(1.0+f)))
    P3 = (abs((1-f)/(1+f)))**((float(m)+n)/2.0)
    l = min(m,n)
    P4 = 0
    for i in range(l+1):
        G = iHermite(n-i)
        H = hermite(m-i)
        P4 += ((factorial(m)*factorial(n) /
                (float(factorial(i))*float(factorial(m-i))*float(factorial(n-i)))) *
               (4*sqrt(f)/abs(1-f))**i
               * H(sqrt(abs(2*X*f/(1-f**2))))
               * G(f*sqrt(abs(2*X/(1-f**2))))
               )
    fc = P0*P1*P2*P3*P4
    return fc
def diffFreqOverlap ( Ln , Lm , d ) : if ( Ln [ 1 ] > Lm [ 1 ] ) : Ln , Lm = Lm , Ln n = Ln [ 0 ] m = Lm [ 0 ] wn_wavenumbers = Ln [ 1 ] wm_wavenumbers = Lm [ 1 ] wn = wn_wavenumbers / 8065.5 / 27.2116 wm = wm_wavenumbers / 8065.5 / 27.2116 f = wn / wm convertedQSquared = d ** 2 X = convertedQSquared / 2 P0 = ( - 1 ) ** ( m + n ) P1 = sqrt ( 2 * sqrt ( f ) / ( 1.0 + f ) ) P2 = ( ( 2 ** ( m + n ) * factorial ( m ) * factorial ( n ) ) ** ( - 0.5 ) * exp ( - X * f / ( 1.0 + f ) ) ) P3 = ( abs ( ( 1 - f ) / ( 1 + f ) ) ) ** ( ( float ( m ) + n ) / 2.0 ) l = min ( m , n ) P4 = 0 for i in range ( l + 1 ) : G = iHermite ( n - i ) H = hermite ( m - i ) P4 += ( ( factorial ( m ) * factorial ( n ) / ( float ( factorial ( i ) ) * float ( factorial ( m - i ) ) * float ( factorial ( n - i ) ) ) ) * ( 4 * sqrt ( f ) / abs ( 1 - f ) ) ** i * H ( sqrt ( abs ( 2 * X * f / ( 1 - f ** 2 ) ) ) ) * G ( f * sqrt ( abs ( 2 * X / ( 1 - f ** 2 ) ) ) ) ) fc = P0 * P1 * P2 * P3 * P4 return fc
Ln and Lm are lists where L[0] is the state number, L[1]
is the frequency in wavenumbers.
Ln and Lm are lists where L [ 0 ] is the state number L [ 1 ] is the frequency in wavenumbers .
""" Ln and Lm are lists where L[0] is the state number, L[1]
        is the frequency in wavenumbers.
        d is the change in normal coordinate (in bohr)
    """ # If the excited state frequency (Ln[1]) is greater than the ground state # frequency (Lm[1]) then we must swap Ln and Lm for the program, but then # take the absolute value of the result. # w = wm # F is the (massless) force constant for the mode. But which w? # F = w ** 2 #convertedQSquared = deltaQ**2/(6.02214*(10**23) * 9.1094*(10**-28)) # X is defined as such in Siders, Marcus 1981 Average frequency? # Should data be alternating plus minus? #In Siders and Marcus's 'F_n(x)' is equal to my G(x) # G = hermite(n-i)
Ln
Lm
d