Re: [sage-support] Coercion problem

2015-01-15 Thread Robert Bradshaw
I assume you meant sage: v = P(5) sage: v(oo) A positive finite number This is because the elements of QQ coerce to the parent of oo, which is the "signed infinity ring." This is so we have sage: P. = PolynomialRing(QQ) sage: w = x + 5 sage: v = w - x w(1.0) 6.00 sage: v(1.0) 5.0

Re: [sage-support] Real Interval Field (RIF) question

2014-10-22 Thread Robert Bradshaw
I do find this behavior quite surprising--diameter should be an alias for either relative or absolute diameter, not depending on the interval. On Wed, Oct 22, 2014 at 2:44 AM, John Cremona wrote: > I am trying to use the Real Interval Field (RIF), which in principle > does exactly what I want. B

Re: [sage-support] Why Sage is called Sage ?

2014-08-14 Thread Robert Bradshaw
http://sagemath.blogspot.com/2009/12/mathematical-software-and-me-very.html On Thu, Aug 14, 2014 at 1:14 AM, John Cremona wrote: > When William Stein first started the project it was an acronym SAGE > for (I think) System for Algebra and Geometry Experimentation. But > soon it became a much wide

Re: [sage-support] Typo in Documentation of Eigenmatrix

2014-07-17 Thread Robert Bradshaw
https://github.com/sagemath/sage/pull/21 aka http://trac.sagemath.org/ticket/16672 On Thu, Jul 17, 2014 at 9:45 AM, Mahrud Sayrafi wrote: > Hi, > > In this page: > http://www.sagemath.org/doc/constructions/linear_algebra.html#eigenvectors-and-eigenvalues > in the eigenvectors and eigenvalues sect

Re: [sage-support] GIT repository and installation

2014-07-15 Thread Robert Bradshaw
The very short answer is to type "make" and wait an hour or three. On Jul 14, 2014 4:54 AM, "Oscar Alberto Castillo Felisola" < o.castillo.felis...@gmail.com> wrote: > Checking it out! Thank you John. > > -- > You received this message because you are subscribed to the Google Groups > "sage-suppor

Re: [sage-support] Re: Simplify number

2014-05-29 Thread Robert Bradshaw
What exactly do you mean by "simplify a real number?" On Thu, May 29, 2014 at 8:32 AM, SiL588 . wrote: > Unfortunately I don't know the rules of Phyton language, i just started > using Sage notebook to do linear algebra computation. > I think I did what you said, I assinged m a value that was the

Re: [sage-support] Re: bug in comparison of function field elements

2014-04-30 Thread Robert Bradshaw
On Tue, Apr 29, 2014 at 10:57 PM, Robert Bradshaw wrote: > On Tue, Apr 29, 2014 at 9:07 AM, Volker Braun wrote: >> On Tuesday, April 29, 2014 3:58:14 PM UTC+1, Simon King wrote: >>> >>> Yes there is! The hook is the hash function. >> >> >> CPytho

Re: [sage-support] Re: bug in comparison of function field elements

2014-04-29 Thread Robert Bradshaw
On Tue, Apr 29, 2014 at 9:07 AM, Volker Braun wrote: > On Tuesday, April 29, 2014 3:58:14 PM UTC+1, Simon King wrote: >> >> Yes there is! The hook is the hash function. > > > CPython implementation detail and subject to change... really Python makes > no guarantee that __hash__() is called at any

Re: [sage-support] Re: Optimizing this function with Cython

2014-03-15 Thread Robert Bradshaw
On Fri, Mar 14, 2014 at 2:03 PM, Georgios Tzanakis wrote: > > On Fri, Mar 14, 2014 at 4:49 PM, Robert Bradshaw > wrote: >> >> Note that >> >> L[i][rows[i]] + j %w == 0: >> >> would probably be just (or nearly) as fast as >> >>

Re: [sage-support] Re: Optimizing this function with Cython

2014-03-14 Thread Robert Bradshaw
Note that L[i][rows[i]] + j %w == 0: would probably be just (or nearly) as fast as (((L[i])[(rows[i])])+j %w)==0 If you're going to be dealing with arrays of ints you might want to look into NumPy and/or memory views for even more speed. On Thu, Mar 13, 2014 at 7:58 PM, Georgios Tzanakis w

Re: [sage-support] Re: README.txt build-from-source buries fact -j8 in "make -j8" ignored -- need export MAKE="make -j8"

2014-01-02 Thread Robert Bradshaw
uld not be enabled in the top-level make, in my opinion. Typically, > "make -jN" makes parallel compiles within the same package (if the package > supports it). The parallel build in sage compiles different packages in > parallel, but each package still compiles as -j1. > >

Re: [sage-support] README.txt build-from-source buries fact -j8 in "make -j8" ignored -- need export MAKE="make -j8"

2014-01-02 Thread Robert Bradshaw
How hard would it be to let "make -jN" actually work from the top-level make? On Tue, Dec 31, 2013 at 4:57 PM, Joseph P. Skudlarek wrote: > This is a request to update the README.txt file used when building from > sources -- the README.txt buries the fact that "-jN" in "make -jN" is > effectively

Re: [sage-support] Re: (unknown)

2013-10-23 Thread Robert Bradshaw
sage: Integers(45)['t'] Univariate Polynomial Ring in t over Ring of integers modulo 45 I don't think we have linear algebra over general non-integral-domains, but sage: R = GF(5)['x'] sage: M = random_matrix(R, 4, 4); b = random_vector(R, 4); x = M \ b sage: M*x (4*x^2 + x + 4, x^2 + 2*x + 4, 4*

Re: [sage-support] arrays in Sage's cython

2013-08-21 Thread Robert Bradshaw
Using a Python list is probably the fastest way to iterate over an array of Python objects--it's a PyObject** under the hood and Cython uses the C API calls to get at it. Your "check" might be the bottleneck, especially if it's a Python call. Also, no need to write this as a while loop; just use "

Re: [sage-support] Re: Left and right limits (is default of 'dir' None?)

2013-08-20 Thread Robert Bradshaw
On Mon, Aug 19, 2013 at 6:30 PM, Dima Pasechnik wrote: > On 2013-08-19, Vincent Knight wrote: >> --001a1133aa8653f2ed04e4510b09 >> Content-Type: text/plain; charset=ISO-8859-1 >> >> Thanks for the answer kcrisman but I'm afraid I'm still not sure I >> understand. >> >> If by 'unsigned infinity' y

Re: [sage-support] Solve Binary Linear System

2013-04-17 Thread Robert Bradshaw
sage: A = random_matrix(GF(2), 1, 1) sage: A.det() 1 sage: b = random_vector(GF(2), 1) sage: %time x = A \ b CPU times: user 1.61 s, sys: 0.06 s, total: 1.67 s Wall time: 1.67 s sage: A * x == b True On Wed, Apr 17, 2013 at 1:45 PM, Juan Grados wrote: > I have the equation Ax=b where

Re: [sage-support] Inconsistency regarding QQ and ZZ?

2013-03-17 Thread Robert Bradshaw
The syntax "R. = QQ[]" creates a polynomial ring in two variables, with generators A and d (bound to the current session). A^d is not a polynomial in A and d over QQ. sage: R.=QQ[] sage: R Multivariate Polynomial Ring in A, d over Rational Field On Sun, Mar 17, 2013 at 12:51 AM, Rolandb wrote: >

Re: [sage-support] sage vs matlab

2013-03-05 Thread Robert Bradshaw
On Mon, Mar 4, 2013 at 11:54 AM, Luis Finotti wrote: > > > On Monday, March 4, 2013 2:42:48 PM UTC-5, Dr. David Kirkby wrote: >> >> >> I think Sage would have a hard job breaking into the MATLAB >> strongholds in engineering. It is used to control a lot of instruments >> and data collection. >> >>

Re: [sage-support] using cpickle to store matrix object

2013-02-20 Thread Robert Bradshaw
It's cPickle with a capital P. On Wed, Feb 20, 2013 at 2:30 AM, akhil wrote: > Hello, > > > I want to use cpickle to store a matrix object in a text file. Sample code > is as follows: > > A = matrix(GF(2),2,3) #creating a 2 * 3 matrix having all entries > zero > > import cpickle as pickl

Re: [sage-support] Link explaining types of decimal numbers

2013-01-23 Thread Robert Bradshaw
First, I would recommend reading up on floating point arithmetic. A cannonical reference is http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html , but if that's a bit dense there are many other good sources on the web. Things get more interesting for Sage, as there are several models for

Re: [sage-support] algebraic number to integer conversion?

2012-10-17 Thread Robert Bradshaw
On Wed, Oct 17, 2012 at 9:37 PM, Eric Kangas wrote: > code: > > b = 11^2 > > a = b^2 > > pri = [int(is_prime(i)) for i in range(a)] > > j = [i for i in range(a)][b+1:a:b] > > k = [i for i in range(a)][(b*2)+1:a:b] > > j.insert(0,0) > > k.insert(0,b) > > m = [matrix(QQ,sqrt(a)/(b/sqrt(b)),pri[j[i]:

Re: [sage-support] algebraic number to integer conversion?

2012-10-17 Thread Robert Bradshaw
What is eval? It looks like a list of eigenvalues, rather than a single one. Could you show how it is computed? On Wed, Oct 17, 2012 at 4:55 PM, Eric Kangas wrote: > Of course complex. > > Here is what happens when I try using the embeddings() function: > > sage: eval[0].embeddings(CC) > >

Re: [sage-support] algebraic number to integer conversion?

2012-10-17 Thread Robert Bradshaw
When you say "plot these values", do you mean as real or complex values? To do so you need to choose an embedding, e.g. sage: K. = QQ[sqrt(5)]; K Number Field in sqrt5 with defining polynomial x^2 - 5 sage: K.embeddings(CC) [ Ring morphism: From: Number Field in sqrt5 with defining polynomial

Re: [sage-support] GPL and code generation using sage

2012-09-27 Thread Robert Bradshaw
On Thu, Sep 27, 2012 at 1:41 PM, Tom Boothby wrote: > On Thu, Sep 27, 2012 at 12:55 AM, Robert Bradshaw > wrote: > >> I would be extremely >> surprised if any Sage developer morally objects to you licensing this >> output as you wish (though opinions may vary w

Re: [sage-support] GPL and code generation using sage

2012-09-27 Thread Robert Bradshaw
On Wed, Sep 26, 2012 at 10:56 PM, Geoffrey Irving wrote: > On Wed, Sep 26, 2012 at 10:42 PM, Robert Bradshaw > wrote: >> On Wed, Sep 26, 2012 at 8:54 PM, Geoffrey Irving wrote: >>> On Wed, Sep 26, 2012 at 6:03 PM, Robert Bradshaw >>> wrote: >>>> On Wed

Re: [sage-support] GPL and code generation using sage

2012-09-26 Thread Robert Bradshaw
On Wed, Sep 26, 2012 at 8:54 PM, Geoffrey Irving wrote: > On Wed, Sep 26, 2012 at 6:03 PM, Robert Bradshaw > wrote: >> On Wed, Sep 26, 2012 at 4:28 PM, Geoffrey Irving wrote: >>> Hello, >>> >>> I recently used sage to write a code generation sc

Re: [sage-support] GPL and code generation using sage

2012-09-26 Thread Robert Bradshaw
On Wed, Sep 26, 2012 at 4:28 PM, Geoffrey Irving wrote: > Hello, > > I recently used sage to write a code generation script for exact > geometric predicates: > > https://github.com/otherlab/simplicity > > Since it's a python script that imports sage, the simplicity script is > GPL. Not automa

Re: [sage-support] Re: Notebook server very slow. What are typical bottlenecks? I have ver5.2 and 1Gb RAM

2012-09-26 Thread Robert Bradshaw
I'd go for several 100M of RAM each, likely 0.5G to be comfortable, plus some memory for the OS and server itself. Throw 4G at it and it should behave much better, 8G and you should be good to go. Something like https://github.com/jasongrout/sage-forker would likely greatly reduce this requirement

Re: [sage-support] randint - Maybe one bug !

2012-09-19 Thread Robert Bradshaw
I agree that this is a surprising and unfortunate wart in the was Sage is built. I would explain it like this: Python has an integer type int that has several surprising behaviors (from a mathematicians perspective, e.g. division). For this reason we created our own time, Integer, that behaves bet

Re: [sage-support] Calling up pi to nth decimal place.

2012-08-17 Thread Robert Bradshaw
ion before my computer crashes due to out of memory. Also I will look > into the Bailey-Borwein-Plouffe formula, and hope to convert each digit from > binary to base 10. > > On Wednesday, August 15, 2012 11:39:12 PM UTC-7, Robert Bradshaw wrote: >> >> On Wed, Aug 15, 2012 at 5:55

Re: [sage-support] Calling up pi to nth decimal place.

2012-08-15 Thread Robert Bradshaw
On Wed, Aug 15, 2012 at 5:55 PM, Eric Kangas wrote: > Yea crashing due to being out of memory. You could go a bit further by doing the string -> list of ints part piecemeal. The memory usage of 1000 digits is 1000 + epsilon bytes, but a list of 1000 ints is something like 24000+ bytes. > So I wi

Re: [sage-support] Calling up pi to nth decimal place.

2012-08-15 Thread Robert Bradshaw
On Wed, Aug 15, 2012 at 5:10 PM, Eric Kangas wrote: > Hi, > > I am trying to figure out a way to call up the sequence for pi to a very > large number ie. centillion, googleplex, even Graham's number. However sage > crashes around 10 million decimal places. Crashing how? Out of memory? > So I am

Re: [sage-support] Fraction Fields coefficients

2012-06-30 Thread Robert Bradshaw
Perhaps your looking for something like sage: R. = QQ[] sage: f = 2 * x^2 / (x^3 + 5); f 2*x^2/(x^3 + 5) sage: f.numerator().list() [0, 0, 2] sage: f.denominator().list() [5, 0, 0, 1] On Sat, Jun 30, 2012 at 8:26 PM, juaninf wrote: > Dears members, > > How I will can get the coefficients list i

Re: [sage-support] Re: Comparison of approximate real numbers

2012-06-12 Thread Robert Bradshaw
On Tue, Jun 12, 2012 at 4:11 PM, William Stein wrote: > On Tue, Jun 12, 2012 at 3:54 PM, rych wrote: >> Interval arithmetics also gives False, >> >> sage: from mpmath import iv >> sage: # iv.prec = 24 >> sage: # iv.prec = 53 # for double precision >> sage: x = 0.1 >> sage: iv.prec = x.prec()  # p

Re: [sage-support] Re: How to fix the path generated by tmp_filename() ?

2012-06-04 Thread Robert Bradshaw
os.path.normpath is handy for cleaning stuff like this up too (including removing /../ and /./). Doesn't really matter here, but is nice when one wants to compare paths or prefixes. - Robert On Mon, Jun 4, 2012 at 8:17 AM, Volker Braun wrote: > Posix stipulates that "multiple successive slashes

Re: [sage-support] MathML

2012-06-04 Thread Robert Bradshaw
There are two parts to this, sage -> MathML (which is what the rudimentary _mathml_ methods are for) and MathML -> sage (which it seems you've written, and might be more useful). To include this into Sage, I would probably create a file sage/interfaces/mathml.py with a single parse_mathml(...) fun

Re: [sage-support] Discrete logarithm

2012-05-26 Thread Robert Bradshaw
sage: var('x,y') (x, y) sage: E = EllipticCurve(y^2 == x^3 - 36*x) sage: P=E(-3,9) sage: Q=E(12,36) sage: discrete_log(Q, P, operation='+', bounds=(0,100)) --- ValueErrorTraceback (most recent c

Re: [sage-support] Re: error in comparison of pi

2012-05-12 Thread Robert Bradshaw
Yes, I consider sage: bool(pi wrote: > I think the "stopgap" was introduced for the case where Sage silently gives > incorrect results. > > > On Saturday, May 12, 2012 4:06:50 AM UTC+8, kcrisman wrote: >> >> >> >> On Friday, May 11, 2012 3:34:2

Re: [sage-support] Re: error in comparison of pi

2012-05-11 Thread Robert Bradshaw
It's no longer (necessarily) a blocker once a stopgap has been assigned. On Fri, May 11, 2012 at 5:01 PM, John H Palmieri wrote: > > > On Friday, May 11, 2012 2:55:19 PM UTC-7, Robert Bradshaw wrote: >> >> Yeah, stopgap refers to the other ticket in case the bug is

Re: [sage-support] Re: error in comparison of pi

2012-05-11 Thread Robert Bradshaw
Yeah, stopgap refers to the other ticket in case the bug is hard to fix. How about "bogus" or "badmath"? On Fri, May 11, 2012 at 1:06 PM, kcrisman wrote: > > > On Friday, May 11, 2012 3:34:26 PM UTC-4, Robert Bradshaw wrote: >> >> Did we ever deci

Re: [sage-support] Re: error in comparison of pi

2012-05-11 Thread Robert Bradshaw
Did we ever decide on a standard label for mathematically incorrect results? This shouldn't drop under the radar. On Fri, May 11, 2012 at 8:37 AM, P Purkayastha wrote: > > > On Friday, May 11, 2012 4:58:53 PM UTC+8, Robert Samal wrote: >> >> Hi! >> >> By some random experiments I discovered the f

Re: [sage-support] Importing Cython .so module

2012-04-19 Thread Robert Bradshaw
On Thu, Apr 19, 2012 at 12:48 PM, Emil wrote: > On 19 April 2012 07:20, Robert Bradshaw wrote: >> It might be distutils. It might be Cython. It might even be Sage or >> Python. But without knowing exactly how you're trying to >> compile/install your package, it's

Re: [sage-support] Importing Cython .so module

2012-04-18 Thread Robert Bradshaw
On Wed, Apr 18, 2012 at 4:03 PM, Emil wrote: > Hi Robert, thanks for taking an interest in my problem! I've been > unwell, and could not respond sooner. Sorry to hear that. > I can't put an __init__.py file > in the top-level /site-packages directory as far as I am aware, and > I'm not sure that

Re: [sage-support] Random Polynomials with restricted coefficients and homogeneous.

2012-04-13 Thread Robert Bradshaw
Doing sage: ZZ.random_element? tells you that ZZ takes x and y arguments for min/max. Polynomial rings' random_element pass extra keywords down to the basrings, so one can do sage: P.random_element(degree=10, terms=10, x=-9, y=9) -9*x^8*y^2 + x^8 + x^7*y + 8*x^6*y^2 - 7*x^2*y^6 - 2*

Re: [sage-support] Importing Cython .so module

2012-04-13 Thread Robert Bradshaw
On Sat, Apr 7, 2012 at 4:06 AM, Emil wrote: > On 7 April 2012 01:14, Maarten Derickx wrote: >> Does executing: >> >> import foo >> >> give what you want or is your problem different? > > import foo doesn't do much, as foo/__init__.py is empty. I have > adopted the Sage-like behaviour of having an

Re: [sage-support] Re: Best way to develop Sage packages?

2012-04-01 Thread Robert Bradshaw
On Sat, Mar 31, 2012 at 3:42 PM, Emil wrote: > On 31 March 2012 12:47, Volker Braun wrote: >> If it is of interest to an academic community then it probably should be >> part of Sage ;-) > > I'm not against it being incorporated into Sage at some point, but > right now I'd rather keep it as a sep

Re: [sage-support] infinite dictionary

2012-03-21 Thread Robert Bradshaw
You should take a look at Python's defaultdict. One of the design decisions was to cache all the values computed for a given key; if you want to do differently you could implement your own using __getitem__ and __setitme__. - Robert On Wed, Mar 21, 2012 at 1:28 PM, Daniel Krenn wrote: > Is there

Re: [sage-support] Re: How to test if something is integer ?

2012-03-15 Thread Robert Bradshaw
On Thu, Mar 15, 2012 at 8:48 AM, Laurent wrote: > >> and it would not make very much sense to provide a method for this >> class to test for integrality, since every such element is an Integer >> by definition.  I suspect that in your intended application, A will be >> the result of come computati

Re: [sage-support] Re: CSV file

2012-03-05 Thread Robert Bradshaw
On Sun, Mar 4, 2012 at 10:34 AM, Nils Bruin wrote: > On Mar 4, 1:14 am, Robert Bradshaw > wrote: >> I think it's fair to test for strings first, trying to parse, before >> testing if it's an iterator. This is consistant with many other >> objects that try to &q

Re: [sage-support] Re: CSV file

2012-03-04 Thread Robert Bradshaw
On Fri, Mar 2, 2012 at 6:19 PM, Nils Bruin wrote: > On Mar 2, 12:28 am, Robert Bradshaw > wrote: >> The difficulty with accepting an iterator (of strings) is that it is >> unclear if each item corresponds to a row or an element. But I would >> be in favor of rather libera

Re: [sage-support] Re: CSV file

2012-03-02 Thread Robert Bradshaw
The difficulty with accepting an iterator (of strings) is that it is unclear if each item corresponds to a row or an element. But I would be in favor of rather liberal string parsing, so one could do matrix(open("test.csv").read()) just like matrix(""" 1,2,3 4,5,5 """) On Mon, Feb 27, 2012 at 6

Re: [sage-support] Re: patch buildbot help

2012-03-01 Thread Robert Bradshaw
On Wed, Feb 29, 2012 at 11:29 AM, Kelvin Li wrote: > On Feb 29, 12:24 pm, Niles wrote: >> So this means that you should write "Apply trac_10229-2.patch" in a >> new comment on the ticket.  Unfortunately writing this in the ticket >> description is useless for the patchbot (although still helpful

Re: [sage-support] Re: Evaluate quickly a complex expression

2012-02-15 Thread Robert Bradshaw
FYI, http://trac.sagemath.org/sage_trac/ticket/12513 On Mon, Feb 6, 2012 at 1:53 PM, Robert Bradshaw wrote: > On Mon, Feb 6, 2012 at 1:01 PM, Jason Grout > wrote: >> On 2/6/12 1:33 PM, Oscar Lazo wrote: >>> >>> That is very nice! Unfortunately I need to evaluate

Re: [sage-support] Re: speed question, numpy vs CDF

2012-02-13 Thread Robert Bradshaw
fits your problem, you could also consider packing your 2x2 matrices into larger arrays (e.g. representing n 2x2 matrices by a 4 x n matrix and manually doing the multiplication) so you can your computations in a "vectorized" form. >> On 13 fév, 18:32, Robert Bradshaw >> wrote

Re: [sage-support] Re: speed question, numpy vs CDF

2012-02-13 Thread Robert Bradshaw
On Sun, Feb 12, 2012 at 4:30 PM, Nils Bruin wrote: > On Feb 12, 1:39 pm, Pierre wrote: >> i think zz above might still be considered as a 1 x 1 matrix instead >> of a complex number, somehow, and this may be slowing things down. > No, that's not the problem. It's simply that numpy's default compl

Re: [sage-support] Re: functions

2012-02-08 Thread Robert Bradshaw
n of some sort here, but I do not want a "def > chaps(u,v)" like what anton has done for now, both for my simplified > and larger problem. > Is there  a solution/method to this? > > Kind Regards > Chappman > > On Feb 7, 9:35 pm, Robert Bradshaw > wrote: >&g

Re: [sage-support] Re: functions

2012-02-07 Thread Robert Bradshaw
On Tue, Feb 7, 2012 at 1:07 PM, Chappman wrote: > Hi Rob, > I am pretty new to Sage and am not used to the syntex, so even though > I write [y1,y2] , i do not mean it as a list. > Basically what I am trying to do is try and get the folllowing code to > work, if the summation does come out correct

Re: [sage-support] functions

2012-02-06 Thread Robert Bradshaw
On Mon, Feb 6, 2012 at 3:12 PM, Chappman wrote: > Hi, I am currently trying to write a program for my project and am > trying to make the following syntax work: > > > if y_1=y_2: >     [y_1,y_2]=2 > elif y_1>y_2: >     [y_1,y_2]=1 I think you want is > if y_1 = y_2: > y_1 = y_2 = 2 > elif y_

Re: [sage-support] Re: Evaluate quickly a complex expression

2012-02-06 Thread Robert Bradshaw
On Mon, Feb 6, 2012 at 1:01 PM, Jason Grout wrote: > On 2/6/12 1:33 PM, Oscar Lazo wrote: >> >> That is very nice! Unfortunately I need to evaluate many different >> expressions quickly, so the copy-paste aproach is not an option. >> That's why I wrote the fast_complex function. I'll be working in

Re: [sage-support] Re: Power series expansion

2011-12-06 Thread Robert Bradshaw
If you create an actual power series element, you can easily write the coefficients to a file: sage: f = taylor(sin(x), x, 0, 10); f 1/362880*x^9 - 1/5040*x^7 + 1/120*x^5 - 1/6*x^3 + x sage: power_series = RR[['x']](f); power_series 0.000 + 1.00*x + 0.000*x^2 -

Re: [sage-support] Re: How to pop a list item in Cython?

2011-10-20 Thread Robert Bradshaw
On Thu, Oct 20, 2011 at 4:55 AM, Simon King wrote: > Hi Robert, > > On 20 Okt., 13:38, Robert Bradshaw > wrote: >> > Since L.pop() (popping the last item) is so much faster than L.pop(0), >> > I could perhaps just revert my lists. >> >> Inserting into th

Re: [sage-support] Re: How to pop a list item in Cython?

2011-10-20 Thread Robert Bradshaw
On Wed, Oct 19, 2011 at 11:52 PM, Simon King wrote: > Hi Robert, > > On 20 Okt., 06:59, Robert Bradshaw > wrote: >> I have no idea why L.pop(0) is not optimized, but L.pop(0) is >> (and the latter should be very fast). Clearly a bug in Cython, but >> user the lat

Re: [sage-support] Re: How to pop a list item in Cython?

2011-10-19 Thread Robert Bradshaw
On Wed, Oct 19, 2011 at 12:42 PM, Simon King wrote: > Hi Alexander and all, > > First of all, sorry that I posted twice the same - google groups > reported an error when I first tried to post. > > On 19 Okt., 19:58, Alexander Juarez wrote: >> I think I found the collections.deque() to be faster t

Re: [sage-support] Re: sagemath.org down

2011-10-18 Thread Robert Bradshaw
On Thu, Aug 25, 2011 at 2:24 PM, William Stein wrote: > On Thu, Aug 25, 2011 at 12:19 PM, Jason Grout > wrote: >> On 8/25/11 12:52 PM, William Stein wrote: >>> >>> On Thu, Aug 25, 2011 at 10:36 AM, Jason Grout >>>  wrote: On 8/25/11 12:32 PM, William Stein wrote: > > On Thu, Au

Re: [sage-support] Sage sgn to Sympy sign

2011-10-13 Thread Robert Bradshaw
We'd welcome a patch. How to do so is written up in detail at http://www.sagemath.org/doc/developer/walk_through.html#creating-a-change . Essentially, you create the change, uploaded it to trac, someone referees it, and then it gets merged into the next release. On Thu, Oct 13, 2011 at 9:30 AM, CD

Re: [sage-support] Question about sagenb.org

2011-10-12 Thread Robert Bradshaw
No. Also note that sagenb.org is on a single computer shared among tens of thousands of users, so if you want to do something computationally expensive you're better of installing Sage on your own hardware. On Tue, Oct 11, 2011 at 8:38 AM, juaninf wrote: > Exist sagenb.org with openmpi module? >

Re: [sage-support] Re: no math module!

2011-09-19 Thread Robert Bradshaw
On Mon, Sep 19, 2011 at 10:45 PM, kod da wrote: > Thanks for your response. > I found the same error when not setting SAGE64=yes. I noticed I got this > message higher in the install log: > Failed to find the necessary bits to build these modules: > bsddb185   dl gdbm > ima

Re: [sage-support] gsl in sage outside of notebook

2011-09-14 Thread Robert Bradshaw
On Wed, Sep 14, 2011 at 2:31 AM, Rajeev Singh wrote: > Hi, > > The following examples compiles from the notebook > > %cython > cimport sage.gsl.ode > import sage.gsl.ode > include 'gsl.pxi' > > cdef class van_der_pol(sage.gsl.ode.ode_system): >    cdef double beta >    def __cinit__(self, double b

Re: [sage-support] complex parts

2011-09-14 Thread Robert Bradshaw
On Wed, Sep 14, 2011 at 7:57 PM, Anton Sherwood wrote: > Is there a function inverse to complex(x,y), > such that (x,y) == ReIm(complex(x,y)) ? > > I could obviously write one -- def ReIm(z): return (z.real,z.imag) -- but > presumably a library function if it exists would be speedier. For Sage's

Re: [sage-support] Obtaining Size of a List and of elements of a List

2011-09-02 Thread Robert Bradshaw
On Fri, Sep 2, 2011 at 3:44 AM, Vince wrote: > Dear all, > > If I have a list, how do I obtain the cardinality of the list, the > command Cardinality() doesn't seem to always work. For example, the > following code produces a set ComSet of sets of combinations. > > Rows=3 > RowVector=[2,3,2] > Com

Re: [sage-support] Can't build sage library

2011-08-31 Thread Robert Bradshaw
On Tue, Aug 30, 2011 at 3:08 PM, dkrumm wrote: > I just made a new installation of Sage 4.7.1 and I tried to build the > library (although I haven't made any changes to it). I get this error > message: > > Building Sage on OS X in 64-bit mode > Creating SAGE_LOCAL/lib/sage-64.txt since it does not

Re: [sage-support] Re: Is "x (x)" impossible with all implicit_multiplication levels? (Please help decode warning get.)

2011-08-22 Thread Robert Bradshaw
On Mon, Aug 22, 2011 at 6:06 AM, Simon King wrote: > Hi Vladimir, > > On 22 Aug., 12:05, v...@ukr.net wrote: >>   Hello guys! >>   Could you please explain me (and perhaps some of the other readers) >> the reasons (or advantages) of using implicit multiplication at all? >>   I mean in what situati

Re: [sage-support] Bug: Finding kernel of a matrix over GF(2) seems to be broken.

2011-08-19 Thread Robert Bradshaw
I can't seem to download your test matrix, but are you sure you're not confusing left kernel and right kernel? What's M * M.kernel().basis()[0]? On Fri, Aug 19, 2011 at 10:57 AM, Sucharit wrote: > I am using Sage to compute homologies of large chain complexes. For this, I > need to compute kerne

Re: [sage-support] Re: how to a copy of a nested list?

2011-08-18 Thread Robert Bradshaw
On Thu, Aug 18, 2011 at 12:48 AM, wrote: >  Hello! > > On Thu, 18 Aug 2011 00:35:21 -0700 (PDT) > Stan Schymanski wrote: > >> Dear Robert, >> >> Thanks a lot for your help, this is exactly what I wanted. I still >> don't get why it is necessary to import a special function to perform >> such a s

Re: [sage-support] how to a copy of a nested list?

2011-08-17 Thread Robert Bradshaw
On Wed, Aug 17, 2011 at 9:09 AM, Stan Schymanski wrote: > Dear all, > > This has been driving me mad. According to the python documentation, > you can modify a copy of a list without modifying the original using > the following code: > > sage: L = [] > sage: M = L[:] # create a copy > sage: # modi

Re: [sage-support] Re: Tracking down a bug(?) in Cython

2011-08-04 Thread Robert Bradshaw
On Thu, Aug 4, 2011 at 10:49 AM, Victor Miller wrote: > There's a real bug in Cython.  It looks like it's some sort of parsing bug. > Consider the following program: > > > def Check(P,x): >     Q = 2**(1+len(x))*P >     R = P >     for _ in range(1+len(x)): >     R = 2*R >     if Q != R: >    

Re: [sage-support] Re: Tracking down a bug(?) in Cython

2011-08-04 Thread Robert Bradshaw
gt;> Robert, I'll see what I can do.  As you suspected, the files are not >> disclosable :-(. >> >> Victor >> >> On Aug 3, 3:03 am, Robert Bradshaw >> wrote: >> >> > This is exactly the kind if thing we try to avoid. I'd like to see the >&g

Re: [sage-support] Re: Tracking down a bug(?) in Cython

2011-08-03 Thread Robert Bradshaw
ed one to the > other, and just in case I checked with diff.  It's very puzzling. > > Victor > > On Aug 2, 8:19 pm, Robert Bradshaw > wrote: >> On Tue, Aug 2, 2011 at 11:29 AM, William Stein wrote: >> > On Tue, Aug 2, 2011 at 11:09 AM, VictorMiller >&g

Re: [sage-support] Tracking down a bug(?) in Cython

2011-08-02 Thread Robert Bradshaw
On Tue, Aug 2, 2011 at 11:29 AM, William Stein wrote: > On Tue, Aug 2, 2011 at 11:09 AM, VictorMiller wrote: >> I've written a bunch of functions (some organized in classes) to do >> some large computations in a particular finite field (always GF(2^n) >> for some odd n).  This seems to work fine.

Re: [sage-support] how to import locally defined extension types?

2011-07-31 Thread Robert Bradshaw
On Fri, Jul 29, 2011 at 5:00 PM, john_perry_usm wrote: > Hi > > I have a file type1.pyx that defines an extension type Type1, and a > file type2.pyx that defines an extension type Type2. Some attributes > of Type2 are of type Type1. If I have the types in one file, > everything runs fine; I'd like

Re: [sage-support] extending the Expression class

2011-07-26 Thread Robert Bradshaw
On Thu, Jul 21, 2011 at 3:37 AM, Burcin Erocal wrote: > Hi, > > On Wed, 20 Jul 2011 17:02:49 -0700 (PDT) > Steven Pollack wrote: > >> I noticed that a thread was developed for this sort of thing (http:// >> groups.google.com/group/sage-support/browse_thread/thread/ >> d50dc3bc2bdbeab0/34798c0585f

Re: [sage-support] including a python module built with autotools in Sage

2011-07-21 Thread Robert Bradshaw
On Wed, Jul 20, 2011 at 4:09 PM, Jose Guzman wrote: > Hi everybody, > > I am trying to install a Python module in Sage that uses autotools as its > build system. I would like to install it in my local Sage, so I type: > ./configure --prefix=$HOME/sage-4.7/local PYTHON=$HOME/sage-4.7/loca

Re: [sage-support] Re: Possible to make implicit multiplication allow "(1 + 2) (3 + 4)" ?

2011-06-27 Thread Robert Bradshaw
On Mon, Jun 27, 2011 at 8:23 AM, Chris Seberino wrote: > > > On Jun 24, 11:59 pm, Jason Grout wrote: >> sage: implicit_mul('diff(f,x)(3)', level=10) >> 'diff(f,x)*(3)' >> >> which is definitely not what I intended. > > Jason > > Would you agree a good robust solution to your issue would be for an

Re: [sage-support] unanticipated divison by zero

2011-06-22 Thread Robert Bradshaw
On Wed, Jun 22, 2011 at 12:35 PM, Ken Levasseur wrote: > Hello.  I'm trying to implement the algorithm for representing primes > congruent to 1 mod 4 as a sum of squares and I know the logic of the > algebra is right (identical equations work in Mathematica).  However, > I get  a "ZeroDivisionErro

Re: [sage-support] How can I tell if an algebraic number is rational?

2011-06-01 Thread Robert Bradshaw
On Wed, Jun 1, 2011 at 7:30 AM, zsharon wrote: > Hi, > > I need to determine if a given algebraic number is rational.  Here is > the setup: > > PolynomialRing(ZZ, 'x') > A=-2 > B=5 > f=x^3 + A*x +B > D=-4*A^3-27*B^2 > L. = NumberField(f) > > Then I need to know if a given number beta=b0+b1*c+b2*c^

Re: [sage-support] Python and Sage

2011-05-28 Thread Robert Bradshaw
On Sat, May 28, 2011 at 4:17 AM, Vahid wrote: > Hi, > I would like to know that if I write my Sage codes in IDLE of Python, > will it be faster when it runs? I highly doubt it. > Someone told me that in this case the > codes are translated to machine language faster and it is better. Looks like

Re: [sage-support] Re: How set up new accounts in a Python script? (instead of the notebook web form?)

2011-05-27 Thread Robert Bradshaw
On Fri, May 27, 2011 at 3:35 PM, Chris Seberino wrote: > On May 27, 3:34 pm, Berkin Malkoc wrote: >> It is in the >> reference:http://www.sagemath.org/doc/reference/sagenb/notebook/notebook.html > > Thank you.  Those docs appear to be for a Sage session. > > I actually need it to work from a Dja

Re: [sage-support] Slow serialization of sparse array

2011-05-16 Thread Robert Bradshaw
Are you suer that savetxt has sparse representations? I bet it's saving a whole bunch or 0's (though the numpy list would be the place to ask for sure, and for a replacement). On Mon, May 16, 2011 at 10:29 AM, akm wrote: > Would it be expected behavior for a 26k x 26k sparse array to take more th

Re: [sage-support] Re: efficient way to convert str to rational

2011-05-10 Thread Robert Bradshaw
On Tue, May 10, 2011 at 12:53 PM, tvn wrote: > sorry my question wasn't so clear --  but yes the main bottleneck is > applying the conversion function from string to rational .   Thanks for the > sage_eval function If the sage_eval function is faster, then string -> Rational needs to be fixed. s

Re: [sage-support] Root finding

2011-05-10 Thread Robert Bradshaw
On Tue, May 10, 2011 at 10:02 PM, Santanu Sarkar wrote: > If  I want to find the roots of x^2-2 in reals, I use the following approach. > > R.=RR[] > f=x^2-2 > f.roots() > > But, it gives the rational approximation.  Is it possible to find the > exact root (irrational form)? Depending on exactly

Re: [sage-support] Re: degree of poly

2011-05-10 Thread Robert Bradshaw
On Tue, May 10, 2011 at 11:40 AM, MathLynx wrote: > Is it safe to say that > > R = PolynomialRing(QQ, 'X,Y') > > defines a ring over  Q  in two variables, in which > > x,y = R.gens() > > sets x & y to be the generators?  If this is so, then what exactly is > the role of 'X,Y' ?  Just to list the n

Re: [sage-support] Re: Modular Exponentiation

2011-03-17 Thread Robert Bradshaw
wrote: > Another option is to use the pow() function, as in pow(a, b, c). > > On Mar 17, 1:58 am, Robert Bradshaw > wrote: >> mod(a, c)^b >> >> On Wed, Mar 16, 2011 at 10:44 PM, Santanu Sarkar >> >> >> >> >> >> >&g

Re: [sage-support] Modular Exponentiation

2011-03-16 Thread Robert Bradshaw
mod(a, c)^b On Wed, Mar 16, 2011 at 10:44 PM, Santanu Sarkar wrote: > How one can calculate  a^b mod c  in Sage for large b? > > -- > To post to this group, send email to sage-support@googlegroups.com > To unsubscribe from this group, send email to > sage-support+unsubscr...@googlegroups.com > F

Re: [sage-support] Re: Unhelpful error message

2011-03-04 Thread Robert Bradshaw
On Fri, Mar 4, 2011 at 6:00 AM, kcrisman wrote: > > > On Mar 4, 12:17 am, Robert Bradshaw > wrote: >> On Wed, Mar 2, 2011 at 5:16 PM, kcrisman wrote: >> >> > On Mar 2, 5:05 pm, achrzesz wrote: >> >> I'm not sure if this is relevant but >&g

Re: [sage-support] Re: Unhelpful error message

2011-03-03 Thread Robert Bradshaw
On Wed, Mar 2, 2011 at 5:16 PM, kcrisman wrote: > > > On Mar 2, 5:05 pm, achrzesz wrote: >> I'm not sure if this is relevant but >> sage: power_mod(2,-1,990) >> also gives helpful error message >> and checking for exponent -1 is not necessary >> A Ch > > Relevant, but of course what I'm really ge

Re: [sage-support] SAGE cluster?

2011-03-03 Thread Robert Bradshaw
Given that we don't do anything special with that library we should probably point the user to its documentation rather than write something ourselves. On Mar 3, 2011 3:55 PM, "David Kirkby" wrote: > On 3 March 2011 21:56, Calcpage wrote: >> Well, I'd like to expose my Computing Independent Study

Re: [sage-support] Server connection problems - which are likely linked to enclosed code.

2011-02-24 Thread Robert Bradshaw
Looks like you downloaded a 10.6 binary and are trying to use it on your 10.5.8 machine. You (probably) want the first item in this list: http://boxen.math.washington.edu/sage/osx/intel/index.html On Thu, Feb 24, 2011 at 10:14 PM, amandachan2...@yahoo.com wrote: > Essentially, I'm having problems

Re: [sage-support] Memory problem

2011-02-23 Thread Robert Bradshaw
What basering is your system over? This could make a huge difference in terms of memory requirements. On Wed, Feb 23, 2011 at 6:57 AM, Guillermo Oviedo wrote: > In trying to solve a linear equation system of 4096 variables (with > matrix.solve_right()) , there occurs a memory > allocation error "

Re: [sage-support] Re: help needed with cube

2011-02-17 Thread Robert Bradshaw
On Sun, Jan 30, 2011 at 6:42 AM, Loïc wrote: > Do you think it's better to report it as a bug? Yes. http://trac.sagemath.org/sage_trac/ticket/10796 -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googl

Re: [sage-support] Re: sagenb.org server(s)

2011-02-07 Thread Robert Bradshaw
On Mon, Feb 7, 2011 at 3:59 PM, Harald Schilly wrote: > On Monday, February 7, 2011 7:52:52 PM UTC+1, robertwb wrote: >> >> Sage is a victim of its own success! > > I think it's really great that there is an online notebook to try sage, but > we should post a warning that this is not intended for

  1   2   3   4   5   6   7   8   9   >