Question: How to create Inverse Operators in a Skew Algebra

I am trying to create a ring of difference operators with customly defined actions. I have managed to get the code to work to an extent, but I am having trouble creating the inverse operators. For example, if Sn sends n to n+2, I want to create Sn^(-1) that sends n to n-2. When I tried to input this into the algebra itself, it gave me the following error: "Error, (in Ore_algebra:-skew_algebra) indeterminate n may appear in a single commutation only". Below is the code that creates the difference algebra. Apologies for the bad formatting.


> with(Ore_algebra);

> CreateDifferenceAlgebra := proc (vars::(list(symbol)), offsets::(list(numeric)))


local actions, i, var, diff_op,
shift_offset, algebra; actions := table();
for i to numelems(vars) do
   var := vars[i];
   diff_op := convert(cat("S",\var), symbol);
   shift_offset := offsets[i];
   actions[diff_op] := (proc (values) options operator, arrow; proc (u, order)
      local res; res := u;
      to order do res := subs(values[1] = values[1]+values[3], res*values[2]) end do;
      res
      end proc

   end proc)([var, diff_op, shift_offset]) end do;


algebra := Ore_algebra:-skew_algebra(seq(shift = [convert(cat("S",

vars[i]), symbol), vars[i]], i = 1 .. numelems(vars)),

action = {seq(convert(cat("S", vars[i]), symbol) =
actions[convert(cat("S", vars[i]), symbol)], i = 1 ..
numelems(vars))}); return algebra end proc


;

 

 

Please Wait...