ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 08 Feb 2012 16:40:01 +0100import sage.rings.polynomial.multi_polynomial_sequencehttps://ask.sagemath.org/question/8700/import-sageringspolynomialmulti_polynomial_sequence/Hi all:
I'm writing some new Sage code to do partial fraction decompositions of
multivariate rational expressions and want to use the Sequence() and
algebraic_dependence() methods from
sage.rings.polynomial.multi_polynomial_sequence. What's the best
import call to use?
I've played around with various import calls, and most recently tried the following from within the function i'm writing.
from sage.structure.sequence import *
from sage.rings.polynomial.polynomial_ring_constructor import *
from sage.rings.polynomial.multi_polynomial_sequence import *
I thought that would work and be overkill, but i got the error message
/Applications/sage/local/lib/python2.6/site-packages/sage/rings/polynomial/multi_polynomial_sequence.pyc
in algebraic_dependence(self)
600 T = T+'T'
601 Ts = [T + str(j) for j in range(r)]
--> 602 RR = PolynomialRing(K,d+r,tuple(Xs+Ts))
603 Vs = list(RR.gens())
604 Xs = Vs[0 :d]
NameError: global name 'PolynomialRing' is not defined
Any advice on this particular import or imports in general would be appreciated.
Thanks.
Mon, 06 Feb 2012 18:05:45 +0100https://ask.sagemath.org/question/8700/import-sageringspolynomialmulti_polynomial_sequence/Comment by araichev for <p>Hi all:</p>
<p>I'm writing some new Sage code to do partial fraction decompositions of
multivariate rational expressions and want to use the Sequence() and
algebraic_dependence() methods from
sage.rings.polynomial.multi_polynomial_sequence. What's the best
import call to use?</p>
<p>I've played around with various import calls, and most recently tried the following from within the function i'm writing.</p>
<pre><code> from sage.structure.sequence import *
from sage.rings.polynomial.polynomial_ring_constructor import *
from sage.rings.polynomial.multi_polynomial_sequence import *
</code></pre>
<p>I thought that would work and be overkill, but i got the error message</p>
<pre><code> /Applications/sage/local/lib/python2.6/site-packages/sage/rings/polynomial/multi_polynomial_sequence.pyc
in algebraic_dependence(self)
600 T = T+'T'
601 Ts = [T + str(j) for j in range(r)]
--> 602 RR = PolynomialRing(K,d+r,tuple(Xs+Ts))
603 Vs = list(RR.gens())
604 Xs = Vs[0 :d]
NameError: global name 'PolynomialRing' is not defined
</code></pre>
<p>Any advice on this particular import or imports in general would be appreciated.</p>
<p>Thanks.</p>
https://ask.sagemath.org/question/8700/import-sageringspolynomialmulti_polynomial_sequence/?comment=20322#post-id-20322Thanks, Volker. I think i'll move this discussion to the Sage trac server: http://trac.sagemath.org/sage_trac/ticket/12417.Wed, 08 Feb 2012 16:40:01 +0100https://ask.sagemath.org/question/8700/import-sageringspolynomialmulti_polynomial_sequence/?comment=20322#post-id-20322Comment by Volker Braun for <p>Hi all:</p>
<p>I'm writing some new Sage code to do partial fraction decompositions of
multivariate rational expressions and want to use the Sequence() and
algebraic_dependence() methods from
sage.rings.polynomial.multi_polynomial_sequence. What's the best
import call to use?</p>
<p>I've played around with various import calls, and most recently tried the following from within the function i'm writing.</p>
<pre><code> from sage.structure.sequence import *
from sage.rings.polynomial.polynomial_ring_constructor import *
from sage.rings.polynomial.multi_polynomial_sequence import *
</code></pre>
<p>I thought that would work and be overkill, but i got the error message</p>
<pre><code> /Applications/sage/local/lib/python2.6/site-packages/sage/rings/polynomial/multi_polynomial_sequence.pyc
in algebraic_dependence(self)
600 T = T+'T'
601 Ts = [T + str(j) for j in range(r)]
--> 602 RR = PolynomialRing(K,d+r,tuple(Xs+Ts))
603 Vs = list(RR.gens())
604 Xs = Vs[0 :d]
NameError: global name 'PolynomialRing' is not defined
</code></pre>
<p>Any advice on this particular import or imports in general would be appreciated.</p>
<p>Thanks.</p>
https://ask.sagemath.org/question/8700/import-sageringspolynomialmulti_polynomial_sequence/?comment=20328#post-id-20328importing PolynomialRing in the sage.categories.quotient_field module won't define it in the sage.rings.polynomial.multi_polynomial_sequence module. Can you find a minimal example of an algebraic_dependence() call that fails with the NameError?Tue, 07 Feb 2012 23:38:58 +0100https://ask.sagemath.org/question/8700/import-sageringspolynomialmulti_polynomial_sequence/?comment=20328#post-id-20328Comment by araichev for <p>Hi all:</p>
<p>I'm writing some new Sage code to do partial fraction decompositions of
multivariate rational expressions and want to use the Sequence() and
algebraic_dependence() methods from
sage.rings.polynomial.multi_polynomial_sequence. What's the best
import call to use?</p>
<p>I've played around with various import calls, and most recently tried the following from within the function i'm writing.</p>
<pre><code> from sage.structure.sequence import *
from sage.rings.polynomial.polynomial_ring_constructor import *
from sage.rings.polynomial.multi_polynomial_sequence import *
</code></pre>
<p>I thought that would work and be overkill, but i got the error message</p>
<pre><code> /Applications/sage/local/lib/python2.6/site-packages/sage/rings/polynomial/multi_polynomial_sequence.pyc
in algebraic_dependence(self)
600 T = T+'T'
601 Ts = [T + str(j) for j in range(r)]
--> 602 RR = PolynomialRing(K,d+r,tuple(Xs+Ts))
603 Vs = list(RR.gens())
604 Xs = Vs[0 :d]
NameError: global name 'PolynomialRing' is not defined
</code></pre>
<p>Any advice on this particular import or imports in general would be appreciated.</p>
<p>Thanks.</p>
https://ask.sagemath.org/question/8700/import-sageringspolynomialmulti_polynomial_sequence/?comment=20329#post-id-20329I want to add my code to sage.categories.quotient_fields.py in the Sage library. The code works outside of the library, but i can't get the imports right to include it in the library. Here's the full file: http://dl.dropbox.com/u/3035372/quotient_fields.py .Tue, 07 Feb 2012 16:29:45 +0100https://ask.sagemath.org/question/8700/import-sageringspolynomialmulti_polynomial_sequence/?comment=20329#post-id-20329Comment by Volker Braun for <p>Hi all:</p>
<p>I'm writing some new Sage code to do partial fraction decompositions of
multivariate rational expressions and want to use the Sequence() and
algebraic_dependence() methods from
sage.rings.polynomial.multi_polynomial_sequence. What's the best
import call to use?</p>
<p>I've played around with various import calls, and most recently tried the following from within the function i'm writing.</p>
<pre><code> from sage.structure.sequence import *
from sage.rings.polynomial.polynomial_ring_constructor import *
from sage.rings.polynomial.multi_polynomial_sequence import *
</code></pre>
<p>I thought that would work and be overkill, but i got the error message</p>
<pre><code> /Applications/sage/local/lib/python2.6/site-packages/sage/rings/polynomial/multi_polynomial_sequence.pyc
in algebraic_dependence(self)
600 T = T+'T'
601 Ts = [T + str(j) for j in range(r)]
--> 602 RR = PolynomialRing(K,d+r,tuple(Xs+Ts))
603 Vs = list(RR.gens())
604 Xs = Vs[0 :d]
NameError: global name 'PolynomialRing' is not defined
</code></pre>
<p>Any advice on this particular import or imports in general would be appreciated.</p>
<p>Thanks.</p>
https://ask.sagemath.org/question/8700/import-sageringspolynomialmulti_polynomial_sequence/?comment=20332#post-id-20332You want to use it in a worksheet or are you writing an addition to the sage library? If you post an actually failing example instead of some prosaic description of what you'd like to do and an error message then we might be able to help you.Mon, 06 Feb 2012 18:35:29 +0100https://ask.sagemath.org/question/8700/import-sageringspolynomialmulti_polynomial_sequence/?comment=20332#post-id-20332