Update aplK.py
This commit is contained in:
parent
83d55f8fd5
commit
d75b8e9d03
13
aplK.py
13
aplK.py
@ -80,7 +80,18 @@ class AplN(DifferentialGCAlgebra_multigraded, UniqueRepresentation):
|
|||||||
- A polynomial
|
- A polynomial
|
||||||
"""
|
"""
|
||||||
if (value in QQ) or ((value in A) and (value.degree().is_zero())):
|
if (value in QQ) or ((value in A) and (value.degree().is_zero())):
|
||||||
return value*factorial(self.n)*prod(self.gens()[self.n+2:])
|
#return value*factorial(self.n)*prod(self.gens()[self.n+2:])
|
||||||
|
|
||||||
|
gens = self.gens()
|
||||||
|
tExp = [randint(0,3) for i in range(self.n+1)]
|
||||||
|
yExp = [0]+[1]*self.n
|
||||||
|
exp = tuple(tExp + yExp)
|
||||||
|
#print(value, " - ", exp, flush=True)
|
||||||
|
numerator = factorial(sum(tExp)+self.n)
|
||||||
|
denominator = prod([factorial(e) for e in tExp])
|
||||||
|
coef = value*QQ(numerator)/QQ(denominator)
|
||||||
|
return coef*self.get_term(self, 1, exp, gens)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
raise ValueError("only field elements can be integrated.")
|
raise ValueError("only field elements can be integrated.")
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user