On Friday, November 8, 2013 3:25:10 PM UTC-8, Travis Scrimshaw wrote:
>
> I think it would be better to make these UniqueRepresentations by sorting 
> the list of integer inputs, that way things like
>
>>
>> sage: G1 is G2
>> False
>> sage: G1 == G2
>> False
>>
>> would make sense.
>>
>
> Sorry, I meant to say these would be True and the output from these 
> comparisons would make sense.
>

Quoting from the documentation of AdditiveAbelianGroup:

    Construct a finitely-generated additive abelian group.

   INPUTS:

   * "invs" (list of integers): the invariants. These should all be
     greater than or equal to zero.

   * "remember_generators" (boolean): whether or not to fix a set of
     generators (corresponding to the given invariants, which need not
     be in Smith form).

I'd agree with you if remember_generators were "false", but it's "true" by 
default. So G1 and G2 should really be non-equal. It pretty clear 
"remember_generators" was partially implemented:
 - It does set the generators properly, so that G2.0, G2.1 etc. do the 
right thing
 - It prints elements represented wrt. the remembered set of generators
 - G2.0.lift() seems to do the right thing
but not fully:
 - the group prints in a funny way (it mentions some isomorphic group, but 
printing the group that was constructed would make a lot more sense)
 - the element construction from lists uses some internal basis
 - asking "list(G2.0)" gives the list of coefficients wrt. the internal 
basis (that's at least consistent with the previous one)
 - indexing on an element works wrt. the internal basis:
sage: (G2.0[0],G2.0[1])
(0, 1)
sage: G2.0
(1, 0)

The best thing is probably to just finish the job.

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to