#24077 closed defect (fixed)

Fix is_integral() for quadratic order elements

Reported by: jdemeyer Owned by:
Priority: major Milestone: sage-8.1
Component: number fields Keywords:
Cc: Merged in:
Authors: Jeroen Demeyer Reviewers: Alina Bucur
Report Upstream: N/A Work issues:
Branch: fb860a0 (Commits) Commit: fb860a0d544800aa7b2e0127a18e21a8d625fcdd
Dependencies: Stopgaps:

Description

sage: O.<w> = EisensteinIntegers()
sage: w.is_integral()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-12-58b818bf63fa> in <module>()
----> 1 w.is_integral()

/usr/local/src/sage-config/src/sage/rings/number_field/number_field_element_quadratic.pyx in sage.rings.number_field.number_field_element_quadratic.NumberFieldElement_quadratic.is_integral (build/cythonized/sage/rings/number_field/number_field_element_quadratic.cpp:17356)()
   2006             return True
   2007         else:
-> 2008             return self.norm().denom() == 1 and self.trace().denom() == 1
   2009 
   2010     def charpoly(self, var='x'):

/usr/local/src/sage-config/src/sage/structure/element.pyx in sage.structure.element.Element.__getattr__ (build/cythonized/sage/structure/element.c:4370)()
    482             AttributeError: 'LeftZeroSemigroup_with_category.element_class' object has no attribute 'blah_blah'
    483         """
--> 484         return self.getattr_from_category(name)
    485 
    486     cdef getattr_from_category(self, name):

/usr/local/src/sage-config/src/sage/structure/element.pyx in sage.structure.element.Element.getattr_from_category (build/cythonized/sage/structure/element.c:4479)()
    495         else:
    496             cls = P._abstract_element_class
--> 497         return getattr_from_other_class(self, cls, name)
    498 
    499     def __dir__(self):

/usr/local/src/sage-config/src/sage/cpython/getattr.pyx in sage.cpython.getattr.getattr_from_other_class (build/cythonized/sage/cpython/getattr.c:1894)()
    252         dummy_error_message.cls = type(self)
    253         dummy_error_message.name = name
--> 254         raise dummy_attribute_error
    255     attribute = <object>attr
    256     # Check for a descriptor (__get__ in Python)

AttributeError: 'sage.rings.integer.Integer' object has no attribute 'denom'

Change History (6)

comment:1 Changed 17 months ago by jdemeyer

  • Summary changed from Fix is_integral() for quadratic number field elements to Fix is_integral() for quadratic order elements

comment:2 Changed 17 months ago by jdemeyer

  • Branch set to u/jdemeyer/fix_is_integral___for_quadratic_number_field_elements

comment:3 Changed 17 months ago by jdemeyer

  • Commit set to fb860a0d544800aa7b2e0127a18e21a8d625fcdd
  • Status changed from new to needs_review

New commits:

fb860a0Fix is_integral() for quadratic order elements

comment:4 Changed 17 months ago by kedlaya

  • Authors set to Alina Bucur
  • Status changed from needs_review to positive_review

Posting on Alina's behalf. She checked this out, and I just confirmed that all doctests pass on k8s.

comment:5 Changed 17 months ago by jdemeyer

  • Authors changed from Alina Bucur to Jeroen Demeyer
  • Reviewers set to Alina Bucur

comment:6 Changed 17 months ago by vbraun

  • Branch changed from u/jdemeyer/fix_is_integral___for_quadratic_number_field_elements to fb860a0d544800aa7b2e0127a18e21a8d625fcdd
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.