Loading [MathJax]/jax/output/HTML-CSS/jax.js

First time here? Check out the FAQ!

Ask Your Question
3

Differentiation of non-commutative polynomials in Sage

asked 3 years ago

klaaa gravatar image

updated 3 years ago

Let f be a polynomial in the non-commutative polynomial ring K[[x1,..,xn]] in n variables. Define a K-linear map for an i with 1in as di:K[[x1,..,xn]]K[[x1,..,xn]] on monomials as di(f)=g if f=xig and di(f)=0 else, so that this operator simply strikes off the leftmost xi.

Define the K-linear (cyclic) differentiation operator for an i with 1in as δi:K[[x1,..,xn]]K[[x1,..,xn]] on monomials as δi(xi1xit)=tj=1di(xijxij+1xitxi1xij1).

Question: Is there an easy (or even already existing) way to obtain the result of applying δi to a non-commutative polynomial using Sage?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 3 years ago

dan_fulea gravatar image

updated 3 years ago

If i correctly understood the cyclic differential, the following pedestrian code should do the job...

def delta(f, i):
    """Implement $d_i$ on elements f of a free algebra with N generators.
    Here, we expect that i is among 0, 1, ... , N-1.

    Below, there is a commented print.
    For the test non-commutative polynomial f from

    F.<a,b,c> = FreeAlgebra(QQ)
    f = a^3*b^2*a*c*b + 3*a*b^3*c - 7*a^3

    it delivers:

    Derivating monomial a^3*b^2*a*c*b
    (alias [(a, 3), (b, 2), (a, 1), (c, 1), (b, 1)] as a list)
    with coefficient 1.

    Derivating monomial a*b^3*c
    (alias [(a, 1), (b, 3), (c, 1)] as a list)
    with coefficient 3.

    Derivating monomial a^3
    (alias [(a, 3)] as a list)
    with coefficient -7.

    Hope this explains the implementation now...    
    """
    F = f.parent()
    N = len(F.gens())
    if i not in range(N):
        return F(0)

    v = F.gens()[i]    # and we cyclically differentiate w.r.t. v

    monomials = []    # so far, and we append monomials from derivations 
    for mon, mon_coeff in f:
        # print('Derivating monomial {}\n(alias {} as a list)\nwith coefficient {}.\n'
        #       .format(mon, list(mon), mon_coeff))
        mon_list = list(mon)
        L = len(mon_list)    # there are L entries in this list
        for j in range(L):
            if mon_list[j][0] == v:
                p = mon_list[j][1] * v^(mon_list[j][1] - 1) \
                    * prod([mon_list[(j + k) % L][0] ^ mon_list[(j + k) % L][1]
                            for k in range(1, L)])

                monomials.append(mon_coeff*p)
    return sum(monomials)

Test:

F.<a,b,c> = FreeAlgebra(QQ)
f = a^3*b^2*a*c*b + 3*a*b^3*c - 7*a^3
print(f'f = {f}')
print(f'delta0 f = {delta(f, 0)}')
print(f'delta1 f = {delta(f, 1)}')
print(f'delta2 f = {delta(f, 2)}')

This delivers:

f = -7*a^3 + 3*a*b^3*c + a^3*b^2*a*c*b
delta0 f = -21*a^2 + 3*b^3*c + 3*a^2*b^2*a*c*b + c*b*a^3*b^2
delta1 f = 9*b^2*c*a + a^3*b^2*a*c + 2*b*a*c*b*a^3
delta2 f = 3*a*b^3 + b*a^3*b^2*a
Preview: (hide)
link

Comments

Probably I didn't understand correctly the question, but I tend to think that the OP wants to implement Voiculescu's cyclic derivative. Then δa on the monomial a3b2acb would be a2b2acb+ab2acba+b2acba2+cba3b2 (the cyclicity comes from the last sum over all the "letters" and dropping always the first, if the first variable x coincides with that of the nc derivative, δx), and the answer from the code is 3a2b2acb+cba3b2. But I think your code has otherwise nailed it (I'm just too new to SageMath to know how to fix this).

c.p. gravatar imagec.p. ( 3 years ago )

Thank you very much for the answer. I will do some tests. The definition can also be found in the beginning of section 3 of https://www.maths.gla.ac.uk/~mwemyss/... . I will try it on some other examples now.

klaaa gravatar imageklaaa ( 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

2 followers

Stats

Asked: 3 years ago

Seen: 294 times

Last updated: Dec 23 '21