Quotient field of the polynomial ring over the complex numbers

87 views
Skip to first unread message

Urs Hackstein

unread,
Oct 18, 2011, 10:37:51 AM10/18/11
to sage-support
Hi all,

it is nearly the same problem I posted already here and I am afraid
that there is no solution. But I hope that this reformulation could
give some new insights.
Let f be an element of the quotient field of the polynomial ring (in
one variable) over the complex numbers.
Our goal is to find representatives a and b in the polynomial ring
over the complex numbers such that f=a/b. Can sage do this for me?
(Simple commands like simplify or expand don' t work.)

Thanks a lot in advance.

Urs Hackstein

Maarten Derickx

unread,
Oct 18, 2011, 3:10:15 PM10/18/11
to sage-s...@googlegroups.com
It all depends on how this f is created/defined. Can you give an explicit example?

Simon King

unread,
Oct 18, 2011, 6:20:49 PM10/18/11
to sage-support
Hi Urs,

On 18 Okt., 16:37, Urs Hackstein <urs.hackst...@googlemail.com> wrote:
> Our goal is to find representatives a and b in the polynomial ring
> over the complex numbers such that f=a/b. Can sage do this for me?
> (Simple commands like simplify or expand don' t work.)

You mention simplify and expand - which probably means that you are in
fact *not* working in the quotient field of a polynomial ring, because
simplify and expand are typical methods of symbolic expressions.

Could you tell us the result of f.parent()?

If f.parent() is a quotient field, then methods like f.numerator()
and f.denominator() will provide you with the polynomials a and b you
were looking for.

Cheers,
Simon

Urs Hackstein

unread,
Oct 20, 2011, 7:08:50 AM10/20/11
to sage-s...@googlegroups.com
Hi Simon,

f.parent() gives indeed "Symbolic Ring".  But at the beginning I defined

P.<s> = CC[]
P.fraction_field()

with the display        
Fraction Field of Univariate Polynomial Ring in s over Complex Field
with 53 bits of precision

so I'm a bit confused.

f.numerator() and f.denominator.de() provide me some results, but these are not the ones I'm looking for.
Actually, f is given as f=c/d, but with c or d not polynomials or not given in the form a_0*s^n+a_1
*s^(n-1)+...+a_n.
Unfortunately, f.numerator() delivers c, not a.

Cheers,

Urs






2011/10/19 Simon King <simon...@uni-jena.de>

--
To post to this group, send email to sage-s...@googlegroups.com
To unsubscribe from this group, send email to sage-support...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Simon King

unread,
Oct 20, 2011, 7:42:47 AM10/20/11
to sage-support
Hi Urs,

On 20 Okt., 13:08, Urs Hackstein <urs.hackst...@googlemail.com> wrote:
> f.parent() gives indeed "Symbolic Ring".  But at the beginning I defined
>
> P.<s> = CC[]
> P.fraction_field()

Then we really need to know how you define f.

Recall that in the other thread on that subject, I pointed out how
easy it is to start with a polynomial and end with a symbolic
expression: The symbol "I" is a symbolic expression. It is recognised
as an element of CC, but nevertheless its parent is the symbolic ring:

sage: I in CC
True
sage: I.parent()
Symbolic Ring

Hence, when you add the generator s of the polynomial ring with I,
then you obtain a symbolic expression, not a polynomial, even though
the sum is recognised as an element of the polynomial ring:
sage: P.<s> = CC[]
sage: s.parent()
Univariate Polynomial Ring in s over Complex Field with 53 bits of
precision
sage: (s+I).parent()
Symbolic Ring
sage: s+I in P
True

This can be avoided by explicitly defining "I" to be the generator of
CC:
sage: I = CC.0
sage: I
1.00000000000000*I
sage: (s+I).parent()
Univariate Polynomial Ring in s over Complex Field with 53 bits of
precision

Best regards,
Simon

Urs Hackstein

unread,
Oct 21, 2011, 5:35:04 AM10/21/11
to sage-s...@googlegroups.com
Hi Simon,

thanks a lot for your remarks. My expression doesn't contain I and thus the definition of I as the generator of CC doesn't change anything.

Well, the definition of f contains a lot of symbolic variables, so that might be the problem. I don't define f at once, but succesively. Starting with the fraction       
T12*T22*Z21*Z22/T1*T2*Z21+T1*T2*Z22,

I replace successively all symbolic variables by expressions with new siymbolic variables, so that f grows larger and larger.

Is there a possibility to have coefficients of symbolic variables and to work over the quotient field of complex numbers at the same time.?


Thanks a lot in advance,

Urs Hackstein

 

2011/10/20 Simon King <simon...@uni-jena.de>
Simon

Urs Hackstein

unread,
Oct 21, 2011, 5:36:30 AM10/21/11
to sage-s...@googlegroups.com
correction: .....over the quotient field of the polynomial ring over the complex numbers....

2011/10/21 Urs Hackstein <urs.ha...@googlemail.com>

Maarten Derickx

unread,
Oct 21, 2011, 7:13:27 AM10/21/11
to sage-s...@googlegroups.com
I suggest that you don't word with symbolic variables then, but make the fraction field of a polynomial ring with enough variables to do the calculations in, in this case c.numerator() and c.denominator() works also for the intermediate results. An other thing you could do is CC['x'](c).denominator() if c is a polynomial expression involving only x and no symbolic variables anymore.

Simon King

unread,
Oct 21, 2011, 10:03:19 AM10/21/11
to sage-support
Hi Urs,

On 21 Okt., 11:35, Urs Hackstein <urs.hackst...@googlemail.com> wrote:
> Well, the definition of f contains a lot of symbolic variables, so that
> might be the problem. I don't define f at once, but succesively. Starting
> with the fraction
>
> T12*T22*Z21*Z22/T1*T2*Z21+T1*T2*Z22,
>
> I replace successively all symbolic variables by expressions with new
> siymbolic variables, so that f grows larger and larger.

So, in a nutshell, you do things like

sage: var('T1 T2')
(T1, T2)
sage: P.<s> = CC[]
sage: q = T1/T2
sage: p = q.subs(T1=1,T2=s)
sage: p.parent()
Symbolic Ring

Not good. I would have expected it to end up in the quotient ring of
P. Also, it won't help to define q as a symbolic function and evaluate
T1 and T2:

sage: q(T1,T2) = T1/T2
sage: p = q(T1=1,T2=s)
sage: p.parent()
Symbolic Ring

Of course, as Maarten has pointed out, you can explicitly cast p into
the fraction field of P:
sage: F = Frac(P)
sage: F(p).parent()
Fraction Field of Univariate Polynomial Ring in s over Complex Field
with 53 bits of precision
sage: F(p)
1.00000000000000/s

Or, which may both be easier and faster, you could define an actual
Python function that returns an arithmetic expression out of input
data T1,T2,T3,...:

sage: def q(T1,T2):
....: return T1/T2
....:
sage: p = q(1,s)
sage: p.parent()
Fraction Field of Univariate Polynomial Ring in s over Complex Field

Urs Hackstein

unread,
Oct 31, 2011, 8:23:09 AM10/31/11
to sage-s...@googlegroups.com
Hi,

in the meantime I tried the variant with the Python function. Unfortunately, if I choose p.denominator(), I receive an expression like
((9.5e-09)*(105263157.895/(x_1*s) + 50)*((1.49968e-05)/x_1 +
1/(((1.2e-11)*y_1 + 0.0191146666667*2^(1/5))*s) +
5263157894.74/((105263157.895/(x_1*s) + 50)*x_1*s) +
(315789473.684/(((1.68843903816e-10)*x_1/y_1 + 6e-13)*s) +
315789473.684)*((1/(((1.68843903816e-10)*x_1/y_1 + 6e-13)*s) +
1)*((1.49968e-05)/x_2 + 1/(((1.2e-11)*y_2 +
0.0191146666667*2^(1/5))*s)) + (1/(((1.68843903816e-10)*x_1/y_1 +
6e-13)*s) + 1)^2*(1/(((1.55147112222e-10)*x_2/y_2 + 6e-13)*s) +
1)^2*(3157.22105263/x_3 + 210526315.789/(((1.2e-11)*y_3 +
0.0191146666667*2^(1/5))*s))/((2/y_2 +
105263157.895/(x_3*s))*((1/(((1.68843903816e-10)*x_1/y_1 + 6e-13)*s) +
1)*(1/(((1.55147112222e-10)*x_2/y_2 + 6e-13)*s) + 1)*((1.49968e-05)/x_3
+ 1/(((1.2e-11)*y_3 + 0.0191146666667*2^(1/5))*s)) +
(210526315.789/(((1.68843903816e-10)*x_1/y_1 + 6e-13)*s) +
210526315.789)*(1/(((1.55147112222e-10)*x_2/y_2 + 6e-13)*s) +.................

where s is the variable of the polynomial ring and x_1, x_2, x_3, y_1, y_2, y_3 are (symbolic) variables.
Best regards,

Urs

2011/10/21 Simon King <simon...@uni-jena.de>

Nils Bruin

unread,
Oct 31, 2011, 12:53:15 PM10/31/11
to sage-support
On Oct 18, 7:37 am, Urs Hackstein <urs.hackst...@googlemail.com>
wrote:
> Let f be an element of the quotient field of the polynomial ring (in
> one variable) over the complex numbers.
> Our goal is to find representatives a and b in the polynomial ring
> over the complex numbers such that f=a/b. Can sage do this for me?
> (Simple commands like simplify or expand don' t work.)

If you know bounds on the degrees of a,b it becomes a simple
interpolation/linear algebra problem. If a,b are guaranteed to exist
of degree <= d then just choose n=2*d+2 evaluation points
z_1,z_2,...,z_n and consider the equations

a(z_i)-f(z_i)*b(z_i) = 0 (for i=1,...,n)

That gives you n equations that are linear homogeneous in the
coefficients of a,b. Just solve for those [you can write down a matrix
representation of that system with about as much effort as introducing
sufficient variables and letting sage figure out what system to
solve].

You get a high degree of confidence that your candidate function is
correct when you ensure your system is overdetermined (i.e., pick n
larger). If you use floats you may have to settle for a least squares
solution and verify that the match is very good.

Once you have a candidate function, you can try and see if sage can
simplify b(z)*f(z)-a(z) to 0. However, if you're working with floats
that is virtually guaranteed to not work or produce garbage.

Urs Hackstein

unread,
Jul 11, 2012, 10:26:20 AM7/11/12
to sage-s...@googlegroups.com
Thanks a lot for your explanations!

I know that the denominator has degree eight and the degree of the numerator is lower or equal 8.
However, if I try to solve the exact interpolation problem by

 solve([f_1*b.subs(w=0.5)-a.subs(w=0.5)==0, f_2*b.subs(w=1)-a.subs(w=1)==0,f_3*b.subs(w=5)-a.subs(w=5)==0,f_4*b.subs(w=10)-a.subs(w=10)==0,f_5*b.subs(w=50)-a.subs(w=50)==0, f_6*b.subs(w=100)-a.subs(w=100)==0, f_7*b.subs(w=500)-a.subs(w=500)==0,f_8*b.subs(w=1000)-a.subs(w=1000)==0,f_9*b.subs(w=5000)-a.subs(w=5000)==0, f_10*b.subs(w=10000)-a.subs(w=10000)==0, f_11*b.subs(w=5*10^4)-a.subs(w=5*10^4)==0, f_12*b.subs(w=10^5)-a.subs(w=10^5)==0, f_13*b.subs(w=5*10^5)-a.subs(w=5*10^5)==0, f_14*b.subs(w=10^6)-a.subs(w=10^6)==0, f_15*b.subs(w=5*10^6)-a.subs(w=5*10^6)==0, f_16*b.subs(w=10^7)-a.subs(w=10^7)==0, f_17*b.subs(w=5*10^7)-a.subs(w=10^7)==0, f_18*b.subs(w=10^8)-a.subs(w=10^8)==0, b_8>0], a_0, a_1, a_2, a_3, a_4, a_5, a_6, a_7, a_8, b_0, b_1, b_2, b_3, b_4, b_5, b_6, b_7, b_8)

sage don't find any solution. What have I to modify to receive a least squares solution?

Thanks a lot in advance!

Urs Hackstein

2011/10/31 Nils Bruin <nbr...@sfu.ca>
Reply all
Reply to author
Forward
0 new messages