Loading [MathJax]/jax/output/HTML-CSS/jax.js
Ask Your Question
3

How to manipulate equations with non-commuting symbols

asked 3 years ago

9cco gravatar image

Hi, I'm very new to sage so I'm not really sure if this is possible to do. For simplicity let's say I want to define an equation D1D2η=κη,κC. Then for the symbols Di all I want to do is define new symbols like D1=Dx+iDy and D2=DxiDy, and insert this into the expression above and get sage to simplify it. If I had DiC, then this could I understand be done with the substitute command. However, the Di are such that D1D2D2D1.

Can I define D1 = var('D1', latex_name=r'D_1') in such a way that it will not commute when put into an expression for example by writing eq1 = D1*D2*eta == k*eta ?


Additional background

More specifically, Di are linear operators that act on functions η:R3C.

I understand FreeAlgebra somehow lets you define expressions based on non-commutative symbols, however I'm not very fluent in rings and abstract algebra so the language is a bit foreign to me. I tried to define

F.<eta,D1,D2> = FreeAlgebra(SR,3)
k = var('k', latex_name=r'\kappa')
eq1 = D1*D2*eta == I*eta*k

However, this just results in False. Not really what I wanted.

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
3

answered 3 years ago

9cco gravatar image

I think I was 90% of the way to the answer. Instead of defining equations by eq = pol1 == pol2, I simply defined pol1 and pol2 as separate variables as

var('k1', latex_name=r'\kappa_1')
var('k2', latex_name=r'\kappa_2')
var('k3', latex_name=r'\kappa_3')
var('k4', latex_name=r'\kappa_4')    
F.<eta_x,eta_y,D_x,D_y> = FreeAlgebra(SR,4)

pol1 = (k1*D_x^2 + k2*D_y^2)*eta_x + (k3*D_x*D_y + k4*D_y*D_x)*eta_y
pol2 = eta_x

I could then substitute new non-commuting variables by making another FreeAlgebra and substituting in all the generators by

G.<eta_p,eta_m,D_p,D_m> = FreeAlgebra(SR,4)
pol2_subs = pol2.subs(eta_x = (eta_p + eta_m)/sqrt(2))
pol1_subs = pol1.subs(eta_x = (eta_p + eta_m)/sqrt(2), eta_y = I*(-eta_p + eta_m)/sqrt(2), D_x = (D_p + D_m)/(q*sqrt(2)), D_y = I*(-D_p + D_m)/(q*sqrt(2))

I defined several equations by defining more polynomial expressions and was able to add and subtract them in the normal way. The only problem I had was that I now wasn't able to substitute the normal k1 variables for some reason. But I was able to solve my problem through this method anyway.

Preview: (hide)
link

Comments

You can accept your own answer. Click the "check mark" button at the top left of the answer.

slelievre gravatar imageslelievre ( 3 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 3 years ago

Seen: 515 times

Last updated: Jun 24 '21