# Free algebra with involution

I'd like to implement an involution over a free (associative noncommutative) algebra, i.e., an antiautomorphism of order 2 (linear map such that $f(ab)=f(b)f(a)$ and $f(f(a))=a$), but I don't know where to start. Perhaps we could define the algebra with a double number of generators, every generator x having its involution x1, and then define f from this by correspondence of generators (but I have no knowledge to do this).

More precisely, what I actually want to do is to take the product of the algebra as starting point to define a new product of the form $$a*b:=af(b).$$