Martin's solution is the correct one as it should be preparsing the input 
before it gets to the __init__(), which is then used as the key. This also 
is needed for HallLittlewood and Macdonald.

Best,
Travis

PS - Sorry for not responding sooner about this.

On Tuesday, February 6, 2024 at 4:16:21 PM UTC+9 Martin R wrote:

> Thank you for the explanation.
>
> I would be very surprised about `R.<t>=S.jack()`, because the 
> *coefficients* are (usually regarded as) rational functions in `t`, and the 
> *monomials* are Jack symmetric functions.
>
> I found the following alternative solution at 
> https://doc.sagemath.org/html/en/reference/structure/sage/structure/unique_representation.html
> :
>
> class Jack(UniqueRepresentation):
>     @staticmethod
>     def __classcall__(cls, Sym, t='t'):
>         return super().__classcall__(cls, Sym, Sym.base_ring()(t))
>     
>     def __init__(self, Sym, t):
>
> I think I like it better.  Is there anything wrong with it?
> On Monday 5 February 2024 at 19:17:20 UTC+1 Nils Bruin wrote:
>
>> I second that response. More specifically, what you're running into is:
>>
>> sage: S.jack(t=t) == S.jack(t='t')
>> False
>>
>> which is indeed within UniqueRepresentation design parameters: returned 
>> values are cached on construction parameters 't' and '"t"' hash to 
>> different values. If you need better processing, you'd need to normalize 
>> the input parameters further before calling the UniqueRepresentation 
>> constructor. In your case, I think jack.Jack (which is what ends up being 
>> called) actually does expect a string. Perhaps this keyword should be 
>> renamed to "names" to comply with uses elsewhere? e.g., would 
>> R.<t>=S.jack() make sense? If so, then the following should probably be 
>> made to work:
>>
>> sage: preparse("R.<t>=S.jack()")
>> "R = S.jack(names=('t',)); (t,) = R._first_ngens(1)"
>> On Monday 5 February 2024 at 05:57:40 UTC-8 Martin R wrote:
>>
>>> At https://github.com/sagemath/sage/pull/37220 I am trying to provide a 
>>> construction functor for symmetric functions. I am hitting the following 
>>> bug, which I hope is easy to fix if one knows the right magic:
>>>
>>> sage: P.<t> = QQ[]
>>> sage: S = SymmetricFunctions(P)
>>> sage: S.jack().P() == S.jack(t=t).P()
>>> False
>>>
>>> Can someone help me out?
>>>
>>> Martin
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/63adb36b-d809-47d0-a98f-6cf3f70508acn%40googlegroups.com.

Reply via email to