Processing math: 100%
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to transpose two variables of an expression

Hello, I am using Sagemath version 10.3 I want to work with Double Affine Hecke Algebra (DAHA) generators, which are operators from Q(q,t)[x1,,xm]Q(q,t)[x1,,xm] Ti(f)=tf+txixi+1xixi+1(Ki,i+1ff) Where Ki,i+1f(x1,,xi,xi+1,xm)=f(x1,,xi+1,xi,xm), is the action which interchanges the two variables xi and xi+1. I tried to write it down but I don't know how to do this on expressions, I didn't found the Ki,i+1 so I wrote it using functions for m=3.

I wrote this:

t = PolynomialRing(RationalField(), 't,z_0,z_1,z_2').gen() def T1(f): expr=tf(z_0,z_1,z_2)+(tz_0-z_1)(f(z_1,z_0,z_2)-f(z_0,z_1,z_2))/(z_0-z_1) out=expr.simplify_full() return out def T2(f): expr=tf(z_0,z_1,z_2)+(tz_1-z_2)(f(z_0,z_2,z_1)-f(z_0,z_1,z_2))/(z_1-z_2) out=expr.simplify_full() return out

My problem with this approach is that I cannot use T2(T1(f)), I have to do a(z_0,z_1,z_2)=T1(f) T2(a) And with bigger m it becomes more cumbersome.

Any advice?

How to transpose two variables of an expression

Hello, I am using Sagemath version 10.3 I want to work with Double Affine Hecke Algebra (DAHA) generators, which are operators from Q(q,t)[x1,,xm]Q(q,t)[x1,,xm] Ti(f)=tf+txixi+1xixi+1(Ki,i+1ff) Where Ki,i+1f(x1,,xi,xi+1,xm)=f(x1,,xi+1,xi,xm), is the action which interchanges the two variables xi and xi+1. I tried to write it down but I don't know how to do this on expressions, I didn't found the Ki,i+1 so I wrote it using functions for m=3.

I wrote this:

t = PolynomialRing(RationalField(), 't,z_0,z_1,z_2').gen()
def T1(f):
    expr=tf(z_0,z_1,z_2)+(tz_0-z_1)(f(z_1,z_0,z_2)-f(z_0,z_1,z_2))/(z_0-z_1)
expr=t*f(z_0,z_1,z_2)+(t*z_0-z_1)*(f(z_1,z_0,z_2)-f(z_0,z_1,z_2))/(z_0-z_1)
    out=expr.simplify_full()
    return out
def T2(f):
    expr=tf(z_0,z_1,z_2)+(tz_1-z_2)(f(z_0,z_2,z_1)-f(z_0,z_1,z_2))/(z_1-z_2)
expr=t*f(z_0,z_1,z_2)+(t*z_1-z_2)*(f(z_0,z_2,z_1)-f(z_0,z_1,z_2))/(z_1-z_2)
    out=expr.simplify_full()
    return out

out

My problem with this approach is that I cannot use T2(T1(f)), I have to do do

a(z_0,z_1,z_2)=T1(f)
T2(a)

And with bigger m it becomes more cumbersome.

Any advice?