[sage-support] Re: how to factorize a polynomial function of third degree with only variables like coefficient

2017-09-20 Thread Yann Cargouet
Thank you Nils for your answer Le mardi 19 septembre 2017 10:23:07 UTC+2, Yann Cargouet a écrit : > > Hi everybody, > > I would like to factorize a polynomial function of third degree in order > to obtain the following form: > (1 + a*s + b*s^2)*(1 + c*s). > > Here my t

[sage-support] Re: how to factorize a polynomial function of third degree with only variables like coefficient

2017-09-19 Thread Yann Cargouet
Rs*Cc + Rs*Cin eq2 = c + a*b == Rc*Rl*Cc*Cl + Rc*Rs*Cc*Cin + Rs*Rl*Cc*Cin + Rs*Rl*Cc*Cl + Rs*Rl*Cin*Cl eq3 = a*c == Rc*Rl*Rs*Cc*Cin*Cl solve([eq1,eq2,eq3],a,b,c) Here is the result given by SAGE: sage: [] Why this systen doesn't work ? Regards, Yann Le mardi 19 septembre 2017 10:23:07 U

[sage-support] Re: how to factorize a polynomial function of third degree with only variables like coefficient

2017-09-19 Thread Yann Cargouet
Here is the text of the expression: Cc*Cin*Cl*Rc*Rl*Rs*s^3 + Cc*Cl*Rc*Rl*s^2 + Cc*Cin*Rc*Rs*s^2 + Cc*Cin*Rl*Rs*s^2 + Cc*Cl*Rl*Rs*s^2 + Cin*Cl*Rl*Rs*s^2 + Cc*Rl*Rs*gm*s + Cc*Rc*s + Cc*Rl*s + Cl*Rl*s + Cc*Rs*s + Cin*Rs*s + 1 Yann Le mardi 19 septembre 2017 10:23:07 UTC+2, Yann Cargouet a écrit

[sage-support] Re: how to factorize a polynomial function of third degree with only variables like coefficient

2017-09-19 Thread Yann Cargouet
Here is the expression: Le mardi 19 septembre 2017 10:23:07 UTC+2, Yann Cargouet a écrit : > > Hi everybody, > > I would like to factorize a polynomial function of third degree in order > to obtain the following form: > (1 + a*s + b*s^2)*(1 + c*s). > > Here my test

[sage-support] how to factorize a polynomial function of third degree with only variables like coefficient

2017-09-19 Thread Yann Cargouet
simplication ? all my variables are defined with the command var('Cc, Cin,...) Thanks in advance for your answers Yann -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, se

Re: [sage-support] Re: Possible bug in algebraic_immunity( ) function in crypto toolbox

2013-08-20 Thread Yann
+f1)*annihilator_f1 == 0 Best regards Le mardi 20 août 2013 20:01:03 UTC+2, Martin Albrecht a écrit : > > Hi Yann, > > I believe you are the original author of this code? > > Cheers, > Martin > > -- Forwarded Message -- > > Subject: [sage-support] Re

[sage-support] Re: Possible bug in algebraic_immunity( ) function in crypto toolbox

2013-08-20 Thread Yann
>From the doc of .algebrais_immunity : Returns the algebraic immunity of the Boolean function. This is the smallest integer i such that there exists a non trivial annihilator for self or ~self. The annihilator you get is for ~f1 (or if you prefer 1+f1) You can check that: (1+f1)*annihil

[sage-support] Re: union of lists and remove an element from a list

2010-10-28 Thread Yann
1, 'a', 'b', 'c', 13, 1/2, 1/3, 1/4] > Hi, just as a sidenote, this might make people write this: L = sum( a list of list, [] ) which is correct but quite inefficient. Compare the following: timeit('L = sum([[0] for i in range(1)], [])') and time

[sage-support] Re: Finding cube roots in terms of parameters

2010-10-24 Thread Yann
On Oct 24, 3:30 am, vasu wrote: > Hi all > Suppose I have an positive integer parameter  't', and a polynomial > Delta(t) , which is a polynomial in 't' with coefficients being > integers. Assume we also know that Delta(t) > 0. > There is another polynomial with integer coefficients , say F(t).

[sage-support] Re: polynomial constructor from roots

2010-10-24 Thread Yann
.roots()[0][0] sage: (a+b).minpoly() x^4 - 12*x^3 + 257/3*x^2 - 298*x + 5503/9 sage: (a*b).minpoly() x^4 + 7*x^3 + 77/3*x^2 + 196/3*x + 784/9 I hope this helps. Yann -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to

[sage-support] Re: minimum polynomial

2010-10-23 Thread Yann
2-7, c^4-2, al-(a+b*c)]) sage: alpha = QQbar(3^(1/3)+(7^(1/2)*2^(1/4))) sage: am = alpha.minpoly()(al) sage: am in I ... True sage: am al^12 + (-12)*al^9 + (-294)*al^8 + 54*al^6 + (-14112)*al^5 + 28812*al^4 + (-108)*al^3 + (-26460)*al^2 + (-345744)*al - 94 cheers, Yann -- To post to th

[sage-support] Re: Creating large matrix hangs

2010-10-23 Thread Yann
On Oct 23, 2:21 pm, Simon King wrote: > On 23 Okt., 14:15, Yann wrote: > > > this is now ticket #10158 > > Thanks! > Simon And ready for review... Yann -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to

[sage-support] Re: Creating large matrix hangs

2010-10-23 Thread Yann
this is now ticket #10158 Yann -- 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 http://groups.google.com/group/sage-support URL: http

[sage-support] Re: Creating large matrix hangs

2010-10-23 Thread Yann
for v in args[0]: entries.extend(v) Yann -- 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 http://groups.google.com/group/sage-support URL: http://www.sagemath.org

[sage-support] Re: Creating large matrix hangs

2010-10-23 Thread Yann
ops, best of 3: 2.81 ms per loop > sage: M = MS(0) > sage: for i in range(len(L)): M[i]=L[i] > : > sage: M == Matrix(ZZ,L) > True > > Cheers, > Simon In the matrix constructor (matrix in sage/matrix/constructor.py): entries = sum([list(v) for v in args[0]], [])<

[sage-support] Re: simplifying expressions

2010-09-28 Thread Yann
way to get the answer right is the following one, but it's a bit of cheating... sage: (M/sqrt(3)).eigenvalues() [I, 1, -1] Yann -- 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 http://groups.google.com/group/sage-support URL: http://www.sagemath.org

[sage-support] Re: simplifying expressions

2010-09-28 Thread Yann
ot; a given expression :) > > - kcrisman But wolfram alpha does it well here: sage: M.charpoly() x^3 - I*sqrt(3)*x^2 - 3*x + 3*I*sqrt(3) http://www.wolframalpha.com/input/?i=x^3+-+I*sqrt%283%29*x^2+-+3*x+%2B+3*I*sqrt%283%29 Yann -- To post to this group, send email to sage-

[sage-support] Re: common devisor

2010-09-28 Thread Yann
dical sage: sage: expr.simplify_rational() 0 (or if you have no good guess, you can also try simplify_full) cheers, Yann -- 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 op

[sage-support] Re: common devisor

2010-09-27 Thread Yann
On Sep 27, 5:53 pm, luisfe wrote: > On Sep 27, 3:34 pm, Johannes 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

[sage-support] Re: subsop

2010-09-26 Thread Yann
he case of function is slightly different and the way I did it you get a deprecation warning. I hope this still gives you some insight. Yann -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr.

[sage-support] Re: integral

2010-09-17 Thread Yann
If I try this, here is what I get: sage: var('a') a sage: integral(cos(2*x)/(x^2+a^2),x,-Infinity,+Infinity) ERROR: An unexpected error occurred while tokenizing input ... TypeError: Computation failed since Maxima requested additional constraints (try the command 'assume(a>0)' before integral or

[sage-support] Re: wrong model fitting

2010-08-29 Thread Yann
On Aug 29, 4:50 am, Oscar Gerardo Lazo Arjona wrote: > Hello! > > I have tried to fit some data about an harmonic oscillator to a sine > function, but without success. > > Well, the find_fit command does return the values of constants, but they > don't fit the data at all! > > I've attatched a wor

[sage-support] Re: Symbolic determinant

2010-08-12 Thread Yann
On Aug 13, 6:45 am, vasu wrote: > Hi > Any clues what is happening here? I am trying out calculations as Yann > mentioned. > > M=matrix(SR,4,[1,1,1,1,x^a,x^b,x^c,1,y^a,y^b,y^c,1,z^a,z^b,z^c,1]) > M.det() gives > > Traceback (most recent call last): > (...) > Type

[sage-support] Re: Symbolic determinant

2010-08-12 Thread Yann
On Aug 12, 5:32 pm, vasu wrote: > Hi > I wanted to know how could one compute symbolic determinants. To give > an idea of what I am looking for, > > R.=PolynomialRing(QQ,'x') > M = [ x^a,x^b][x^c x^d] > I would like to compute the determinant of the 2*2 matrix M, say. Now, > I know that a,b,c,d

[sage-support] Re: Cython and static data

2010-06-07 Thread Yann
You migth also try this: timeit('for x in sxrange(1,10): x.is_square()', number=25) On Jun 7, 6:59 pm, Rolandb wrote: > Tnx! > int* did the tric. Maybe an idea to mention this in the Cython manual. > > Look at the amazing difference in speed > > sage: timeit('for x in xrange(1,10): i

[sage-support] Re: Polynomial mod

2010-04-28 Thread Yann
This at least documented: sage: R.=ZZ[] sage: f = x^3+x+1 sage: f.mod? ... When little is implemented about a given ring, then mod may return simply return f. For example, reduction is not implemented for ZZ[x] yet. (TODO!) sage: R. = PolynomialRing(ZZ) sage: f = x

[sage-support] Re: Lattice Probem

2010-03-30 Thread Yann
> An orthogonal lattice might not exist in general, but you can use LLL   > to get close (and, perhaps, hit it right on). > > sage: m = matrix([[1,2,3],[2,3,4]]) > sage: m.LLL() > [-1  0  1] > [ 1  1  1] You might also want to try BKZ algorithm too. sage: m [ 1 0 -1 -2 -1] [ 1 -2 0 1 0] [ 1

[sage-support] Re: convert trigonometric/hyperbolic functions to exponentials

2010-03-12 Thread Yann
And I guess the answer to Paul's question is then: sage: (sinh(log(t)))._maxima_().exponentialize().sage() 1/2*t - 1/2/t sage: (cos(log(t)))._maxima_().exponentialize().sage() 1/2*e^(-I*log(t)) + 1/2*e^(I*log(t)) -- To post to this group, send email to sage-support@googlegroups.com To unsubscri

[sage-support] Re: norm or absolute value

2010-03-12 Thread Yann
Hi, Is this helping? sage: var('a,b,z') (a, b, z) sage: f=a*z+i*b*z^2 sage: f.norm() b*z^2*conjugate(b)*conjugate(z)^2 - I*a*z*conjugate(b)*conjugate(z)^2 + I*b*z^2*conjugate(a)*conjugate(z) + a*z*conjugate(a)*conjugate(z) sage: f.norm().full_simplify() b^2*z^4 + a^2*z^2 sage: f.norm().factor() (b

[sage-support] Re: Why does my little program bring my department's server to its knees?

2010-03-04 Thread Yann
sage: R.=QQ[] sage: while True: : f=x+1 this eats up memory... it's bad -- 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 http://groups.goo

[sage-support] Re: Why does my little program bring my department's server to its knees?

2010-03-04 Thread Yann
the "del a4" should be indented one step more to the left (otherwise you try to use it to define your matrix but it doesn't exist anymore) -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.co

[sage-support] Re: Why does my little program bring my department's server to its knees?

2010-03-04 Thread Yann
And I should have added that K=NumberField(f,'t', cache=False) does not help -- 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 http://groups.google

[sage-support] Re: Why does my little program bring my department's server to its knees?

2010-03-04 Thread Yann
it seems the part eating memory is: K=NumberField(f,'t') don't know why though -- 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 http://groups.goog

[sage-support] Re: Roots of polynomial system involving square roots

2010-03-01 Thread Yann
Is this enough for you? sage: var('x,y,z') (x, y, z) sage: solve([sqrt(x)-2,y-2*x,x-z**2],[x,y,z]) [[x == 4, y == 8, z == -2], [x == 4, y == 8, z == 2]] (you can then filter the solutions) -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send

[sage-support] Re: cancellation in fraction fields

2010-01-24 Thread Yann
On Jan 24, 9:17 pm, William Stein wrote: > > Here's a potentially good way to do this right now  :-) > > Define this function: > > def normalize_denoms(f): >     n, d = f.numerator(), f.denominator() >     a = [vector(x.coefficients()).denominator() for x in [n,d]] >     return (n*a[0])/(d*a[1])

[sage-support] Re: polynomial remainder

2010-01-05 Thread Yann
mialRing(SR) sage: var('a') a sage: f = a*x^10+2*x^8+3*x+1 sage: g = cyclotomic_polynomial(18)(x) sage: f.quo_rem(g) (a*x^4 + 2*x^2 + a*x, 2*x^5 - 2*x^2 + (-a + 3)*x + 1) Yann -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send em

[sage-support] Re: matrix exponential and logarith in sage?

2009-12-22 Thread Yann
some exponentials exist: sage: M = matrix(SR,2,[1,0,3,x]) sage: M.exp() [ e0] [-3*(e - e^x)/(x - 1) e^x] sage: M = matrix(CDF,2,[1+i,0,3,i]) sage: M.exp() [ 1.46869393992 + 2.28735528718*I 0] [ 2.78517490214

[sage-support] Re: Integer points of an elliptic curve

2009-12-07 Thread Yann
If you want solution for this precise equation, look for "thue equation". The thue equations are some of the few for which there exists efficient methods. for example in PARI/GP (from sage with gp_console()) sage: gp_console() GP/PARI CALCULATOR Version 2.3.3 (released) [snip] P

[sage-support] Re: Integer points of an elliptic curve

2009-12-07 Thread Yann
You might also take a look at the full book www.ucm.es/BUCM/mat/doc8354.pdf And of course, it's only a method to go from a general cubic equation to a weierstrass form, net a general method th find integral points. On Dec 7, 6:24 pm, Yann wrote: > The general method is called

[sage-support] Re: Integer points of an elliptic curve

2009-12-07 Thread Yann
The general method is called Naggel's algorithm. Take a look at http://www.math.mcgill.ca/connell/public/ECH1/c1.ps (1.4) On Dec 7, 1:53 pm, Jaakko Seppälä wrote: > Hello again! > > Is that method general? I tried now to find the integer points of x^3 > - 3*x*y^2-y^3-1 without success. > > Jaakk

[sage-support] Re: Integer points of an elliptic curve

2009-12-06 Thread Yann
>From the example you give: 2x**3+385x**2+256x-58195=3y**2 , over the rational field it's not direct because sage does not handle general cubic equation yet. In sage, let's define: {{{ sage: R. = QQ[] sage: P = 2*x**3 + 385*x**2 + 256*x - 58195 - 3*y**2 }}} Given an equation A6 + A4 x + A3 y +

[sage-support] Re: Does sage pre-evaluate expressions?

2009-11-26 Thread Yann
You can find the answer here (look for fromfunction): http://dsnra.jpl.nasa.gov/software/Python/numpydoc/numpy-6.html On Nov 26, 9:45 pm, William Stein wrote: > On Wed, Nov 25, 2009 at 10:07 PM, shaunc wrote: > > Hello! > > > I am new to sage -- but an experienced python user. > > I have succes

[sage-support] Re: sparse linear algebra

2009-09-20 Thread Yann
I made a tiny one line patch, it would be nice of view to review it. http://sagetrac.org/sage_trac/ticket/6968 Yann Results after patching: sage: m=identity_matrix(1000,sparse=True) sage: v=vector([1]*1000,sparse=True) sage: time p = v*m CPU times: user 0.20 s, sys: 0.00 s, total: 0.20 s Wall

[sage-support] sparse linear algebra

2009-09-20 Thread Yann
Is there a good reason for such a difference? sage: m=identity_matrix(1000,sparse=True) sage: v=vector([1]*1000,sparse=True) sage: time p = v*m CPU times: user 2.26 s, sys: 0.00 s, total: 2.26 s Wall time: 2.26 s sage: v=matrix(1,1000,[1]*1000,sparse=True) sage: time p = v*m CPU times: user 0.36

[sage-support] linbox bug?

2009-06-10 Thread Yann
-- | Sage Version 4.0.1, Release Date: 2009-06-06 | | Type notebook() for the GUI, and license() for information.| -- sage: A=matrix

[sage-support] Re: Questions about parallel sage, i.e. dsage

2008-09-18 Thread yann-ledu
Thanks for your answers, this will probably solve all my problems. And writing to a file sounds good, since I can always read it's tail and do whatever I want. Yann On 17 sep, 22:03, John Voight <[EMAIL PROTECTED]> wrote: > Hello! > > It is a pity that Yi has moved on (at

[sage-support] Re: Questions about parallel sage, i.e. dsage

2008-09-18 Thread yann-ledu
sal > (http://supercomp.basnet.by/index_en.html) and I want to install sage on > worker nodes. > Yann, do you generate Monte Carlo data for LHC experiment ? > > I would be grateful for any links and any collaboration on developing > dsage for Grid computing. No, it's

[sage-support] Re: Questions about parallel sage, i.e. dsage

2008-09-17 Thread yann-ledu
On Sep 16, 9:37 pm, "William Stein" <[EMAIL PROTECTED]> wrote: > On Tue, Sep 16, 2008 at 12:16 PM, Yann Le Du <[EMAIL PROTECTED]> wrote: > > > > > Hello, > > > I tried to email the person apprently responsible for dsage, Yi Qiang, > > abou

[sage-support] Questions about parallel sage, i.e. dsage

2008-09-16 Thread Yann Le Du
inished ? Say a job outputs a list, and I want to plot it, can I say something like "If there is some output, plot it, otherwise wait." ? 6/ If you have any notes, drafts, illustrating some of dsage functionalities, I'd be more than happy to chec

[sage-support] An octal bug and some book advice for abstract algebra

2008-04-30 Thread Yann Le Du
nd out of datedness. Irc suggested wikipedia. Any other suggestion ? Cheers, -- Yann Le Du --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this