Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#3913 closed enhancement (fixed)

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

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

Status badges

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 (1)

sage-trac3913.patch (3.7 KB) - added by cremona 13 years ago.

Download all attachments as: .zip

Change History (6)

Changed 13 years ago by cremona

comment:1 Changed 13 years ago 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.

comment:2 Changed 13 years ago by AlexGhitza

  • Cc AlexGhitza added

comment:3 follow-up: Changed 13 years ago 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).

comment:4 Changed 13 years ago by mabshoff

  • Resolution set to fixed
  • Status changed from new to closed

Merged in Sage 3.1.2.alpha1

comment:5 in reply to: ↑ 3 Changed 13 years ago 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!

Note: See TracTickets for help on using tickets.