Changes between Initial Version and Version 1 of Ticket #25388, comment 10


Ignore:
Timestamp:
05/18/18 17:04:39 (4 years ago)
Author:
nbruin
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #25388, comment 10

    initial v1  
    99
    1010By turning quaternion algebras into globally unique objects, you are requiring the algebras to be immutable in a very strong sense: different parts could end up having references to the same algebra, so ANY change in state (even little representation/caching details) must be assumed to affect completely unrelated code. It's not possible to make your own little local algebra and scribble in it anymore.
     11
     12More precisely. The kind of scenario in the coercion framework where I know that `UniqueRepresentation` is really required is to make this assertion hold:
     13{{{
     14sage: Zxy.<x,y>=ZZ[]
     15sage: Qx.<x>=QQ[]
     16sage: Qy.<y>=QQ[]
     17sage: Qxy=QQ['x','y']
     18sage: x=Qx.0
     19sage: y=Zxy.1
     20sage: (x+y).parent() is Qxy
     21True
     22sage: Qy.<y>=QQ[]
     23sage: (Qy.0+Zxy.0).parent() is Qxy
     24True
     25}}}
     26
     27Note that the coercion framework needs to construct a common covering parent for `Zxy` and `Qx` and one for `Zxy` and `Qy` itself. It would be very surprising if the results were not identical.
     28(the fact that the resulting parent is equal to `Qxy` constructed by the user is convenient but less important). I don't think people would be doing that with `QuaternionAlgebra` so I think you could safely leave off the `UniqueRep` for now.