1 | initial version |
It is hard to understand what is going wrong on the road. The code is doing some checks, and one of them is failing. The following code tries to reproduce what the code would have done, when going into it step for step.
from sage.algebras import commutative_dga as cdga
D.<y> = GradedCommutativeAlgebra(QQ, degrees = (2,))
d = D.differential({y: 0})
E = D.cdg_algebra(d)
E.inject_variables() # make y known to the world, just to be sure we have the right y...
J = E.ideal(y^3)
AQ = cdga.GCAlgebra.quotient(E, J, check=False)
dic = {AQ(a) : AQ(a.differential()) for a in E.gens()}
Q = AQ.cdg_algebra(dic)
And it works... For instance:
sage: for k in [0..5]:
....: print(f"{k = } {Q(y)^k = }")
....:
k = 0 Q(y)**k = 1
k = 1 Q(y)**k = y
k = 2 Q(y)**k = y^2
k = 3 Q(y)**k = 0
k = 4 Q(y)**k = 0
k = 5 Q(y)**k = 0
sage: Q.differential(y)
Differential of Commutative Differential Graded Algebra with generators ('y',) in degrees (2,) with relations [y^3] over Rational Field
Defn: y --> 0
sage: Q.differential()(y)
0
sage:
The explicit code above is avoiding the many self
occurrences in the original code... There must be a related bug in there, that must be fixed... (I never got involved in such bug fixes, but maybe i should start doing it...)