# Construct S polynomial using GAP.

I am trying to write a function which would create an s polynomial when provided with two polynomials : p1 and p2.

Here it is :

sPolynomial := function(p1, p2, order)
local lcm, res;

return res;

end;


Then here is what I am trying to do:

gap> x := Indeterminate(FLOAT_PSEUDOFIELD,"x");
x
gap> y := Indeterminate(FLOAT_PSEUDOFIELD, "y");
y
gap> l:=[x^3-2*x*y,(x^2)*y-2*y^2+x,-x^2,-2*x*y,-2*y^2+x];
gap> lexord:=MonomialLexOrdering();
gap> sPolynomial(l[4], l[5], lexord);
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 1st choice method found for IsFiniteDimensional' on 1 arguments at /proc/cygdrive/C/gap-4.9.1/lib/methsel2.g:250 called from
IsFiniteDimensional( V ) at /proc/cygdrive/C/gap-4.9.1/lib/modfree.gi:120 called from
IsFinite( r ) at /proc/cygdrive/C/gap-4.9.1/lib/ringpoly.gi:172 called from
PolynomialRing( DefaultField( cfs ), ind ) at /proc/cygdrive/C/gap-4.9.1/lib/ringpoly.gi:579 called from
DefaultRingByGenerators( arg[1] ) at /proc/cygdrive/C/gap-4.9.1/lib/ring.gi:396 called from
DefaultRing( arg ) at /proc/cygdrive/C/gap-4.9.1/lib/ring.gi:1373 called from
...  at *stdin*:19
you can 'quit;' to quit to outer loop, or
you can 'return;' to continue
brk> quit;


How could it be that the method was not found? I checked that it is situated in the needed directory.

What am I doing wrong in the case? Will be grateful for any help provided.

• "No method found" is not the same as "No file found", so the directory is not relevant here. Instead, it's a special kind of message informing you that there is no method installed - in this case for IsFiniteDimensional for V. It could be anything from calling a function with an argument of a wrong type to more complicated reasons. Please see here for some ways to inspect what's happening. I have tried to reproduce the example myself, but can't do so without definitions for indeterminates x and y. – Alexander Konovalov Jun 3 '18 at 21:34
• You are using undocumented FLOAT_PSEUDOFIELD. The code works if you define indeterminates via x := Indeterminate(Rationals,"x"); and y := Indeterminate(Rationals,"y");. Why FLOAT_PSEUDOFIELD is necessary for your calculation? – Alexander Konovalov Jun 4 '18 at 19:35
• @AlexanderKonovalov, but I would like to use Real numbers. – manymanymore Jun 4 '18 at 19:44
• Ok, actually it's mentioned in the Float package but as said there, such polynomials "behave, in subtle ways, quite differently than polynomials over rings". It might happen that you will have to go back and forth between polynomials over FLOAT_PSEUDOFIELD` and over Rationals, using the latter when exact computations suffice. – Alexander Konovalov Jun 4 '18 at 20:08