Re: [sage-support] The behavior of empty sums

2019-06-25 Thread 'luisfe' via sage-support
On Tuesday, June 25, 2019 at 10:03:03 AM UTC+2, Peter Luschny wrote: > > How that? Look at the output above. Sage *knows* that the terms of the sum > are polynomials. So it should return the zero of that ring, which is the > null polynomial. > > Not in the first case, look at what are you

Re: [sage-support] The behavior of empty sums

2019-06-17 Thread 'luisfe' via sage-support
On Monday, June 17, 2019 at 2:12:58 PM UTC+2, Peter Luschny wrote: As I see it the problem is that the sum runs over (0..n-1). > Thus for n = 0 it returns by convention the integer 0 for the > empty sum (is this correct?) which of course has no list. > > But shouldn't it return the null

Re: [sage-support] The behavior of empty sums

2019-06-17 Thread 'luisfe' via sage-support
On Monday, June 17, 2019 at 2:12:58 PM UTC+2, Peter Luschny wrote: As I see it the problem is that the sum runs over (0..n-1). > Thus for n = 0 it returns by convention the integer 0 for the > empty sum (is this correct?) which of course has no list. > > But shouldn't it return the null

Re: [sage-support] surface normal vector of polyhedron face

2019-02-27 Thread 'luisfe' via sage-support
On Wednesday, February 27, 2019 at 2:52:36 PM UTC+1, Daniel Krenn wrote: > > I suppose in non-full-dimensional case you still can use > > P.inequalities() as above, > > projecting them on the affine hull of P. > > Yes, this is the interesting case. The problem then is going back from > the

[sage-support] Re: differences between the "image()" and "column_space()" commands on a matrix

2017-05-09 Thread 'luisfe' via sage-support
Sage interprets that matrices M acts on row vectors v on the left, v*M so in fact the method image corresponds to row_space >From the help of image: Return the image of the homomorphism on *rows* defined by this matrix. -- You received this message because you are subscribed to the Google

[sage-support] Re: About finding roots of polynomials in specific domains

2015-06-12 Thread 'luisfe' via sage-support
On Thursday, June 11, 2015 at 5:26:28 PM UTC+2, Phoenix wrote: I have two polynomials $p(x)$ and $q(x)$ and I want to know if there are roots of the equation $\frac{p'}{p} = \frac{q'}{q}$ in the domain $(a,\infinity)$ - where $a = max \{ roots(p),roots(q) \}$ This is the same as asking for

[sage-support] Re: Expression to polynomial

2015-06-12 Thread 'luisfe' via sage-support
On Friday, June 12, 2015 at 11:17:37 AM UTC+2, Néstor wrote: Hello, I've got a rational expression in sage and I would like to convert it to a polynomial with coefficients in some fraction field. More precisely, I've got something like this: a , x = var( 'a , x' ) ; P = x/a ; and I

[sage-support] Re: elements of a field extensions

2015-06-10 Thread 'luisfe' via sage-support
On Tuesday, June 9, 2015 at 5:36:01 PM UTC+2, black...@gmx.de wrote: Thank you, and i already tried this. In this case it obiously does work but in case i have denominators, can u explain me how to solve it? for example: K(s/(s+t),s^2*t^2) then i have to calculate the elimination ideal

[sage-support] Re: Homomorphism from power series ring to residue field

2015-06-09 Thread 'luisfe' via sage-support
Within a specific interactive session, you could do the following, when creating the rings: sage: R = PowerSeriesRing(GF(2),'t') sage: F = R.residue_field() sage: phi = R.hom([0], F) sage: F.register_coercion(phi) This way, you are indicating that the morphism phi should be considered a

[sage-support] Re: elements of a field extensions

2015-06-09 Thread 'luisfe' via sage-support
Have you tried using elimination ideals? K=QQ['s,t,a0,a1,a2'] K.inject_variables() I = Ideal( a0-s^2, a1-t^2, a2 - (s^2+t^2)) I.elimination_ideal([s,t]) Ideal (a0 + a1 - a2) of Multivariate Polynomial Ring in s, t, a0, a1, a2 over Rational Field So a2 = a0 + a1 The elimination ideal tells you

[sage-support] Re: Typo in provided documentation

2014-10-02 Thread 'luisfe' via sage-support
It looks right to me. I am not a native English speaker so I could be (very) wrong, but I understand that the comparison x2 is evaluated, which is completely true, independently if the condition is evaluated as True or False. In fact, next lines tell why x2 is evaluated False and that h(x)

[sage-support] Re: Computing Grobner Basis for general coefficients denoted by some variables.

2014-09-20 Thread 'luisfe' via sage-support
In general, I prefer to put the parameters a_i as variables and then interpret the results. Another approach you may try is to work in the field: GF(2^d)['a_1,a_2,a_3'].fraction_field()['x_1,x_2,x_3'] but then you may encounter specialiation problems with denominators, another problem is

Re: [sage-support] segmentation fault computing discriminants

2014-03-26 Thread luisfe
On Wednesday, March 26, 2014 10:34:35 AM UTC+1, John Cremona wrote: Looking at the code used, it uses the resultant formula which in turn evaluates a determinant. I agree with you that for small degrees it would be better (almost certainly in a lot of cases) be better to substitute into

[sage-support] Re: groebner bases of polynomials with complex coefficients

2014-02-17 Thread luisfe
On Monday, February 17, 2014 6:39:38 PM UTC+1, sahi...@gmail.com wrote: OK, I tried the following: S.i,x,y = PolynomialRing(QQ,order='lex') I = ideal(i^2+1,(1+i)*x+y,x+(1-i)*y-(1-i)) G = I.groebner_basis() G would give me [i - x - 1, x^2 + 2*x + 2, y - 2] which are the results. But

Re: [sage-support] Can I change QQ[sqrt(a),sqrt(b)] to QQ[\alpha] ?

2013-12-12 Thread luisfe
Nevermind, I found it. Call K2.structure() for the maps. Thank you! Moreover, you can register these isomorphisms as coercions. I do not recommend the following for noninteractive scripts. But I find it very convenient: sage: K=QQ[sqrt(2),sqrt(3)] sage: s2,s3=K.gens() sage:

[sage-support] Re: Floating point exception when factoring over QQ['x,y']

2012-11-29 Thread luisfe
On Wednesday, November 28, 2012 9:27:58 PM UTC+1, Simon King wrote: Hi Georgi, On 2012-11-28, Georgi Guninski guni...@guninski.com javascript: wrote: Probably the problem is in Singular. Probably not. If I am not mistaken, Singular is involved in polynomial factorisation over

[sage-support] Re: Floating point exception when factoring over QQ['x,y']

2012-11-28 Thread luisfe
I can confirm the problem with sage 5.4, I cannot reproduce it with sage 5.3 -- You received this message because you are subscribed to the Google Groups sage-support group. To post to this group, send email to sage-support@googlegroups.com. To unsubscribe from this group, send email to

Re: [sage-support] Strange results with multivariate resultants

2012-09-20 Thread luisfe
On Wednesday, September 19, 2012 6:34:52 AM UTC+2, Georgi Guninski wrote: Hi, I may be missing something, but the resultant = 1 confuses me. According to wikipedia [1] the multivariate resultant or Macaulay's resultant of n homogeneous polynomials in n variables is a polynomial in

Re: [sage-support] Strange results with multivariate resultants

2012-09-20 Thread luisfe
On Thursday, September 20, 2012 1:05:56 PM UTC+2, Georgi Guninski wrote: pari disagrees with sage and maxima agrees with it. which way is it? maxima session: (%i12) p1:(x2)*(x3-x4);p2:x2*(x3-2*x4); (%i14) resultant(p1,p2,x1); (%o14) 1 In this

[sage-support] rotation of a scene and tachyon

2012-06-07 Thread luisfe
I have a problem to set an animation. I have the following: sage: L1 = sphere((0,0,0),5) sage: L2 = L1.rotateZ(pi/3) sage: L1.save('one.png',aspect_ratio=[1,1,1],frame=False) sage:

[sage-support] Re: Question about scoping

2012-01-17 Thread luisfe
On Jan 16, 5:53 pm, Ed Scheinerman edward.scheiner...@gmail.com wrote: I'm confused by the fact that variables defined inside functions can leak out and become global variables. Here's what I've noticed. The problem is twith the function var. According to its documentation: (var?) The new

[sage-support] Re: Question about minimal polynomial to build GF

2011-12-12 Thread luisfe
sage: F.x=GF(2^8,name='x',modulus=z^8+z^4+z^3+z^2+1,check_irreducible=False) sage: F Finite Field in x of size 2^8 sage: F.polynomial() x^8 + x^4 + x^3 + x^2 + 1 Andrzej Chrzeszczyk In this case sage does not complaint, but check_irreducible is not intended for this use, but to avoid the

[sage-support] Re: Increasing memory limit?

2011-10-17 Thread luisfe
On Oct 17, 2:51 pm, Eric enordens...@gmail.com wrote: Does anyone know how to enlarge the memory limits set by sage? I get the following message when running a certain computation that involves computing large determinants. Memory limit reached. Please jump to an outer pointer, quit program

[sage-support] Problem with VirtualBox image

2011-09-23 Thread luisfe
Hi list, I have downloaded the virtualbox sage image to run under windows to make a presentation of the capabilities of Sage. I wanted to try in windows and an old machine to try to force things. So I took my five- years good old laptop. The problem is that sage in virtualbox does not run. Sage

[sage-support] Re: Problem with VirtualBox image

2011-09-23 Thread luisfe
On Sep 23, 7:06 pm, Volker Braun vbraun.n...@gmail.com wrote: I'll look into lowering the processor requirements. Though SSE3 has been out for a looong time... You can rebuild Sage inside the virtual machine. Just interrupt the notebook server (Ctrl-C), go to the Sage directory, run make

[sage-support] Re: Bug in pari/gp or sage? Any fixes?

2011-09-16 Thread luisfe
On Sep 15, 12:43 pm, Amir amirg...@gmail.com wrote: Hi I have the same problem. I am using sage 4.6 installed on windows vista. This is part of code I have written in sage. Is there anyway I can catch this error and make an exception? Thanks An exception is not the way to dela with this

[sage-support] Re: Bug in pari/gp or sage? Any fixes?

2011-09-13 Thread luisfe
On Sep 13, 9:11 am, vasu tewari.v...@gmail.com wrote: Hi all I am trying to run a particular piece of code and it gives an error saying there is a bug in Pari/gp. It turns out that the bug is not present in previous versions of Pari like 2.3.4 (on Windows at least). And if I understand

[sage-support] Re: How to calculate the affine coordinats of a point

2011-07-18 Thread luisfe
On Jul 16, 1:33 am, Johannes dajo.m...@web.de wrote: a very easy example would be this: sage: p1 = vector([-3,1,1]) sage: p2 = vector([1,-3,1]) sage: p = vector([0,-2,1]) #now i'm looking for some x,y such that #x * p1 + y * p1 == p x,y = var('x,y') sage: assume(x 0) sage: assume(y

[sage-support] Re: How to calculate the affine coordinats of a point

2011-07-18 Thread luisfe
On Jul 18, 3:48 pm, Johhannes dajo.m...@web.de wrote: thnx. I see that the problem can be also formulated as marix problem. but the way i did it is in this case the more natural one for me. is there any reason why it only works this way and solve does not lead to any result? For me it

[sage-support] Re: Polynomials Mod 7

2011-07-15 Thread luisfe
On Jul 14, 3:23 am, Mel chemmyg...@gmail.com wrote: Hi, I've been having an issue with a program I've written in sage. I need to calculate a polynomial mod 7. When I do this using the command line, I don't have any trouble. Example: sage: x = var('x') sage: y = var('y') sage:

[sage-support] Re: Decomposing polynomials from other polynomials using Gröbner bases

2011-04-05 Thread luisfe
On Apr 5, 2:10 pm, Johan S. R. Nielsen santaph...@gmail.com wrote: Oops, continuing: more precisely, we wish to find a q in Q[Y1, Y2] such that q(f1, f2) = g. In this case, we have q(Y1, Y2) = Y1^2 + Y1*Y2 - Y2 as a solution, as f1^2 + f1*f2 - f2 = g This is an elimination problem. Note

[sage-support] Re: full_simplify and trig_simplify

2011-03-09 Thread luisfe
hi Jose Luis, By the error do you mean a NameError? There are no such global functions defined in Sage. I would rather use simplify_full and simplify_trig because there would be easier to discover by a user writing simpl and pressing tab. On the one hand it is true that for newcomers

[sage-support] Re: Intersection of complex Ideals

2011-03-01 Thread luisfe
Robert, You have been answered how to solve the problem. But I would like to remark Volker's advice. Do not use ideals over CC. CC is an inexact ring, so most operations will fail. Work instead over the rationals. R.x,y = PolynomialRing(QQ,2) or if you need complex numbers, you may try with a

[sage-support] Re: Intersection of complex Ideals

2011-03-01 Thread luisfe
No, it is not an exact computation over the complex, they are gauss rationals a+b*I where a and b are rationals. As far as I know there is no exact complex field implementation that is good for working with ideals. What kind of generators of ideals are you dealing with? Note that even if the

[sage-support] Re: Intersection of complex Ideals

2011-03-01 Thread luisfe
On Mar 1, 12:59 pm, Robert Goss goss.rob...@gmail.com wrote: What kind of generators of ideals are you dealing with? For reference all the input generators are in QQ. Robert Then, definitely you should work in PolynomialRing(QQ,2) -- To post to this group, send email to

[sage-support] Re: Isolating real roots of exact univariate polynomial

2011-02-18 Thread luisfe
Just for the record. The problem seems to be related to RIF. For the inexact ring RR, it works: len(e.roots(ring=RR)) 13 len(e.real_roots()) 13 numeric approximations of the two missing roots are: 0.953956769342757, 0.957223630414975 This pair of roots is exactly the pair of most close roots

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

2011-02-14 Thread luisfe
The first method creates the ring AND add the variables so that they are available to the user by tipping their name. for instance: sage: R.x,y,z,A,B,k,i,j,m=QQ[] sage: x x sage: type(x) type 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular' Note that this is not

[sage-support] parallel map

2011-02-12 Thread luisfe
I thought I have already asked this. But I do not see it on the history of the group. Apologize for multiple posting. Is there an equivalent in Sage to ParallelMap in mathematica? I am looking a method that applies a given function to a list of objects for a small presentation of Sage I am

[sage-support] Re: simplify ans sqrt

2011-01-26 Thread luisfe
On Jan 26, 8:42 am, Loïc xl...@free.fr wrote: Hello list, Version: sage 4.6.1 I'm quite a newbie with Sage but I'm really impressed this powerful software. Since an hour, I'm on a stupid problem: sage: sqrt(2)*sqrt(3) sqrt(2)*sqrt(3) sage: sqrt(2)*sqrt(3)-sqrt(6) sqrt(2)*sqrt(3)-sqrt(6)

[sage-support] Re: Hermite Normal Form

2010-12-28 Thread luisfe
On Dec 28, 5:27 pm, Santanu Sarkar sarkar.santanu@gmail.com wrote: Is there any faster method to compute Hermite Normal Form of a matrix A and corresponding transformation matrix? I use A.hermite_form(transformation=true). However it is very slow. Also is there any transformation

[sage-support] Re: Hermite Normal Form

2010-12-28 Thread luisfe
On Dec 28, 6:23 pm, Santanu Sarkar sarkar.santanu@gmail.com wrote: Size of my matrix is (90, 36) with entries are around 2^1000. What is the fastest method to compute Hermite Normal Form? In that case, the fastest may be the default one you are already using. Note that computing the

[sage-support] Re: intersection of ideals

2010-12-07 Thread luisfe
On Dec 7, 5:03 pm, 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: newbie working in polynomial quotient rings

2010-12-05 Thread luisfe
On Dec 5, 1:58 pm, eggartmumie eggartmu...@googlemail.com wrote: Hi, I am a newbie working in polynomial quotient rings: I want to implement the Patterson algorithm to decode Goppa Codes. Therefore, I need to split a polynomial p in a quotient ring in its even part p0 and its odd part p1

[sage-support] Re: Bug in genus of an ideal

2010-11-22 Thread luisfe
On Nov 21, 6:22 am, VictorMiller victorsmil...@gmail.com wrote: sage: T.t1,t2,u1,u2 = QQ[] sage: TJ = Ideal([t1^2 + u1^2 - 1,t2^2 + u2^2 - 1, (t1-t2)^2 + (u1- u2)^2 -1]) sage: TJ.genus() 4294967295 sage: TJ.dimension() 1 Yes, there is a bug in the code. If I try Sage 32 bits, the answer

[sage-support] Re: elimination of variables

2010-11-06 Thread luisfe
On 5 nov, 21:45, andrew ewart aewartma...@googlemail.com wrote: i want to write a polynomial p of variables x and y such that p(x,y)=0 i also have that x and y can be expressed in terms of a variable u such that  2x=2u^2+2u-1 and -y^2=u^4+2u^3-2u-1 how to write code to eliminate u, hence

[sage-support] Re: sage won't simplify something that is clearly 0

2010-11-04 Thread luisfe
On 2 nov, 17:00, Rob H. robert.har...@gmail.com wrote: Hi, so here is some sample code: var('chi,k') R.x=SR[] I=R.ideal(x^2) Rbar.epsilon=R.quotient_ring(I) expr=Rbar(epsilon-(chi^(k-1))^5+chi^(2*k-2)*(chi^(k-1))^3) view(expr) print (expr) For the kind of operations you are doing, you

[sage-support] Polyhedron from inequalities

2010-11-04 Thread luisfe
Suppose that I define a set of equalities and inequalities {{{ sage: var('x,y,z,t') (x, y, z, t) sage: L = [x==y+z, x=t-z, x+3*y=0] }}} Is there an easy way to construct the Polhyedron of the solutions of this system? The constructor of Polyhedron does not seem very user- friendly for

[sage-support] Re: Lot of segfaults...

2010-10-20 Thread luisfe
On Oct 16, 1:59 pm, Thierry Dumont tdum...@math.univ-lyon1.fr wrote: Hello, On our Sage server, we have a lot a students doing simple computer algebra. Our version of Sage is 4.5.3 on Debian Lenny. We have a lot of segfaults in maxima: Could you post more information of the problem? Did

[sage-support] Re: common devisor

2010-09-27 Thread luisfe
On Sep 27, 3:34 pm, Johannes dajo.m...@web.de wrote: Hi list, is there a way to get a sum of fraction to a common devisor? or even better into a product of a fraction like \frac{1}{something here} and a sum of integers? and my next step would be this, i dont have a single value, which i want

[sage-support] Re: Testing if polynomial is in ideal

2010-09-08 Thread luisfe
On Sep 8, 2:49 am, Cary Cherng cche...@gmail.com wrote: This works but is too slow for more complicated examples. Is there a way to speed up x in I for much bigger examples? Or does this already use the fastest algorithm based on groebner basis or something else. Blind checking if a

[sage-support] Re: why does constructing this ring take forever?

2010-07-07 Thread luisfe
On Jul 7, 2:21 am, dmharvey dmhar...@cims.nyu.edu wrote: sage: R.x = PolynomialRing(Integers(16219299585*2^16612 - 1)) Maybe not literally forever, but I got sick of waiting. Should be instantaneous. david When constructing a polynomial ring over Z/nZ sage distingishes between prime

[sage-support] Possible bug in relative number fields homomorphisms

2010-07-02 Thread luisfe
I found the following: {{{ sage: N.s2,s3,s5 = NumberField([x^2-2, x^2-3, x^2-5],'s2,s3,s5') sage: M = N.absolute_field('gamma') sage: N_to_M = M.structure()[1] sage: phi = N.hom([N_to_M(s2)]) sage: phi(s2) == N_to_M(s2) True sage: phi(s3) == N_to_M(s3) True sage: phi(s5) == N_to_M(s5) False sage:

[sage-support] Re: Conversion from number field to polynomial

2010-04-19 Thread luisfe
On 19 abr, 12:07, samuele.anni samuele.a...@gmail.com wrote: Hello, I'm trying to implement an algorithm for complete my thesis work about congruence between modular forms and Galois representation. A step of the algorithm I am working on consists in replacing a generator of the number

[sage-support] Re: p-adic implementation in SAGE

2010-03-24 Thread luisfe
On 24 mar, 06:13, Barukh Ziv barukh@gmail.com wrote: Dear all, I would like to ask you about a problem I am encountering while using NTL library for p-adic numbers manipulation. Sometimes, I get the following internal error from NTL function: can't grow this _ntl_gbigint Are you

[sage-support] Re: p-adic implementation in SAGE

2010-03-24 Thread luisfe
On 24 mar, 12:53, Barukh Ziv barukh@gmail.com wrote: Guys, Thank you for the quick reply. I will answer to both questions: Are you using ntl_ZZ_p or ntl_ZZ_pE? I have experienced the same type of errors with the latter (due to bad manipulations of ntl_ZZ_pEContext by myself. Yes,

[sage-support] cython cimport problems

2010-03-21 Thread luisfe
-luisfe/sage/libs/ntl/ntl_ZZ.pxd:4 * include decl.pxi * * cdef class ntl_ZZ: # * cdef ZZ_c x * cdef public int get_as_int(ntl_ZZ self) */ struct __pyx_obj_4sage_4libs_3ntl_6ntl_ZZ_ntl_ZZ { PyObject_HEAD struct __pyx_vtabstruct_4sage_4libs_3ntl_6ntl_ZZ_ntl_ZZ *__pyx_vtab

[sage-support] Re: numerator has a funny parent() -- intentional ?

2010-03-02 Thread luisfe
On 1 mar, 20:46, Pierre pierre.guil...@gmail.com wrote: oooh wait wait wait. I've said something totally confusing. My previous two posts apply to rational fractions... for which indeed, the numerator method gives the 'correct' answer ! The issue I raised in my original post is the 'funny'

[sage-support] Re: Fwd: sage bug report

2009-12-17 Thread luisfe
On 17 dic, 11:48, ma...@mendelu.cz ma...@mendelu.cz wrote: And another observation: maxima returns answer immediatelly (with a lag necessary to start maxima) m is the original matrix from x.py sage: m._maxima_().determinant().expand().sage() x0^2*x2^2*x3^2*x7^2 -

[sage-support] Re: Dealing with algebraic elements and rational functions

2009-03-22 Thread luisfe
On 20 mar, 14:07, Mike Hansen mhan...@gmail.com wrote: The best way to work with this object is to do like you did: sage: K.a=NumberField(x^4+x+1) sage: R.x,y,z,t=K['x,y,z,t'] Then, we can construct some elements of this field: sage: f = (a^2*x + y)*(z+a*t); f (a^2)*x*z + y*z +

[sage-support] Dealing with algebraic elements and rational functions

2009-03-20 Thread luisfe
Hi all, I am wondering how to make some computations with rather specific field extensions. I cannot figure out how to solve the following on SAGE. Mathematically, I have the following field: Q(x,y,z,t,a) Where x,y,z,t are indeterminates and a is an algebraic number over the rationals (lets