First time here? Check out the FAQ!

Ask Your Question
1

Products in a free algebra.

asked 11 years ago

broken_symlink gravatar image

If I have a free algebra generated by x and y is there a way to tell that xy is a product of x and y? I would like to define a function that takes products xy and returns -2x - 2y - 4.

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 11 years ago

broken_symlink gravatar image

updated 11 years ago

Someone answered my question on the mailing list. To get access to each generator in a product you need to use the following:

F.<x,y>=FreeAlgebra(ZZ,2)
g=4+3*x^7*y^10*x^13
h=g._FreeAlgebraElement__monomial_coefficients
print h
print h.items()
print h.items()[1][0]._element_list

Source

Preview: (hide)
link

Comments

Thanks. I have opened ticket 14848

ppurka gravatar imageppurka ( 11 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: 11 years ago

Seen: 335 times

Last updated: Jul 02 '13