Opened 11 years ago

Closed 11 years ago

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

Reported by: Owned by: was was major sage-3.2 number theory

### 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.

### 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

### comment:2 follow-up: ↓ 3 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: ↓ 4 Changed 11 years ago by mabshoff

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

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.