Ask Your Question
0

Working with polynomials with non-commuting variables and symbolic rational coefficients

asked 2025-05-18 16:35:08 +0200

Ascot gravatar image

I'm new to sage and need to work with polynomials in non-commuting variables but with symbolic rational coefficients. Looking through Lie algebras here and FreeAlgebra I can see hints that this is possible but it is not clear how I can do this where I can expand expressions and collect symbolic coefficients of the non-commuting monomials of the polynomials.

Any help or suggestions would be welcome.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2025-05-18 20:28:28 +0200

FrédéricC gravatar image

updated 2025-06-12 21:40:38 +0200

something like this ?

sage: F = algebras.Free(SR,list('AB'))
sage: A, B = F.gens()
sage: (sin(x)*A+B)**2
sin(x)^2*A^2 + sin(x)*A*B + sin(x)*B*A + B^2

or

sage: Rx = PolynomialRing(QQ,'x')
sage: x = Rx.gen()
sage: F = algebras.Free(Rx,list('AB'))
sage: A, B = F.gens()
sage: x*A+(1/x)*B*A
x*A + 1/x*B*A

maybe ?

edit flag offensive delete link more

Comments

I see. How would I create a polynomial ring now in the variables A and B with rational and symbolic coefficients, like the 'x' above? This is where I get stuck.

Ascot gravatar imageAscot ( 2025-05-18 21:50:05 +0200 )edit

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: 2025-05-18 16:35:08 +0200

Seen: 85 times

Last updated: Jun 12