Ticket #3913 (closed enhancement: fixed)

Opened 4 months ago

Last modified 3 months ago

[with patch, positive review] order function not defined for ideal classes

Reported by: cremona Assigned to: was
Priority: minor Milestone: sage-3.1.2
Component: number theory Keywords:
Cc: AlexGhitza

Description

In 3.1 you can't ask for the order of an ideal class. Example:

sage: K.<w>=QuadraticField(-23)
sage: OK=K.ring_of_integers()
sage: C=OK.class_group()
sage: h=C.order()
sage: P2a,P2b=[P for P,e in (2*OK).factor()]
sage: c=C(P2a); c
Fractional ideal class (2, 1/2*w - 1/2)
sage: c.order()
#boom

This is easily provided:

sage: sage.groups.generic.order_from_multiple(c,c.parent().order(),operation='*')
3

Patch coming up.

Attachments

sage-trac3913.patch (3.7 kB) - added by cremona on 08/20/2008 10:00:20 AM.

Change History

08/20/2008 10:00:20 AM changed by cremona

  • attachment sage-trac3913.patch added.

08/20/2008 10:02:04 AM changed by cremona

  • summary changed from order function not defined for ideal classes to [with patch, needs review] order function not defined for ideal classes.

The patch implements this, and adds doctests to some other functions. Based on 3.1.1, and all doctests in sage/rings/number_fields pass.

08/26/2008 05:27:43 AM changed by AlexGhitza

  • cc set to AlexGhitza.

(follow-up: ↓ 5 ) 08/27/2008 12:12:43 AM changed by AlexGhitza

  • summary changed from [with patch, needs review] order function not defined for ideal classes to [with patch, positive review] order function not defined for ideal classes.

Looks good and passes doctests. Also, when this gets merged, #1400 should be closed as a duplicate (note btw that John's patch addresses precisely Nick's objection on #1400).

08/27/2008 12:54:18 AM changed by mabshoff

  • status changed from new to closed.
  • resolution set to fixed.

Merged in Sage 3.1.2.alpha1

(in reply to: ↑ 3 ) 08/27/2008 01:10:02 AM changed by cremona

Replying to AlexGhitza:

Looks good and passes doctests. Also, when this gets merged, #1400 should be closed as a duplicate (note btw that John's patch addresses precisely Nick's objection on #1400).

Thanks -- sorry to have opened a new ticket unnecessarily (I did look, honest). In any case this patch is more efficient, and shows how useful the generic algorithms I implemented are!