On Friday, May 25, 2018 at 1:00:22 AM UTC-7, Travis Scrimshaw wrote:
>
> I believe the matrix and permutation groups are quite old code, so 
> UniqueRepresentation may not have been available at that time. The 
> permutation group code does need updating; in particular, it is still an 
> old-style parent:
>
> sage: S.__class__.__mro__
> (<class 
> 'sage.groups.perm_gps.permgroup_named.SymmetricGroup_with_category'>,
>  <class 'sage.groups.perm_gps.permgroup_named.SymmetricGroup'>,
>  <class 'sage.groups.perm_gps.permgroup_named.PermutationGroup_symalt'>,
>  <class 'sage.groups.perm_gps.permgroup_named.PermutationGroup_unique'>,
>  <class 'sage.structure.unique_representation.CachedRepresentation'>,
>  <class 'sage.groups.perm_gps.permgroup.PermutationGroup_generic'>,
>  <type 'sage.groups.old.FiniteGroup'>,
>  <type 'sage.groups.old.Group'>,
>  <type 'sage.structure.parent_gens.ParentWithGens'>,
>  <type 'sage.structure.parent_base.ParentWithBase'>,
>  <type 'sage.structure.parent_old.Parent'>,
>  <type 'sage.structure.parent.Parent'>,
> ...
>
> (Side note: We also should not be importing things like 
> PermutationGroup_generic and PermutationGroupMorphism_id into the global 
> namespace.)
>
> I don't see a reason off-hand why these should not be UniqueRepresentation 
> subclasses.
>

There is a very good reason why they should NOT'. Equality between 
subgroups is not uniquely determined by the construction parameters. It's 
part of the API of UniqueRepresentation that equality is identity on them.

Also, UniqueRepresentation objects make it much harder to write predictable 
code: because they're global objects they really MUST be immutable. No 
cheating! That's often quite inconvenient. Also, the processing of the 
construction parameters is possibly more expensive than the construction 
itself, so they may degrade performance. Furthermore, they have proven time 
and again to be very prone to memory leaks, to the point where I'd now work 
on the assumption that if you change an object to UniqueRepresentation, 
you're introducing memory leaks various places.


-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to