Can you give a specific example of a computation in which you care about the degree where your zero element lives? Or where you can't just recover it from its component elements (if ab=0, then you have an element in degree = deg(a) + deg(b)). I'm struggling to understand this.
If you are doing the same check repeatedly, then write a little function to do it and then you have a one-line call to that function scattered around your code, which doesn't seem like that big a deal to me. Alternatively, and I know this isn't how we like to think about these things, but what goes wrong if you allow nonhomogeneous elements? That could be another way to simplify things. - John On Saturday, July 18, 2020 at 3:28:56 PM UTC-7, Sverre Lunøe-Nielsen wrote: > > > On Saturday, July 18, 2020 at 11:31:43 PM UTC+2, John H Palmieri wrote: >> >> In any case where the degree matters, you should first test whether an >> element is zero (in which case it won't have a degree) and then perhaps >> whether it is homogeneous. If not, you can raise an error (to keep someone >> from multiplying a module element by Sq(1) + Sq(2), for example). If it is >> homogeneous, you can proceed the way you want. >> > > This is indeed what we do in the current version. However, I have come to > think of this as some kind of anti-pattern, so I am seeking ways to avoid > it. > > On Saturday, July 18, 2020 at 11:57:21 PM UTC+2, Christian Nassau wrote: > > I don't think it's a good idea to have different zeroes in an algebraic > structure that is also categorized as an abelian group, unless you take the > point that a "graded abelian group" should not be an "abelian group". > > Yes, as I outlined, they should definitely be living in a category where > the objects are sequences of k-vectorspaces with the structure maps that > make them k-algebras. But the data that goes into defining an algebra this > way is no different from usual. > > > - Sverre > -- 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/1c0dbd4e-b019-4199-88b6-01f35559a679o%40googlegroups.com.