Definition of symbolic functions on path algebra

asked 2020-04-10 15:54:33 +0100

Z3r0 gravatar image

updated 2020-04-11 00:36:42 +0100

I tried to define a symbolic function on path algbera like that:

G = DiGraph({1:{2:['a']}, 2:{3:['b']}})
P = G.path_semigroup()
A = P.algebra(GF(7))
A.inject_variables()

def ev(self, x): return 2*x
foo = function("foo", nargs=1, eval_func=ev)
foo(a)

But I get an error: TypeError: cannot coerce arguments: no canonical coercion from Path algebra of Multi-digraph on 3 vertices over Finite Field of size 7 to Symbolic Ring. My question how can I define a symbolic function to accept path algebra variables?

Thanks.

edit retag flag offensive close merge delete

Comments

What do you actually want to achieve? Symbolic functions are probably not the answer.

rburing gravatar imagerburing ( 2020-04-11 10:12:57 +0100 )edit

Thanks, I want to create derivations on path algebras.

Z3r0 gravatar imageZ3r0 ( 2020-04-11 12:30:43 +0100 )edit

It seems SageMath only has an implementation for derivations over commutative rings. I guess you could do something yourself though. Which derivations do you want to create, and what do you want to do with them?

rburing gravatar imagerburing ( 2020-04-11 13:45:13 +0100 )edit

Do you have any idea from where I can start? I want a linear map "d" that gives d(xy) = d(x)y+xd(y).where x,y in PathAlgebra.

Z3r0 gravatar imageZ3r0 ( 2020-04-11 14:55:20 +0100 )edit

Do I understand correctly that you want a "generic" derivation $d$, not any particular one? (A particular one would be easier.) I'm not an expert on path algebras, but: for an element a, you can get its terms by doing list(a) (that takes care of linearity), and you should manipulate the QuiverPaths somehow to get the "factors", to implement the product rule.

rburing gravatar imagerburing ( 2020-04-11 15:55:57 +0100 )edit