Opened 11 years ago

Closed 11 years ago

#4329 closed defect (fixed)

[with patch; positive review] class numbers of non-maximal orders -- should return NotImplementedError for now

Reported by: was Owned by: was
Priority: major Milestone: sage-3.2
Component: number theory Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

This is just wrong (and easy to fix):

sage: R = ZZ[3*sqrt(-3)]
sage: R.class_number??
Type:           instancemethod
Base Class:     <type 'instancemethod'>
String Form:    <bound method AbsoluteOrder.class_number of Order in Number Field in a with defining polynomial x^2 + 27>
Namespace:      Interactive
File:           /home2/sage/build/sage-3.1.4/local/lib/python2.5/site-packages/sage/rings/number_field/order.py
Definition:     R.class_number(self, proof=None)
Source:
    def class_number(self, proof=None):
        """
        EXAMPLES:
            sage: ZZ[2^(1/3)].class_number()
            1
            sage: ZZ[sqrt(-23)].class_number()
            3
        """
        return self.number_field().class_number(proof=proof)   

For a non-maximal order, the class_number (and class group) commands should return NotImplementedError?, rather than give a wrong or meaningless answer.

To fix this, all you have to do is make these function raise NotImplementedError?, except in the case of the maximal order.

Attachments (1)

sage-4329.patch (1.2 KB) - added by was 11 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 11 years ago by was

  • Summary changed from class numbers of non-maximal orders -- should return NotImplementedError for now to [with patch; needs review] class numbers of non-maximal orders -- should return NotImplementedError for now

Changed 11 years ago by was

comment:2 follow-up: Changed 11 years ago by shumow

Code looks good. Confirmed that it worked. Confirmed that it passes tests.

comment:3 in reply to: ↑ 2 ; follow-up: Changed 11 years ago by mabshoff

Replying to shumow:

Code looks good. Confirmed that it worked. Confirmed that it passes tests.

Is that a positive review?

Cheers,

Michael

comment:4 in reply to: ↑ 3 Changed 11 years ago by shumow

  • Summary changed from [with patch; needs review] class numbers of non-maximal orders -- should return NotImplementedError for now to [with patch; positive review] class numbers of non-maximal orders -- should return NotImplementedError for now

Replying to mabshoff:

Replying to shumow:

Code looks good. Confirmed that it worked. Confirmed that it passes tests.

Is that a positive review?

Affirmative

comment:5 Changed 11 years ago by mabshoff

  • Milestone changed from sage-3.2.1 to sage-3.2
  • Resolution set to fixed
  • Status changed from new to closed

Merged in Sage 3.2.rc1

Note: See TracTickets for help on using tickets.