[sage-combinat-devel] Re: Partition options and cleanup patch

2012-10-30 Thread Andrew Mathas
Hi Travis,

This all looks very good. Here's a few comments and suggestions:

- Added comparison methods to Partition_class
>
If you have he stomach for it, I think that it would also be good to name 
the class Partition_class as Partition -- and make the current Partition 
function its __classcall_private__ method. 


> - Made Partitions_n inherit from Partitions
>

A more descriptive name for this class would be Partitions_size -- in which 
case self.n should be self.size.

Right now there are about 8 tests which fail in partition.py. 5 of them are 
> because I don't know how to get the old pickle information for the classes 
> I changed, so Andrew any advice? 


Apply my pickle documentation patch and read the new improved documentation!

A quicker solution is just to copy the __setstate__ method from the Tableau 
class into the partition class (that is, into Partition_class), and then 
adjust the documentation and - most importantly -- changing Tableaux() to 
Partitions(). This will almost certainly fix most, if not all, of your 
unpickling problems. The problem arises because partitions now inherits 
from Element which means that it now has a sensible __setstate__ method. 
Unfortunately, as a by-product, this also breaks the old pickles. 

If you do change Partition_class to Partition, as I suggested above, then 
you will also need to add the lines

from sage.structure.sage_object import register_unpickle_override
register_unpickle_override('sage.combinat.partition', 'Partition_class',  
Partition)

to (the bottom of) partition.py. If any other class names have changed then 
you will also need to add similar function calls for them.

Let me know if you have any problems.

Also there are a few questions I want to ask. Tableaux should also have 
> options (French vs. English in particular), but should they be linked to 
> the options for Partitions? Same question to PartitionTuples with 
> Partitions. Does anybody disagree with or have any 
> suggestions/recommendations on any of the above changes?
>

It would make sense to have the English/French convention shared between 
partitions and tableaux --- and, possibly, their tupled friends although I 
don't have strong feelings about the latter. On the other hand, you 
probably would not want to do this for all options so if they some linked 
this would confuse at least some people because they would not known which 
options were in sync and which not.

Perhaps the rule should be that "conventions" are synchronised between 
classes but "options" are not. (Please do not ask me to define these 
terms!:)
 
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/-/Ra2ow_EcHOQJ.
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: Don't use combinat with 5.4.rc2 (fixed)

2012-10-30 Thread Florent Hivert
  Hi Hugh,

> 9265 was merged in 5.4.beta1; it then got unmerged again.  So the guards 
> should be set so neither of those patches would get applied to 5.4.beta1.  
> If you didn't run sage -combinat update explicitly, but are just using hg 
> to pull patches, then your guards may not be set right; you should either 
> run sage -combinat update or else add 5_4_rc2 to your 
> sage-xxx/devel/sage-combinat/.hg/patches/guards file.

For normal usage, you shoudn't need to edit guards manually. The combinat
script do that for you if you call
sage -combinat qselect
So basically sage -combinat update does more or less the following sequence:

  1 - memorize the top patch returned by "hq qtop"
  2 - hg qpop -a
  3 - cd $SAGE_DEVEL/.hg/patch
  4 - hg pull
  5 - hg update
  6 - cd $SAGE_DEVEL/
  7 - sage -combinat qselect
  8 - hg qgoto "patch memorized at step 1"

Cheers,

Florent

-- 
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: Partition options and cleanup patch

2012-10-30 Thread Travis Scrimshaw
Also, I've disabled the following patches since they will need to be 
rebased/changed once everything in partition.py is sorted out:

- partition_constructor_speedup-fh.patch
- tableaux-combinatorics-am.patch
- trac_13605?--generic_partition_options-am.patch

Best,
Travis


On Tuesday, October 30, 2012 4:02:08 PM UTC-7, Travis Scrimshaw wrote:
>
> Hey everyone,
>Here's the state of the #13605 patch and what it currently is doing:
>
> - Added partition options which can do French/English, latex outputs, 
> Ferrers' diagram characters, some ordering
>
> - Deprecating the following methods and classes:
> * evaluation()
> * dominate() -- Changed name to dominated_partitions()
> * OrderedPartitions_nk -- Renamed to OrderedPartitions since the 
> function OrderedPartitions just created this
> * PartitionsInBox_hw -- Renamed to PartitionsInBox since the function 
> PartitionsInBox just created this
> * PartitionsGreatestLE_nk -- Renamed to PartitionsGreatestLE since the 
> function PartitionsGreatestLE just created this
> * PartitionsGreatestEQ_nk -- Renamed to PartitionsGreatestEQ since the 
> function PartitionsGreatestEQ just created this
>
> - Changed *_lengths into *_length_tableau() (ex. arm_lengths() becomes 
> arm_length_tableau() ) and deprecated old names
>
> - Added comparison methods to Partition_class
>
> - Made Partition_class an element (had to touch two symmetric function 
> files for this as well)
>
> - Made Partitions() into the class Partitions which now does the work of 
> Partitions_all, however Partitions(options) still returns the appropriate 
> parent
>
> - Made Partitions_n inherit from Partitions
>
> - Made the other finite set of partitions inherit from Partitions_n except 
> those that inherited from IntegerListsLex
>
> - IntegerListsLex no longer inherits from CombinatorialClass, but instead 
> from Parent with elements of ClonableArray
>
> - All classes Partitions* are not in the category framework except 
> PartitionsRestricted which will eventually be removed.
>
> - Removed the ferrers_diagram() function (not the method of 
> Partition_class) since it was deprecated a long time ago (2-3 years as I 
> recall)
>
> - Added same options for tuple of partitions.
>
> - Cleaned up the documention
>
> Right now there are about 8 tests which fail in partition.py. 5 of them 
> are because I don't know how to get the old pickle information for the 
> classes I changed, so Andrew any advice? The other 3 are more serious and 
> have to do with docstring testing. Apparently if a parent class has a 
> category which has a default implementation of a method, that category's 
> implementation is what's called, despite if the parent defines the same 
> function. However this does not show up in a sage session.
>
> Also there are a few questions I want to ask. Tableaux should also have 
> options (French vs. English in particular), but should they be linked to 
> the options for Partitions? Same question to PartitionTuples with 
> Partitions. Does anybody disagree with or have any 
> suggestions/recommendations on any of the above changes?
>
> Thanks,
> Travis
>
>

-- 
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/-/CKFOlwzdGy0J.
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] Partition options and cleanup patch

2012-10-30 Thread Travis Scrimshaw
Hey everyone,
   Here's the state of the #13605 patch and what it currently is doing:

- Added partition options which can do French/English, latex outputs, 
Ferrers' diagram characters, some ordering

- Deprecating the following methods and classes:
* evaluation()
* dominate() -- Changed name to dominated_partitions()
* OrderedPartitions_nk -- Renamed to OrderedPartitions since the 
function OrderedPartitions just created this
* PartitionsInBox_hw -- Renamed to PartitionsInBox since the function 
PartitionsInBox just created this
* PartitionsGreatestLE_nk -- Renamed to PartitionsGreatestLE since the 
function PartitionsGreatestLE just created this
* PartitionsGreatestEQ_nk -- Renamed to PartitionsGreatestEQ since the 
function PartitionsGreatestEQ just created this

- Changed *_lengths into *_length_tableau() (ex. arm_lengths() becomes 
arm_length_tableau() ) and deprecated old names

- Added comparison methods to Partition_class

- Made Partition_class an element (had to touch two symmetric function 
files for this as well)

- Made Partitions() into the class Partitions which now does the work of 
Partitions_all, however Partitions(options) still returns the appropriate 
parent

- Made Partitions_n inherit from Partitions

- Made the other finite set of partitions inherit from Partitions_n except 
those that inherited from IntegerListsLex

- IntegerListsLex no longer inherits from CombinatorialClass, but instead 
from Parent with elements of ClonableArray

- All classes Partitions* are not in the category framework except 
PartitionsRestricted which will eventually be removed.

- Removed the ferrers_diagram() function (not the method of 
Partition_class) since it was deprecated a long time ago (2-3 years as I 
recall)

- Added same options for tuple of partitions.

- Cleaned up the documention

Right now there are about 8 tests which fail in partition.py. 5 of them are 
because I don't know how to get the old pickle information for the classes 
I changed, so Andrew any advice? The other 3 are more serious and have to 
do with docstring testing. Apparently if a parent class has a category 
which has a default implementation of a method, that category's 
implementation is what's called, despite if the parent defines the same 
function. However this does not show up in a sage session.

Also there are a few questions I want to ask. Tableaux should also have 
options (French vs. English in particular), but should they be linked to 
the options for Partitions? Same question to PartitionTuples with 
Partitions. Does anybody disagree with or have any 
suggestions/recommendations on any of the above changes?

Thanks,
Travis

-- 
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/-/sPhMHijN0AAJ.
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: Don't use combinat with 5.4.rc2 (fixed)

2012-10-30 Thread Mike Zabrocki
Hi Hugh,
 Thanks for looking into it.  I switched to 5.4.rc2 and since no one 
else complained I'm guessing it was a glitch on my computer.
-Mike

On Tuesday, 30 October 2012 16:11:55 UTC-4, Hugh Thomas wrote:
>
> Hi Mike--
>
> Sorry, I was away from email for a few days.  
>
> 9265 was merged in 5.4.beta1; it then got unmerged again.  So the guards 
> should be set so neither of those patches would get applied to 5.4.beta1.  
> If you didn't run sage -combinat update explicitly, but are just using hg 
> to pull patches, then your guards may not be set right; you should either 
> run sage -combinat update or else add 5_4_rc2 to your 
> sage-xxx/devel/sage-combinat/.hg/patches/guards file.
>
> For me, at the moment, the queue applies smoothly on 5.4.beta1, so maybe 
> the further problem you encountered was some temporary glitch.  (Unless 
> someone fixed it in the meantime?)
>
> cheers,
>
> Hugh
>
>
>
>
> On Wednesday, October 24, 2012 1:18:53 PM UTC-7, Mike Zabrocki wrote:
>>
>> Hi,
>>
>> I disabled both of these patches and then I run into
>> trac_12876_category-fix_abstract_class-nt-rel11521.patch
>> doesn't apply. It doesn't look like these patches touch
>> the same files, but this patch hasn't been touched in a
>> few months so something must be conflicting.
>> Any ideas?
>>
>> I'm compiling 5.4.rc2 now, but that will take a while.
>>
>> -Mike
>>
>>
>> On Wednesday, 24 October 2012 14:23:18 UTC-4, Mike Zabrocki wrote:
>>>
>>> Hi,
>>> Something went wrong here for me using 5.4.beta1.
>>>
>>> The lines in the series files are:
>>> trac_9265_tableaux_categories_am.patch  #+5_4_beta0
>>> trac_9265_tableaux_categories_am-duplicate.patch#-5_4_rc2
>>>
>>> Are those right?
>>> I'd like to push some changes but I don't want to mess things up
>>> with this patch.
>>>
>>> -Mike
>>>
>>> On Tuesday, 23 October 2012 02:10:18 UTC-4, Hugh Thomas wrote:

 You're welcome.  It's actually quite fun (in a somewhat perverse way).  

 After having set things up as I did, I realized it woud be even cleaner 
 if I could simply have two different lines in the series file pointing to 
 the same patch, but, alas, mercurial doesn't let you do that.  

 cheers,

 Hugh

 On Monday, October 22, 2012 8:54:51 AM UTC-7, Nicolas M. Thiery wrote:
>
> On Sat, Oct 20, 2012 at 01:13:23AM -0700, Hugh Thomas wrote: 
> > I think this is now fixed, by introducing a second copy of 
> > trac_9265_tableaux_categories_am.patch which is guarded so it will 
> only be 
> > applied to 5.4.rc2 or later. 
>
> Ah yes, that works! 
>
> > This should mean that the queue will apply cleanly against 5.4 and 
> all its 
> > prerelease versions. 
>
> Thanks for going the extra mile for our devs :-) 
>
> 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 view this discussion on the web visit 
https://groups.google.com/d/msg/sage-combinat-devel/-/44i-f6VWcosJ.
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: Don't use combinat with 5.4.rc2 (fixed)

2012-10-30 Thread Hugh Thomas
Hi Mike--

Sorry, I was away from email for a few days.  

9265 was merged in 5.4.beta1; it then got unmerged again.  So the guards 
should be set so neither of those patches would get applied to 5.4.beta1.  
If you didn't run sage -combinat update explicitly, but are just using hg 
to pull patches, then your guards may not be set right; you should either 
run sage -combinat update or else add 5_4_rc2 to your 
sage-xxx/devel/sage-combinat/.hg/patches/guards file.

For me, at the moment, the queue applies smoothly on 5.4.beta1, so maybe 
the further problem you encountered was some temporary glitch.  (Unless 
someone fixed it in the meantime?)

cheers,

Hugh




On Wednesday, October 24, 2012 1:18:53 PM UTC-7, Mike Zabrocki wrote:
>
> Hi,
>
> I disabled both of these patches and then I run into
> trac_12876_category-fix_abstract_class-nt-rel11521.patch
> doesn't apply. It doesn't look like these patches touch
> the same files, but this patch hasn't been touched in a
> few months so something must be conflicting.
> Any ideas?
>
> I'm compiling 5.4.rc2 now, but that will take a while.
>
> -Mike
>
>
> On Wednesday, 24 October 2012 14:23:18 UTC-4, Mike Zabrocki wrote:
>>
>> Hi,
>> Something went wrong here for me using 5.4.beta1.
>>
>> The lines in the series files are:
>> trac_9265_tableaux_categories_am.patch  #+5_4_beta0
>> trac_9265_tableaux_categories_am-duplicate.patch#-5_4_rc2
>>
>> Are those right?
>> I'd like to push some changes but I don't want to mess things up
>> with this patch.
>>
>> -Mike
>>
>> On Tuesday, 23 October 2012 02:10:18 UTC-4, Hugh Thomas wrote:
>>>
>>> You're welcome.  It's actually quite fun (in a somewhat perverse way).  
>>>
>>> After having set things up as I did, I realized it woud be even cleaner 
>>> if I could simply have two different lines in the series file pointing to 
>>> the same patch, but, alas, mercurial doesn't let you do that.  
>>>
>>> cheers,
>>>
>>> Hugh
>>>
>>> On Monday, October 22, 2012 8:54:51 AM UTC-7, Nicolas M. Thiery wrote:

 On Sat, Oct 20, 2012 at 01:13:23AM -0700, Hugh Thomas wrote: 
 > I think this is now fixed, by introducing a second copy of 
 > trac_9265_tableaux_categories_am.patch which is guarded so it will 
 only be 
 > applied to 5.4.rc2 or later. 

 Ah yes, that works! 

 > This should mean that the queue will apply cleanly against 5.4 and 
 all its 
 > prerelease versions. 

 Thanks for going the extra mile for our devs :-) 

 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 view this discussion on the web visit 
https://groups.google.com/d/msg/sage-combinat-devel/-/4zvZ1dQohWYJ.
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] Weight diagrams

2012-10-30 Thread JesusTorrado
Hi all,

I have coded for myself some functions to plot weight diagrams: a ranked, 
directed graph whose vertices are the weights of a representation and whose 
edges are the simple roots connecting them. It shows the multiplicities of 
the weights too. Here is how it looks like for the adjoint representation 
of A2: http://dl.dropbox.com/u/80518046/adj_of_A2.png

As this is something I would have liked to have found implemented in Sage, 
I would humbly suggest to include it, I guess after some more or less heavy 
polishing. Maybe as a method of a member of a Weyls character ring?

The relevant functions and some examples are in a worksheet here: 
http://dl.dropbox.com/u/80518046/Plotting%20weight%20diagrams.sws

I did my best with optimization, specially in weight_graph. I am kind of 
proud of it all :)

Cheers,
Jesús Torrado

-- 
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/-/LHbsj50rYkYJ.
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] coroot style for weight_multiplicities() ?

2012-10-30 Thread JesusTorrado
Hi,

Am Donnerstag, 4. Oktober 2012 17:14:54 UTC+2 schrieb bump:
>
> After the patch #13461 you can do the following: 
>
> sage: A2=WeylCharacterRing("A2",style="coroots") 
> sage: rep = A2(1,0) 
> sage: a2 = WeightRing(A2) 
> sage: a2(rep) 
> a2(0,-1) + a2(-1,1) + a2(1,0) 
>

Thanks, Dan! That's exactly what I need. Would one be able to get something 
like [(0,-1),(-1,1),(1,0)] from there in a not-too-cumbersome way? I cannot 
see how right now.

IMHO, Nicola's approach seems nicer though.

Cheers,
Jesús

-- 
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/-/10jWUwmGN1AJ.
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: [sage-devel] Cartan matrix for a relabelled Cartan type?

2012-10-30 Thread JesusTorrado
Ok, this is shameful, but I have been a few weeks absolutely overloaded 
with work.

Is it too late to fix it?

Cheers, ans sorry!
Jesús

Am Freitag, 5. Oktober 2012 09:24:38 UTC+2 schrieb Nicolas M. Thiery:
>
> On Thu, Oct 04, 2012 at 04:01:11AM -0700, JesusTorrado wrote: 
> >I will put my hands on it, then. 
>
> Great, thanks! 
>
> >This will be my first contribution to Sage, 
>
> Even better: we love when new contributors come in, and this is a 
> perfect fit for a first contribution. 
>
> >so I would ask some patience from you ;) 
>
> Certainly! We all know the hurdles ... 
>
> By the way, instead of a: 
>
> if type.is_affine(): 
> self._add_abstract_superclass(CartanType_affine) 
> if ... 
>
> you may want to use something less redundant like: 
>
> for cls in [CartanType_affine, ...]: 
> if isinstance(type, cls) and not isinstance(self, cls): 
> self._add_abstract_superclass(cls) 
>
> Probably the list of classes should be ordered from most specific to 
> most general. 
>
> 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 view this discussion on the web visit 
https://groups.google.com/d/msg/sage-combinat-devel/-/vihs3USRm38J.
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: Summer School in Discrete Maths / Sage-Combinat Days, Bobo

2012-10-30 Thread Mike Zabrocki
Good luck Nicolas!  
Have you seen Book of Mormon yet?  I can imagine the Sage parody has
Elder Price = Nicolas (maybe William Stein = Joseph Smith?).

If lack of internet is the only problem you run into then you got off easy!

-Mike

On Monday, 29 October 2012 14:29:13 UTC-4, Nicolas M. Thiery wrote:
>
> Hi! 
>
> Just some quick news from Bobo-Dioulasso, in Burkina, where we just 
> started our summer school on discrete maths / Sage-Combinat Days!  An 
> interesting challenge to run a Sage-Combinat days with basically no 
> internet. You probably won't hear from us much in the two coming 
> weeks! 
>
> 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 view this discussion on the web visit 
https://groups.google.com/d/msg/sage-combinat-devel/-/QKRQP0inhLEJ.
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.