Changes between Initial Version and Version 15 of Ticket #15369


Ignore:
Timestamp:
11/12/13 10:57:18 (7 years ago)
Author:
ncohen
Comment:

Done !

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #15369

    • Property Status changed from new to needs_review
    • Property Summary changed from IntegerVectors/FreeModules/AdditiveAbelianGroup of dimension 1 do not accept 5 as input and expect [5] to groups.misc.AdditiveCyclic
    • Property Dependencies changed from to #15368
    • Property Branch changed from to u/ncohen/15369
    • Property Commit changed from to 7df421a36ad515f6b2c3cf9178dbcccfb05161c8
  • Ticket #15369 – Description

    initial v15  
    1 Following the discussion at ​https://groups.google.com/d/msg/sage-devel/tyAxhqxk3ZI/SuBg2Ukwwj4J
     1Following the discussion at ​https://groups.google.com/d/msg/sage-devel/tyAxhqxk3ZI/SuBg2Ukwwj4J3
    22
    3 When one creates the additive group `Z/nZ`, it would be nice to be able to use integers and cast them as members of this group. However :
    4 
    5 {{{
    6 sage: G=AdditiveAbelianGroup([5]); G(1)
    7 TypeError: can't initialize vector from nonzero non-list
    8 }}}
    9 
    10 The same way with free modules :
    11 
    12 {{{
    13 sage: G=FreeModule(ZZ,1); G(1) 
    14 TypeError: can't initialize vector from nonzero non-list
    15 }}}
    16 
    17 This patch makes it possible :
    18 
    19 {{{
    20 sage: G=AdditiveAbelianGroup([5]); G(1)
    21 (1)
    22 sage: G=FreeModule(ZZ,1); G(1)         
    23 (1)
    24 }}}
     3There is currently no way to create a group representing `Z/nZ` easily. And the one acknowledged way to do that being `Integers(n)` (i.e. `IntegerModRing(n)`), this patch exposes it as `groups.misc.AdditiveCyclic`.
    254
    265Nathann