MareoRaft / k_combinat_for_sage

k-Schur combinatorics for SageMath
4 stars 1 forks source link

Ghseeli/specialized catalan functions #11

Closed ghseeli closed 6 years ago

ghseeli commented 6 years ago

I added the interface to specialize t in the evaluation method of a CatalanFunction. This seemed like the best place to put it without modifying any of the existing code too heavily.

MareoRaft commented 6 years ago

Can you add some tests to test_all.py showing how you would plug in t=1 when creating a catalan function? Make sure all tests in test_all.py continue to pass.

MareoRaft commented 6 years ago

The tests normally pass in under 6 seconds.

Sym = SymmetricFunctions(QQ['t'])
hl = Sym.hall_littlewood().Qp()
p = Partition([5, 5, 3, 3, 1, 1])
a(compositional_hall_littlewood_Qp(p), hl(p))

is the slow point. I think something in your changes causes a slow down.

MareoRaft commented 6 years ago

The slow down ultimately comes from passing t into SymmetricFunctions(self.base_ring).hall_littlewood(t=t).Qp(). Using SymmetricFunctions(self.base_ring).hall_littlewood().Qp() is significantly faster.

MareoRaft commented 6 years ago

The only thing that I don't understand is your change of compositional_hall_littlewood_Qp(gamma, t=s.t, base_ring=s.base_ring()). Do we need that change?

ghseeli commented 6 years ago

Re the repr comment, the problem is that the code does not specify t in the init method, it instead gets evaluated at the eval() method. This was the least work way to modify the catalan functions.

Odd that it causes such a slowdown, I can change it up slightly.

I put tests in the docstring, but I can add them to test_all.py, too.

MareoRaft commented 6 years ago

As for issue #9 , it seems that the line return H(gamma)(HLQp.one()) was the culprit. I forgot to pass in the base ring. Now it's return H(gamma, base_ring=base_ring)(HLQp.one()).

Pushing my version up shortly.

ghseeli commented 6 years ago

For more information on my in-line comment, the compositional hall-littlewood needs to be passed a t because specializing t affects both the raising operator expression AND what they act on (using the hall-littlewood definition).

MareoRaft commented 6 years ago

I think passing in t in return compositional_hall_littlewood_Qp(gamma, base_ring=basis.base_ring(), t=basis.t) may slow down things in certain situations. Hopefully won't become a problem though

MareoRaft commented 6 years ago

Thanks, George!!