예제 #1
0
def coef(l1, l2, l, p, n, algorithm=None):
    q = var('q')

    if p >= 0:
        result1 = q**(2*n*(l1+l2) + n)

        qpoch1 = qPochhammerSymbol([q**(-4*l2), q**(-4*l1 + 2*p)], q**2, n)
        qpoch2 = qPochhammerSymbol([q**2, q**(2*p + 2)], q**2, n)
        result2 = sqrt(qpoch1.evaluate() / qpoch2.evaluate())
        
        if p <= 2*l1 - 2*l2:
            result3 = dual_q_Hahn_polynomials( \
                n, l1 + l2 - l, q**(-4*l1 + 2*p - 2), \
                q**(-4*l2 - 2*p - 2), 2*l2, q**2 \
            )
        else:
            result3 = dual_q_Hahn_polynomials( \
                n, l1 + l2 - n, q**(-4*l2 - 2), \
                q**(-4*l1 - 2), 2**l1 - 2*p, q**2
            )

    else:
        return coef(l2, l1, l, -p, n)

    if algorithm == 'mathematica':
        return mathematica(result1*result2*result3).FullSimplify().sage() 
    return result1*result2*result3
예제 #2
0
def dual_q_Hahn_polynomials(n, x, c, d, N, q):
    if n != N:
        l1 = [q**(-n), q**(-x), c*d*q**(x + 1)]
        l2 = [c*q, q**(-N)]
        result = BasicHypergeometricSeries(l1, l2, q, q).evaluate()
    else:
        # For n = N we must understand the dual q-Hahn polynomials as
        # polynomials by continuity.
        result = 0
        for k in range(N + 1):
            qpoch1 = qPochhammerSymbol([q**(-x), c*d*q**(x + 1)], q, k)
            if qpoch1.evaluate() == 0:
                break
            qpoch2 = qPochhammerSymbol([c*q, q], q, k)
            result += qpoch1.evaluate() / qpoch2.evaluate() * q**k

    return result       
예제 #3
0
def new_normalized_cgc(l1, l2, l, p, n):
    q = var('q')

    sign = (-1)**(l1+l2-l)
    
    qpoch1 = qPochhammerSymbol(q**(-4*l2 - 2*p), q**2, 2*l2).evaluate()
    qpoch2 = qPochhammerSymbol([q**(-4*l1 + 2*p), q**(-4*l1 - 4*l2 - 2), \
        q**(-4*l2)], q**2, l1 + l2 - l).evaluate()
    qpoch3 = qPochhammerSymbol(q**(-4*l1 - 4*l2), q**2, 2*l2).evaluate()
    qpoch4 = qPochhammerSymbol([q**2, q**(-4*l1), q**(-4*l2 - 2*p)], q**2, \
        l1 + l2 - l).evaluate()
    line1 = sqrt(qpoch1 * qpoch2 / (qpoch3 * qpoch4))

    line2 = sqrt((1 - q**(-4*l - 2)) / (1 - q**(-4*l1 - 4*l2 - 2))) \
        * q**((l1+l2-l)*(2*l1+2*l2-p)+l2*(2*p-4*l1)-binomial(l1 + l2 - l, 2))

    qpoch5 = qPochhammerSymbol([q**(-4*l2), q**(-4*l1 + 2*p)], \
        q**2, n).evaluate()
    qpoch6 = qPochhammerSymbol([q**2, q**(2*p + 2)], q**2, n).evaluate()
    poly = dual_q_Hahn_polynomials(n, l1 + l2 - l, q**(-4*l1 + 2*p - 2), \
        q**(-4*l2 - 2*p - 2), 2*l2, q**2)
    line3 = q**((2*l1 + 2*l2 + 1)*n) * sqrt(qpoch5 / qpoch6) * poly

    return line1 * line2 * line3
예제 #4
0
def qbinomial(n, k, q):
    nominator = qPochhammerSymbol(q**n, q**(-1), k).evaluate()
    denominator = qPochhammerSymbol(q, q, k).evaluate()
    return nominator/denominator