Ask Your Question
1

How to implement Non Commuting Multivariate Formal Power Series rings in SageMat

asked 2025-01-06 16:14:28 +0100

levav gravatar image

updated 2025-01-06 20:39:11 +0100

Hi everyone,

As the title says, I need to use Non Commuting Multivariate Formal Power Series rings (Over P-adics) for my masters research, and while I found Non Commuting Multivariate Polynomial rings (e.g. the FreeAlgebra) and Multivariate Formal Power Series rings, I haven't found something that mixes both.

Is there some terminology for this that I'm missing? Or a simple way to implement this in sage?

Edit: I need to be able to do calculations with its generators. For example, (a+1)^(-1) should be 1 - a + a^2 - a^3 + ... + O(..) when 'a' is a generator.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2025-01-06 18:28:02 +0100

FrédéricC gravatar image

updated 2025-01-07 08:31:18 +0100

Like this

sage: F = algebras.Free(QQ, ['a','b'], degrees=(1,1))
sage: FF = F.completion(); FF
Lazy completion of Free Algebra on 2 generators (a, b) with degrees (1, 1) over Rational Field
sage: a,b = F.gens()
sage: a = FF(a) ; b = FF(b)
edit flag offensive delete link more

Comments

Note that this is quite recent and probably not much tested.

FrédéricC gravatar imageFrédéricC ( 2025-01-06 19:48:31 +0100 )edit

Thank you for the answer! I tried it but didn't manage to do calculations with its elements. I should've mentioned that I needed to do so in the question. I should be able to, for example, calculate (a+1)^(-1) to be 1 - a + a^2 - a^3 + ... + O(..)

Errors I encountered:

G = F.completion()
G.algebra_generators()

Throws

TypeError: 'NotImplementedType' object is not callable

and

G.inject_variables()

Throws

ValueError: variable names have not yet been set using self._assign_names(...)

I've tried doing:

G._assign_names(['a', 'b'])
G.inject_variables()

But it throws:

AttributeError: 'LazyCompletionGradedAlgebra_with_category' object has no attribute 'gens'

Oh, just saw what you wrote 48 min ago. Welp, I guess this is the result of my tests.

levav gravatar imagelevav ( 2025-01-06 20:36:19 +0100 )edit

I have edited my answer to explain how to define the generators.

FrédéricC gravatar imageFrédéricC ( 2025-01-07 08:32:02 +0100 )edit

Thank you so much! that solved my issue completely. Just wish I could upvote lol

levav gravatar imagelevav ( 2025-01-07 09:50:29 +0100 )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

Stats

Asked: 2025-01-06 16:14:28 +0100

Seen: 35 times

Last updated: 2 days ago