[sage-support] Re: install additional package

2011-05-04 Thread Simon King
Hi Foad, On 4 Mai, 10:35, Foad Khoshnam khosh...@gmail.com wrote: Hi How I can install the huge additional package for sage in linux? Do you mean the Stein-Watkins database? The package can be found at http://www.sagemath.org/sagedb/ (it is the file stein-watkins- ecdb.spkg), and I guess it

[sage-support] Re: install additional package

2011-05-04 Thread Simon King
Hi John, On 4 Mai, 23:19, John Cremona john.crem...@gmail.com wrote: I have tried and failed to load the large SW database (and complained about this to William yesterday).  All the spkg_install scripts is to move a whole lot of files, but it uses the command mv -r which is illegal on my

[sage-support] Re: .factor() output consistent?

2011-05-01 Thread Simon King
Hi Roland, On 1 Mai, 12:08, Rolandb rola...@planet.nl wrote: sage: R.A,B=QQ[] sage: list((A^2+B).factor()+(B^2).factor()) [(1, A^2), (1, B^2), (1, B)] sage: list((A^2+B).factor())+list((B^2).factor()) [(A^2 + B, 1), (B, 2)] Is the first result what I could (should) expect? (tested via

[sage-support] Re: doctest treats 1/2 as 0

2011-04-21 Thread Simon King
Hi! On 21 Apr., 06:45, Justin C. Walker jus...@mac.com wrote: def test(p):     var('x')    x test(1/2*x)    1/2*x        print p ... You are using a .py file, so Sage treats it as python (not Sage) code.  It doesn't get preparsed using Sage's rules.  In particular, a/b is the

[sage-support] Re: doctest treats 1/2 as 0

2011-04-21 Thread Simon King
Hi! On 21 Apr., 18:23, tvn nguyenthanh...@gmail.com wrote: Hi, sorry I still don't get this. If I write my code in a test.sage file -- then load or attach it from Sage interactive.  Then how do I call doctest on it ?     Previously I write my code in a test.py file , then from Sage

[sage-support] What gcd algorithm is used for integers?

2011-04-19 Thread Simon King
Hi! I see that Sage uses mpz to compute gcd. But (at least by a quick google search) I was not able to find which algorithm is used by mpz to compute gcd. Can you tell me which? Cheers, Simon -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group,

[sage-support] Re: Sage Scripts

2011-04-18 Thread Simon King
On 17 Apr., 04:57, nkulmati kulmatits...@gmail.com wrote: However, I had a major disappointment. I wrote a short script, and it is apparently too much for sage/python to handle when I am running a virtual machine from Win 7. I use process monitor and it goes like this: when I run my script,

[sage-support] Re: How can I reconstruct the reference manual?

2011-03-24 Thread Simon King
On 19 Feb., 07:02, Simon King simon.k...@uni-jena.de wrote: No, delete the output from the doctree. That is, rm -rf doc/output. Then sage -b sage -docbuild reference html. I am afraid this did not work. I deleted the output, and even after sage -ba, sage -docbuild did not do any good

[sage-support] Re: linear algebra: populating a matrix

2011-03-15 Thread Simon King
Hi Ben and Justin, On 15 Mrz., 05:38, Justin C. Walker jus...@mac.com wrote: On Mar 14, 2011, at 21:24 , Ben123 wrote: I was hoping I wouldn't need to make that many changes to the python code, but this would seem to indicate Sage and Python aren't 1-to-1. Perhaps you think of a matrix as a

[sage-support] Re: linear algebra: populating a matrix

2011-03-15 Thread Simon King
On 15 Mrz., 08:13, Justin C. Walker jus...@mac.com wrote: The way of setting/getting elements of a matrix has nothing to do with the preparser. Of course.  My second comment was in response to the OP's statement that ...Sage and Python aren't 1-to-1. Sure. I just wanted to avoid that the

[sage-support] Re: Intersection of complex Ideals

2011-02-28 Thread Simon King
Hi Robert, On 1 Mrz., 01:00, Robert Goss goss.rob...@gmail.com wrote: I have 2 ideals over the complex field and I would like to take their intersection. If I try and use the intersection method on one of the ideals i get an error message from singular stating the following type error:

[sage-support] How can I reconstruct the reference manual?

2011-02-18 Thread Simon King
Hi! I don't know what I did wrong, but apparently I completely destroyed the reference manual in my copy of Sage. I tried to do sage -docbuild reference html, but it gave me 810 warnings about non-existing files. There used to be a devel/sage/doc/en/reference/sage, but now that folder does not

[sage-support] Re: How can I reconstruct the reference manual?

2011-02-18 Thread Simon King
Hi Volker, On 18 Feb., 21:45, Volker Braun vbraun.n...@gmail.com wrote: I also noticed that, sometimes, the incremental document building gets confused to the point where it falls on its face. Simplest option is to wipe the doc tree and rebuild the whole documentation. How do I wipe the doc

[sage-support] Re: How can I reconstruct the reference manual?

2011-02-18 Thread Simon King
Hi Volker On 18 Feb., 22:07, Volker Braun vbraun.n...@gmail.com wrote: No, delete the output from the doctree. That is, rm -rf doc/output. Then sage -b sage -docbuild reference html. I am afraid this did not work. I deleted the output, and even after sage -ba, sage -docbuild did not do any

[sage-support] Re: Error in using PolynomialRing(QQ, vars) and elimination_ideal()

2011-02-14 Thread Simon King
Ceterum censeo: The use of symbolic expressions for the creation of a polynomial ring should be deprecated (see trac ticket #10483). Mistaking a symbolic expression for an element of a polynomial ring of the same name is a *very* common error, and would be easy to avoid by making the

[sage-support] Re: Error starting sage after a source build

2011-01-30 Thread Simon King
Hi Jorges, On 30 Jan., 04:04, Jeff Post j_p...@pacbell.net wrote: On Saturday 29 January 2011 17:43, jorges wrote: Maybe this is a dumb question, but should sage be built by root? I'm not sure this applies to Sage, since I haven't yet got it to work, but in general, software should be

[sage-support] Re: Ideal and Groebner Basis

2011-01-28 Thread Simon King
Hi, On 28 Jan., 15:19, Santanu Sarkar sarkar.santanu@gmail.com wrote: Suppose in an array A[100], I have 100 polynomials over R.x,y,z=QQ[] I first want to construct an ideal generated by this polynomial. Then I want to find the Groebner Basis. How this can be done  in Sage? When we have

[sage-support] Re: simplify_full on matrices.

2011-01-26 Thread Simon King
Hi Joal, On 26 Jan., 09:14, ancienthart joalheag...@gmail.com wrote: I'm relying on the fact that __getattr__ is only called if the attribute is missing from the matrix class. I was of the opinion that this would completely avoid raising an AttributeError in the first place. Exactly. And as

[sage-support] Re: simplify_full on matrices.

2011-01-26 Thread Simon King
On 26 Jan., 09:14, ancienthart joalheag...@gmail.com wrote: The output of __getattr__ has to be a callable. And when called, it has to return a matrix object with the mapped values of the original matrix. I'm thinking it's going to involve a helper function. o_O That's what I told you in a

[sage-support] Re: basic import question

2011-01-25 Thread Simon King
Hi Ryan, On 25 Jan., 13:25, Ryan Krauss ryanwkra...@gmail.com wrote: So, is there a supported way for the user to append paths to the PYTHONPATH in the Sage installation (sage-env)? AFAIK, it is not supported to work with your system-wide Python from within Sage. Hence, the supported way of

[sage-support] Re: [sage-devel] simplify_full on matrices.

2011-01-25 Thread Simon King
Hi Joal, On 26 Jan., 08:06, ancienthart joalheag...@gmail.com wrote: My current path of research involves giving the Matrix class a __getattr__ method with argument *missing_method*, that returns a callable object. The callable object then returns the matrix result of .apply_map(lambda x:

[sage-support] How to inherit from the parent_class of a category?

2011-01-21 Thread Simon King
Hi! I tried to implement an example of pointed sets. I tried: class PointedSet(UniqueRepresentation,Set_object_enumerated): def __init__(self, S,p): Set_object_enumerated.__init__(self,S) self._p = p self._init_category_(PointedSets()) ... S =

[sage-support] Multiplication of elements: How to implement?

2011-01-21 Thread Simon King
Hi! Suppose you have a Cython class P that derives from sage.structure.parent.Parent and another Cython class E that derives from sage.structure.element.Element. The class P has an _element_constructor_, and its instances get the category Magmas() Now you want to define multiplication for

[sage-support] Re: Assign the elements of matrix in the cycle

2011-01-12 Thread Simon King
Hi Dimitry! On 12 Jan., 10:43, Dmitry Shkirmanov piminusme...@bk.ru wrote: Hello, i need  to assign the elements of matrix in the cycle, for example here is the code (in a notebook): # var('a,b,c,d,e,f') v1=vector([a,b,c]) v2=vector([d,e,f]) v3=matrix(1,3) j=0 while j=2:    

[sage-support] Catching a DeprecationWarning

2011-01-10 Thread Simon King
Dear Sage supporters, Is there a way to catch a deprecation warning (as one would catch an error)? A DeprecationWarning inherits from BaseException, but nonetheless the following does not work: sage: def f(): : try: : deprecation('bla') : except DeprecationWarning:

[sage-support] Re: Ring Problem

2011-01-04 Thread Simon King
Hi! Integers(n) is the same (but shorter): sage: Integers(5) is IntegerModRing(5) True Cheers, Simon -- 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 For more options, visit this

[sage-support] PY_TYPE_CHECK or isinstance?

2010-12-20 Thread Simon King
Dear sage-support, at #10496, David Roe gave me the advice to use PY_TYPE_CHECK rather than isinstance in Cython files. I did so. But actually I didn't know PY_TYPE_CHECK at all, and so I have a two questions: 1) Apparently there are several PY_... functions. Where can I read about them? 2)

[sage-support] Re: PY_TYPE_CHECK or isinstance?

2010-12-20 Thread Simon King
Dear Volker, dear Jason, thank you for your answers! So, I chose the wrong example isinstance(x,int). With other types to test, PY_TYPE_CHECK will be faster. @Volker But if you really write Cython code then you probably want to type the argument so that the compiler knows what x is. ...

[sage-support] Re: Reduced quadratic Forms

2010-12-15 Thread Simon King
Hi Christian! Disclaimer: Since I work in a different area of maths, I don't know how the algorithm of computing the reduced binary form should work. I just had a brief look at the code and at the definition of reduced binary form as found on some page of Wolfram. On 16 Dez., 00:18, cjung

[sage-support] Re: Installing SAGE alongside existing Python installation

2010-12-14 Thread Simon King
Hi, On 14 Dez., 17:07, emil emil.widm...@gmail.com wrote: Is it an idea to do it the other way around? Make symlink to the python which is contained in sage to use it from outside? I think that functionality is provided by the command install_scripts. Cheers, Simon -- To post to this group,

[sage-support] Re: Installing SAGE alongside existing Python installation

2010-12-14 Thread Simon King
Hi Emil! On 14 Dez., 23:20, emil emil.widm...@gmail.com wrote: Could you give an example of how to use install_scripts  to make e.g. python or R available from outside sage? For example: I have a directory bin/ in my home directory, that also is in my PATH. Once upon a time, I did sage:

[sage-support] Re: Cannot print large dense matrices + A.str() also fails

2010-12-14 Thread Simon King
Hi Pranav! On 15 Dez., 04:36, pranav pranav.garg2...@gmail.com wrote: Traceback (most recent call last):   File out.py, line 79, in module     print A.str()   File parent.pyx, line 703, in sage.structure.parent.Parent.__getattr__ (sage/structure/parent.c: 5382)   File parent.pyx, line 268,

[sage-support] Re: Having trouble getting *ultra* high precision in this infinite sum calculation...

2010-12-13 Thread Simon King
Hi Chris, disclaimer: I am no expert in numerics. On 13 Dez., 07:34, Chris Seberino cseber...@gmail.com wrote: Why isn't the error improving as I increase the number of terms that are summed?  Am I doing something wrong in Sage?  (Yes it is possible that this infinite sum converges

[sage-support] Re: Confused about rmul and lmul

2010-12-11 Thread Simon King
Hi, On 11 Dez., 04:36, Kwankyu ekwan...@gmail.com wrote: Below is a passage in the Reference manual on the coercion model: If R is the base of S (as in the first example), simply implement _rmul_ and/or _lmul_ on the Elements of S. In this case r * s gets handled as s._rmul_(r) and s * r as

[sage-support] Re: graded term orderings of fields

2010-12-07 Thread Simon King
On 6 Dez., 16:36, andrew ewart aewartma...@googlemail.com wrote: which of the term orderings that are listed in the sgae help manual are graded term orderings? the link to the page in question ishttp://www.sagemath.org/doc/reference/sage/rings/polynomial/term_orde... The page is the right

[sage-support] Re: intersection of ideals

2010-12-07 Thread Simon King
Hi, On 7 Dez., 17:03, andrew ewart aewartma...@googlemail.com wrote: I have the following code P.x0,x1,y0,y1,y2,y3 = PolynomialRing(QQ,order='degrevlex') I = Ideal(x0^4-y0,x0^3*x1-y1,x0*x1^3-y2,x1^4-y3) print I R.y0,y1,y2,y3 = PolynomialRing(QQ,order='degrevlex') I1=Ideal(1)

[sage-support] Re: intersection of ideals

2010-12-07 Thread Simon King
On 7 Dez., 17:48, andrew ewart aewartma...@googlemail.com wrote: I thought I1=R=1 As I said, nobody could guess that you believe that 1 is in R. also the intersection should be in R, not just in P, so how is this achieved? Read my previous post, it is answered there. -- To post to this

[sage-support] Re: Specializing a base ring

2010-11-21 Thread Simon King
Hi! On 21 Nov., 19:09, John Cremona john.crem...@gmail.com wrote: Note that #8807 very nearly got a positive review (from me) but there were some trivial issues, and then the patch author (Simon King) moved house and has not had time to fix them yet. Sorry... -- To post to this group, send

[sage-support] Re: polynomial division by increasing powers

2010-11-16 Thread Simon King
Hi Johannes! On 16 Nov., 23:48, Johannes Huisman johannes.huis...@gmail.com wrote: Does sage have a command for polynomial division by increasing powers? I could not find such a command. Of course, one may use power series division in order to compute the quotient, but it would be neat if one

[sage-support] Re: Installation problem (Sage 4.6)

2010-11-11 Thread Simon King
PS: sage-4.5.3 seems to be fine on my machine. I'm now trying to upgrade. There is one detail that may be relevant: While I tried to build sage-4.6, the computer crashed. Later, I typed make again, in order to complete the build process. Perhaps this is then things went wrong. Best regards,

[sage-support] Re: Sage and Macaulay 2

2010-11-10 Thread Simon King
Hi Doug, hi David! On 10 Nov., 19:05, Dr. David Kirkby david.kir...@onetel.net wrote: On 11/10/10 04:14 PM, doug5y wrote: ... I've built sage already, would I have to rebuild sage if I installed Macaulay 2 after the build? It should not be necessary to do so. I think typing $ sage -i

[sage-support] Installation problem (Sage 4.6)

2010-11-10 Thread Simon King
Hi! I just tried to install Sage-4.6 on the computer in my new office, but it failed. The last line of the install.log says: To install gap, gp, singular, etc., scripts in a standard bin directory, start sage and type something like sage: install_scripts('/usr/local/bin') at the Sage command

[sage-support] Re: Fundamental Group

2010-11-10 Thread Simon King
Hi Robert! On 10 Nov., 18:31, Robert Goss goss.rob...@gmail.com wrote: I am trying to compute the fundamental group of some simplicial complexes in sage. Is there a way of creating a group with a given set of generators and relations? You could use the fact that GAP is part of Sage. Using the

[sage-support] Re: Round symbolic expressions

2010-10-25 Thread Simon King
Hi Cristóvão! On 25 Okt., 03:30, Cristóvão Sousa cris...@gmail.com wrote: ... It just has a minor bug when the operator has more than two operands, like x+y+z, but I'll try to fix it as I got the picture now. Yes, to my surprise, the add operator only accepts two arguments, but the list of

[sage-support] Re: Round symbolic expressions

2010-10-25 Thread Simon King
Hi Burcin, On 25 Okt., 11:04, Burcin Erocal bur...@erocal.org wrote: I suggest we raise a ValueError when there is no operator or operands. This is already done for iterators of symbolic expressions in #7537: http://trac.sagemath.org/sage_trac/ticket/7537 Can you open a ticket to do the

[sage-support] Re: Round symbolic expressions

2010-10-25 Thread Simon King
Hi Burcin! On 25 Okt., 14:39, Burcin Erocal bur...@erocal.org wrote: If we return an identity operator for these cases, how do you plan to test for it in your code: Something like this: L = x.operands() if len(L)1: return x.operator()(*map(lambda ..., L)) else: try: return

[sage-support] Re: Round symbolic expressions

2010-10-25 Thread Simon King
PS: I know that testing is None is faster than len(L)1 and wouldn't insist that there *has* to be an identity operator. One has to consider two different cases anyway. However, if there *is* an operator, s==s.operator()(*s.operands()) should hold. Cheers, Simon -- To post to this group, send

[sage-support] Re: Round symbolic expressions

2010-10-25 Thread Simon King
Hi Burcin, On 25 Okt., 15:26, Burcin Erocal bur...@erocal.org wrote: This initializes a list with a single element for objects which return None for operator() now. IMHO, this approach is inefficient. In this case, you should act on the object directly. I didnt claim that it was efficient -

[sage-support] Re: Casting from type rational functions to type polynomials

2010-10-24 Thread Simon King
Hi Cary and John! On 24 Okt., 04:41, John H Palmieri jhpalmier...@gmail.com wrote: ... sage: R.g17,g19 = PolynomialRing(QQ) sage: R.inject_variables() Note that inject_variables is not needed, because g17 annd g19 are defined by the previous line anyway. sage: p = (g17^2 - g19^2)/(g17 + g19)

[sage-support] Re: Round symbolic expressions

2010-10-24 Thread Simon King
Hi Cristóvão! On 24 Okt., 00:50, Cristóvão Sousa cris...@gmail.com wrote: But, is there any way of round reals even if they are inside a symbolic expression? I guess it would be needed to define a recursive function for that purpose, using operator and operands of a symbolic expression. Such

[sage-support] Re: Creating large matrix hangs

2010-10-23 Thread Simon King
Hi Robert! On 23 Okt., 10:18, Robert Bradshaw rober...@math.washington.edu wrote: Can you run top() and see (1) how much CPU it's using and (2) how much memory it's using (compared to your free memory). I doubt that memory is the problem. The following is on sage.math (thus, with plenty of

[sage-support] Re: Creating large matrix hangs

2010-10-23 Thread Simon King
Hi! On 23 Okt., 11:59, Simon King simon.k...@nuigalway.ie wrote: So, one should create an empty matrix and then insert the elements row by row. It it also more efficient on a smaller skale (and does the right thing): sage: MS = MatrixSpace(ZZ,100,50) sage: L = [[ZZ.random_element

[sage-support] Re: Creating large matrix hangs

2010-10-23 Thread Simon King
Hi Yann! On 23 Okt., 13:32, Yann yannlaiglecha...@gmail.com wrote: ... In the matrix constructor (matrix in sage/matrix/constructor.py): entries = sum([list(v) for v in args[0]], [])    --- this is bad (quadratic in the length of argv[0] which is the number of rows here) I guess this line

[sage-support] Re: Creating large matrix hangs

2010-10-23 Thread Simon King
On 23 Okt., 14:15, Yann yannlaiglecha...@gmail.com wrote: this is now ticket #10158 Thanks! Simon -- 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 For more options, visit this group at

[sage-support] Re: Substituting variables from two different structures

2010-10-20 Thread Simon King
Hi Alasdair! What about this: sage: F.x=GF(2^8,name='x') sage: R.y=PolynomialRing(GF(2)) sage: p = F.random_element() sage: p x^7 + x^5 + x^4 + x sage: pp = p.polynomial() sage: pp(x=y) y^7 + y^5 + y^4 + y The only difference to your approach is that R is defined over the field GF(2) rather

[sage-support] Re: size of varities

2010-10-13 Thread Simon King
Hi Andrew, On 12 Okt., 15:19, andrew ewart aewartma...@googlemail.com wrote: i think its just reffering to vector space dimension I have no idea what the Krull dimension of this space is Also if i try lex in QQ the grobner basis i get out is [x + y + z - 3, y^2 + y*z - 3*y + z^2 - 3*z + 2,

[sage-support] Re: size of varities

2010-10-13 Thread Simon King
PS: On 13 Okt., 10:14, Simon King simon.k...@nuigalway.ie wrote: sage: IR = I.radical().groebner_basis()*P; IR Ideal (z^3 - 3*z^2 + 2*z + 2/3, y^2 + y*z + z^2 - 3*y - 3*z + 2, x + y + z - 3) of Multivariate Polynomial Ring in x, y, z over Rational Field sage: IR.dimension() 0 sage

[sage-support] Re: size of varities

2010-10-13 Thread Simon King
On 13 Okt., 12:21, Simon King simon.k...@nuigalway.ie wrote: I am not sure if the methods dimension and vector_space_dimension would automatically compute the Gröbner basis. The corresponding commands in Singular won't. I just checked: Yes, the GB is computed internally if the Krull or vector

[sage-support] Re: size of varities

2010-10-13 Thread Simon King
Hi Martin! On 13 Okt., 15:12, Martin Albrecht martinralbre...@googlemail.com wrote:   sage: I.radical().vector_space_dimension()   6 which would raise a TypeError if the ideal was not zero dimensional. We should probably change that to be a ValueError, since the value of the ideal is

[sage-support] Re: size of varities

2010-10-12 Thread Simon King
Hi Andrew! On 12 Okt., 11:34, andrew ewart aewartma...@googlemail.com wrote: If I is Ideal(x+y+z-3,x^2+y^2+z^2-5,x^3+y^3+z^3-7) and X=V(I), where V(I) is the variety of I and I have the following code Code: P.x,y,z = PolynomialRing(CC,order='lex') I =

[sage-support] Re: initial ideal

2010-10-10 Thread Simon King
Hi Andrew! On 10 Okt., 16:58, andrew ewart aewartma...@googlemail.com wrote: hmm sage doesnt seem to recognise the Im() command How do you define your polynomials? Are you sure that you *do* define polynomials? Examples: 1. This is a polynomial: sage: R.x,y = QQ[] sage: p = x^2+3*x*y+y^3

[sage-support] Re: initial ideal

2010-10-10 Thread Simon King
Hi Andrew! On 10 Okt., 19:25, andrew ewart aewartma...@googlemail.com wrote: i tried to take this into consideration giving the following code P.x,y,z = PolynomialRing(QQ,order='neglex') I = Ideal(x^5 + y^4 +z^3, x^3 + y^2 + z^2 -1) print I gb=I.groebner_basis()

[sage-support] Re: Global variables called in a function

2010-09-29 Thread Simon King
Hi Walker! On 29 Sep., 16:42, Walker ebwal...@gmail.com wrote: ... My question is: is there a way to make Sage not creating a global variable but assigning directly the global one? This is actually a Python question. It would of course be very dangerous if variables defined outside a function

[sage-support] Re: summation

2010-09-15 Thread Simon King
Hi sps! On Sep 14, 4:55 pm, kcrisman kcris...@gmail.com wrote: On Sep 14, 11:40 am, sps debernasave...@libero.it wrote: So you say, I have to digit this: maxima_console() Not exactly. I would say that our reply to your question had two layers: 1) Both kcrisman and I explained how it

[sage-support] How to deal with write protected data?

2010-09-15 Thread Simon King
Hi! I have the following setting: - There is read-only data in some folder public/ - I want to do further computation, which requires write permission on the data. Obviously, one may write all new data into another folder private/ with write permissions, and read the existing data from public/.

[sage-support] Re: Obtaining data from a computation in process

2010-09-14 Thread Simon King
Hi Nick! On Sep 13, 9:36 pm, Nick aroy...@gmail.com wrote: Sorry, I just needed to be a little patient.  I eventually returned to the Sage command prompt.  Typed S and got back an empty set (I know it wouldn't have been completely empty). OK, but ctrl-c will only interrupt the computation,

[sage-support] Re: summation

2010-09-14 Thread Simon King
Hi! On Sep 14, 4:08 pm, sps debernasave...@libero.it wrote: How can I calculate this summation: summation(from:0,to:+oo,((2*I)^n/(n^3+1)*(1/4)^n)) in sage? Disclaimer: I am not an expert in symbolics (I am more into algebra). I thought the following should work: sage: var('n') n

[sage-support] Re: Arbitrary precision in Cython NumPy?

2010-09-08 Thread Simon King
Hi Jason! On 8 Sep., 20:57, Jason Grout jason-s...@creativetrax.com wrote: Actually, for a while now, for i in range(...) is translated into fast C intelligently.  In fact, I believe it's the recommended syntax now, instead of 0=i... Even if you do *not* cdefine cdef int i? That's new to me.

[sage-support] Re: installation of Sage

2010-09-06 Thread Simon King
Hi! On Sep 6, 10:03 am, Dan Drake dr...@kaist.edu wrote: ... Googling sh: undefined symbol: rl_filename_rewrite_hook immediately led me to this thread: http://www.mail-archive.com/sage-support@googlegroups.com/msg16822.html There, the problem seemed related to different compiler versions,

[sage-support] Re: Implication

2010-09-04 Thread Simon King
Hi! On 4 Sep., 22:52, tvn nguyenthanh...@gmail.com wrote: HI Jason,  I tried what you posted and get some errors , I am using the latest Sage version 4.5.2 -- | Sage Version 4.5.2, Release Date: 2010-08-05                    

[sage-support] Re: rexpression of lists

2010-09-03 Thread Simon King
Hi Andrew! On Sep 2, 6:56 pm, andrew ewart aewartma...@googlemail.com wrote: ... degx= f.degree(z1) degy= f.degree(z2) degree=2*degx*degy ...           for q in xrange(0,degree+1):                 for ja in range(0,degx):                    

[sage-support] Re: rexpression of lists

2010-09-03 Thread Simon King
Hi Andrew! On Sep 3, 12:28 pm, andrew ewart aewartma...@googlemail.com wrote: so for ad^0 i should get out [1,0,0,0,0,...,0] What you can use is padded_list! Example: sage: R.x=QQ[] sage: p = R.random_element() sage: p 3/4*x^2 + 1/2*x - 1 sage: p.padded_list(5) [-1, 1/2, 3/4, 0, 0] The

[sage-support] Re: rexpression of lists

2010-09-03 Thread Simon King
On Sep 3, 1:42 pm, andrew ewart aewartma...@googlemail.com wrote: ... this is very close all i want to do is now join each collection of lists together so get outputs [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] and [0, 1, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0] thoughts?

[sage-support] Number of CPUs?

2010-09-03 Thread Simon King
Hi! I have a list of computations (in fact, a test suite), and I'd like to do them in parallel. Of course, I could use @parallel, but: 1) each computation uses 3 processes (Sage, GAP, Singular) 2) it is probably not nice to other users if parallel computation uses all available CPUs. I'd

[sage-support] Re: Number of CPUs?

2010-09-03 Thread Simon King
Hi! I guess I can answer the question about number of cpus myself (google was my friend, after all...): import multiprocessing multiprocessing.cpu_count() However, I'd appreciate to get an answer to the sage -t question. Cheers, Simon -- To post to this group, send email to

[sage-support] Re: Number of CPUs?

2010-09-03 Thread Simon King
Hi Didier and John! On 3 Sep., 20:02, didier deshommes dfdes...@gmail.com wrote: Besides, a while ago I asked how one can execute the sage test script on a string, *without* saving that string into a file and *without* forking a sage -t subprocess. Do you see a way? Sounds like you want

[sage-support] Re: Implication

2010-09-03 Thread Simon King
Hi! On 3 Sep., 21:37, JamesHDavenport j.h.davenp...@bath.ac.uk wrote: On Sep 3, 6:56 pm, Jason Bandlow jband...@gmail.com wrote: For polynomial equations, the following should work in general. sage: R.x,y = CC['x','y'] sage: f = x-y sage: g = x^2 - y^2 sage: I = R.ideal([f]).radical()

[sage-support] Re: Number of CPUs?

2010-09-03 Thread Simon King
Hi David! On 4 Sep., 01:01, Dr. David Kirkby david.kir...@onetel.net wrote: Be aware, that for hyperthreaded machines, the number of CPUs may exceed the number of cores. Ah. I guess that I wanted the number of cores. If, as you say, half the CPUs is enough to occupy all resources, then I'd

[sage-support] Re: Number of CPUs?

2010-09-03 Thread Simon King
Hi David, On 4 Sep., 01:53, Dr. David Kirkby david.kir...@onetel.net wrote: Is SAGE_NCPUS used anywhere? Well, I was not suggesting to introduce an environment variable that is used anywhere in Sage except to tame my test script. Of course, if there already is an environment variable that

[sage-support] Re: rexpression of lists

2010-09-02 Thread Simon King
Hi Andrew! On 2 Sep., 18:12, andrew ewart aewartma...@googlemail.com wrote: suppose i have a list of the form l=[a+b*x+c*x^2, d+e*x+f*x^2] how do i use l[n].list() correctly to produce [a,b,c,d,e,f] as at the moment im only getting [a,b,c] ... Please provide a complete code snipped. From

[sage-support] How do I doctest this KeyboardInterrupt?

2010-08-30 Thread Simon King
Hi! I try to write a doctest for a method that, under certain conditions, is supposed to raise a KeyboardInterrupt with a specific error message (simulation in this case). I understood that in order to doctest an error, one would do something like sage: f.bar(G2) Traceback (most recent call

[sage-support] Re: How do I doctest this KeyboardInterrupt?

2010-08-30 Thread Simon King
Hi Mitesh! On 30 Aug., 23:20, Mitesh Patel qed...@gmail.com wrote: Yes, since otherwise the doctest framework will catch the keyboard interrupt and stop the tests. Great, thank you! And catching the error does indeed work. Cheers, Simon -- To post to this group, send email to

[sage-support] Re: subtraction with dates?

2010-08-25 Thread Simon King
On 25 Aug., 02:07, Dr. David Kirkby david.kir...@onetel.net wrote: ... The silly thing is, they have known about this defect for 9 months, but it was given a low priority. 9 months later it damages our car, and the council denies they were aware the road was dangerous. Is there really

[sage-support] Re: iteration from previous terms

2010-08-24 Thread Simon King
Hi Andrew! On 24 Aug., 15:35, andrew ewart aewartma...@googlemail.com wrote: suppose we define a function f(x)=x^3+1 and define a_0=1 and then had the iteration a_n=f(a_n-1)/(a_n-1) how would one go about writing this in sage? You can use the fact that Sage is built on Python. So, you can

[sage-support] Re: Those cookies again...

2010-08-23 Thread Simon King
Hi All! Shouldn't this discussion better go to sage-devel? On 22 Aug., 22:01, Dr. David Kirkby david.kir...@onetel.net wrote: ... http://www.python.org/dev/peps/pep-0006/ Quoting from this source: In general, only the N-1 release will be under active maintenance at any time. That is,

[sage-support] Re: How can I make implicit_multiplication default?

2010-08-23 Thread Simon King
Hi Robin, On 23 Aug., 12:58, robin hankin hankin.ro...@gmail.com wrote: But, if I didn't know it existed, how could I possibly have found it? (give me a pointer to a FAQ!) I just tried to find it in the FAQ, but without success. Anyway. If you know that it is called implicit_multiplication

[sage-support] Re: How can I make implicit_multiplication default?

2010-08-23 Thread Simon King
Hi Robin, On 23 Aug., 13:43, robin hankin hankin.ro...@gmail.com wrote: Re automatic_names(): why isn't this the default? Now I know it exists, I think I'll probably use it all the time. Who uses sage without this option? I find automatic_names horrible, to say the least! In my opinion,

[sage-support] Re: Those cookies again...

2010-08-23 Thread Simon King
PS: On 23 Aug., 12:55, Simon King simon.k...@nuigalway.ie wrote: ... My impression is that the Sage development process is quite far from that way of thinking. ... or perhaps it is not so much the way of thinking? I would expect that Python has a lot more person power than Sage. How many

[sage-support] Re: How can I make implicit_multiplication default?

2010-08-23 Thread Simon King
Hi Robert, On 23 Aug., 18:08, Robert Bradshaw rober...@math.washington.edu wrote: ... And on the other hand, I can't see how life with Sage would be any easier if automatic_names was the standard. Think about someone working through a series of calculus textbook exercises (mostly

[sage-support] Re: Those cookies again...

2010-08-22 Thread Simon King
On 22 Aug., 17:47, Jeff Post j_p...@pacbell.net wrote: On Sunday 22 August 2010 08:07, Mike Witt wrote: Having said this, I can't help but wonder what possible motivation there could be, among developers, to do something like a bug fix release? Professionalism? Pride in their work?

[sage-support] Re: solve() problem

2010-08-19 Thread Simon King
Hi! On 19 Aug., 22:41, robin hankin hankin.ro...@gmail.com wrote: sagesolve([a*b==15*I-5,a*conjugate(b)==-13*I+9],[a,b]) [] So, from the first two lines I know that a=2+I, b=1+7I should be a solution to the system in the third, yet solve()  returns empty. Admittedly I am no expert for

[sage-support] Re: Point-set topology in sage?

2010-08-05 Thread Simon King
Hi kcrisman, On 5 Aug., 16:51, kcrisman kcris...@gmail.com wrote: I think we do have some support for persistent homology type stuff. Do you mean the persistent group cohomology that is part of the optional p_group_cohomology package? While the basic concept of that notion was inspired by

[sage-support] Re: How to deal with wrapper_descriptor / slot wrapper

2010-08-01 Thread Simon King
Hi Mike, On 1 Aug., 03:10, Mike Hansen mhan...@gmail.com wrote: On Tue, Jul 27, 2010 at 12:30 PM, Simon King simon.k...@nuigalway.ie wrote: So, the fact that RingElement uses the category framework means that both the code *and* the documentation are hidden behind layers of abstraction

[sage-support] Re: How to deal with wrapper_descriptor / slot wrapper

2010-08-01 Thread Simon King
Hi Mike! On 1 Aug., 20:07, Mike Hansen mhan...@gmail.com wrote: Where can I learn more about method-wrapper? A method wrapper is a basically a light wrapper around an underlying C function.  I'm not sure where to find documentation on-line, but it's all in the Python source code.  This is

[sage-support] Re: Cython: importing a cdef class

2010-07-31 Thread Simon King
Hi Jeroen! On 31 Jul., 02:30, Robert Bradshaw rober...@math.washington.edu wrote: ... In file A.pyx, I have cdef MyClass myobj cdef class MyClass:    [...] In file A.pxd, I have cdef class MyClass:    [...] In file B.pyx, I would like to access myobj from A.pyx, but how? You

[sage-support] Re: passing coefficient ring and indeterminant to a function to return a polynomial in the intended polynomialRing

2010-07-29 Thread Simon King
Hi Nils and Eggart, On 29 Jul., 01:20, Nils Bruin nbr...@sfu.ca wrote: The term Goppa polynomial leads me to suspect that the OP had coding theoretic and hence probably quite algebraic intentions, so he/she probably is better off looking at polynomial rings rather than symbolic expressions.

[sage-support] Re: passing coefficient ring and indeterminant to a function to return a polynomial in the intended polynomialRing

2010-07-29 Thread Simon King
Hi Thomas! (sorry, previously I made a wrong guess on your name) On Jul 29, 10:02 am, eggartmumie eggartmu...@googlemail.com wrote: ... Later I need the coefficients of the Goppa polynomial as linear combination of monomials. I don't understand what that means. Please provide explicit

[sage-support] Re: passing coefficient ring and indeterminant to a function to return a polynomial in the intended polynomialRing

2010-07-29 Thread Simon King
Dear Thomas, thank you! That clarifies a lot! On Jul 29, 3:45 pm, eggartmumie eggartmu...@googlemail.com wrote: def goppapolynomial(F,z):     # returns a polynomial over F in indeterminant z     X = PolynomialRing(F,repr(z)).gen();     return (X^3+F(1))*X That should work. For example:

[sage-support] Re: passing coefficient ring and indeterminant to a function to return a polynomial in the intended polynomialRing

2010-07-29 Thread Simon King
On Jul 29, 5:10 pm, Simon King simon.k...@nuigalway.ie wrote: ... 3) We have  sage: P(1/5)  1  sage: P('1/5')  1  sage: P(1/5*x)  x Sorry, it seems that, while writing, I had somehow changed the definition of x. In fact, 1/5*x already raises an error (which it certainly should). So

[sage-support] Re: bug in computing Sylow p-subgroups

2010-07-28 Thread Simon King
Hi Kenny, On 28 Jul., 04:36, Kenny Brown im.self.emplo...@gmail.com wrote: ... sage: G.sylow_subgroup(3)    File string, line 1      [(1,344,246,148,50,393,295,197,99,), (2,345,247,149,51,394,296,198,100,), ...

<    1   2   3   4   5   6   7   8   9   10   >