Opened 6 years ago

Closed 6 years ago

#3275 closed defect (fixed)

[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: Merged in:
Authors: Reviewers:
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:


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

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

Download all attachments as: .zip

Change History (3)

Changed 6 years ago by craigcitro

comment:1 Changed 6 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 6 years ago by mabshoff

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

Merged in Sage 3.0.2.rc0. Testall long passes.

Note: See TracTickets for help on using tickets.