Re: [sage-combinat-devel] Constructing homs

2012-12-05 Thread Nicolas M. Thiery
On Tue, Dec 04, 2012 at 08:00:57PM -0800, Andrew Mathas wrote:
>Thanks Nicolas. I appreciate your efforts in putting the category
>framework in place! It's beginning to grow on me:)


:-)

>Depending how far my explorations go I may end up adding some of
>the missing pieces...

You would be very welcome! One step that needs to be done at some
point, and that is fairly independent from the category framework
would be to implement:

- Matrices with rows and columns indexed by whatever objects

- Morphisms between two finite dimensional free modules G and H (using the 
above)
  with arithmetic, ...

  I.e. the analogue of sage.modules.matrix_morphism.MatrixMorphism.

- A parent for those.

  I.e the analogue of sage.modules.free_module_homspace.HomSpace

What would be missing would be the shortcuts so that we could just do
Hom(G,H), as well as generic methods that could be shared between.

Cheers,
Nicolas
--
Nicolas M. Thiéry "Isil" 
http://Nicolas.Thiery.name/

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.



Re: [sage-combinat-devel] Constructing homs

2012-12-05 Thread Andrew Mathas


> - Matrices with rows and columns indexed by whatever objects 
>
 
I have a (very) rough prototype for this as it is one of the things that I 
need. Rather than matrices, however, I am thinking of making the underlying 
object just an array/table as for my applications the full matrix is often 
not known and more entries are added as the calculations proceed whereas 
matrices are immutable. Perhaps I should finally learn about these 
cloneable arrays...

>
> - Morphisms between two finite dimensional free modules G and H (using the 
> above) 
>   with arithmetic, ... 
>

For what I am doing at the moment the following would be useful:

   - MorphismOfCombinatorialFreeModule
   - HomSpaceWthBasis
   - MorphismFromCyclicModule 

and graded versions of all of the above. I mainly care about (graded) homs 
between CombinatorialFreeModules and i f is such a hom, and t indexes a 
basis element of G then I'd like to have f(t)=f(G(t)). I have a hacked 
version of this, combining the three "categories" above, for my modules, 
without that many features. I'll have make this palatable for human 
consumption before I release this code:)
 

>   I.e. the analogue of sage.modules.matrix_morphism.MatrixMorphism. 
>
> - A parent for those. 
>
>   I.e the analogue of sage.modules.free_module_homspace.HomSpace 
>
> What would be missing would be the shortcuts so that we could just do 
> Hom(G,H), as well as generic methods that could be shared between. 
>

I think that I still don't really undestand what Hom(G,H) represents inside 
sage. Is it simply supposed to be the parent for all homs from G to H? 

Typically, it seems to me that Hom(G,H) doesn't -- and, in fact, can't -- 
do very much: if G and H are (free) modules then Hom(G,H) is just a bunch 
of matrices, which is easy.  But if G and H have any extra structure which 
these homs should preserve then there often won't even be an algorithm for 
computing Hom(G,H), and in many cases there won't even be a practical 
algorithm for determining when a linear map belongs to Hom(G,H). So what is 
Hom(G,H) suppose to do?

Andrew

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sage-combinat-devel/-/29S9CF9anMwJ.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.



[sage-combinat-devel] Re: Constructing homs

2012-12-05 Thread Dima Pasechnik
On 2012-12-05, Andrew Mathas  wrote:
> --=_Part_1499_29645117.1354701799117
> Content-Type: text/plain; charset=ISO-8859-1
>
>
>
>> - Matrices with rows and columns indexed by whatever objects 
>>
>  
> I have a (very) rough prototype for this as it is one of the things that I 
> need. Rather than matrices, however, I am thinking of making the underlying 
> object just an array/table as for my applications the full matrix is often 
> not known and more entries are added as the calculations proceed whereas 
> matrices are immutable. 
huh?
sage: m=matrix([[1,2],[3,4]])
sage: m
[1 2]
[3 4]
sage: m[1,1]=100
sage: m
[  1   2]
[  3 100]
sage: 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.



[sage-combinat-devel] Re: Constructing homs

2012-12-05 Thread Andrew Mathas


> huh? 
> sage: m=matrix([[1,2],[3,4]]) 
> sage: m 
> [1 2] 
> [3 4] 
> sage: m[1,1]=100 
> sage: m 
> [  1   2] 
> [  3 100] 
> sage: 
>

Yes, you're right. My issue with matrices is that I can't write something 
like:

sage: matrix([[1,0],[None,0]])

(Unless, of course, you want to correct me again:)

A.
 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sage-combinat-devel/-/6Qm7YHqf5g8J.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.



[sage-combinat-devel] facade initialisation

2012-12-05 Thread Vincent Delecroix
Dear facade lovers,

I just upload on trac a patch about the initialisation of facade sets
at #13801. One of the smallest patch I never write... which corrects
two errors.

Please, send comments.

Best,
Vincent

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.



[sage-combinat-devel] sage.sets.disjoint_set and sage.combinat.set_partitions

2012-12-05 Thread Vincent Delecroix
Hello,

I do not understand the purpose of sage.sets.disjoint_set (which
moreover has nothing to do with disjoint set) ! As far as I understand
it is a duplicate of set partitions with some special features. Am I
right ?

Best,
Vincent

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.



[sage-combinat-devel] Re: Constructing homs

2012-12-05 Thread Travis Scrimshaw
Hey Andrew,
   It sounds more like you want to use a spare matrix (or even just a 
dictionary with a tuple as the key) and fill in entries as you compute them.

Best,
Travis


On Wednesday, December 5, 2012 3:29:27 AM UTC-8, Andrew Mathas wrote:
>
>
> huh? 
>> sage: m=matrix([[1,2],[3,4]]) 
>> sage: m 
>> [1 2] 
>> [3 4] 
>> sage: m[1,1]=100 
>> sage: m 
>> [  1   2] 
>> [  3 100] 
>> sage: 
>>
>
> Yes, you're right. My issue with matrices is that I can't write something 
> like:
>
> sage: matrix([[1,0],[None,0]])
>
> (Unless, of course, you want to correct me again:)
>
> A.
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sage-combinat-devel/-/bGhR-svWEI8J.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.



Re: [sage-combinat-devel] Re: Constructing homs

2012-12-05 Thread Nicolas M. Thiery
On Wed, Dec 05, 2012 at 10:45:13AM -0800, Travis Scrimshaw wrote:
>Hey Andrew,
>   It sounds more like you want to use a spare matrix (or even just a
>dictionary with a tuple as the key) and fill in entries as you compute
>them.

A sparse matrix would probably not work, as you can't make difference
between a coefficient that has been computed and is zero, and a not
computed coefficient.

I guess we need both; morphism implemented as matrices, and morphisms
implemented as "lazy matrices", and we should share as much as
possible between the two.

Andrew: please keep up implementing such things! Don't worrying too
much about the design; just make it as straightforward as
possible. When the infrastructure will be in place, it should be easy
to cleanup the things before getting them into Sage.


Btw: Hom(F, G, C) models the set of all morphisms from F to G in the
category C. By default, C is the meet of the categories of F and G. Of
course, for most categories one can't do much with that. But there
certainly are categories where we can or could and would want to:

 - Hom(V, W, VectorSpaces)
 - Hom(V, W, A-modules)
 - Hom(F, G, Groups)

Cheers,
Nicolas
--
Nicolas M. Thiéry "Isil" 
http://Nicolas.Thiery.name/

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.



Re: [sage-combinat-devel] Re: Constructing homs

2012-12-05 Thread Andrew Mathas
Here's a related question: suppose I have an object G in sage. Is there a 
"correct" way to ask G if is it a CombinatorialFreeModule? I can check for

if hasattr(G,'_basis_keys'): ...

but I would have thought that there was a better way to do this...

Andrew

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sage-combinat-devel/-/8axqoe8vKCQJ.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.



[sage-combinat-devel] Re: Constructing homs

2012-12-05 Thread Dima Pasechnik
On 2012-12-05, Andrew Mathas  wrote:
> --=_Part_33_6944284.1354751535501
> Content-Type: text/plain; charset=ISO-8859-1
>
> Here's a related question: suppose I have an object G in sage. Is there a 
> "correct" way to ask G if is it a CombinatorialFreeModule? I can check for
>
> if hasattr(G,'_basis_keys'): ...
>
> but I would have thought that there was a better way to do this...
isinstance?


sage: F = CombinatorialFreeModule(QQ, ['a','b','c'])
sage: isinstance(F,CombinatorialFreeModule)
True
sage: isinstance([],CombinatorialFreeModule)
False

HTH,
Dima
>
> Andrew
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.



[sage-combinat-devel] Re: Constructing homs

2012-12-05 Thread Andrew Mathas
Yes, I worked it out and deleted my question bot before you replied it 
seems. 

Thanks anyway,
Andrew

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sage-combinat-devel/-/wWxrvtdzHRoJ.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.



Re: [sage-combinat-devel] Re: Constructing homs

2012-12-05 Thread Nicolas M. Thiery
On Thu, Dec 06, 2012 at 01:13:09AM +, Dima Pasechnik wrote:
> > Here's a related question: suppose I have an object G in sage. Is there a 
> > "correct" way to ask G if is it a CombinatorialFreeModule? I can check for
> >
> > if hasattr(G,'_basis_keys'): ...
> >
> > but I would have thought that there was a better way to do this...
> isinstance?
> 
> 
> sage: F = CombinatorialFreeModule(QQ, ['a','b','c'])
> sage: isinstance(F,CombinatorialFreeModule)
> True
> sage: isinstance([],CombinatorialFreeModule)
> False

Depending on what you want to test exactly, you might or not want to do

sage: F in ModulesWithBasis

which will eventually include QQ^3, QQ['x'], ...

Cheers,

Nicolas
--
Nicolas M. Thiéry "Isil" 
http://Nicolas.Thiery.name/

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.



[sage-combinat-devel] End(CombinatorialFreeModule)?

2012-12-05 Thread Dima Pasechnik
I wonder if one can actually work in the endomorphism ring/algebra of a
CombinatorialFreeModule, and if yes, how.
Examples most appreciated.
(Ideally, I would like to know how to work with algebras specified by
multiplication coefficients in this framework)

Thanks,
Dima


-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.



[sage-combinat-devel] Re: facade initialisation

2012-12-05 Thread Travis Scrimshaw
Hey everyone,
   What is the reason why facade=True is allowable by Parent? It seems like 
we always want to pass in the parent(s) which our facade parent is acting 
for.

Best,
Travis


On Wednesday, December 5, 2012 8:23:01 AM UTC-8, Vincent Delecroix wrote:
>
> Dear facade lovers, 
>
> I just upload on trac a patch about the initialisation of facade sets 
> at #13801. One of the smallest patch I never write... which corrects 
> two errors. 
>
> Please, send comments. 
>
> Best, 
> Vincent 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sage-combinat-devel/-/nwv9jU9y4FEJ.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.



Re: [sage-combinat-devel] Re: facade initialisation

2012-12-05 Thread Vincent Delecroix
An example in sage.sets.finite_enumerated_set. But an example is not
an explanation ;-)

2012/12/6 Travis Scrimshaw :
>What is the reason why facade=True is allowable by Parent? It seems like
> we always want to pass in the parent(s) which our facade parent is acting
> for.
>
> On Wednesday, December 5, 2012 8:23:01 AM UTC-8, Vincent Delecroix wrote:
>>
>> I just upload on trac a patch about the initialisation of facade sets
>> at #13801. One of the smallest patch I never write... which corrects
>> two errors.
>>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.