Ask Your Question
0

Linear transformations between CombinatorialFreeModule

asked 2022-07-12 20:41:47 +0100

eti_902 gravatar image

I have a CombinatorialFreeModule whose basis is a set of tuples. I want to define a linear transformation that permutes the two first components of a tuple in the basis. As a minimal example, that's what I tried:

def Action(k):    
    V = CombinatorialFreeModule(SR, [(1,0,0),(0,1,0)], prefix="")
    e = V.basis()
    f = lambda x: ((-1)^(k - x[2]))*V.basis()[(x[1],x[0],x[2])]
    return V.hom([f(x) for x in e.keys()], V)

However, I get the following error when I compute Action(1) (I have parameters in the case I am interested in, but this is a minimal example):

unable to convert [-[(0, 1, 0)], -[(1, 0, 0)]] to an element of Set of Morphisms from Free module generated by {(1, 0, 0), (0, 1, 0)} over Symbolic Ring to Free module generated by {(1, 0, 0), (0, 1, 0)} over Symbolic Ring in Category of finite dimensional vector spaces with basis over Symbolic Ring

Is there a way to correct that? As my real basis is much more bigger than that, I don't want to just define the image of each vector separately.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-07-13 20:25:55 +0100

Max Alekseyev gravatar image

Here is a solution via module_morphism:

V = CombinatorialFreeModule(SR, [(1,0,0),(0,1,0)], prefix="")
p = [1,0,2]     # permutation of tuple indices
H = V.module_morphism(lambda t: V.monomial(tuple(t[i] for i in p)), codomain=V)
e = V.random_element()
print('e =\t',e)
print('H(e) =\t',H(e))

As an example it prints:

e =  [(0, 1, 0)] + 2*[(1, 0, 0)]
H(e) =   2*[(0, 1, 0)] + [(1, 0, 0)]
edit flag offensive delete link more

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: 2022-07-12 18:26:37 +0100

Seen: 149 times

Last updated: Jul 13 '22