From 3e06400d35d7b8f105e45e70ca9cfb3161d720b0 Mon Sep 17 00:00:00 2001 From: "Trevor K. Karn" Date: Mon, 22 Jan 2024 15:55:01 -0800 Subject: [PATCH] Initial commit of fix for #37108 --- .../algebras/exterior_algebra_groebner.pyx | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/sage/algebras/exterior_algebra_groebner.pyx b/src/sage/algebras/exterior_algebra_groebner.pyx index 265e9323536..f5aadb46772 100644 --- a/src/sage/algebras/exterior_algebra_groebner.pyx +++ b/src/sage/algebras/exterior_algebra_groebner.pyx @@ -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: