def _groebner(self, extended=False): """Returns a standard basis in sdm form.""" from sympy.polys.distributedmodules import sdm_groebner, sdm_nf_mora if self._gbe is None and extended: gb, gbe = sdm_groebner( [self.ring._vector_to_sdm(x, self.order) for x in self.gens], sdm_nf_mora, self.order, self.ring.dom, extended=True, ) self._gb, self._gbe = tuple(gb), tuple(gbe) if self._gb is None: self._gb = tuple( sdm_groebner( [self.ring._vector_to_sdm(x, self.order) for x in self.gens], sdm_nf_mora, self.order, self.ring.dom, ) ) if extended: return self._gb, self._gbe else: return self._gb
def _groebner(self, extended=False): """Returns a standard basis in sdm form.""" from sympy.polys.distributedmodules import sdm_groebner, sdm_nf_mora if self._gbe is None and extended: gb, gbe = sdm_groebner( [self.ring._vector_to_sdm(x, self.order) for x in self.gens], sdm_nf_mora, self.order, self.ring.dom, extended=True) self._gb, self._gbe = tuple(gb), tuple(gbe) if self._gb is None: self._gb = tuple(sdm_groebner( [self.ring._vector_to_sdm(x, self.order) for x in self.gens], sdm_nf_mora, self.order, self.ring.dom)) if extended: return self._gb, self._gbe else: return self._gb
def _groebner(self): """Returns a standard basis in sdm form.""" from sympy.polys.distributedmodules import sdm_groebner, sdm_nf_mora if self._gb is None: self._gb = tuple(sdm_groebner( [self.ring._vector_to_sdm(x, self.order) for x in self.gens], sdm_nf_mora, self.order, self.ring.dom)) return self._gb
def test_chain_criterion(): gens = [x] f1 = sdm_from_vector([1, x], grlex, QQ, gens=gens) f2 = sdm_from_vector([0, x - 2], grlex, QQ, gens=gens) assert len(sdm_groebner([f1, f2], sdm_nf_mora, grlex, QQ)) == 2
def contains(I, f): S = [sdm_from_vector([g], igrlex, QQ, gens=gens) for g in I] G = sdm_groebner(S, sdm_nf_mora, igrlex, QQ) return sdm_nf_mora(sdm_from_vector([f], lex, QQ, gens=gens), G, lex, QQ) == sdm_zero()