$\operatorname{RamRatPolyToLMOp}(f, x, M, b)$
libname := libname, FileTools:-JoinPath(["maple","lib","dcfun.mla"],base=homedir):
with(dcfun):
For a rational function, an order $1$ operator does the job and is obviously of minimal order among all nonzero linear Mahler operators which annihilates the rational function.
b := 2;
$$2$$
f := x/(1 + x);
$$\frac{x}{1+x}$$
L := RamRatPolyToLMOp(f, x, M, b);
$$x \left(1+x \right)-\left(x^{2}+1\right) M$$
LMOpEval(L, f, x, M, b);
$$0$$
For a ramified rational function, the order of the provided operator may be greater than $1$.
f := x^(1/3)/(1 + x);
$$\frac{x^{\frac{1}{3}}}{1+x}$$
L := RamRatPolyToLMOp(f, x, M, b);
$$M^{2} \left(x^{4}+1\right)-x^{2}-x$$
LMOpEval(L, f, x, M, b);
$$0$$
With the option '${\mathit output}$' = '$\mathit{monic}$', the unique monic polynomial which annihilates on $f$ is provided.
L := RamRatPolyToLMOp(f, x, M, b, 'output' = 'monic');
$$M^{2}-\frac{x \left(1+x \right)}{x^{4}+1}$$