# Revision history [back]

### Definition symbolic functions on path algebra

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)


and 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.

### Definition symbolic functions on path algebra

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)


and 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.

### Definition of symbolic functions on path algebra

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)


and 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.