Passing Sage functions to Singular
Hello Everyone,
given a polynomial f:C2→C in two complex variables x,y together with a singular isolated point (0,0) of f, I try to extract information about the set of points (x,y)∈C2:f(x,y)=0 that intersect a small sphere Sϵ3(z) centered at the origin. In order to obtain points (x,y) satisfying both conditions, I wanted to split my two complex variables (x,y) in their real and imaginary part to obtain a polynomial f:R4→R2 and to easily write the second condition in terms of x21+x22+y21+y22−ϵ2=0,x=x1+i x2, y=y1+i y2.
I know that the solution is homeomorphic to S1∪S1, that's why I want to pass f splitted in real and imaginary part as functions of (x1,x2,y1,y2) to Singular together with the equation above, to get the two components of the solution. Everything works perfectly so far (giving the equations to Singular directly), except that I can't manage to pass the functions from Sage to singular (via the built-in Interface).
I tried something like:
C.<x, y> = PolynomialRing(CC)
f = x^2 +y^2
f1 = real_part(f)
f2 = imag_part(f); f2
# The output for f2 is:
# 2.00000000000000*imag_part(x)*real_part(x) + 2.00000000000000*imag_part(y)*real_part(y)
I know how to define new functions in Singular via
R = singular.ring(0, '(x_1,x_2,y_1,y_2)', 'lp')
g = singular.new('2*x_1*x_2 + 2*y_1*y_2')
but how can I pass f1 and f2 to Singular and tell Singular to treat them as functions of (x1,x2,y1,y2)?
Thanks you very much!