Skip to content

Commit

Permalink
Initial commit of fix for sagemath#37108
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorkarn committed Jan 23, 2024
1 parent 3dd953c commit 3e06400
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions src/sage/algebras/exterior_algebra_groebner.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -477,13 +477,32 @@ cdef class GroebnerStrategy:
0
sage: I._groebner_strategy.reduce(E.zero())
0
Check #37108 is fixed::
sage: E = ExteriorAlgebra(QQ, 6)
....: E.inject_variables(verbose=False)
....: gens = [-e0*e1*e2 + e0*e1*e5 - e0*e2*e3 - e0*e3*e5 + e1*e2*e3 + e1*e3*e5,
....: e1*e2 - e1*e5 + e2*e5,
....: e0*e2 - e0*e4 + e2*e4,
....: e3*e4 - e3*e5 + e4*e5,
....: e0*e1 - e0*e3 + e1*e3]
....: I = E.ideal(gens)
....: S = E.quo(I)
....: I.reduce(e1*e3*e4*e5)
0
"""
if not f:
return f
# Make a copy to mutate
f = type(f)(f._parent, copy(f._monomial_coefficients))
for g in self.groebner_basis:
self.reduce_single(f, g)
was_reduced = True
while was_reduced:
was_reduced = False
for g in self.groebner_basis:
was_reduced = self.reduce_single(f, g)
if was_reduced:
break
return f

cdef bint reduce_single(self, CliffordAlgebraElement f, CliffordAlgebraElement g) except -1:
Expand Down

0 comments on commit 3e06400

Please sign in to comment.