[with patch, positive review] Make SL2Z distinct
|Reported by:||craigcitro||Owned by:||craigcitro|
|Report Upstream:||Work issues:|
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]