Ticket #5666 (closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

forming ideals in IntegerModRing_generic does not work

Reported by: cremona Owned by: tbd
Priority: major Milestone: sage-4.3.1
Component: algebra Keywords:
Cc: Work issues:
Report Upstream: N/A Reviewers: Rob Beezer
Authors: William Stein Merged in: sage-4.3.1.rc1
Dependencies: Stopgaps:

Description

It is impossible to create ideals in rings of the form Integers mod n:

sage: R = Integers(10)
sage: R.ideal(1)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)

/home/masgaj/.sage/temp/host_56_150/5831/_home_masgaj__sage_init_sage_0.py
in <module>()

/local/jec/sage-3.4.1.alpha0/local/lib/python2.5/site-packages/sage/rings/quotient_ring.pyc
in ideal(self, *gens, **kwds)
   487             gens = gens[0]
   488         from
sage.rings.polynomial.multi_polynomial_libsingular import
MPolynomialRing_libsingular
--> 489         if not
isinstance(self.__R,MPolynomialRing_libsingular) and not
self.__R._has_singular:
   490             # pass through
   491             MPolynomialRing_generic.ideal(self,gens,**kwds)

AttributeError: 'sage.rings.integer_ring.IntegerRing_class' object has
no attribute '_has_singular'
sage: R.ideal([2,4])
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)

(as above)

It looks as if the ideal() method for class QuotientRing_generic is only really geared to polynomial ring quotients.

Attachments

trac_5666.patch Download (1.7 KB) - added by was 3 years ago.

Change History

comment:1 Changed 4 years ago by mabshoff

  • Milestone set to sage-4.0

Changed 3 years ago by was

comment:2 Changed 3 years ago by was

  • Status changed from new to needs_review
  • Report Upstream set to N/A

comment:3 Changed 3 years ago by rbeezer

  • Status changed from needs_review to positive_review
  • Reviewers set to Rob Beezer
  • Authors set to William Stein

Passes tests and allows creation of ideals within rings of integers mod n.

But it seems the resulting ideals still need some work, for example _contains_() in rings.ideal.Ideal_generic is not implemented.

sage: R=Integers(40)
sage: Q=R.ideal([2,3])
sage: type(Q)
<class 'sage.rings.ideal.Ideal_generic'>
sage: 1 in Q
------------------
NotImplementedError
<snip>

comment:4 Changed 3 years ago by rlm

  • Status changed from positive_review to closed
  • Resolution set to fixed
  • Merged in set to sage-4.3.1.rc1
Note: See TracTickets for help on using tickets.