[sage-support] Re: var() definition in finite fields

2014-10-01 Thread Nils Bruin
On Wednesday, October 1, 2014 3:30:16 PM UTC-7, Kim Schoener wrote: Hi Peter, hi Martin, somehow both approaches I think don't work for me. For example, the square (m1^2) is carried in both approaches, even though it can be simplified to m1 in GF(2). I would like sage to account for the

[sage-support] Re: Derivatives of bessel_K have the wrong sign

2014-09-23 Thread Nils Bruin
On Tuesday, September 23, 2014 6:04:30 AM UTC-7, kcrisman wrote: It looks like this may have just been copied from bessel_I in the original place, most likely.. Wolfram functions also says this is a correct change, so go for it! OK, this seemed like the perfect change to try to make

[sage-support] Re: Derivatives of bessel_K have the wrong sign

2014-09-22 Thread Nils Bruin
On Monday, September 22, 2014 5:31:58 AM UTC-7, kcrisman wrote: Good workaround! But I assume this is still incorrect in Sage proper, though? (The derivative is done by Pynac/Ginac, not Maxima.) It would seem so: sage: bessel_K(3,x).diff(x) 1/2*bessel_K(4, x) + 1/2*bessel_K(2, x) sage:

[sage-support] Re: Derivatives of bessel_K have the wrong sign

2014-09-22 Thread Nils Bruin
On Monday, September 22, 2014 9:16:08 AM UTC-7, Nils Bruin wrote: sage: bessel_K(3,x).diff(x) 1/2*bessel_K(4, x) + 1/2*bessel_K(2, x) sage: SR(maxima_calculus(bessel_K(3,x)).diff(x)) -1/2*bessel_K(4, x) - 1/2*bessel_K(2, x) Given that bessel_K(3,x) is not a constant function, at least one

[sage-support] Re: Segfault on integration

2014-09-20 Thread Nils Bruin
On Saturday, September 20, 2014 11:18:07 AM UTC-7, Kristoffer Ryhl-Johansen wrote: The following: f(x)=log(1-x)*log(1+x)/(1+x) f.integrate(x,0,1) It seems that this fails in Maxima: Maxima 5.33.0 http://maxima.sourceforge.net using Lisp ECL 12.12.1 Distributed under the GNU Public

[sage-support] Re: Segfault on integration

2014-09-20 Thread Nils Bruin
On Saturday, September 20, 2014 7:22:45 PM UTC-7, Robert Dodier wrote: I will try to investigate some more. If someone files a bug report, that will help us track it. http://sourceforge.net/p/maxima/bugs Thanks for checking!. This is now: https://sourceforge.net/p/maxima/bugs/2815/ --

Re: [sage-support] Understanding precisely why 0.1 + 0.2 = 0.30000000000000004

2014-09-15 Thread Nils Bruin
On Monday, September 15, 2014 8:13:15 AM UTC-7, projetmbc wrote: It is simply the consequence of upper or lower roundings regarding to 1 or 0. Here is my example. 0.1 = 0.00011001100110011001100110011001100110011001100110011*010* [Sage value] Things go wrong here already. The above

[sage-support] Re: sage symbolic error

2014-09-10 Thread Nils Bruin
On Wednesday, September 10, 2014 11:02:05 AM UTC-7, Stein William wrote: Hi, Bill Page reported this issue, which I'm copying here to the sage-support list, in the hopes somebody will look into it: sage: var('k, l') sage: f = real(cosh(sqrt(1/2*k-1/2*sqrt(k^2+4l The problem is

[sage-support] Re: Cannot plot in both notebook and terminal mode

2014-09-09 Thread Nils Bruin
On Monday, September 8, 2014 8:03:31 PM UTC-7, Miguel Yorro wrote: 28 from numpy.lib import triu, asfarray --- 29 from numpy.linalg import lapack_lite, _umath_linalg 30 from numpy.matrixlib.defmatrix import matrix_power 31 from numpy.compat import asbytes ImportError:

[sage-support] Re: Free Algebra with symbolic coefficients

2014-09-08 Thread Nils Bruin
On Sunday, September 7, 2014 10:28:02 AM UTC-7, Chris Thron wrote: HI, I'm trying to write a program that converts electromagnetic equations from CGS to MKS units. I've run into the following issues: (1) I have expressions like curl*H - c^(-1)*d_t*D, where curl and d_t express

[sage-support] Re: Free Algebra with symbolic coefficients

2014-09-07 Thread Nils Bruin
On Sunday, September 7, 2014 10:28:02 AM UTC-7, Chris Thron wrote: (1) I have expressions like curl*H - c^(-1)*d_t*D, where curl and d_t express derivatives. In the process of conversion, sage switches the order and outputs: H*curl - D*d_t/c Are you sure D and d_tand H and curl get

[sage-support] Re: Collect Coefficients MPolynomial_libsingular

2014-08-21 Thread Nils Bruin
On Thursday, August 21, 2014 8:52:36 AM UTC-7, juaninf wrote: q = 2 nvars = 2 k.t = GF(2^q) Xi = [] xij = [] for i in range(nvars): Xi.append(var('X'+str(i))) for j in range(q): xij.append(var('x'+str(i)+''+str(j))) You never use

Re: [sage-support] Re: Several Substitution

2014-08-18 Thread Nils Bruin
On Monday, August 18, 2014 7:11:53 AM UTC-7, juaninf wrote: Dear Emmanuel, Thank, ... one last question ... How I will be able to extract the coefficients of t^0,t^1,...,t^(p-1) I wouldn't trust SR with anything in positive characteristic. It is not designed for it and it is hard to

Re: [sage-support] Re: Several Substitution

2014-08-18 Thread Nils Bruin
On Monday, August 18, 2014 9:25:56 AM UTC-7, Nils Bruin wrote: You could use q.dict() instead which has the appropriate order, but encodes the monomials as exponent vectors, which are hard to convert to At. [you should go that route, though, because the other method can give you wrong

[sage-support] Re: Cartesian n-product of set for given n

2014-08-14 Thread Nils Bruin
On Thursday, August 14, 2014 4:47:42 AM UTC-7, jori.ma...@uta.fi wrote: To get for example all bit vectors of size 3 one can say CartesianProduct(range(2), range(2), range(2)).list() If you want to generate a list of arguments that have to be passed as separate arguments, you can use in

Re: [sage-support] Re: how to enlarge memory limits

2014-08-12 Thread Nils Bruin
On Tuesday, August 12, 2014 7:29:01 AM UTC-7, Daniel Krenn wrote: (type 'sage.rings.complex_interval.ComplexIntervalFieldElement', 2175) (type 'sage.rings.real_mpfi.RealIntervalFieldElement', 8563) Numbers of course depend on the context, but this doesn't look alarming. You can probably

Re: [sage-support] Re: how to enlarge memory limits

2014-08-12 Thread Nils Bruin
On Tuesday, August 12, 2014 7:29:01 AM UTC-7, Daniel Krenn wrote: It doesn't look like the results above help (but maybe I just interpret them wrongly) Possible fix now on: http://trac.sagemath.org/ticket/16809 -- You received this message because you are subscribed to the Google Groups

Re: [sage-support] Re: how to enlarge memory limits

2014-08-11 Thread Nils Bruin
On Sunday, August 10, 2014 11:16:19 PM UTC-7, Daniel Krenn wrote: In my case, this (maxima_calculus.reset()) gives the following: See http://maxima.sourceforge.net/docs/manual/en/maxima_4.html for what the reset() command does: not that much. The description doesn't make it sound it should

[sage-support] Re: how to enlarge memory limits

2014-08-10 Thread Nils Bruin
On Sunday, August 10, 2014 6:31:03 AM UTC-7, Dima Pasechnik wrote: if this is the case then how one would to to reclaim the memory? And why this is not a memory leak? It's not necessarily a leak from the perspective of ecl: the memory obtained from the operating system may well sit there,

[sage-support] Re: how to enlarge memory limits

2014-08-10 Thread Nils Bruin
On Sunday, August 10, 2014 1:06:44 PM UTC-7, Dima Pasechnik wrote: hmm, AFAIK GAP will call its GC now and then, thus libGAP better be able to cope with this... It will garbarge collect just fine. It's a question on the side of the memory manager whether unmapping memory pages or keeping

[sage-support] Re: Problem with incomplete Gamma function and Maxima?

2014-08-08 Thread Nils Bruin
On Friday, August 8, 2014 6:49:21 AM UTC-7, Rafael Greenblatt wrote: I suspect that the problem is that Sage (sometimes?) treats gamma and incomplete_gamma as the same function, but Maxima doesn't, and the interface doesn't take that into account. That's probably what happens. There's

[sage-support] Re: how to enlarge memory limits

2014-08-08 Thread Nils Bruin
On Friday, August 8, 2014 3:02:03 AM UTC-7, Dima Pasechnik wrote: have a look at http://ecls.sourceforge.net/new-manual/re86.html#table.memory.limits and http://trac.sagemath.org/ticket/6772 where one of these limits was removed. Perhaps removing other limits will help. Actually,

[sage-support] Re: Problem with incomplete Gamma function and Maxima?

2014-08-08 Thread Nils Bruin
On Friday, August 8, 2014 6:49:21 AM UTC-7, Rafael Greenblatt wrote: The following commands: var(x,y) (incomplete_gamma(x,y).diff(x)).simplify() give the following error (on cloud.sagemath.com): TypeError: ECL says: Error executing code in Maxima: gamma: wrong number of arguments. This

[sage-support] Re: graph and dict possible bug or user error?

2014-08-07 Thread Nils Bruin
On Wednesday, August 6, 2014 10:34:36 PM UTC-7, kcrisman wrote: Consider plot(Graph({1:[2],1:[3]})) I would expect two edges. Instead the vertex 2 isn't even there. Is this a bug or a feature? The documentation for this way of entering graphs is pretty terse so I was quite surprised

[sage-support] Re: is it possible to keep writing y(x) instead of just y in differential equations?

2014-08-04 Thread Nils Bruin
On Sunday, August 3, 2014 8:56:40 PM UTC-7, Nasser M. Abbasi wrote: I am a sage newbie so please be easy on me. In sage, to make a differential equation one must write, as shown here http://www.sagemath.org/doc/reference/calculus/sage/calculus/desolvers.html sage: x = var('x')sage: y =

[sage-support] Re: is it possible to keep writing y(x) instead of just y in differential equations?

2014-08-04 Thread Nils Bruin
On Sunday, August 3, 2014 11:32:36 PM UTC-7, Nasser M. Abbasi wrote: Thanks. Ok, Now I understand. But then why do I get this answer now: sage: z = var('z') sage: x = var('x') sage: y = function('y') sage: desolve( diff(y(x),x) + y(x) - 1,y(z)) y(x) == (c + e^x)*e^(-x)??? The ode

[sage-support] Re: how to cancel a multi-line incomplete Sage command at the command-line?

2014-08-04 Thread Nils Bruin
On Monday, August 4, 2014 1:49:42 PM UTC-7, John H Palmieri wrote: I can complete the command (by typing ) then RET), and it will execute and give me an error because basis doesn't take any arguments. Or I can type ] then RET and get a SyntaxError. Is there any way to get back to the Sage

Re: [sage-support] Re: Clifford Algebras, grrrrrr

2014-08-01 Thread Nils Bruin
On Thursday, July 31, 2014 8:09:04 PM UTC-7, Stephen Kauffman wrote: # examples cliff_elt = g3*g2*g1*g0 [ST.free_algebra()(str(cliff_elt)).coefficient(mon) for mon in ST.monomial_basis()] # st_elt.coefficients() results in error since it has no such attribute ST is constructed to

[sage-support] Re: Clifford Algebras, grrrrrr

2014-08-01 Thread Nils Bruin
On Friday, August 1, 2014 11:23:27 AM UTC-7, John H Palmieri wrote: Have you looked at http://trac.sagemath.org/ticket/15300? This is at attempt at adding Clifford algebras to Sage. I don't know if it does what you want, but you should take a look. Independent of that, I think it's a good

Re: [sage-support] Re: Clifford Algebras, grrrrrr

2014-07-28 Thread Nils Bruin
On Monday, July 28, 2014 7:24:47 PM UTC-7, Stephen Kauffman wrote: exec preparse('ST.' + gen_str + '=FreeAlgebraQuotient(PRGA,mons_mats[0],mons_mats[1])') Congratulations to get all of this figured out! It's nice to see code of this generality. Please use gen_names=tuple(str(g) for g in

Re: [sage-support] Re: random subs() surprise that has just kept me guessing for over an hour

2014-07-27 Thread Nils Bruin
I don't think we'll ever get SR to operate properly in positive characteristics; especially because it would allow completely arbitrary characteristic combinations in the first place, but perhaps the cases below help in tracking down if we can so something to improve the situation a bit: sage:

[sage-support] Re: Clifford Algebras, grrrrrr

2014-07-26 Thread Nils Bruin
On Saturday, July 26, 2014 12:21:38 PM UTC-7, Stephen Kauffman wrote: TypeError: unsupported operand parent(s) for '*': 'Vector space of dimension 16 over Rational Field' and 'Full MatrixSpace of 8 by 8 dense matrices over Integer Ring' The error that you're getting is because there's a

[sage-support] Re: Unexplained Integration error message

2014-07-22 Thread Nils Bruin
On Tuesday, July 22, 2014 2:04:01 AM UTC-7, Craig E Larson wrote: I am getting an error that I don't understand for the following definite integral. sage: integral(sqrt(1+(9*cos(3*x)^2)),0,pi/2) This is definitely real on its domain and under the square-root is always positive.

[sage-support] Re: SAGE

2014-07-22 Thread Nils Bruin
On Tuesday, July 22, 2014 7:23:39 AM UTC-7, William wrote: From: Bhavin Moriya bhavin...@gmail.com javascript: The thing is every time I wanna use it, I have to run this code. Now, I just wanna know how do I make it work like the in-built command in sage. Like for factoring number 10. I

[sage-support] Re: Got sagenb running, need help

2014-07-21 Thread Nils Bruin
On Monday, July 21, 2014 8:56:14 AM UTC-7, Jole Bradbury wrote: Could you push me in the right direction? Would Django be a good tool to accomplish this with? Your top-post makes it a little difficult to determine what with is. Do you mean communicating with a notebook server? In that case,

[sage-support] Re: Simplifying combinations of atomic inequalities

2014-07-16 Thread Nils Bruin
On Wednesday, July 16, 2014 1:25:03 AM UTC-7, robert.pollak wrote: Hello! I see the following wrong results: sage: x2 and x1 x 2 sage: x2 or x1 x 1 That's because and and or are program flow constructs in python, as they are in C (they have shortcut evaluation behaviour. They

[sage-support] Re: Simplifying combinations of atomic inequalities

2014-07-16 Thread Nils Bruin
On Wednesday, July 16, 2014 11:41:49 AM UTC-7, Nils Bruin wrote: That's because and and or are program flow constructs in python, as they are in C (they have shortcut evaluation behaviour. They are equivalent to (x2) if bool(x2) else (x1) and (x2) if not(bool(x2)) else (x1) except

[sage-support] Re: Transcendental Function?

2014-07-16 Thread Nils Bruin
On Wednesday, July 16, 2014 3:49:06 PM UTC-7, Chris Maness wrote: But I am getting some strange results. Only one root that does not match the graph. with: sage: find_root?? you find that this code calls (via some horrible indirections: find_root calls f.find_root, which calls

Re: [sage-support] Re: Transcendental Function?

2014-07-16 Thread Nils Bruin
On Wednesday, July 16, 2014 4:11:09 PM UTC-7, Chris Maness wrote: I am a bit new to Sage, what method would you recommend for finding the solutions numerically? The routine you were using should be quite OK if you give it input for which it's valid. So first do some work to determine

[sage-support] Re: Got sagenb running, need help

2014-07-15 Thread Nils Bruin
On Tuesday, July 15, 2014 11:28:35 AM UTC-7, Jole Bradbury wrote: I can't. I've tried compiling sagecell using the instructions posted online and have gotten countless errors. It appears that it is because I am running 10.9 not 10.6, but I cannot revert back to 10.6. OSX 10.9 I presume?

[sage-support] Re: Newbie qepcad.py syntax problem

2014-07-10 Thread Nils Bruin
On Thursday, July 10, 2014 8:44:25 AM UTC-7, Robert Pollak wrote: Dear Mr. Witty, I am currently researching how to replace Mathematica in our first-year students' lectures. One of the main emerging topics is how to solve (systems of) rational inequalities. In this context I have just

[sage-support] Re: Can't import sage into Python

2014-07-09 Thread Nils Bruin
On Tuesday, July 8, 2014 11:53:33 AM UTC-7, Jole Bradbury wrote: I have a Django project with views.py: #!/usr/bin/env sage -python from django.shortcuts import render from django.http import HttpResponse import sys from django.http import HttpRequest from django.template import

[sage-support] Re: Failed Integration

2014-07-02 Thread Nils Bruin
On Wednesday, July 2, 2014 4:33:33 PM UTC-7, Chris Maness wrote: I don't see what the issue is with the code below: phinS=e^(i*n*pi*x/a); phim=e^(-i*m*pi*x/a); a=var('a'); assume(a 0); n=1; m=1; integrate(phinS*phim,x,-a,a) For one thing, it doesn't execute, and it doesn't

[sage-support] Re: Failed Integration

2014-07-02 Thread Nils Bruin
On Wednesday, July 2, 2014 4:33:33 PM UTC-7, Chris Maness wrote: TypeError: unsupported operand parent(s) for '*': 'Symbolic Ring' and 'type 'function'' This error is more concisely generated with: sage: x*n TypeError: unsupported operand parent(s) for '*': 'Symbolic Ring' and 'type

[sage-support] Re: Help with understanding and setting up Sage Cell Server

2014-07-02 Thread Nils Bruin
On Wednesday, July 2, 2014 10:14:44 AM UTC-7, Jole Bradbury wrote: 2) I've noticed on the Sage Cell Server demo online that typing Maxima code will result in every line being evaluated but Sage code only evaluates the last line. For example, integrate(1,x) integrate(2,x) In Sage code

[sage-support] Re: Difficulty evaluating a boolean polynomial at a point specified by a tuple

2014-06-23 Thread Nils Bruin
On Monday, June 23, 2014 7:57:39 PM UTC-7, Stephen Kauffman wrote: poly(tuple(mat_list(GS)+mat_list(GC)+mat_list(GY))) # GS etc are matrices of boolean polynomials turned into lists, concatenated and then turned into a tuple ValueError: Number of arguments is different

[sage-support] Re: [sage-cloud]: unable to convert x to an integer

2014-06-08 Thread Nils Bruin
On Sunday, June 8, 2014 9:40:42 AM UTC-7, Андрей Ширшов wrote: TypeError: unable to convert x (=floor(tan(abs(1/2*pi + alpha)^0.220))) to an integer The problem is that fibonacci isn't a symbolic function, so when you give it an argument, it wants to evaluate it to an integer

[sage-support] Re: Best Practices for extending functionality of a sage class

2014-06-06 Thread Nils Bruin
On Thursday, June 5, 2014 2:50:22 PM UTC-7, Dinakar Muthiah wrote: Partition.i_part = i_part Then if later I wrote: p = Partition([3,2,1]) I can call p.i_part(2) That works. Of course, without the monkey-patching (changing code on a class after its original definition), you could

[sage-support] Re: numerical approximation with units of measurement?

2014-06-06 Thread Nils Bruin
On Thursday, June 5, 2014 6:32:42 PM UTC-7, Hal Snyder wrote: IIs there a simple way to take n() of things without getting into the following? You could automate the application, but you'll quickly see you need to be a bit careful: #unfortunately, the operators returned for sums and

[sage-support] Re: Best Practices for extending functionality of a sage class

2014-06-06 Thread Nils Bruin
On Friday, June 6, 2014 7:13:50 AM UTC-7, Dinakar Muthiah wrote: Ideally, I would like to define a subclass of Partition called MyPartition and include all my custom methods. I think this is a standard way to extend libraries, but for some reason this doesn't work at all. Is there a

[sage-support] Re: Timing issues for Multiplication in LaurentPolynomialRing() (version 6.2)

2014-06-04 Thread Nils Bruin
On Wednesday, June 4, 2014 7:32:38 AM UTC-7, Markus-Ludwig Wermer wrote: Some basic multiplications were more than 10 times faster in Sage 6.1.1. Is there a way to speed up those multiplications? We can get a reasonable first impression of what is taking most time by profiling some code:

[sage-support] Re: Timing issues for Multiplication in LaurentPolynomialRing() (version 6.2)

2014-06-04 Thread Nils Bruin
On Wednesday, June 4, 2014 8:58:37 AM UTC-7, Nils Bruin wrote: This suggests that element_from_data uses significant time. This is a generic conversion routine! Looking around in the call graph would probably show where this happens. Given most elements lie in the right ring already

[sage-support] Re: ECL says: In function GCD, the value of the second argument is not of the expected type INTEGER

2014-06-03 Thread Nils Bruin
On Tuesday, June 3, 2014 7:12:12 AM UTC-7, Bruno wrote: RuntimeError: ECL says: In function GCD, the value of the second argument is 1.0 which is not of the expected type INTEGER I don't know what this means. Can anyone give me a clue? It means Maxima, which gets used for integration,

[sage-support] Re: Construction of point on elliptic curve fails

2014-05-30 Thread Nils Bruin
On Friday, May 30, 2014 7:57:34 AM UTC-7, Peter Mueller wrote: However, E(x,1) fails with an intimidating traceback, with the last line being (Intimidating but extremely informative) AttributeError: 'FunctionField_polymod_with_category' object has no attribute 'parent' Am I doing

[sage-support] Re: Method to invert the birational map from degree 3 curve to its Weierstrass form?

2014-05-25 Thread Nils Bruin
Some design comments: sage: R.x,y,z = QQ[] sage: f = 3*y^2*x-y^2*z-2*x*y*z+y*z^2+2*x^3-2*x^2*z sage: e = EllipticCurve_from_cubic(f,[0,0,1]) sage: e Scheme morphism: ... This is not ideal naming. The command reads like you'd be asking for an elliptic curve, but a morphism is returned

[sage-support] Re: Method to invert the birational map from degree 3 curve to its Weierstrass form?

2014-05-24 Thread Nils Bruin
On Saturday, May 24, 2014 9:18:29 AM UTC-7, Volker Braun wrote: Its a 4:1 map so you can't invert it... I would find that surprising. For a general plane cubic, there are good recipes for getting a 9:1 map to a Weierstrass model in general and a 1:1 map when a rational point is specified. A

[sage-support] Re: Problem with a derivative of order k in a summation in k

2014-05-15 Thread Nils Bruin
On Thursday, May 15, 2014 6:03:04 AM UTC-7, Bruno wrote: somat=sum( (((t-a)**k)/factorial(k))*((derivative(s,t,k)).limit(t=1)) ,k,0,3) This is unfortunately rather subtle. The problem is that your notation derivative(s,t,k) clashes with the also accepted notation for the double

[sage-support] Re: Computing a Groebner Basis (singular algorithm) raises an error

2014-05-15 Thread Nils Bruin
On Thursday, May 15, 2014 6:15:21 PM UTC-7, Fabian Weise wrote: Since this only happens using the Singular algorithms I came up with this: http://www.gap-system.org/Manuals/pkg/singular/doc/chap1.html#X82260C8E82090E87 (cp. 1-7-5) The situation here is different, since Sage doesn't use

[sage-support] Re: reflexive @interact controls (control values update)

2014-05-12 Thread Nils Bruin
On Monday, May 12, 2014 5:27:21 AM UTC-7, Jason Grout wrote: Right. I think you're pointing out a problem with the example interact William posted, which I agree is not very polished. I haven't looked at William's version, only your SageCell translation. I imagine they would suffer from

[sage-support] Re: reflexive @interact controls (control values update)

2014-05-09 Thread Nils Bruin
Hi Jason, Thank you very much for all the work on SageCell. It's an unbelievably useful tool to make little demonstrations. On Friday, May 9, 2014 6:11:24 AM UTC-7, Jason Grout wrote: 4. When you click on a selector button that is already selected, the cell server ignores the click (since

[sage-support] Re: reflexive @interact controls (control values update)

2014-05-09 Thread Nils Bruin
On Friday, May 9, 2014 1:05:23 PM UTC-7, Jason Grout wrote: Right---the interact always is recreating that control, which defaults to the first entry. With a selector, our thinking was that if the item was already selected, then it didn't need to be selected again. But I can see where it

[sage-support] Re: Complex embedding with quotient()

2014-05-07 Thread Nils Bruin
On Wednesday, May 7, 2014 9:58:48 AM UTC-7, François Colas wrote: What I want to do is a way to evaluate polynomials of K in a power of a primitive square root of unity: omega = CC(e^(2*I*pi/m)) F = Hom(K, CC) f = F([omega]) TypeError: images do not define a valid homomorphism Does

[sage-support] Re: M.right_eigenvectors() brings old error

2014-05-02 Thread Nils Bruin
On Friday, May 2, 2014 8:38:16 AM UTC-7, leif wrote: return self.transpose().eigenvectors_left(extend) def eigenvectors_right(self, extend=True): So 'extend' is defined where the call happens... Stylistically it seems to be a keyword argument, so wouldn't return

[sage-support] Re: Memory leak in Cone.dual()

2014-04-30 Thread Nils Bruin
On Wednesday, April 30, 2014 7:19:12 AM UTC-7, pete.d...@port.ac.uk wrote: Hi all, I'm pretty new to Python, so perhaps I'm doing something wrong, but I've encountered what I believe to be a memory leak in Sage's Cone.dual() method. Below is some very simplified proof of concept code

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

2014-04-29 Thread Nils Bruin
On Tuesday, April 29, 2014 7:47:39 AM UTC-7, Volker Braun wrote: Always putting things in canonical form will be slow (there is no hook for you are about to be put into a set) and/or not possible (fp group elements). I disagree in this particular case. Making the denominator monic is

[sage-support] Re: Eigenvalues of QQ-matrix, magic limit?

2014-04-28 Thread Nils Bruin
On Monday, April 28, 2014 12:56:48 AM UTC-7, jori.ma...@uta.fi wrote: It takes less than two minutes to run ./sage -c n=121; l=range(1,n+1); x=matrix([[floor(n/lcm(i,j)) for i in l] for j in l]).eigenvalues(); But with n=122 calculation seems to get stuck. Well, 122=61*2, so maybe

Re: [sage-support] How to see (1,1,1,1) as an element of Z/3Z x Z/2Z x Z/2Z x Z/2Z ?

2014-04-28 Thread Nils Bruin
On Monday, April 28, 2014 9:14:17 AM UTC-7, Volker Braun wrote: Showing a deprecation warning for valid input isn't ideal ;-) How about we deprecate all list/tuple input and force the user to use G.linear_combination_of_smith_form_gens / G.linear_combination_of_gens. list input is actually

[sage-support] Re: wrong or nonexistent results for various infinite sums

2014-04-23 Thread Nils Bruin
On Wednesday, April 23, 2014 2:40:46 PM UTC-7, Karl S wrote: I understand that Sage has limited exploitation of Maxima's hypergeometric functionality, and I suspect this is the main issue. Are there any conceivable workarounds? http://trac.sagemath.org/ticket/2516 should basically do the

[sage-support] Re: Substitution in infinite polynomial rings

2014-04-17 Thread Nils Bruin
On Wednesday, April 16, 2014 4:16:30 PM UTC-7, BJ wrote: I have the following code, which produces a list of polynomials in the infinite number of variables e_0, e_1, ... M.e = InfinitePolynomialRing(QQ, implementation=sparse) However, I've been having a lot of trouble figuring out how

[sage-support] Re: Substitution in infinite polynomial rings

2014-04-17 Thread Nils Bruin
On Thursday, April 17, 2014 9:39:09 AM UTC-7, Nils Bruin wrote: but it's flawed: sage: f(e_4=2) KeyError: 'e_4' And also flawed in a different way: sage: f(e_2=e[4]) TypeError: unsupported operand parent(s) for '+': 'Multivariate Polynomial Ring in e_4, e_2, e_1 over Rational Field

[sage-support] Re: Modulo operator on reals: e.g., 4.9 % 10 = 4.9 but 5.1 % 10 = -4.9 instead of 5.1. Why??

2014-04-10 Thread Nils Bruin
On Thursday, April 10, 2014 8:23:06 PM UTC-7, Privasie Invazhian wrote: I'm running Sage 5.3 on a MacBook Pro with OS X version 10.7.5, and I don't understand why the modulo operator % works so differently on reals and on integers or how I can work around it. For instance, 4 % 10 = 4

Re: [sage-support] very easy polynomial question

2014-04-09 Thread Nils Bruin
On Wednesday, April 9, 2014 2:45:39 AM UTC-7, Kevin Buzzard wrote: Thanks William and Nils! So now I can write better code than yesterday and, as John says, the only remaining question is how someone with no sage experience is supposed to work out for themselves that if R is a polynomial

Re: [sage-support] very easy polynomial question

2014-04-08 Thread Nils Bruin
On Tuesday, April 8, 2014 1:55:49 PM UTC-7, Nils Bruin wrote: F=Qxz(f) #this conveniently lifts z to a transcendental in Q[x,z] Oops, that only works because of the last-resort attempt of converting f to a string and then feeding the string to Qxz. One probably

[sage-support] Re: Simplifying expressions involving sums

2014-04-03 Thread Nils Bruin
On Thursday, April 3, 2014 10:23:54 AM UTC-7, Luigi Malagò wrote: PS: maxima.load('simplify_sum') didnt work In order for it to affect the sum command, you'd need to do maxima_calculus.load('simplify_sum') and then some work is required to actually call the routine on your expression.

Re: [sage-support] Re: Simplifying expressions involving sums

2014-04-03 Thread Nils Bruin
On Thursday, April 3, 2014 11:09:12 AM UTC-7, Luigi Malagò wrote: PS: also a pointer to other software packages besides maxima that would help me would be appreciated Free beer solution: www.wolframalpha.com does it (i.e., mathematica simplifies the sums away) maple does too. -- You

[sage-support] Re: if I input 1.1, why is it real not rational?

2014-03-28 Thread Nils Bruin
On Friday, March 28, 2014 2:34:55 AM UTC-7, Ralf Stephan wrote: while in Pari: ? sin(1.1) %1 = 0.89120736006143533995180257787170353832 ? sin(11/10) %2 = 0.89120736006143533995180257787170353832 Pari works with multiprecision by default, so you're getting more digits here: ?

[sage-support] Re: Polynomial division without remainder

2014-03-25 Thread Nils Bruin
On Monday, March 24, 2014 7:56:33 AM UTC-7, martin@gmx.net wrote: Working in a stack of multivariate polynomial rings, how can I compute the quotient of two polynomials in those cases where I know the remainder to be zero? Reading the docs I found two likely approaches, but neither

[sage-support] Re: BooleanPolynomialRing in standalone python script

2014-03-17 Thread Nils Bruin
On Sunday, March 16, 2014 10:14:43 PM UTC-7, Prakash Dey wrote: but when i want to run the file test.sage #/usr/bin/sage -python R.a,b,c=BooleanPolynomialRing(3) print (a+b+c)*(a+b) Don't put the -python there. You want this file to be run through sage's preprocessor. So keep the .sage

[sage-support] Re: Coercion between polynomial rings gives parent sympy.core.add.Add

2014-03-16 Thread Nils Bruin
On Sunday, March 16, 2014 6:45:03 AM UTC-7, Tristan wrote: I'm not sure if it's relevant but my polynomial f is defined by taking a list of coefficients and then adding relevant powers of u multiplied by each coefficient to an initial 0 polynomial. I mention this because if I define the

[sage-support] Re: trouble with deepcopy

2014-03-15 Thread Nils Bruin
On Thursday, March 13, 2014 3:05:22 PM UTC-7, Lee Worden wrote: sage: s = symbolic_expression( 'a(x)' ) sage: s.substitute_function( sage.symbolic.function_factory.function('a'), sage.symbolic.function_factory.function('A') ) A(x) sage: t = deepcopy( s ) Since symbolic expressions

Re: [sage-support] Re: How to do symbolic algebra in GF(2)={0,1}

2014-03-11 Thread Nils Bruin
On Tuesday, March 11, 2014 11:26:13 AM UTC-7, Christian Nassau wrote: You could work in the polynomial ring generated by the ak, modulo the relation ak**2 = ak For which sage wraps a specially optimized library PolyBoRi: sage: R.a,b,c=BooleanPolynomialRing(3) sage: (a+b+c)*(a+b) a*c + a

[sage-support] Re: Best way to show my work?

2014-01-01 Thread Nils Bruin
On Wednesday, January 1, 2014 10:44:51 AM UTC-8, Buck Golemon wrote: My work is in a worksheet. I can manually convert it to a sage-terminal style, but it's a time-consuming process, and the result is worse. There is a row of buttons on a worksheet, Print, Worksheet, Edit, Text, ... . If you

[sage-support] Re: libGap Error

2014-01-01 Thread Nils Bruin
On Wednesday, January 1, 2014 11:07:10 AM UTC-8, Neda wrote: Hello, I use this for computing automorphism group: G = SymmetricGroup(3) H = libgap(G).AutomorphismGroup() but when I want to compute order of automorphism group, I cant compute and I have this error: In the future, please

[sage-support] Re: NameError after importing third-party module which calls on ntl

2013-12-02 Thread Nils Bruin
On Sunday, December 1, 2013 6:06:42 PM UTC-8, sea21 wrote: Hi, I wanted to write a Sage third-party module to generate random numbers. The module contains a class which includes a method to generate a random number. The method calls on the ntl library: r = ntl.ZZ_random(2**512)

Re: [sage-support] numpy.count_nonzero

2013-11-30 Thread Nils Bruin
On Monday, November 18, 2013 2:04:18 AM UTC-8, John Cremona wrote: I discovered the same difference between M.list() and list(M) when formulating my reply. It seems that list(M) is the same as M.rows() rather than M.list(), but I don't know why it was implemented this way. It may just be

[sage-support] Re: Calling gp.F(n) in a loop about 2^16 times raises exception

2013-11-22 Thread Nils Bruin
On Friday, November 22, 2013 10:26:52 AM UTC-8, Peter Bruin wrote: The results of all GP command are stored in an array named 'sage' inside GP. If you execute too many commands, this array apparently isn't enlarged anymore. I suspect that this is because GP runs out of stack space and

[sage-support] Re: performance of applying a map to an integer vector

2013-11-20 Thread Nils Bruin
On Wednesday, November 20, 2013 2:02:59 AM UTC-8, Felix Breuer wrote: Hi all! I have a large collection (~50,000) of integer vectors in low dimension (~20). For each of these vectors, I want to divide all entries by their gcd. In other words if def prim_v(v): d = abs(gcd(v))

[sage-support] Re: performance of applying a map to an integer vector

2013-11-20 Thread Nils Bruin
On Wednesday, November 20, 2013 10:54:29 AM UTC-8, Nils Bruin wrote: return [c div g for c in v] Sorry, that's spelled [c // g for c in v] Incidentally, a typical vector of 20 integers has gcd 1 for its coefficients. If that happens a lot in your data, you should shortcut on gcd==1

[sage-support] Re: performance of applying a map to an integer vector

2013-11-20 Thread Nils Bruin
On Wednesday, November 20, 2013 11:13:32 AM UTC-8, Felix Breuer wrote: I don't think NumPy will help, as NumPy works with machine precision throughout, as far as I was able to figure out. I think you can put arbitrary fixed length types in there, which would include multiprecision integers

Re: [sage-support] Re: Running doctests in group writable directory

2013-11-08 Thread Nils Bruin
On Thursday, November 7, 2013 11:20:53 PM UTC-8, Jeroen Demeyer wrote: On 2013-11-07 19:37, Nils Bruin wrote: I can confirm that I also am not able to get sage --python to run without printing a warning in any situation I tried where the current directory is group writeable. You need

Re: [sage-support] Re: Running doctests in group writable directory

2013-11-08 Thread Nils Bruin
On Friday, November 8, 2013 1:24:33 PM UTC-8, Nils Bruin wrote: I think what you are experiencing can be characterized as a bug. Hopefully someone can fix it or find a work-around. In fact, I've just tried the same scenario on bsd.math.washington.edu, which runs Darwin (so I guess OSX

[sage-support] Re: Running doctests in group writable directory

2013-11-07 Thread Nils Bruin
On Thursday, November 7, 2013 7:13:39 AM UTC-8, scma...@gmail.com wrote: I read through that ticket before posting, but I didn't (and still don't) see a solution to my problem. Admittedly I don't understand all of the issues talked about on that ticket. I created a test script in the same

[sage-support] Re: exact eigenvalues

2013-11-07 Thread Nils Bruin
On Thursday, November 7, 2013 9:00:36 AM UTC-8, ccandide wrote: I dont' understand why Sage is unable to give an exact expression for the eigenvalues of the following matrix : sage: A= matrix([[0,1],[1,-2]]) sage: [a for a,_,_ in A.eigenvectors_right()] [-2.414213562373095?,

[sage-support] Re: Running doctests in group writable directory

2013-11-07 Thread Nils Bruin
On Thursday, November 7, 2013 10:01:00 AM UTC-8, scma...@gmail.com wrote: How come this only comes into play for doctesting and not for just running a script with sage? Using the example I posted before in the file example_script.py, I get It looks like sage silences the python message.

[sage-support] Re: Why can't I see my code while debugging with trace?

2013-11-07 Thread Nils Bruin
On Thursday, November 7, 2013 3:02:11 PM UTC-8, Dima Pasechnik wrote: wow, this must be in the docs! I agree, but for instance on http://www.sagemath.org/doc/reference/cmd/sage/misc/trace.html it isn't mentioned, so is it in the docs? -- You received this message because you are

[sage-support] Re: Why can't I see my code while debugging with trace?

2013-11-06 Thread Nils Bruin
On Wednesday, November 6, 2013 1:56:12 AM UTC-8, Tobias Weich wrote: Hi, If I load some sage script and try to debug it with trace I am unable to see the code which I'm debugging load('~/test.sage') trace('example_func()') yields only to an output like: ipdb s --Call--

Re: [sage-support] Re: Comment in python code [[cloud.sagemath.com]]

2013-11-04 Thread Nils Bruin
On Sunday, November 3, 2013 11:19:45 PM UTC-8, projetmbc wrote: The use of AST is a pretty way BUT you must not use *eval* or *exec*because of real security issues. It's easy to find explanations about that on the web. If you read these explanations, you'll see that by the same logic, you

Re: [sage-support] How to compute the quality of $abc$ triple over number fields?

2013-11-04 Thread Nils Bruin
On Monday, November 4, 2013 1:29:10 AM UTC-8, Georgi Guninski wrote: On Sun, Nov 03, 2013 at 09:51:15AM -0800, Nils Bruin wrote: On Sunday, November 3, 2013 6:36:35 AM UTC-8, John Cremona wrote: The function is called global_height(): sage: K.a = NumberField(x^3-2) sage

Re: [sage-support] How to compute the quality of $abc$ triple over number fields?

2013-11-04 Thread Nils Bruin
On Monday, November 4, 2013 1:29:10 AM UTC-8, Georgi Guninski wrote: Isn't it possible to define the quality only in terms of the norm and the integer radical, something like this: q(a,b,c) = max( norm(a),norm(b),norm(c) ) / (log(Delta(K)) + degree(K) *

[sage-support] Re: Plot several functions in the same graphic - A stack like method

2013-11-03 Thread Nils Bruin
On Sunday, November 3, 2013 2:22:05 AM UTC-8, projetmbc wrote: Hello, here is a way to draw several functions on the same graphic. myFamily = plot(0, x, 1, 7) for a in range(1, 10): myFamily += plot(a*x^2+2, x, 1, 7)

<    1   2   3   4   5   6   >