Ask Your Question

Daniel Friedan's profile - activity

2021-08-25 14:36:20 +0100 received badge  Notable Question (source)
2021-08-25 14:36:20 +0100 received badge  Popular Question (source)
2020-11-26 10:39:31 +0100 commented question power series method pade(m,n) off by 1?

Thanks for the quick fix. It looks to me that the calculation of pade(m,n) was fine. It was just the error check that was off by 1. So the fix seems good to me.

I've never dared look at the code of sagemath. I came to python late in life. When I write calculations in sagemath, I spend half my time googling basic python questions.

I was a bit surprised to see that pade(m,n) is simply a wrapper around rational_reconstruct(). I had the impression that rational_reconstruct() only worked modulo a prime.

Daniel

2020-11-26 00:46:27 +0100 asked a question power series method pade(m,n) off by 1?

If p = 1+ x + O(x^2) is a power series, then then the method p.pade(0,1) should give p.pade(0,1) = 1/(1-x) but instead it gives an error

ValueError: the precision of the series is not large enough

The documentation says that p should be given up through O(x^(m+n+1)).

Isn't this wrong? Shouldn't it be up through O(x^(m+n)) ?

The Padé approximant P_m(x)/Q_n(x) contains m+n+1 unknown coefficients, so m+n+1 terms should be included in the power series: x^0 ... x^(m+n).

I'm working with a power series that I generate numerically, term by term. I'm using the pade method to estimate the region of analyticity in order to make a conformal transformation that will accelerate the convergence. I want to use pade(n-1,n) when I have 2n terms in the power series. But the pade(m,n) throws the above error. It does not seem possible to get a Padé approximation with the same number of coefficients as in the power series.

thanks for taking a look at this. Daniel Friedan

Daniel Friedan

2020-07-27 22:07:45 +0100 commented answer suggestion for documentation of Multivariate Polynomials

I suggest adding a paragraph in Sage 9.1 Reference Manual: Polynomials, section 1.1 Constructors for Polynomial Rings, immediately after the first paragraph.

But I am singularly unqualified to write the paragraph. I barely grasp the meaning of "localization". I'm only suggesting this revision because I got into trouble because I was ignorant of the fact that "Constructors for polynomial rings" does not mean "Constructors of polynomial rings".

2020-07-27 22:01:33 +0100 commented answer suggestion for documentation of Multivariate Polynomials

The dependence of the ring on the term ordering is explained in

Gert-Martin Greuel, Gerhard Pfister "A Singular Introduction to Commutative Algebra" with contributions by Olaf Bachmann, Christoph Lossen and Hans Schoenemann Second, Extended Edition Springer-Verlag

Section 1.2 Monomial Orderings p. 16 "SINGULAR Example 1.2.13 (monomial orderings). Global orderings are denoted with a p at the end, referring to “polynomial ring” while local orderings end with an s, referring to “series ring”. "

Section 1.5 Rings Associated to Monomial Orderings p. 38 In this section we show that non–global monomial orderings lead to new rings which are localizations of the polynomial ring.

p. 39 Definition 1.5.1. For any monomial ordering > on Mon(x1,...,xn), we define K[x]> the localization of K[x]

2020-07-27 22:01:33 +0100 received badge  Commentator
2020-07-27 11:56:59 +0100 received badge  Nice Question (source)
2020-07-26 20:46:42 +0100 asked a question suggestion for documentation of Multivariate Polynomials

It might be helpful for non-experts if the documentation of Multivariate Polynomials were to mention explicitly that the ring being constructed is not the polynomial ring, but the polynomial ring wrt the term ordering, which is not always the same as the polynomial ring.

I found an explanation of the difference in Greuel & Pfister, "A Singular Introduction to Commutative Algebra".

My ignorance of the dependence of the ring on the term ordering was the source of my earlier question:

https://ask.sagemath.org/question/526...

Daniel Friedan

2020-07-25 23:14:09 +0100 commented question find quotient of two multivariate polynomials (which are divisible)

As pointed out in the answers, the data was created with one term ordering, while the workbook uses another term ordering.

However, why does the term ordering affect the truth of 'num is contained in the ideal generated by denom' i.e., the value of num.reduce(Ideal[denom]) ? One of the answers refers to "This 'local' term ordering ``. I don't understand how the term ordering affects the structure of the ideals in a polynomial ring over the integers.

2020-07-22 22:35:21 +0100 asked a question find quotient of two multivariate polynomials (which are divisible)

I have two multivariate polynomials, num and denom such that denom divides num. But I have not been able to get SageMath to simplify the quotient num/denom.

The worksheet and the two polynomials are available at

Sample code is below.

sage: dR.<d1, d2, d3, d4, d12, d13, d14, d23, d24, d34, d123, d124, d134, d234, d1234> = PolynomialRing(ZZ, 15, order='lex')

sage: denom = load('denom')
sage: num = load('num')
sage: denom.divides(num)
True
sage: num.reduce(Ideal([denom]))
0
sage: F = num/denom
sage: F.denominator()/denom
1
sage: F.reduce()
sage: F.denominator() / denom
1
sage: num.number_of_terms()
3197
sage: denom.number_of_terms()
64
sage: num.degree()
24
2019-09-29 13:03:05 +0100 received badge  Taxonomist
2018-04-03 21:09:12 +0100 received badge  Famous Question (source)
2016-06-23 21:12:53 +0100 received badge  Notable Question (source)
2015-10-15 22:37:25 +0100 received badge  Notable Question (source)
2015-10-15 22:37:25 +0100 received badge  Famous Question (source)
2015-10-15 22:37:25 +0100 received badge  Popular Question (source)
2014-06-16 10:00:59 +0100 received badge  Popular Question (source)
2013-02-11 13:06:48 +0100 asked a question quitting sage.app leaves processes running

Using sage.app under Mac OS X 10.6.8 sage-5.6-OSX-64bit-10.6-x86_64-Darwin-app.dmg when I quit sage.app (choosing 'Quit Sage' from the 'Sage' menu), several processes continue to run (see below for 'ps x' output).

Is this normal? Could I have messed up my Sage installation? I've been installing CPLEX and Gurobi lately. I've run 'sage -b' several times.

thanks, Daniel

after quitting sage.app: $ ps x | grep sage 5758 ?? Ss 0:00.02 /bin/bash /Applications/Sage.app/Contents/Resources/start-sage.sh /Applications/Sage.app/Contents/Resources/sage/sage /Users/daniel/Library/Logs/sage.log 5761 ?? Ss 0:00.81 /bin/bash /Applications/Sage.app/Contents/Resources/sage-is-running-on-port.sh --wait 5827 ?? S 0:00.00 bash ./sage --notebook 5829 ?? S 0:00.01 bash /Applications/Sage.app/Contents/Resources/sage/spkg/bin/sage --notebook 5834 ?? S 0:01.92 python /Applications/Sage.app/Contents/Resources/sage/local/bin/sage-notebook 5849 ?? S 0:04.64 python /Applications/Sage.app/Contents/Resources/sage/local/bin/twistd --pidfile=sage_notebook.sagenb/sagenb.pid -ny sage_notebook.sagenb/twistedconf.tac 6796 ?? Ss 0:00.15 /bin/bash /Applications/Sage.app/Contents/Resources/sage-is-running-on-port.sh --wait 7323 s000 S+ 0:00.00 grep sage

2013-02-03 18:15:35 +0100 received badge  Nice Question (source)
2012-07-30 12:01:02 +0100 commented answer where to put a public worksheet referenced in a paper?

Thanks for the advice. I'll attach the .sws file to the arxiv submission. It's too specialized for interact.sagemath.org.

2012-07-29 19:48:16 +0100 asked a question where to put a public worksheet referenced in a paper?

I'll be publishing a paper that depends on calculations in a Sage worksheet. What is the standard practice for publishing such a worksheet? I'll attach in to the arXiv submission a printout of the worksheet and a .sobj file containing the worksheet. I'd also like to make the worksheet available to readers who do not have Sage installations of their own. I could say: 'get an account at sagenb.org and upload the worksheet', but that seems a bit awkward. I can't simply publish the worksheet from our local Sage installation because I need (in other worksheets) our Sage installation to allow running shell scripts from a Sage worksheet, which would be a bad security hole in a published worksheet.

2012-07-27 22:12:08 +0100 commented answer adding real literal and real number of high precision

Thank you very much for the explanations and for the pointers to the documentation. I gather that Sage's interpretation of a token such as '0.7' is context dependent. In RF(0.3+0.4), '0.3' and '0.4' are elements of RDF, and 0.3+0.4=0.7 in RDF, so RF(0.3+0.4)=RF(RDF(0.7)). But in RF(0.7), '0.7' is not an element of RDF, so RF(0.3+0.4) \ne RF(0.7). In order to avoid worrying about this context dependence, I can use 'RealNumber = RF' whenever I need to do high precision calculations where an accidental invocation of RDF would be disastrous. I'll be careful to do this in the future. I must say I find this behavior of Sage to be somewhat peculiar. I assumed that an expression of the form RF ... (more)

2012-07-27 17:34:13 +0100 commented question adding real literal and real number of high precision

But RF(RDF(0.3))= 0.29999999999999998889776975374843459576368332 and RF(RDF(0.7))= 0.69999999999999995559107901499373838305473328 so how can RF(0.3+0.7)= 1.0000000000000000000000000000000000000000000 if the addition is being done in double precision?

2012-07-27 15:07:08 +0100 commented question adding real literal and real number of high precision

There seem to be inconsistencies: RF(.5 + .4 ) 0.90000000000000002220446049250313080847263336 RF(.3+.7) 1.0000000000000000000000000000000000000000000 If .4 and .5 are added as double precision, why not .3 and .7 ?

2012-07-27 13:14:18 +0100 received badge  Editor (source)
2012-07-27 13:05:52 +0100 asked a question adding real literal and real number of high precision

When Sage is adding a real literal to a real number of high precision, shouldn't it calculate the sum in the high precision ring? Instead, Sage seems to calculate in double precision:

RF=RealField(150); RF

Real Field with 150 bits of precision

RF(0.9 + RF(1e-18))

0.90000000000000002220446049250313080847263336

RF(1.0+ RF(1e-18))

1.0000000000000000000000000000000000000000000

RF(1+ RF(1e-18))

1.0000000000000000010000000000000000000000000

I'm trying to use high precision arithmetic (2658 bits) in Sage to verify some results produced by the high precision semidefinite program solver sdpa_gmp. Sage's treatment of real literals in these calculations has made me anxious about the possibility that I'm overlooking other ways in which the calculations might be unreliable.

Is there anywhere an explanation of Sage's treatment of real literals in high precision arithmetic?

Added: Immediately after posting this question, the list of Related Questions in the sidebar pointed me to question/327/set-global-precision-for-reals where I learned that 'RealNumber = RF' would make all real literals lie in the high precision ring. Still, I wonder why the default behavior is to discard precision that is present in the original real literal.

thanks, Daniel Friedan

thanks for

2012-04-06 16:06:59 +0100 commented question polynomials of derivative operator

Here's an example. Let p(y)=y^2. Then p(d/dx + x^2) = (d/dx)^2 + 2 x^2 d/dx + 2 x + x^4. Acting on 1, this operator gives 2 x + x^4.

2012-04-06 15:57:36 +0100 commented answer polynomials of derivative operator

please see my comment in response to jdc above

2012-04-06 15:56:47 +0100 commented question polynomials of derivative operator

Sorry I wasn't clear. Try a simpler example. p is a polynomial in 1 variable. p(d/dx + x^2) is a differential operator. p(d/dx + x^2) 1 is that operator acting on the constant function. The result is a polynomial in x. I'd like to calculate that polynomial in Sage. I have a workaround, using Fourier transforms, that Sage can do via Macsyma, but I suspect an algebraic method would scale better.

2012-04-05 13:27:24 +0100 commented answer polynomials of derivative operator

Thanks, but I don't think your proposed answer does what I asked. Here's a simpler version: (d/dx + a x)^2 1 = a + a^2 x^2 Your code sage: var('a y') (a, y) sage: F = function('F',x) sage: G = F.derivative(x) sage: G D[0](F)(x) sage: exp = G + a*x sage: p(h) = h^2 sage: p(exp) (a*x + D[0](F)(x))^2

2012-04-05 12:49:10 +0100 received badge  Student (source)
2012-04-04 23:32:12 +0100 asked a question polynomials of derivative operator

Is there any way in Sage to evaluate expressions such as p(x^2d/dx + a + x - x^2y) 1 where p() is a polynomial in one variable? The result would be a polynomial in a,x, and y.

Alternatively, can Sage evaluate (1/f) p(d/dx) f where f is a (non-polynomial) function of x and a and y?

Thanks very much.