Ticket #3275 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

[with patch, positive review] Make SL2Z distinct

Reported by: craigcitro Owned by: craigcitro
Priority: minor Milestone: sage-3.0.2
Component: modular forms Keywords:
Cc: Work issues:
Report Upstream: Reviewers:
Authors: Merged in:
Dependencies: Stopgaps:

Description

This patch changes SL2Z to be a distinct object, as opposed to a class. The following error was brought up on sage-support:

sage: S = SL2Z()([0,-1,1,0])
sage: T = SL2Z()([1,1,0,1])
sage: S*T
...
<type 'exceptions.RuntimeError'>: There is a bug in the coercion code in SAGE.

The issue (as the poster pointed out) is that the parents of S and T are distinct copies of SL2Z, when they don't need to be. Indeed, I don't see any difference between this and other distinct rings in Sage (such as ZZ, QQ, etc), so I've made it distinct.

Now the above becomes:

sage: S = SL2Z.([0,-1,1,0])
sage: T = SL2Z.([1,1,0,1])
sage: S*T
[ 0 -1]
[ 1  1]

Attachments

trac-3275.patch Download (10.7 KB) - added by craigcitro 5 years ago.

Change History

Changed 5 years ago by craigcitro

comment:1 Changed 5 years ago by rlm

  • Summary changed from [with patch, needs review] Make SL2Z distinct to [with patch, positive review] Make SL2Z distinct

looks good to me, but i haven't tried applying the patch or testing...

comment:2 Changed 5 years ago by mabshoff

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

Merged in Sage 3.0.2.rc0. Testall long passes.

Note: See TracTickets for help on using tickets.