Skip to content

Commit 50cfa54

Browse files
author
Release Manager
committed
gh-37146: Fix a bug in reduction of element modulo ideal in exterior algebra <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes #1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> This adds a loop to continue doing reduction modulo a Grobner basis for an element modulo an ideal in the exterior algebra. This guarantees a unique representative for each element, and that representative will be $0$ if the element is in the ideal. This fixes #37108. <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes #12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - #12345: short description why this is a dependency - #34567: ... --> None. <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #37146 Reported by: trevorkarn Reviewer(s): Travis Scrimshaw
2 parents ebeb7a2 + fa766d2 commit 50cfa54

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

src/sage/algebras/exterior_algebra_groebner.pyx

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,13 +477,30 @@ cdef class GroebnerStrategy:
477477
0
478478
sage: I._groebner_strategy.reduce(E.zero())
479479
0
480+
481+
Check :issue:`37108` is fixed::
482+
483+
sage: E = ExteriorAlgebra(QQ, 6)
484+
sage: E.inject_variables(verbose=False)
485+
sage: gens = [-e0*e1*e2 + e0*e1*e5 - e0*e2*e3 - e0*e3*e5 + e1*e2*e3 + e1*e3*e5,
486+
....: e1*e2 - e1*e5 + e2*e5, e0*e2 - e0*e4 + e2*e4,
487+
....: e3*e4 - e3*e5 + e4*e5, e0*e1 - e0*e3 + e1*e3]
488+
sage: I = E.ideal(gens)
489+
sage: S = E.quo(I)
490+
sage: I.reduce(e1*e3*e4*e5)
491+
0
480492
"""
481493
if not f:
482494
return f
483495
# Make a copy to mutate
484496
f = type(f)(f._parent, copy(f._monomial_coefficients))
485-
for g in self.groebner_basis:
486-
self.reduce_single(f, g)
497+
was_reduced = True
498+
while was_reduced:
499+
was_reduced = False
500+
for g in self.groebner_basis:
501+
was_reduced = self.reduce_single(f, g)
502+
if was_reduced:
503+
break
487504
return f
488505

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

0 commit comments

Comments
 (0)