Hi Trevor, thank you for reporting this bug. This is indeed a problem, as the implementation is written only with the commutative case in mind. We should make sure that it is called in that case only.
As for your proposed fix, I am afraid I am not so familiar with the non-commutative theory myself, so I would value another opinion on this or a reference to some literature that covers this specifically. Trevor Karn schrieb am Montag, 18. Oktober 2021 um 19:28:39 UTC+2: > I forgot to add that Sage does recognize that f(a1*b2) is nonzero: > > sage: f(a1*a2) > b1*b2 > > > On Monday, October 18, 2021 at 12:21:47 PM UTC-5 Trevor Karn wrote: > >> Hi all, >> >> It looks like I have found a bug in the `.kernel()` method of a ring >> homomorphism from one `GradedCommutativeAlgebra` to another. I think I >> have identified the issue, but was hoping to post here for confirmation >> that my thinking makes sense before opening a trac ticket and working on a >> fix. >> >> *The bug:* let A, B be `GradedCommutativeAlgebra`s each generated by two >> elements (a_1, a_2 and b_1, b_2 respectively) of degree-1 (so A,B are >> exterior algebras). Define a homomorphism f: A -> B taking a_1 -> b_1 and >> a_2 -> b_1 + b_2. >> >> Then f(a_1a_2) = f(a_1)f(a_2) = b_1(b_1+b_2) = b_1^2 + b_1b_2 = 0 + b_1b2 >> =/= 0. >> >> When I perform the same computation in Sage, I get: >> >> sage: A = GradedCommutativeAlgebra(QQ,['a1','a2'], (1,1)) >> sage: B = GradedCommutativeAlgebra(QQ,['b1','b2'], (1,1)) >> sage: A.inject_variables(); >> sage: B.inject_variables(); >> sage: f = A.hom([b1, b1+b2], codomain=B) >> sage: f.kernel() >> Twosided Ideal (0, a1*a2, 0) of Graded Commutative Algebra with >> generators ('a1', 'a2') in degrees (1, 1) over Rational Field >> >> which I believe to be incorrect by my computation above. >> >> *What I think is going wrong:* >> When computing the kernel, the graph ideal is computed as an ideal in the >> tensor product ring of the domain tensored with the codomain. In >> constructing this it uses a (commutative) polynomial ring and takes a >> quotient. In creating the commutative polynomial ring the >> `.defining_ideal().gens()` method is called on the domain. The >> `.defining_ideal()` for a noncommutative ring has generators and relations, >> but calling the `.gens()` method accesses the generators only. For example: >> >> sage: A.defining_ideal() >> Twosided Ideal (a1^2, a2^2) of Noncommutative Multivariate Polynomial >> Ring in a1, a2 over Rational Field, nc-relations: {a2*a1: -a1*a2} >> sage: A.defining_ideal().gens() >> (a1^2, a2^2) >> >> And so the relation that a2*a1 = - a1*a2 is forgotten in the tensor >> product ring. >> >> *My proposed fix:* >> Add a function in sage.rings.morphism that computes the tensor product >> ring when the two rings are noncommutative, then add a check inside of >> graph_ideal to call _tensor_product_ring_nc as opposed to >> _tensor_product_ring. >> >> Does this seem like a reasonable plan, or is there a better approach? >> >> Thanks! >> >> -Trevor >> >> >> >> -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/b1e6ed6e-127f-4579-8f9b-889c8c64f5f7n%40googlegroups.com.