Opened 6 years ago

Last modified 3 years ago

#10930 new enhancement

specializations for symmetric functions

Reported by: mantepse Owned by: mantepse
Priority: minor Milestone: sage-6.4
Component: combinatorics Keywords: principal specialization, exponential specialization, symmetric functions
Cc: jbandlow Merged in:
Authors: Martin Rubey Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by mantepse)

This patch -- in the combinat queue:

http://combinat.sagemath.org/hgwebdir.cgi/patches/file/tip/sf_principal_specialization-mr.patch

implements the principal and exponential specialisations for symmetric functions as given in Stanley, Enumerative Combinatorics, Section 7.8.

Unfortunately, the patch currently has several problems:

1) it seems that always the default code in sf/sfa.py is called, I don't know why

2) I do not know how to give the desired default argument 1 the correct type in exponential_specialization

3) I guess one should rather implement this for quasi-symmetric functions, but I do not know enough about these currently

4) the documentation and sensible tests are still missing

Attachments (1)

sf_principal_specialization-mr.patch (21.0 KB) - added by mantepse 6 years ago.
patch for principal and exponential specialization

Download all attachments as: .zip

Change History (14)

Changed 6 years ago by mantepse

patch for principal and exponential specialization

comment:1 Changed 6 years ago by mantepse

  • Owner changed from tbd to mantepse

comment:2 Changed 6 years ago by mantepse

  • Component changed from PLEASE CHANGE to combinatorics
  • Priority changed from major to minor

comment:3 Changed 6 years ago by mantepse

  • Description modified (diff)

comment:4 Changed 6 years ago by jbandlow

Hi Martin,

Thanks submitting this! A quick response to your points above. I'm not sure what you mean by point (1)... can you elaborate?

For point (2), you can use None as the default value, and then do

    if q is None:
        q = self.parent().base_ring().one()

as the first line of your code.

For point (3), quasisymmetric functions are still somewhat immature--in particular they are not in Sage proper. So this is not too big of a concern.

For point (4), yes, there should be more doc and tests. In particular, I find tests like

    all( e[mu].principal_specialization(4) == e[mu].expand(4)(1,q,q^2,q^3) for mu in Partitions(4) )

particularly convincing.

comment:5 Changed 6 years ago by mantepse

Hi Jason!

Many thanks for your quick comments.

1) Using trace I find

sage: S = SymmetricFunctions(QQ); s=S.s(); f = s[2,1]
sage: trace("f.principal_specialization()")
> <string>(1)<module>()

ipdb> s
--Call--
> /home/martin/SAGE/local/lib/python2.6/site-packages/sage/combinat/sf/sfa.py(1653)principal_specialization()
   1652 
-> 1653     def principal_specialization(self, n=infinity, q=var('q')):
   1654         r"""

ipdb> s
> /home/martin/SAGE/local/lib/python2.6/site-packages/sage/combinat/sf/sfa.py(1681)principal_specialization()
   1680         """
-> 1681         from sage.combinat.sf.sf import SymmetricFunctions
   1682         p = SymmetricFunctions(self.parent().base_ring()).p()

ipdb> 

but I was hoping that the principal specialisation from schur.py would be called.

2) Well, currently the actual value of 1 is not used at all (I test q==1 and call principal_specialization without passing q). So my question really is: some day somebody might implement something where the q is actually used. Is it better then if the default is None and the doc says, None should always mean one?

Thanks again!

comment:6 Changed 6 years ago by mantepse

I fixed indenting, bugs and added documentation and tests. Feedback welcome!

comment:7 follow-up: Changed 6 years ago by jbandlow

Hi Martin, a few more points:

1) If I'm not mistaken, the function f in the exponential_specialization code for Schur functions is returning the product of the hooks of partition. This can also be done with Partition(partition).hook_product(1)

2) You do not give the result of the test in line 275 of the Schur function code.

3) See this and make sure that your patch satisfies these criteria. Please ask the sage-combinat list if you have any questions about these.

4) Once you have completed all of this, mark the patch as 'Needs Review' (by clicking the button at the bottom of the page). Then the 'Patchbot' will automatically apply and test your code.

Again, many thanks for your good work!

comment:8 in reply to: ↑ 7 ; follow-up: Changed 6 years ago by mantepse

Replying to jbandlow:

Jason, might it be that you were looking on a different version of the patch? There is no exponential_specialization for Schur functions (I use the generic version) and there is no test in line 275...

On the other hand, I just noticed several other problems with the code. Eg., s[1].exponential_specialization() doesn't work right now. I also should include tests for calling without any arguments...

comment:9 in reply to: ↑ 8 Changed 6 years ago by jbandlow

Replying to mantepse:

Hi Martin,

Sorry for the delay. Yes I was looking at the wrong version of the patch last time. Everything on the combinat queue now looks good to me. I think that all that is left is for you to prepare the patch for sage as mentioned in my point (3) above.

comment:10 Changed 4 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:11 Changed 3 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:12 Changed 3 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:13 Changed 3 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4
Note: See TracTickets for help on using tickets.