Skip to content

Commit

Permalink
src/sage/quivers/algebra_elements.pyx: Fix handling of 0 elements in …
Browse files Browse the repository at this point in the history
…multiplication
  • Loading branch information
Matthias Koeppe committed Mar 9, 2024
1 parent 2bd14d6 commit 90d480e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/sage/quivers/algebra_elements.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1196,6 +1196,8 @@ cdef class PathAlgebraElement(RingElement):
sage: z*3
3*a + 6*b + 9*e_2
"""
if self.data == NULL:
return self
cdef path_homog_poly_t * out = homog_poly_scale(self.data, right)
cdef path_homog_poly_t * outnxt
if out.poly.nterms == 0:
Expand Down Expand Up @@ -1226,6 +1228,8 @@ cdef class PathAlgebraElement(RingElement):
sage: 3*z
3*a + 6*b + 9*e_2
"""
if self.data == NULL:
return self
cdef path_homog_poly_t * out = homog_poly_scale(self.data, left)
cdef path_homog_poly_t * outnxt
if out.poly.nterms == 0:
Expand Down Expand Up @@ -1312,7 +1316,11 @@ cdef class PathAlgebraElement(RingElement):
sage: pA^5 == sage_eval(repr(pF^5), A.gens_dict())
True
"""
if self.data == NULL:
return self
cdef PathAlgebraElement right = other
if right.data == NULL:
return right
cdef path_homog_poly_t *H1 = self.data
cdef path_homog_poly_t *H2
cdef path_term_t *T2
Expand Down

0 comments on commit 90d480e

Please sign in to comment.