Re: [sage-combinat-devel] Re: dot2tex, combinat

2012-01-12 Thread Nicolas M. Thiery
On Wed, Jan 11, 2012 at 03:44:53PM -0800, Anne Schilling wrote:
   - The change: since #11498, strings are now rendered using \verb|...|
 instead of \texttt.
   - The issue: is that dot2tex 
 
 Is there something missing in this sentence?

Oh, yes: The issue is that dot2tex does not handle \verb|...|

 Would the best option be to implement a latex method for partitions?
 Travis volunteered to do so.

Thanks Travis for volunteering. That would solve the issue for
partition. But not for all the other Sage objects that do not have a
latex method, and not for plain strings either.

So, unless there is a compelling reason to implement latex for
partitions (anything better than \verb|[4,3,1]|?), that would be just
a workaround: i.e. something useful in the short term, and worth
putting in the queue, but probably not something we would want to get
in Sage.

Cheers,
Nicolas
--
Nicolas M. Thiéry Isil nthi...@users.sf.net
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] Coercion error in symmetric functions

2012-01-12 Thread Simon King
Hi!

Working on fixing some memory leaks by using weak references (here:
#12215), together with making matrix spaces unique parents (at #12290)
my patches trigger a problem with the method
sage.combinat.sf.sf.SymmetricFunctions.register_isomorphism.

self.register_isomorphism(morphism) does
   morphism.codomain().register_coercion(morphism)

The problem is that the method
sage.structure.parent.Parent.register_coercion raises an error, if
there already is a coercion from self to morphism.codomain(). In fact,
to my understanding, register_coercion is supposed to only be used
during initialisation of an object.

Admittedly I don't understand (yet) how using weak references and
unique matrix spaces can trigger that error. Perhaps the error did not
occur before, because currently equal matrix spaces can have different
hashes (which is a bug tackled at #12290).

But anyway, I think register_coercion is not correctly used, and it
should be fixed.

So, let me ask: What exactly is
SymmetricFunctions.register_isomorphism supposed to do? Shall it wipe
an existing coercion and replace it with something new? Or shall it do
nothing, if there already is a coercion in use?

Cheers,
Simon

-- 
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: Coercion error in symmetric functions

2012-01-12 Thread Simon King
It turns out that sage/combinat/... uses the implicit assumption that
SymmetricFunctions(...) is a strongly cached object, i.e., that it
will persist in memory forever. But #12215 turns
`UniqueRepresentation` into a weak cache.

I don't know if it is a good solution on the long run, but for now, I
simply made SymmetricFunctions strongly cached, and that was enough to
solve the problem.

Sorry for the noise.
Simon

-- 
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: dot2tex, combinat

2012-01-12 Thread Anne Schilling
On 1/12/12 1:14 AM, Nicolas M. Thiery wrote:
 On Wed, Jan 11, 2012 at 03:44:53PM -0800, Anne Schilling wrote:
  - The change: since #11498, strings are now rendered using \verb|...|
instead of \texttt.
  - The issue: is that dot2tex 

 Is there something missing in this sentence?
 
 Oh, yes: The issue is that dot2tex does not handle \verb|...|
 
 Would the best option be to implement a latex method for partitions?
 Travis volunteered to do so.
 
 Thanks Travis for volunteering. That would solve the issue for
 partition. But not for all the other Sage objects that do not have a
 latex method, and not for plain strings either.
 
 So, unless there is a compelling reason to implement latex for
 partitions (anything better than \verb|[4,3,1]|?), that would be just
 a workaround: i.e. something useful in the short term, and worth
 putting in the queue, but probably not something we would want to get
 in Sage.

I agree the problem should be fixed in general!

But for partitions, I think a latex method is very desirable anyway.
We need it for rigged configurations (which contain partitions) and for drawing
nice posets containing partitions (like weak and strong order that Florent
recently deleted from his patch). So I hope this method could go into sage
anyway.

Best,

Anne

-- 
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: dot2tex, combinat

2012-01-12 Thread Nicolas M. Thiery
On Thu, Jan 12, 2012 at 08:04:48AM -0800, Anne Schilling wrote:
 But for partitions, I think a latex method is very desirable anyway.
 We need it for rigged configurations (which contain partitions) and for 
 drawing
 nice posets containing partitions (like weak and strong order that Florent
 recently deleted from his patch). So I hope this method could go into sage
 anyway.

Here you mean latexing a partition using it's Ferrers diagram? Then this is:

http://trac.sagemath.org/sage_trac/ticket/4355

which has been in need for a volunteer for three years.

Cheers,
Nicolas
--
Nicolas M. Thiéry Isil nthi...@users.sf.net
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: dot2tex, combinat

2012-01-12 Thread Anne Schilling
On 1/12/12 8:10 AM, Nicolas M. Thiery wrote:
 On Thu, Jan 12, 2012 at 08:04:48AM -0800, Anne Schilling wrote:
 But for partitions, I think a latex method is very desirable anyway.
 We need it for rigged configurations (which contain partitions) and for 
 drawing
 nice posets containing partitions (like weak and strong order that Florent
 recently deleted from his patch). So I hope this method could go into sage
 anyway.
 
 Here you mean latexing a partition using it's Ferrers diagram? Then this is:
 
   http://trac.sagemath.org/sage_trac/ticket/4355
 
 which has been in need for a volunteer for three years.

Yes, so Travis please use this ticket number for your patch!

Cheers,

Anne

-- 
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: dot2tex, combinat

2012-01-12 Thread Travis Scrimshaw
  Here you mean latexing a partition using it's Ferrers diagram? Then this is:

     http://trac.sagemath.org/sage_trac/ticket/4355

  which has been in need for a volunteer for three years.

 Yes, so Travis please use this ticket number for your patch!

It has been done. I basically just called output.tex_from_array() with
a list of \phantom{x} (strings). So what needs to be done for this
trac ticket?

Best,
Travis

-- 
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: dot2tex, combinat

2012-01-12 Thread Nicolas M. Thiery
On Thu, Jan 12, 2012 at 10:35:22AM -0800, Travis Scrimshaw wrote:
 It has been done. I basically just called output.tex_from_array() with
 a list of \phantom{x} (strings). So what needs to be done for this
 trac ticket?

In principle, the ticket description (with the referenced MuPAD doc
and code) is fairly complete. But feel free to ask further questions
if needed!

Cheers,
Nicolas
--
Nicolas M. Thiéry Isil nthi...@users.sf.net
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] Re: Data structure design pattern (for Cartan types)

2012-01-12 Thread Travis Scrimshaw

 Certainly something that's been though of a lot, and deserves yet more
 thoughts. Have you explored the related:

  -http://combinat.sagemath.org/code/file/tip/sage/categories/with_reali...
  -http://combinat.sagemath.org/code/file/tip/sage/categories/examples/r...

I looked at them, and I don't think this isn't quite what I was
considering (however it does work for linking together the necessary
parents). For example if we have two parents A and B that represent
the same data but we don't care which representation that we have
because we only want to iterate through and do some other operation
on, and it's faster to iterate through them using the parent A, but
the operation is faster on parent B. Whereas how I am reading this
category you've created, it is just a contract stating that the two
objects are equivalent. To comply with the sage model, I think this
category is necessary.

 A note, just to be pedantic: Singleton is a special case of
 UniqueRepresentation (when there are no arguments). And by the way,
 there is an upcoming Singleton class for that special case coming in
 #11900.

Good to know. I just wanted to make sure my terminology was
understood.

   (And someday someone should implement matrices indexed by anything,
   and upgrade cartan matrices accordingly).

  I concur with this, but I think we should carry this one step further
  and have vectors spaces whose basis is indexed by arbitrary lists so
  the matrices can act in a natural fashion.

 Isn't that the (misnamed) CombinatorialFreeModule?

Yes it is. So there is the object, but no morphism between them?

Best,
Travis

-- 
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: dot2tex, combinat

2012-01-12 Thread Anne Schilling
On 1/12/12 10:35 AM, Travis Scrimshaw wrote:
 Here you mean latexing a partition using it's Ferrers diagram? Then this is:

http://trac.sagemath.org/sage_trac/ticket/4355

 which has been in need for a volunteer for three years.

 Yes, so Travis please use this ticket number for your patch!
 
 It has been done. I basically just called output.tex_from_array() with
 a list of \phantom{x} (strings). So what needs to be done for this
 trac ticket?

Great! I checked its functionality and ran the tests. Everything looks good!
Here are some further comments:

* Could you please also add a latex method to cores in /combinat/core.py ?
  There is a method to_partition which you can use and then it could just
  use the latex method of partitions that you just implemented.

* Your patch creates a conflict with

  displayhook-fh.patch

  later on the in queue. Could you discuss with Florent whether to incorporate 
his
  patch into yours (since it also seems to be dealing with the display of 
partitions)?
  If not, then Florent should update his patch.

Once your patch is finalized, you need to export it for the trac server, see

http://wiki.sagemath.org/combinat/MercurialStepByStep#Exporting_Patches_for_use_with_trac

and then upload that version to the sage-combinat queue and the trac server.

Let me know when this is done!

Anne

-- 
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.