On Friday, April 18, 2014 4:22:59 PM UTC-7, Travis Scrimshaw wrote:
>
> Hey everyone,
>    On http://trac.sagemath.org/ticket/15289 I'm implementing monoids and 
> groups indexed by an arbitrary set of generators and Nicolas and I would 
> like your input on some possible idioms.
>
> * Is anyone opposed to removing Free* from the global namespace and 
> instead accessing free objects via their respective category. For example, 
> instead of `FreeGroup(blah)` we access it by `Groups().free(blah)` and 
> `FreeAlgebra(R, blah)` becomes `Algebras(R).free(blah)`. However this 
> partially conflicts with http://trac.sagemath.org/ticket/15801, we could 
> work around it by passing in the base ring as before. I do like this idiom 
> since it has a more category-theoretic feel.
>

For the sake of tab completion, and for consistency with how other groups 
are accessed, you should be able to do "groups.free(...)" also. Without 
this and with just Groups().free(...), it might be hard to figure out how 
to create free groups. Should we have a top-level "algebras" object with 
the same kind of functionality? Probably not a bad idea.
 

>
> * If we decide to not support the first, is should we be able to access 
> free abelian groups via `FreeGroup` with an optional boolean keyword of 
> `abelian`. Same for monoids.
>

Sounds good to me. (If we go with the first, Groups().free(...) could also 
take an 'abelian' keyword, as could groups.free(...), and of course we 
should have groups.free_abelian(...) and groups.free_abelian_additive(...).)
 

>
> * (In a similar vein to the second) Should we pass an optional boolean 
> argument of `additive` to `FreeGroup` (and maybe `FreeMonoid`)?
>

Sure.
 

>
> * Should `IndexedFreeAbelianGroup` be additive or multiplicative. I'm 
> voting for multiplicative since `CombinatorialFreeModule` over ZZ is the 
> additive counterpart.
>

I have no opinion on this. I've never used IndexedFreeAbelianGroup. What is 
it for? 

>
> Last is should we indexed polynomials by elements of an additive group? I 
> wanted to use `IndexedFreeGroup` as the indexing set for a 
> `CombinatorialFreeModule` to build (non-commutative) polynomial-like rings. 
> It's easy enough to do it with it's (additive) ZZ-module counterpart 
> (`CombinatorialFreeModule`) as well, but defining 
>
> def product_on_basis(self, a, b):
>     return self.monomial(a + b)
>
> feels slightly unnatural to me. Also I haven't tested speed/memory yet to 
> compare.
>

This feels *completely* natural to me. 'return self.monomial(a * b)' would 
feel strange, though, if the group were written multiplicatively.
 

>
> I'd appreciate any thoughts you have on the matters above (I suspect some 
> are going to controversial), and if you have better names.
>
> Best,
> Travis
>

John

-- 
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/d/optout.

Reply via email to