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)
Change History (6)
comment:1 Changed 11 years ago by
- 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
comment:2 follow-up: ↓ 3 Changed 11 years ago by
comment:3 in reply to: ↑ 2 ; follow-up: ↓ 4 Changed 11 years ago by
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
- 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
comment:5 Changed 11 years ago by
- 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.
Code looks good. Confirmed that it worked. Confirmed that it passes tests.